not able to access rgb stream [closed]

asked 2015-01-11 07:52:41 -0600

Deepak Kumar gravatar image

updated 2015-01-11 07:56:51 -0600

hi, i am working on intel realsense camera. i am not able to access its rgb stream using opencv

below is the source code :-

PXCImage *color_image = pp.QueryImage( PXCImage::IMAGE_TYPE_COLOR ); PXCImage *depth_image = pp.QueryImage( PXCImage::IMAGE_TYPE_DEPTH );

PXCImage::ImageData colorImageData; PXCImage::ImageData depthImageData;

color_image->AcquireAccess( PXCImage::ACCESS_READ, &colorImageData ); depth_image->AcquireAccess( PXCImage::ACCESS_READ, &depthImageData );

cvSetData( cvColorimg, (uchar)colorImageData.planes[0], cvColorimg->width * 3 * sizeof(uchar) ); cvSetData( cvDepthimg, (short)depthImageData.planes[0], cvDepthimg->width * sizeof(short) ); cvSetData( cvUVimg, (float*)depthImageData.planes[2], cvDepthimg->width * sizeof(float) );

Mat rgbMat(cvColorimg,CV_8UC3);.........<<<<<<<<<<<<<<<<error occurs.....here="" mat="" depthmat(cvdepthimg="" );<="" p="">

imshow( "test", rgbMat ); imshow( "depth", depthMat ); imshow( "UV", Mat(cvUVimg) );

color_image->ReleaseAccess(&colorImageData); depth_image->ReleaseAccess(&depthImageData);

Thank you

here when i am trying to store the pxc image into mat variable and when i runs the code error comes at Mat rgbMat(cvColorimg,CV_8UC3); saying memory access violation.

how can i get rid of this.

thanks!!

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by FooBar
close date 2015-01-11 07:57:12.545832

Comments

hi @Deepak, please edit your older question, to push it up again ..

berak gravatar imageberak ( 2015-01-11 08:29:08 -0600 )edit