Page 1 of 1

Error with img.binary

Posted: Thu Jun 01, 2017 6:01 pm
by zlite
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:

Re: Error with img.binary

Posted: Fri Jun 02, 2017 3:08 am
by deshipu
Try

Code: Select all

img.binary(*threshold)

Re: Error with img.binary

Posted: Fri Jun 02, 2017 11:21 am
by kwagyeman
Neither worked... The first just didn't give an error.

It's a list of tuples. So [(12, 1, 1, 1, 1, 12)].

Re: Error with img.binary

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

Re: Error with img.binary

Posted: Sat Jun 03, 2017 5:45 pm
by iabdalkader
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]