Hi Koduri, for the project I'm working on I needed something similar. Using the C++ API of OpenCV I found the following code to be working:
Code: osgImg->readPixels( 0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE ); cv::Mat cvImg(osgImg->t(), osgImg->s(), CV_8UC3); cvImg.data = (uchar*)osgImg->data(); // Flipping because of different origins cv::flip(cvImg, cvImg, 0); Cheers, Dakota ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50895#50895 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org