<< return to Pixycam.com

Block Age and Help me Understand the Logic

Hi I couldn’t understand what Block Age is, can you give a description for me?. Also, I’m trying to steer a ship by the data I get from Pixy2 camera. I hooked it up to a raspberry pi and I can successfully run it with python3. But my problem is, I need to use your locking on a block algorithm in my own python file because I don’t understand how pixy chooses which block to lock on. And I thought like, maybe Block Age is the Factor that helps Pixy to lock on. Also I would be happy if you could explain me how how pixy continious following the block which it chose on the previous frame.

Thanks by now,

Hello,
You are asking about Pixy2’s “tracking” abilities. There is some information here:

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:overview#pixy2-tracks-each-object-it-detects

The block age (m_age in the Block structure) is just a number that advances every frame that a given block is still present in the image. Once the age reaches 255, it stays at 255, indicating that the block has been tracked for at least 255 frames.

It is possible that a given detected object leaves Pixy2’s view, in which case it will not longer be tracked, and it will lose its tracking index (m_index in the Block structure.) If it re-enters Pixy2’s view, it will be reacquired and Pixy2 will being tracking it again, but with a different index and a reset age.

To determine objects between frames, Pixy2 solves the “correspondence problem” by finding the best candidates in subsequent frames.

Hope this helps!

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

Edward