Error with img.binary

Discussion related to "under the hood" OpenMV topics.
zlite
Posts: 73
Joined: Sun Feb 05, 2017 9:26 pm

Error with img.binary

Postby zlite » Thu Jun 01, 2017 6:01 pm

I'm getting the weirdest errors with the latest firmware (2.4) and binary filtering:

If I use "img.binary(0, 83, -128, 15, -128, 127)" it works.

But if I do this:
threshold = (0, 83, -128, 15, -128, 127)
img.binary(threshold)
I get the attached error:
Attachments
IMG_20170601_143158.jpg
IMG_20170601_143158.jpg (272.53 KiB) Viewed 4524 times
User avatar
deshipu
Posts: 74
Joined: Sat Jan 09, 2016 5:36 am
Location: Zürich
Contact:

Re: Error with img.binary

Postby deshipu » Fri Jun 02, 2017 3:08 am

Try

Code: Select all

img.binary(*threshold)
User avatar
kwagyeman
Posts: 4665
Joined: Sun May 24, 2015 2:10 pm

Re: Error with img.binary

Postby kwagyeman » Fri Jun 02, 2017 11:21 am

Neither worked... The first just didn't give an error.

It's a list of tuples. So [(12, 1, 1, 1, 1, 12)].
Nyamekye,
zlite
Posts: 73
Joined: Sun Feb 05, 2017 9:26 pm

Re: Error with img.binary

Postby zlite » Sat Jun 03, 2017 5:35 pm

Thanks guys. I ended up going with:
img.binary([thresholds[threshold_index]])
Looks weird, but seems to work!
User avatar
iabdalkader
Posts: 1245
Joined: Sun May 24, 2015 3:53 pm

Re: Error with img.binary

Postby iabdalkader » Sat Jun 03, 2017 5:45 pm

zlite wrote:
Sat Jun 03, 2017 5:35 pm
Thanks guys. I ended up going with:
img.binary([thresholds[threshold_index]])
Looks weird, but seems to work!

I think this should work as well:

Code: Select all

thresholds[index:index+1]

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests