Selam Osman, Did you try void osg::Image::setOrigin ( Origin<http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00305.html#3eb3fb7f290c3b5ef6122b76d5fe6c69> *origin* ) [inline]function before convert TopLeft image to BottomLeft? May be you won't need any flipping operation before setImage funtion. And another hint, are you sure your captured image's depth is IPL_DEPTH_8U from OpenCV. You have set GL_UNSIGNED_BYTE to image type but may be your type could be IPL_DEPTH_16U or IPL_DEPTH_32U.
Hope this helps. Regards. Ümit Uzun 2010/5/29 Osman Hancer <enderenderenderen...@hotmail.com> > Hi, > > I want to convert an OpenCV IplImage to an OSG image. For this, I first > fliped image from top-left to bottom-left by > > cvConvertImage(cvImg , cvImg, CV_CVTIMG_FLIP); > > > then converted BGR to RGB color format by > > cvCvtColor( cvImg, cvImg, CV_BGR2RGB ); > > > then I used setImage to do the actual conversion. > > osgImg->setImage(cvImg->width,cvImg->height, 3, > GL_RGB, GL_RGB, > GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE > ,1); > > > The result is not what I expected. First of all, the result is in Greyscale > and image seems to shifted a little bit. You can see the results form the > attached picture. > > Do you have any idea about the problem? > > Thank you! > > Cheers, > osman > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=28335#28335 > > > > > Attachments: > http://forum.openscenegraph.org//files/aaaa_700.jpg > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org