Operator Reference

distance_to_disparityT_distance_to_disparityDistanceToDisparityDistanceToDisparitydistance_to_disparity (Operator)

distance_to_disparityT_distance_to_disparityDistanceToDisparityDistanceToDisparitydistance_to_disparity — Transform a distance value into a disparity in a rectified stereo system.

Signature

distance_to_disparity( : : CamParamRect1, CamParamRect2, RelPoseRect, Distance : Disparity)

Herror T_distance_to_disparity(const Htuple CamParamRect1, const Htuple CamParamRect2, const Htuple RelPoseRect, const Htuple Distance, Htuple* Disparity)

void DistanceToDisparity(const HTuple& CamParamRect1, const HTuple& CamParamRect2, const HTuple& RelPoseRect, const HTuple& Distance, HTuple* Disparity)

HTuple HCamPar::DistanceToDisparity(const HCamPar& CamParamRect2, const HPose& RelPoseRect, const HTuple& Distance) const

double HCamPar::DistanceToDisparity(const HCamPar& CamParamRect2, const HPose& RelPoseRect, double Distance) const

HTuple HPose::DistanceToDisparity(const HCamPar& CamParamRect1, const HCamPar& CamParamRect2, const HTuple& Distance) const

double HPose::DistanceToDisparity(const HCamPar& CamParamRect1, const HCamPar& CamParamRect2, double Distance) const

static void HOperatorSet.DistanceToDisparity(HTuple camParamRect1, HTuple camParamRect2, HTuple relPoseRect, HTuple distance, out HTuple disparity)

HTuple HCamPar.DistanceToDisparity(HCamPar camParamRect2, HPose relPoseRect, HTuple distance)

double HCamPar.DistanceToDisparity(HCamPar camParamRect2, HPose relPoseRect, double distance)

HTuple HPose.DistanceToDisparity(HCamPar camParamRect1, HCamPar camParamRect2, HTuple distance)

double HPose.DistanceToDisparity(HCamPar camParamRect1, HCamPar camParamRect2, double distance)

def distance_to_disparity(cam_param_rect_1: Sequence[Union[int, float, str]], cam_param_rect_2: Sequence[Union[int, float, str]], rel_pose_rect: Sequence[Union[int, float]], distance: MaybeSequence[float]) -> Sequence[Union[int, float]]

def distance_to_disparity_s(cam_param_rect_1: Sequence[Union[int, float, str]], cam_param_rect_2: Sequence[Union[int, float, str]], rel_pose_rect: Sequence[Union[int, float]], distance: MaybeSequence[float]) -> Union[int, float]

Description

distance_to_disparitydistance_to_disparityDistanceToDisparityDistanceToDisparitydistance_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 CamParamRect1CamParamRect1CamParamRect1camParamRect1cam_param_rect_1 of the camera 1 and CamParamRect2CamParamRect2CamParamRect2camParamRect2cam_param_rect_2 of the camera 2 and the external parameters RelPoseRectRelPoseRectRelPoseRectrelPoseRectrel_pose_rect. The 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_camerascalibrate_camerasCalibrateCamerasCalibrateCamerascalibrate_cameras and gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMapgen_binocular_rectification_map. The distance value is passed in DistanceDistanceDistancedistancedistance and the resulting disparity value DisparityDisparityDisparitydisparitydisparity is defined by the column difference of the image coordinates of two corresponding features on an epipolar line according to the equation .

Attention

If using cameras with telecentric lenses, the DistanceDistanceDistancedistancedistance is not defined as the distance of a point to the camera but as the distance from the point to the plane, defined by the y-axes of both cameras and their baseline (see gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMapgen_binocular_rectification_map).

For stereo setups of mixed type (i.e., for a stereo setup in which one of the original cameras is a perspective camera and the other camera is a telecentric camera; see gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMapgen_binocular_rectification_map), the rectifying plane of the two cameras is in a position with respect to the object that would lead to very unintuitive distances. Therefore, distance_to_disparitydistance_to_disparityDistanceToDisparityDistanceToDisparitydistance_to_disparity does not support stereo setups of mixed type.

Additionally, stereo setups that contain cameras with and without hypercentric lenses at the same time are not supported.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

CamParamRect1CamParamRect1CamParamRect1camParamRect1cam_param_rect_1 (input_control)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Rectified internal camera parameters of camera 1.

CamParamRect2CamParamRect2CamParamRect2camParamRect2cam_param_rect_2 (input_control)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Rectified internal camera parameters of camera 2.

RelPoseRectRelPoseRectRelPoseRectrelPoseRectrel_pose_rect (input_control)  pose HPose, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Point transformation from the rectified camera 2 to the rectified camera 1.

Number of elements: 7

DistanceDistanceDistancedistancedistance (input_control)  real(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Distance of a world point to camera 1.

DisparityDisparityDisparitydisparitydisparity (output_control)  number(-array) HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Disparity between the images of the point.

Result

distance_to_disparitydistance_to_disparityDistanceToDisparityDistanceToDisparitydistance_to_disparity returns 2 ( H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.

Possible Predecessors

binocular_calibrationbinocular_calibrationBinocularCalibrationBinocularCalibrationbinocular_calibration, gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMapgen_binocular_rectification_map

Possible Successors

binocular_disparitybinocular_disparityBinocularDisparityBinocularDisparitybinocular_disparity

Module

3D Metrology