Ask Your Question
0

Reprojectimageto3d output

asked 2019-09-27 03:06:20 -0600

Isath gravatar image

updated 2019-09-27 03:57:57 -0600

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?

image description

edit retag flag offensive 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) ?

berak gravatar imageberak ( 2019-09-27 04:24:48 -0600 )edit
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?

Isath gravatar imageIsath ( 2019-09-27 04:56:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-09-27 05:17:10 -0600

berak gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 1,101 times

Last updated: Sep 27 '19