c++ interface of cvCreateImageHeader(), cvSetData()

asked 2015-01-09 23:27:25 -0600

Deepak Kumar gravatar image

updated 2015-01-11 06:45:11 -0600

hi, i want to convert c interface of opencv into c++ interface. such as cvCreateImageHeader

and how can i convert this to c++ interface :

cvSetData( colorimg, (uchar*)colorImageData.planes[0], colorimg->width * 3 * sizeof(uchar) );
cvSetData( depthimg, (short*)depthImageData.planes[0], depthimg->width * sizeof(short) );
cvSetData( UVimg, (float*)depthImageData.planes[2], depthimg->width * sizeof(float) );
edit retag flag offensive close merge delete


in your 3rd case, does depthImageData.planes[2] really hold float data ? no idea, how you acquire this, but the same image having different formats in different planes looks weird to me.

berak gravatar imageberak ( 2015-01-10 06:36:47 -0600 )edit

no, in depthImageData.plane[2] i am getting uv image. and in depthImageData[0] i am getting depth image. I want to ask how can i store its data in mat using cv::mat instead of iplimage pointer.

Deepak Kumar gravatar imageDeepak Kumar ( 2015-01-12 10:02:49 -0600 )edit

again, does that channel hold float data, or do you want float data ? (2 very different things..)

berak gravatar imageberak ( 2015-01-12 10:16:59 -0600 )edit