Hi all ! I’ve found several post on the forum, and some code in the OF examples but I’m still not sure if I’m doing things the right way…
I need to get the RGB values of each pixel of a video frame (Raspberry ofOmxPlayer)
I read them (on purpose) from the bottom to the top of each col, and proceed cols left to the right
The video is RGB (and not RGBA) and very small on (32x32 pixels), and I draw circles on screen just to check if I have retrieved the right values. So far, the frames drawn with circles doesn’t look likes the video frames content at all…
v_width = omxPlayer.getWidth();
v_height = omxPlayer.getHeight();
int bpp = 3;
for (int col = 0; col < v_width; col++) {
for (int row = v_height - 1; row >= 0; row--) {
base = (row * v_width + col) * bpp;
unsigned char cRed = pixels[base];
unsigned char cGreen = pixels[base + 1];
unsigned char cBlue = pixels[base + 2];
ofSetColor(cRed, cGreen, cBlue);
ofCircle((col + 10) * 30, (row + 1) * 30, 5);
}
}
Is there anything wrong with these lines of code ?
Thanks for your help !