Hi,

On 01/06/10 07:48, Ulrich Hertlein wrote:
Hi Osman,

On 29/05/10 23:38 , Osman Hancer wrote:
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 line-offset (skew) could indicate that the image is stored as 4-bytes 
per-pixel (not
three, as indicated by RGB) in the OpenCV image.

You're specifying r=3, is this correct?  Do you have three layers?

as Ulrich said, r is the depth for a 3D texture, not the depth ito colour layers. Make this 1 and check again.

Also, you can flip the image by just flipping texture coordinates in OSG and therefore skip some CPU processing. Also, check if your GPU can directly take BGR textures, it should.

jp


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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to