<< return to Pixycam.com

ColorSignature Information

Hi!

I´d like to tell pixy via USART to track a custom Signature.
I handle the USART events at video/progblobs.cpp which is fine.

But how can I tell pixy to track a new color?

My thoughts:

  • Generate a object of type ColorSignature (mysig)
  • pass it over to ColorLUT::setSignature(uint8_t signum, const ColorSignature &mysig)

1. Would this work?

2. Can you please explain the parameters of the struct ColorSignature? Has m_uMin m_uMax todo with HUE-Colors?

Thank you a lot!

@common/colorlut.h:
struct ColorSignature
{
ColorSignature()
{
m_uMin = m_uMax = m_uMean = m_vMin = m_vMax = m_vMean = m_type = 0;
}

int32_t m_uMin;
int32_t m_uMax;
int32_t m_uMean;
int32_t m_vMin;
int32_t m_vMax;
int32_t m_vMean;
uint32_t m_rgb;
uint32_t m_type;

};

Hello Jan,
The ColorSignature struct is an internal datatype. Are you wanting to modify the Pixy firmware?

This struct contains two ranges and two means. (1) the u range/mean and (2) the v range/mean. u and v are the two color components, which are u = (R-G)/(R+G+B) and v = (B-G)/(R+G+B).

Hope this helps!

Thank you Edward!

Cool, that´s what I wanted to know.

I found out the u range/mean and v range/mean from a red object for testing purposes via debugging.

When I add these infos as struct to signature 1 in progblobs.cpp it´s not tracking the object.
The debugger goes over the lines and also delivers the ColorSignature to g_blobs->m_clut.setSignature(0x01,*sig) successfully.

Is there another function than setSignature I need to call?

Thank you in advance!
Jan

//Build a red ColorSignature
ColorSignature* sig = new ColorSignature;
sig->m_uMin = 0x000011E3;
sig->m_uMax = 0x0000146D;
sig->m_uMean = 0x0000132E;

sig->m_vMin = 0xFFFFF7BD;
sig->m_vMax = 0xFFFFF9AD;
sig->m_vMean = 0xFFFFF8A7;
sig->m_rgb = 0x0055392E;
sig->m_type = 0x0;

//Set the signature to signature-slot 1
g_blobs->m_clut.setSignature(0x01,*sig);

//necessary? g_blobs->m_clut.generateLUT();
// go ahead and flush since we’ve changed things
//necessary? g_qqueue->flush();