MATLAB: Project 2nd points onto a 3D reconstructed scene

image processingstereo vision

Hello! i am currently having a bit of a problem understanding an issue regarding Stereo vision. if we follow the path to the stereo parameters file (pathToYourMatlab\toolbox\vision\vision\+vision\+internal\+calibration\StereoParametersImpl.m ) in line 274 we have this formula as a notation : [x, y, disparity, 1] * Q = [X, Y, Z, 1] * w
x and y are the x and y values of the pixel to be converted to 3d in the left camera image, disparity is the calculated disparity for that pixel that I attain from the disparity map,Q is a 4*4 projection matrix and we can see its initialization in line 278, and after the equation mark we have X,Y,Z which are the corresponding X,Y,Z points to the 2nd x,y points.those are the points i want to find. yet there is another variable, w, which i cannot find anywhere in the file mentioned and can't grasp it's meaning. I need to know it's meaning so that I can convert every 2d point on the left image to its appropriate 3d point in the reconstructed scene, yet without knowing w it's impossible.
I am trying very hard to find an answer to this problem , but haven't had any progress in the last time so you are my last hope.
thanks in advance, Ohad

Best Answer

[X, Y, Z, 1] is a homogeneous vector and so is unique only up to multiplication by a non-zero scalar, w.
Related Question