<< return to Pixycam.com

Detect when a barcode leaves the view

Hello,

I have been using the barcode detection in a context when i want to detect barcode when they enter the view. It works just fine.

However, since – by default – pixy only sends you the signal that a given barcode has entered the view once, then i cannot detect when it leaves the view.

I need to creates a scenario when showing/hiding barcodes is a user interface. Therefore, I need to know for each frame, when a given code is there. I still want the filtering thing to happen.

barcode documentation suggests it’s possible to do so

Pixy2 can provide your program with all lines, intersections and barcodes that it detects

but does not clearly states how to configure it to do so (did not find a relevant parameters in any configuration tab).

How can I do that? (reminder: I would rather keep the filtering thing, or at least know from code if a given barcode is filtered or unfiltered (to reject false positives if any)

You will need to use getAllFeatures():

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_api

It will report all barcodes detected as long as they are in-frame. Your code will need to determine when a particular barcode leaves the frame by keeping a list of barcodes detected in the previous frame.

Edward

ok. will try that soon.

will i have MUCH more data going between the microcontroller and the pixy?
is there a chance that i no longer make the 61fps using getAllFeatures() while I perfectly make the 61fps using getMainFeatures() ?

ok. it works.
i also do not notice any particular performance difference between getMainFeatures() and getAllFeatures()

thanks

[edit: but i have another unrelated question to performance. for another thread :slight_smile: ]