Webcam feed reads as a inverted RGB and so the rendered colors are incorrect. I need to change BGR to RGB. Below shows incomplete code of trying to achieve the end result. Can someone guide me through this to complete? Currently using OoenCV 2.xx
GdkPixbuf* pix;
IplImage* frame;
CvCapture* capture;
frame = cvQueryFrame( capture );
// Converting BGR to RGB
for (int i = 0; i<frame->height; i++)
{
for (int x=0; x<frame->width; x++)
{
// LOST
}
}
pix = gdk_pixbuf_new_from_data((guchar*) frame->imageData,
GDK_COLORSPACE_RGB, FALSE, frame->depth, frame->width,
frame->height, (frame->widthStep), NULL, NULL);