Hi all. I’m trying to build a widget out of a Pixy and an Arduino Uno that will look at a group of colored objects and determine whether any one of them is moving in the Pixy field of view, and switch a digital output on the Arduino based on the result. I’m not much of a coder, so I’d appreciate your good advice. I imagine the program will do the following:
- Track objects of one color, with let’s say two to five objects being tracked at a given time. 2. At some time interval, write the x,y of object1. 3. At the next interval get the new object1 x,y. 4. Do math on the new and old coordinates to see if object1 is moving in the Pixy image frame. 5. Change the digital output based on the recent results; for example if the last three coordinate differences are below some minimum, the controller switches the outputs, and switches back when the differences grow above the minimum.
It looks like all this is possible; I’ll get to work now, and post up what I come up with.
Cheers