<< return to Pixycam.com

sort order of incoming blob data ?

hi,
3 questions about the blob data:

1.) what is the sort order of incoming blob data e.g. by the hello__world example sketch (SPI mode) ?
do the data come in either reliably sorted pre-order or do they come randomly ?

2.) what is this

   if (i % 10==0)...

for?

3.) are all available data of each recognized block shown or do exist yet additionally non-displayed obscured blob data?

void loop()
{ 
  static int i = 0;
  int j;
  uint16_t blocks;
  char buf[32]; 
  
  blocks = pixy.getBlocks();
  
  if (blocks)
  {
    i++;
    
    if (i % 10==0)
    {
      sprintf(buf, "Detected %d:\n", blocks);
      Serial.print(buf);
      for (j=0; j<blocks; j++)
      {
        sprintf(buf, "  block %d: ", j);
        Serial.print(buf); 
        pixy.blocks[j].print();
      }
    }
  }  
}

hello…?
anyone in here…?

Hi Helmut,

i don’t know much about pixy because i use it recently, but i can say you that if (i % 10==0) 10 is the number of frame,so this mean pixy output blocks every 10 frames, but 10 is so low ani it would bog down the Arduino!

point 3: yes it is available data of each recognized http://cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Microcontroller_(like_an_Arduino)

I’m curious which data come first - by location, by color, by size, or randomly?

sometimes one gets dozens of tiny blobs of the same color (e.g., artefacts by shades or cover of larger areas by small objects) and then actually only the largest blocks are of interest.

So the issue is about how to filter the blocks in order to evaluate just the position of the largest blobs and then drop the rest of tiny artefacts:

if they come pre-sorted by size, one only needs to count them up to a limit,
if they come sorted by color, one will have to count all of the same color and then sort by size,
if they come sorted by location one may evaluate some regions of interest first,
but if 1000 blocks are listed completely randomly the image processing will become quite weired, I’m afraid… :-/

where are the developers in this forum to answer the questions ??

what a crap!
who is supposed to know details about the Pixy cam if not the developers?!?

how can I get support by the developers???

I’m not a developer, but looking at the code, I believe the blobs are sent in the order they are received.

maybe my question was not written clearly enough…

by what order are the BLOBS/blocks sent by the Pixycam (via SPI) and received by the Arduino?

the arduino serial print you the block in order of signature

Detected 2:
block 0: sig: 1 x: 309 y: 179 width: 6 height: 3 angle 0
block 1: sig: 2 x: 300 y: 170 width: 6 height: 8 angle 0

try the example hello world

that was not my question!

given you have 500 detected blocks by 500 different sizes and 500 different (x,y) localizations and by 7 different signatures and by 7 different colorcodes -
by what order are they sent and received ?

Please don’t reply if you don’t know the exact answer!

i think if you try the simple example hello world you could understand about your question but ok, good luck

of course I tried, but that does not give the answer to my question by what sequence/sort order the 500 blocks (0…499) will be sent and received !
Are they pre-sorted by size, by color signature, or by location - or what ??

Helmut Wunder wrote:

given you have 500 detected blocks by 500 different sizes and 500 different (x,y) localizations and by 7 different signatures and by 7 different colorcodes -
by what order are they sent and received ?

Hi Helmut,
So Pixy returns the signatures in order — Signature 1 blocks are sent first, followed by signature 2, etc.

Within each set of blocks for a given signature, the largest blocks are sent first.

thanks!

aah - ok, then I have just to take up to the first 4 ones of each signature, and then drop the rest until a new signature number will appear - that’s fine, thanks!