0

I need your help. I have implemented stereo calibration, rectification using my stereo pair. I have got a disparity image which is quite reasonable. The problem that I face is with cvReprojectImageTo3D.I have used stereobM. And rectified in a correct way. Declaration is as follows

 CvMat* disp = cvCreateMat( imageSize.height, imageSize.width, CV_16S );
 CvMat* vdisp = cvCreateMat( imageSize.height,imageSize.width, CV_8U );
 CvMat* Image3D = cvCreateMat(imageSize.height, imageSize.width, CV_32FC3);   

disp is disparity image obtained for the stereo pair.And when I run the command of showimage of Image3D I obtain colorful divisions. My doubt is why this is so. I attach the link of my result
photo is given below

https://plus.google.com/photos/110965556771924534380/albums/5745356738809417329/5748680803335389906

Another doubt I have is how this image3D is stored. Does CV_32FC3 mean that first channel gives x value second gives y and third gives z or sort of or Is there any other representation..?

nbsrujan
  • 1,179
  • 1
  • 12
  • 26

2 Answers2

1

Yes, " Output 3-channel floating-point image of the same size as disparity . Each element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map."

So it's the floating pointing x,y,z at each pixel coordinate

see http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html

Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
  • there is also another question based on photo that I have attached..Could you please give me the explanation why image consists of 4 colors – nbsrujan Jun 01 '12 at 16:42
  • what can we derive from these colors? – nbsrujan Jun 01 '12 at 16:49
  • 1
    @nbsrujan - you aren't supposed to display the 3D image, it's not really an image. It just uses the image format for convenience to reuse all the memory handling, I/O etc code – Martin Beckett Jun 01 '12 at 16:50
  • 1
    @nbsrujan - it's nothing to do with YCbCr, the four colors are simply where the floating point x,y values change from -ve to +ve or wrap around 255 or something, it's just an artifact of how the display handles a floating point image. Print the values of the array out and look at them – Martin Beckett Jun 01 '12 at 16:58
0

did you try something like

cvSave("depthmeasure.txt", Image3D);

Jose Bravo
  • 181
  • 1
  • 2
  • 5