Skip to content

disparity_image_to_xyzdisparity_image_to_xyzDisparityImageToXyzDisparityImageToXyzdisparity_image_to_xyzT_disparity_image_to_xyzπŸ”—

Short descriptionπŸ”—

disparity_image_to_xyzdisparity_image_to_xyzDisparityImageToXyzDisparityImageToXyzdisparity_image_to_xyzT_disparity_image_to_xyz β€” Transform a disparity image into 3D points in a rectified stereo system.

SignatureπŸ”—

disparity_image_to_xyz( image Disparity, out image X, out image Y, out image Z, campar CamParamRect1, campar CamParamRect2, pose RelPoseRect )disparity_image_to_xyz( Disparity : X, Y, Z : CamParamRect1, CamParamRect2, RelPoseRect : )void DisparityImageToXyz( const HObject& Disparity, HObject* X, HObject* Y, HObject* Z, const HTuple& CamParamRect1, const HTuple& CamParamRect2, const HTuple& RelPoseRect )static void HOperatorSet.DisparityImageToXyz( HObject disparity, out HObject x, out HObject y, out HObject z, HTuple camParamRect1, HTuple camParamRect2, HTuple relPoseRect )def disparity_image_to_xyz( disparity: HObject, 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]] ) -> Tuple[HObject, HObject, HObject]

Herror T_disparity_image_to_xyz( const Hobject Disparity, Hobject* X, Hobject* Y, Hobject* Z, const Htuple CamParamRect1, const Htuple CamParamRect2, const Htuple RelPoseRect )

HImage HImage::DisparityImageToXyz( HImage* Y, HImage* Z, const HCamPar& CamParamRect1, const HCamPar& CamParamRect2, const HPose& RelPoseRect ) const

HImage HCamPar::DisparityImageToXyz( const HImage& Disparity, HImage* Y, HImage* Z, const HCamPar& CamParamRect2, const HPose& RelPoseRect ) const

HImage HPose::DisparityImageToXyz( const HImage& Disparity, HImage* Y, HImage* Z, const HCamPar& CamParamRect1, const HCamPar& CamParamRect2 ) const

HImage HImage.DisparityImageToXyz( out HImage y, out HImage z, HCamPar camParamRect1, HCamPar camParamRect2, HPose relPoseRect )

HImage HCamPar.DisparityImageToXyz( HImage disparity, out HImage y, out HImage z, HCamPar camParamRect2, HPose relPoseRect )

HImage HPose.DisparityImageToXyz( HImage disparity, out HImage y, out HImage z, HCamPar camParamRect1, HCamPar camParamRect2 )

DescriptionπŸ”—

Given the disparity image Disparitydisparitydisparity of a rectified binocular stereo system, disparity_image_to_xyzDisparityImageToXyz computes the corresponding 3D points. Their coordinates relative to the rectified camera 1 are stored as gray values in the images Xxx, Yyy, and Zzz, i.e., the pixels at the position (Row,Column) in Xxx, Yyy, and Zzz contain the x, y, and z coordinate, respectively, of the pixel (Row,Column) in the disparity image.

The rectified binocular camera system is specified by its internal camera parameters CamParamRect1camParamRect1cam_param_rect_1 of the rectified camera 1 and CamParamRect2camParamRect2cam_param_rect_2 of the rectified camera 2, and the external parameters RelPoseRectrelPoseRectrel_pose_rect. The latter one is a pose in the form \(\mvPoseVar{{ccsR1}}{{ccsR2}}\), thus it defines the relative pose of the rectified camera coordinate system 2 (ccsR2) relative to the rectified camera coordinate system 1 (ccsR1) (see [``Solving machine vision tasks > Machine vision basics

Transformations > 3D Transformationsβ€™β€˜](https://docs.mvtec.com/hdevelopevo/26.11/content/mvtasks/machine_vision_basics/transformations/3d/poses/index.html). These camera parameters can be obtained from the operators calibrate_camerasCalibrateCameras and gen_binocular_rectification_mapGenBinocularRectificationMap.

AttentionπŸ”—

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

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on domain level.

ParametersπŸ”—

Disparitydisparitydisparity (input_object) singlechannelimage(-array) β†’ object (real)object (real)HObject (real)HImage (real)HObject (real)Hobject (real)

Disparity image.

Xxx (output_object) singlechannelimage(-array) β†’ object (real)object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

X coordinates of the points in the rectified camera system 1.

Yyy (output_object) singlechannelimage(-array) β†’ object (real)object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Y coordinates of the points in the rectified camera system 1.

Zzz (output_object) singlechannelimage(-array) β†’ object (real)object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Z coordinates of the points in the rectified camera system 1.

CamParamRect1camParamRect1cam_param_rect_1 (input_control) campar β†’ (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Internal camera parameters of the rectified camera 1.

CamParamRect2camParamRect2cam_param_rect_2 (input_control) campar β†’ (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Internal camera parameters of the rectified camera 2.

RelPoseRectrelPoseRectrel_pose_rect (input_control) pose β†’ (real / integer)(real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

Pose of the rectified camera 2 in relation to the rectified camera 1.

Number of elements: 7

ExampleπŸ”—

(HDevelop)


disparity_image_to_xyz (ImageDisparity, ImgX, ImgY, ImgZ, RectCamParL, \
                        RectCamParR, RectLPosRectR)
get_region_points (ImageDisparity, Rows, Columns)
get_grayval (ImgX, Rows, Columns, XValues)
get_grayval (ImgY, Rows, Columns, YValues)
get_grayval (ImgZ, Rows, Columns, ZValues)

ResultπŸ”—

The operator disparity_image_to_xyzDisparityImageToXyz returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input image available) is set via the operator set_system('no_object_result',<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

binocular_disparityBinocularDisparity

Possible successors

thresholdThreshold, write_imageWriteImage

Alternatives

disparity_to_point_3dDisparityToPoint3d, binocular_distanceBinocularDistance

See also

binocular_calibrationBinocularCalibration, gen_binocular_rectification_mapGenBinocularRectificationMap, intersect_lines_of_sightIntersectLinesOfSight

ModuleπŸ”—

3D Metrology