# Revision history [back]

### Depth from Disparity

Hello,

i have 2 images from a calibrated camera. I could rectify the images using the following snippet:

Mat H1, H2;
stereoRectifyUncalibrated(image_points[0], image_points[1], F, image1.size(), H1, H2);

warpPerspective(image1, image1_rectified, H1, image1.size());
warpPerspective(image2, image2_rectified, H2, image2.size());


image_points[0] and image_points[1] are the corresponding image points from image1 and image2 (calculated with SURF and then matched).

I can calculate the disparity map with the two rectified images using StereoSGBM.

The last step would be to use

reprojectImageTo3D(image_disparity, XYZ, Q);


but i don't have the reprejection matrix Q.

Can someone describe me how to obtain this parameter?
I have the intrinsic camera matrix.

### Depth from Disparity

Hello,

i have 2 images from a calibrated camera. I could rectify the images using the following snippet:

Mat H1, H2;
stereoRectifyUncalibrated(image_points[0], image_points[1], F, image1.size(), H1, H2);

warpPerspective(image1, image1_rectified, H1, image1.size());
warpPerspective(image2, image2_rectified, H2, image2.size());


image_points[0] and image_points[1] are the corresponding image points from image1 and image2 (calculated with SURF and then matched).

I also can calculate the disparity map with the two rectified images using StereoSGBM.

The next and last step would be to use

reprojectImageTo3D(image_disparity, XYZ, Q);


but i don't have the reprejection matrix Q.

Can someone describe me how to obtain this parameter?
I have the intrinsic camera matrix.

### Depth from Disparity

Hello,

i have 2 images from a the same calibrated camera. I could rectify the images using the following snippet:

Mat H1, H2;
stereoRectifyUncalibrated(image_points[0], image_points[1], F, image1.size(), H1, H2);

warpPerspective(image1, image1_rectified, H1, image1.size());
warpPerspective(image2, image2_rectified, H2, image2.size());


image_points[0] and image_points[1] are the corresponding image points from image1 and image2 (calculated with SURF and then matched).

I also can calculate the disparity map with the two rectified images using StereoSGBM.

The next and last step would be to use

reprojectImageTo3D(image_disparity, XYZ, Q);


but i don't have the reprejection matrix Q.

Can someone describe me how to obtain this parameter?
I have the intrinsic camera matrix.