Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

not able to access rgb stream

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!!

not able to access rgb stream

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!!