<< return to Pixycam.com

Color Codes, signature inconsistencies

Hello world! (Scott, this is probably a question for you)

So I encountered this issue/inconsistency a while back (a few month ago). Im now starting to rely more on color codes, and kind of starting to annoy me just a little :slight_smile:

I made a color coded beacon using green and orange colors. I took a stripe of orange and sandwiched it between two greens (green,orange,green combo). I assigned a CC signature 5 to green, and CC signature 3 to orange. The color code block was recognized in my Pixymon with s=535. I ran hello_world example and indeed the print() command reported that a block with signature=535 was found. HOWEVER, if you actually use the API to get a color signature, like this
@
if(blokcs){
for(int j=0; j<blocks; j++){//cycle trough the blocks
signature=pixy.blocks[j].signature; //read color signature
Serial.println(signature); //should be 535 but its not
}
}
@
i get signature=349. So if I wanted to have a robot do stuff when it sees this beacon, I would have to look for blocks with signature 349 (and this number doesnt change if I reteach pixy or whatever)
The bottom line is that I can still work with color codes, but every time I would like to introduce a new color code combination, I have to figure out what the actual signature value is.
Is this a bug?

P.S. Im using latest version of Pixymon and arduino library.

Thanks!
Best,
Vadim

Hi Vadim,

Its definitely possible that this is a bug, which is why we’ve labeled the new CC firmware as beta.

I know this seems like a dumb question, but are you sure Pixy isn’t actually detecting the colors in signature 4 and 9? Which colors are 4 and 9 trained to? Are the signature numbers that get returned always random each time you re-train a signature?

Thanks!

Scott

Hey Scott!

There is no such thing as a dumb question!
The pixy is not decting colors in signatures 4 and 9. Pixy only has 7 color signatures to start with! Im using color signatures 1,2,6,7 as colors and 3 4 5 as color codes.
The signature numbers that get returned are NOT random each time I retrain a signature on a beacon. So if i didnt like lets say color saturation on my beacon which would consist of color signatures 535, i would go ahead change the color settings and retrain the camera. The returned signature number would still be 349.

However, If I want to create a new beacon consisting of color codes 3,4,5, then I would have to go trough troubles of discovering of what the actual returned number is. That number wouldnt change

Additional info:
So my beacon consists of color signatures 535 and the actual returned number is 349. If i cover up the “5” color on my beacon making it “35” the actual color code returned is 29. (also it doesnt matter which 5 i cover up, i think it recognizes that its the same thing if i remove a 5 from the right or left of the beacon, but the angle calculated is ± 180 degrees)

My pixy is configured to ouput as signatures or color codes (option 1 if i remember correctly)

I observed this bug on arduino UNO, Fio, MEGA, and DUE

Hi Vadim,

Ha yes you’re right, there are only 7 signatures (see that was a dumb question! :slight_smile: ).

Thanks for all the info. I’ll pass it along and see if we can identify the bug. Please let us know if you find anything else.

Scott

Hi,
thats not a bug. The color code numbers are returned as octal numbers. This means 535 in base 8 is 51+38+58^2=349 in base 10.
Same for color code 35: 5
1+3*8=29.

oh!

That explains why CC singature 434 is returned as 284… (48^0+38^1+48^2=284)
and why 43 is returned as 28 (4+3
8=28)

Thanks for the insight!