Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to change BGR to RGB of a video frame using C /C++

$
0
0
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; iheight; i++) { for (int x=0; xwidth; 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); Edit: Its OK the same requirement is coded in C++

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>