| Table of Contents / 3D Reconstruction / Sheet of Light | Operators |
create_sheet_of_light_model — Create a model to perform 3D-measurements using the sheet-of-light technique.
create_sheet_of_light_model(ProfileRegion : : GenParamNames, GenParamValues : SheetOfLightModelID)
The operator create_sheet_of_light_model creates a model to perform 3D-Measurements using the sheet-of-light technique.
The sheet-of-light technique performs a three-dimensional reconstruction of the surface of an opaque and diffuse reflecting solid by using an area scan camera and a light line projector (typically a laser line projector). The camera and the line projector must be mounted so that their main axis form an angle of triangulation. The value of the angle of triangulation is typically chosen between 30° and 60°. The projected light line defines a plane in space. This plane intersects the surface of the solid under measurement and builds a profile of the surface visible for the camera. By moving the solid in front of the measurement system (i.e., the combination of the camera and the line projector), it is possible to record the whole surface of the solid. As an alternative, the measurement system can also be moved over the surface under measurement. Please note that the profiles must be oriented roughly horizontal in the profile images, because they are processed column by column.
If geometrical information about the measurement setup is available, it is possible to compute true three-dimensional coordinates of the reconstructed surface. For an overview of the required geometrical (i.e., calibration) information, refer to the operator set_sheet_of_light_param. If such information is not available, the result of the measurement is a disparity image, where each pixel holds a record of the subpixel precise position of the detected profile.
The operator returns a handle to the sheet-of-light model in SheetOfLightModelID, which is used for all further operations on the sheet-of-light model, like modifying parameters of the model, measuring profiles, applying calibration transformations or accessing the results of measurements.
Mandatory input iconic parameters
In order to perform measurements, you will have to set the following input iconic parameter:
- ProfileRegion: defines the region of the profile images, which will be processed by the operator measure_profile_sheet_of_light. This region should be rectangular and can be generated e.g. by using the operator gen_rectangle1. If the region passed to ProfileRegion is not rectangular, its smallest enclosing rectangle (bounding box) will be used.
Default settings of the sheet-of-light model parameters
The default settings of the sheet-of-light model were chosen to perform non-calibrated measurements in a basic configuration. The following list provides an overview of the parameter values used by default:
is set to 'center_of_gravity'
is set to 100
is set to 'none'
is set to 'first'
is set to 512
is set to 'none'
Modify the sheet-of-light model parameters
We recommend to adapt the default parameters to your specific measurement task, in order to enhance the quality of the measurement or to shorten the runtime. You will also have to modify the default values of the model parameters if you need calibrated results.
create_sheet_of_light_model provides the generic parameters GenParamNames and GenParamValues to modify the default value of most of the model parameters. Note that model parameters can also be set by using the operator set_sheet_of_light_param. Nevertheless, with this second operator only one parameter can be set at the same time, whereas it is possible to set more than one parameter at the time with create_sheet_of_light_model. Refer to set_sheet_of_light_param for a detailed description of all supported generic parameters.
Please note that the following model parameters can not be set with the operator create_sheet_of_light_model, and thus have to be set with the operator set_sheet_of_light_param: 'camera_parameter', 'camera_pose', 'lightplane_pose', and 'movement_pose'.
It is possible to query the value of the model parameters with the operator get_sheet_of_light_param. The names of all supported model parameters are returned by the operator query_sheet_of_light_params.
Free the sheet-of-light model
Since memory is allocated for the model during the call of the operator create_sheet_of_light_model and during the following operations, the model should be freed explicitly by the operator clear_sheet_of_light_model as soon as it is no longer used.
Region of the images containing the profiles to be processed. If the provided region is not rectangular, its smallest enclosing rectangle will be used.
Names of the generic parameters that can be adjusted for the sheet-of-light model.
Default value: 'min_gray'
List of values: 'min_gray', 'method', 'ambiguity_solving', 'score_type', 'num_profiles', 'calibration', 'scale'
Values of the generic parameters that can be adjusted for the sheet-of-light model.
Default value: 50
List of values: 'default', 'center_of_gravity', 'last', 'first', 'brightest', 'none', 'intensity', 'width', 50, 100, 150, 180
Handle for using and accessing the sheet-of-light model.
* Create the rectangular region in which the profiles are measured.
gen_rectangle1 (ProfileRegion, 120, 75, 195, 710)
*
* Create a model in order to measure profiles according to
* the sheet-of-light technique. Simultaneously set some
* parameters for the model.
create_sheet_of_light_model (ProfileRegion, ['min_gray','num_profiles', \
'ambiguity_solving','score_type'], \
[70,290,'first','width'], \
SheetOfLightModelID)
*
* Measure the profile from successive images
for Index := 1 to 290 by 1
read_image (ProfileImage, 'sheet_of_light/connection_rod_'+Index$'.3')
dev_display (ProfileImage)
dev_display (ProfileRegion)
measure_profile_sheet_of_light (ProfileImage, SheetOfLightModelID, [])
endfor
*
* Get the resulting disparity and score images
get_sheet_of_light_result (Disparity, SheetOfLightModelID, 'disparity')
get_sheet_of_light_result (Score, SheetOfLightModelID, 'score')
*
* Close the sheet-of-light handle once the measurement
* has been performed
clear_sheet_of_light_model (SheetOfLightModelID)
The operator create_sheet_of_light_model returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.
set_sheet_of_light_param, measure_profile_sheet_of_light
3D Metrology
| Table of Contents / 3D Reconstruction / Sheet of Light | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |