Python Forum
Help with datatypes and conversion between them
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with datatypes and conversion between them
#3
(Sep-12-2020, 08:01 PM)bowlofred Wrote: Not certain, but there's a discussion about a similar issue on the opencv github. It's the same error message, but it's not related to the color tuple. I'm not familiar with opencv, so I'm not sure I'm following the discussion well.

Thanks for the info. Had a long look at that post and through a bit of trial and error it seems the fault was in the method of data conversion. Basically in my colour variable numpy returned the individual elements as type numpy.int32, but opencv required the colour parameters as simply int, so in a nutshell I do;

workingcolour  = (int(numpycolour[0]),int(numpycolour[1]),int(numpycolour[2]))


And this solves the issue. Thanks.
Reply


Messages In This Thread
RE: Help with datatypes and conversion between them - by crashmeplease - Sep-16-2020, 01:43 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020