create_sheet_of_light_model — Create a model to perform 3D-measurements using the sheet-of-light technique.
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.
Use the simplified sheet-of-light model parameters
In case of a simple setup or if not a real metric calibration is necessary, the transformation of the observed disparities into 3D values can be controlled using a simplified parameter set of the sheet-of-light model:
By setting the calibration with the set_sheet_of_light_param to 'offset_scale', the poses and camera parameter are changed to such values, that an offset of one pixel corresponds to one unit in the 3D result. This allows to create a 3D object model and 3D images from an uncalibrated sheet-of-light model.
The transformation from disparity to 3D coordinates can be controlled by six parameters: 'scale_x', 'scale_y', 'scale_z', 'offset_x', 'offset_y','offset_z'. Refer to set_sheet_of_light_param for a detailed description of all supported generic parameters.
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', 'scale_x', 'scale_y', 'scale_z', 'offset_x', 'offset_y', 'offset_z'
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', 'offset_scale', 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.