| Table of Contents / 3D Reconstruction / Sheet of Light | Operators |
apply_sheet_of_light_calibration — Apply the calibration transformations to the input disparity image.
apply_sheet_of_light_calibration(Disparity : : SheetOfLightModelID : )
The operator apply_sheet_of_light_calibration reads the disparity image Disparity, stores it to the sheet-of-light model specified by SheetOfLightModelID 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_result. The corresponding 3D object model can be retrieved with get_sheet_of_light_result_object_model_3d.
The disparity image Disparity may have been acquired previously by using the operator measure_profile_sheet_of_light 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_param:
extend of the calibration transformation which shall be applied to the disparity image. 'calibration' must be set to 'xz' or 'xyz'. Refer to set_sheet_of_light_param for details on this parameter.
the internal parameters of the camera used for the measurement.
the pose of the camera with respect to the world coordinate system.
the pose representing the transformation from the light-plane coordinate system 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.
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 extend has been set to 'xyz'. It is ignored when the calibration extend has been set to 'xz'.
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' must be specified as the ratio desired unit/original unit. The original unit is determined by thecoordinates 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' is set to 1.0.
A sheet-of-light model 'SheetOfLightModelID' cannot be shared between two or more user's threads. Different sheet-of-light models can be used independently and safely in different threads.
Height or range image to be calibrated.
Handle of the sheet-of-light model.
* ...
* 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')
*
* Clear the sheet-of-light model
clear_sheet_of_light_model (SheetOfLightModelID)
The operator apply_sheet_of_light_calibration returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.
get_sheet_of_light_result, get_sheet_of_light_result_object_model_3d
3D Metrology
| Table of Contents / 3D Reconstruction / Sheet of Light | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |