Re: [osg-users] How convert osg::Image to OpenCV IplImage

2013-04-22 Thread csdfsdf
wo,thanx for showing that to us

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53523#53523





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How convert osg::Image to OpenCV IplImage

2012-10-30 Thread Jen Hunter
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