distance_to_disparity — Transfrom a distance value into a disparity in a rectified stereo system.
distance_to_disparity transforms a distance of a 3D point to the binocular stereo system into a disparity value. The cameras of this system must be rectified and are defined by the rectified internal parameters CamParamRect1 of the projective camera 1 and CamParamRect2 of the projective camera 2 and the external parameters RelPoseRect. latter specifies the relative pose of both camera systems to each other by defining a point transformation from the rectified camera system 2 to the rectified camera system 1. These parameters can be obtained from the operator calibrate_cameras and gen_binocular_rectification_map. The distance value is passed in Distance and the resulting disparity value Disparity is defined by the column difference of the image coordinates of two corresponding features on an epipolar line according to the equation d = c2 - c1 .
rectified internal camera parameters of the projective camera 1.
Number of elements: CamParamRect1 == 8 || CamParamRect1 == 12
rectified internal camera parameters of the projective camera 2.
Number of elements: CamParamRect2 == 8 || CamParamRect2 == 12
Point transformation from rectified camera 2 to rectified camera 1.
Number of elements: 7
Distance of a world point to camera 1.
Restriction: 0 < Distance
Disparity between the images of the point.
distance_to_disparity returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.