<< return to Pixycam.com

Can't pull width and height block values?

Hey everyone, I’m using a Pixy CMUcam5 through an Arduino Uno and am trying to read and process the width and height blocks to filter out some objects for each signature. The problem I am encountering is that while it can read each signature just fine, it cannot process the width and height values to filter out a specific object. Part of my code is below:

if (signature == 1)
{
if (pixy.blocks[j].width>100 && pixy.blocks[j].height>100)
{
//Do what it needs to
}

Can anybody lead me in the right direction to what is possibly the problem?

Hello,
I’m not sure what you mean by “cannot process the width and height values”. I’m not sure why your code isn’t working, or how it’s failing specifically. The code you post looks reasonable, assuming it’s in a for loop. Have you verified that there are objects that meet these width and height criteria? Have you tried other values, or printed the values to make sure you are filtering using the correct numbers?

Edward