Skip to content

apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibrationT_apply_sheet_of_light_calibration🔗

Short description🔗

apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibrationT_apply_sheet_of_light_calibration — Apply the calibration transformations to the input disparity image.

Signature🔗

apply_sheet_of_light_calibration( image Disparity, sheet_of_light_model SheetOfLightModelID )apply_sheet_of_light_calibration( Disparity : : SheetOfLightModelID : )void ApplySheetOfLightCalibration( const HObject& Disparity, const HTuple& SheetOfLightModelID )static void HOperatorSet.ApplySheetOfLightCalibration( HObject disparity, HTuple sheetOfLightModelID )def apply_sheet_of_light_calibration( disparity: HObject, sheet_of_light_model_id: HHandle ) -> None

Herror T_apply_sheet_of_light_calibration( const Hobject Disparity, const Htuple SheetOfLightModelID )

void HImage::ApplySheetOfLightCalibration( const HSheetOfLightModel& SheetOfLightModelID ) const

void HSheetOfLightModel::ApplySheetOfLightCalibration( const HImage& Disparity ) const

void HImage.ApplySheetOfLightCalibration( HSheetOfLightModel sheetOfLightModelID )

void HSheetOfLightModel.ApplySheetOfLightCalibration( HImage disparity )

Description🔗

The operator apply_sheet_of_light_calibrationApplySheetOfLightCalibration reads the disparity image Disparitydisparitydisparity, stores it to the sheet-of-light model specified by SheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id and applies the calibration transformation to this image, in order to compute the calibrated coordinates of the reconstructed 3D surface points. The resulting calibrated coordinates can be retrieved from the model by using the operator get_sheet_of_light_resultGetSheetOfLightResult. The corresponding 3D object model can be retrieved with get_sheet_of_light_result_object_model_3dGetSheetOfLightResultObjectModel3d. Note that prior to the next call of apply_sheet_of_light_calibrationApplySheetOfLightCalibration for a disparity image of smaller height, reset_sheet_of_light_modelResetSheetOfLightModel should be called.

The disparity image Disparitydisparitydisparity may have been acquired previously by using the operator measure_profile_sheet_of_lightMeasureProfileSheetOfLight or by an image acquisition device, which directly provides disparity values and works according to the sheet-of-light technique.

In order to compute the calibrated coordinates, the parameters listed below must have been set for the sheet-of-light model with the help of the operator set_sheet_of_light_paramSetSheetOfLightParam:

  • 'calibration'"calibration": extent of the calibration transformation which shall be applied to the disparity image. 'calibration'"calibration" must be set to 'xz'"xz", 'xyz'"xyz" or 'offset_scale'"offset_scale". Refer to set_sheet_of_light_paramSetSheetOfLightParam for details on this parameter.

  • 'camera_parameter'"camera_parameter": the internal parameters of the camera used for the measurement. This pose is required when the calibration extent has been set to 'xyz'"xyz" or 'xz'"xz".

  • 'camera_pose'"camera_pose": the pose of the world coordinate system relative to the camera coordinate system. This pose is required when the calibration extent has been set to 'xyz'"xyz" or 'xz'"xz".

  • 'lightplane_pose'"lightplane_pose": the pose of the light-plane coordinate system relative to the world coordinate system. The light-plane coordinate system must be chosen so that its plane z=0 coincides with the light plane described by the light line projector. This pose is required when the calibration extent has been set to 'xyz'"xyz" or 'xz'"xz".

  • 'movement_pose'"movement_pose": a pose representing the movement of the object between two successive profile images with respect to the measurement system built by the camera and the laser. This pose is required when the calibration extent has been set to 'xyz'"xyz". It is ignored when the calibration extent has been set to 'xz'"xz".

  • 'scale'"scale": with this parameter you can scale the 3D coordinates X, Y and Z that result when applying the calibration transformations to the disparity image. 'scale'"scale" must be specified as the ratio desired unit/original unit. The original unit is determined by the coordinates of the calibration object. If the original unit is meters (which is the case if you use the standard calibration plate), you can set the desired unit directly by selecting ‘m’, ‘cm’, ‘mm’ or ‘um’ for the parameter Scale. By default, 'scale'"scale" is set to 1.0.

Execution information🔗

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

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

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

Disparitydisparitydisparity (input_object) singlechannelimage → object (real)object (real)HObject (real)HImage (real)HObject (real)Hobject (real)

Height or range image to be calibrated.

SheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id (input_control, state is modified) sheet_of_light_model → (handle)(handle)HTuple (HHandle)HSheetOfLightModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the sheet-of-light model.

Example🔗

(HDevelop)


* ...
* Read an already acquired disparity map from file
read_image (Disparity, 'sheet_of_light/connection_rod_disparity.tif')
*
* Create a model and set the required parameters
gen_rectangle1 (ProfileRegion, 120, 75, 195, 710)
create_sheet_of_light_model (ProfileRegion, ['min_gray','num_profiles', \
                             'ambiguity_solving'], [70,290,'first'], \
                              SheetOfLightModelID)
set_sheet_of_light_param (SheetOfLightModelID, 'calibration', 'xyz')
set_sheet_of_light_param (SheetOfLightModelID, 'scale', 'mm')
set_sheet_of_light_param (SheetOfLightModelID, 'camera_parameter', \
                          CameraParameter)
set_sheet_of_light_param (SheetOfLightModelID, 'camera_pose', CameraPose)
set_sheet_of_light_param (SheetOfLightModelID, 'lightplane_pose', \
                          LightPlanePose)
set_sheet_of_light_param (SheetOfLightModelID, 'movement_pose', \
                          MovementPose)
*
* Apply the calibration transforms and
* get the resulting calibrated coordinates
apply_sheet_of_light_calibration (Disparity, SheetOfLightModelID)
get_sheet_of_light_result (X, SheetOfLightModelID, 'x')
get_sheet_of_light_result (Y, SheetOfLightModelID, 'y')
get_sheet_of_light_result (Z, SheetOfLightModelID, 'z')
*

Result🔗

The operator apply_sheet_of_light_calibrationApplySheetOfLightCalibration returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.

Combinations with other operators🔗

Combinations

Possible successors

get_sheet_of_light_resultGetSheetOfLightResult, get_sheet_of_light_result_object_model_3dGetSheetOfLightResultObjectModel3d

Module🔗

3D Metrology