Ask Your Question

# Reprojectimageto3d output

Using reprojectimageto3d function I calculate the actual coordinate points [X, Y, Z], however, according to the documentation, the results obtained are divided by W. Please answer what the variable W is and how can I calculate it? edit retag close merge delete

## Comments

how can I calculate it?

why would you need to ? look at the formula again, [X Y Z W] is the result of Q * [x y d 1]

so, you need to obtain x,y,d and Q.

and here comes the more challenging question: how do you get Q, the projection matrix, (if not from a real world stereo calibration) ?

1

I am using function stereoCalibrate and stereoRectify to get the Q matrix. The result seems to be correct(baseline and focal are OK). To calculate 'd' l am using disparity image. x, y are taken from the mouse position in the disparity image.

I am using this formulas to get real world cordinates:

reprojectedImage = reprojectimageto3d(disp, Q) # disp - disparity map.

realcords = reprojectedImage(x,y) # _3dImage(x,y) = (X/W, Y/W, Z/W) W???.

The question is whether the cordinates returned to realcords variable are real or must be divided by W?

## 1 answer

Sort by » oldest newest most voted

The question is whether the cordinates returned to realcords variable are real or must be divided by W?

no, you don't have to, as it's already done internally

more

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2019-09-27 03:06:20 -0500

Seen: 394 times

Last updated: Sep 27 '19