<< return to Pixycam.com

135 objects per frame

I read the Pixy can detected 135 objects per frame (Pixy processes at 50 frames per second.) , thus providing theoretically 6,700 block formats.

How can I obtain each of the 135 object’s x-y coordinates per frame?

Can it be the same object but in different locations of the same frame?

Is this possible?

Thank you very much.

Alex

Hi Alexander,
Pixy can potentially detect hundreds of objects. It depends on the nature of the object, its size and the number of connected pixels. But it’s really difficult constructing a scene with hundreds of objects!

The objects can consist of any combination of the 7 available signatures, or can consist of only 1 signature.

Pixy has a choice of interfaces. There is more information here:

http://cmucam.org/projects/cmucam5/wiki/Porting_Guide

Hope this helps!

Edward

Thank you for replying Edward.

Lots of technical stuff to digest, but can you clarify the following?

What do you meant by “detect”? I am only interested in obtaining (capturing) the width and height of a small object (if it can be detected), 50 times in each frame. The object will move to several different locations within each frame. 50 “detection” per frame times 50 frames per seconds gives me 2500 width and heights.
The data will be recorded by an Arduino Due.
I’m not interested in seeing the object just the data which will be put into an array.

Thank you for your time and effort.

Sincerely,

Alexander

Hello Alexander,
When Pixy detects and object (when Pixy finds an object that matches one of its 7 signatures) it reports it through one of its serial ports (SPI, i2c or UART). The information it reports for each detected object includes the width and height, so it sounds like Pixy can provide the information you need.

Hope this helps!

Edward

Dear Edward,
Thank you again for taking your time to respond. I believe I understand what you have provided, but I feel I’m still not being clear.

My object will be only one matched signature, and I want the same object to be detected 50 time per frame (all block information) times 50fps. So I guess what I am asking is: 2500 blocks for the same object in one second.

Can I some how capture all this data and send it into an array for later modification?

How can the “Hello World” be modified to capture all 2500 block in one second for the SAME object?

" void loop()
{
static int i = 0;
int j;
uint16_t blocks;
char buf[32];
blocks = pixy.getBlocks();
if (blocks)
{
i++;
if (i%50==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();
}
}
}
}
"

Still reading and digesting your provided link.

Again, Thank you very much for all your time and effort.

Sincerely,

Alexander

Hello Alexander,
If you want to detect 50 objects per frame, you shouldn’t have any problems with the standard Arduino cable and Hello_world example. One problem you may run into is what to do with all of the data. In the Hello_world example, Pixy can detect objects faster than the Arduino can print them. This is a problem if you want to print the results. We solve this by printing the detected objects every 50th frame. (which is what the “if (1%50)==0” line does.)

So I’d start with the Hello_world example and you should be fine.

Edward

Again Edwards, your the man !
Thank you for your time and suggestions. I will not print the data out, but capture the 50 object info per-frame for 50 fps into an array as fast as it comes for one second, then at the end of the routine the data will be sent to a function where it extracts and convert data into the right format for 'processing" to graph.
I’ll search under Wiki to see how to write this sketch.
Thank you again.

Sincerely,

alexander

Dear Edwards,
If I may ask a simple question for my clarification. The Pixy’s resolution is 320 by 200 (for width and height of rectangle), and the measurements are in pixel?

If the rectangle width is 245 and I wish to convert into millimeters, must the 245 be multiplied by (25.4/320) ? I wish to have the range be given in millimeters.

Also, an object with ONE signature can provide many different “blocks”?

Thank you for your time.

Alexander

Hello Alexander,
That’s correct — 320 x 200 are pixels, not millimeters. Pixy is basically a camera. Distant objects appear smaller in the image than close-up objects, so you can’t convert pixels to millimeters without also knowing the distance of the object from Pixy’s lens. Sorry, this is probably not what you wanted to hear.

Edward