Hello
I’m trying to understand how exactly You are segmenting the image. I have seen description of CMVision algorithm which is similar to Yours but unfortunately I can’t understand Your implementation. First question, which format do You obtain from the camera (RGB565 or YUV422)? And second question how do You comparise it with LUT table? I think it is made in assembler on pixy but I found second version of it too. It is written in C and I think it is a part of pixymon app. Name of this file is cccmodule.cpp. And this is the part which I don’t understand:
void CccModule::handleLine(uint8_t *line, uint16_t width)
{
uint32_t index, sig, sig2, usum, vsum, ysum;
int32_t x, r, g1, g2, b, u, v, u0, v0;
Qval newline;
// new line
m_qq->enqueue(&newline);
x = 1;
next:
usum = vsum = ysum = 0;
r = line[x];
g1 = line[x-1];
g2 = line[x-width];
b = line[x-width-1];
u = r-g1;
v = b-g2;
ysum += r + (g1+g2)/2 + b;
usum += u;
vsum += v;
u0 = u>>(9-CL_LUT_COMPONENT_SCALE);
v0 = v>>(9-CL_LUT_COMPONENT_SCALE);
u0 &= (1<<CL_LUT_COMPONENT_SCALE)-1;
v0 &= (1<<CL_LUT_COMPONENT_SCALE)-1;
index = (u0<=width)
return;
if (sig==0)
goto next;
r = line[x];
g1 = line[x-1];
g2 = line[x-width];
b = line[x-width-1];
u = r-g1;
v = b-g2;
ysum += r + (g1+g2)/2 + b;
usum += u;
vsum += v;
u0 = u>>(9-CL_LUT_COMPONENT_SCALE);
v0 = v>>(9-CL_LUT_COMPONENT_SCALE);
u0 &= (1<<CL_LUT_COMPONENT_SCALE)-1;
v0 &=(1<<CL_LUT_COMPONENT_SCALE)-1;
index = (u0<=width)
return;
if (sig==sig2)
goto save;
goto next;
save:
Qval qval(usum, vsum, ysum, (x/2<enqueue(&qval);
x += 2;
if (x>=width)
return;
goto next;
}
If You could tell me more about this part I would be really very grateful.
Thank You
Greetings
JB