<< return to Pixycam.com

Newby question on detect boxes

Hi, I am awaiting delivery of my Pixy 1,
I am trying to detect boxes under the camera, regardless of their colour. ie boxes on a conveyor.

From what I can see there is the ability to get blocks, can anyone please confirm if this would work for me ?
as in pixy.getBlocks() where I imagine I would get an array of blocks, I could ignore their colour signature, and just get X&Y as pixy.blocks[ x ] .X and pixy.blocks[ x ] .Y for 0 to x boxes in the field of view.

I would like the X-Y co-ordinates of the four corners of each box in the field of view, say 5 boxes.

Thanks in advance

Hi, I believe this would work, assuming the boxes you’re trying to get this data for are colored objects that are taught to Pixy as color signatures.

Pixy returns the X-Y coordinates of the center of each block (aka each colored object it detects) as well as height and width. With some quick math you should be able to get corner coordinates.

What’s your application?

Thanks,
Jesse

FYI here is a bit more info on the data returned from original Pixy: https://docs.pixycam.com/wiki/doku.php?id=wiki:v1:hooking_up_pixy_to_a_microcontroller_-28like_an_arduino-29#arduino-api