<< return to Pixycam.com

How to capture when the camera 'misses' and object?

I’m trying to accomplish the following.

Creating a graph that shows time, and then when the camera doesn’t see an object. I basically want the plot of the blocks position, but if the camera misses the object for a set period of time, I would plot a x line to show that it lost the object.

Any ideas on how to do this? I tried:

If(blocks)
Do stuff and increment time
if(!blocks)
increment time

Then I just plotted the position of the blocks, vs the time with python, however this doesn’t seem to work.

Thanks for any hints or thoughts!

Hi Blue Duck,
It’s probably important to point out that GetBlocks() which will return 0 if there are either no blocks detected or no new blocks for the current frame. So you may be getting 0’s because no new blocks are available for the current frame. This can be confusing. One workaround is to put a delay in your program so that your call to getBlocks will always result in new frame data. Delaying 20 ms is guaranteed to do this, but it may be less depending on the update rate of your loop. This thread has some similar information:

http://cmucam.org/boards/9/topics/5734?r=5758#message-5758

Hope this helps!

Edward

Thanks, that was really helpful!