Name
create_sheet_of_light_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel — Create a model to perform 3D-measurements using the sheet-of-light
technique.
void CreateSheetOfLightModel(const HObject& ProfileRegion, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* SheetOfLightModelID)
HSheetOfLightModel HRegion::CreateSheetOfLightModel(const HTuple& GenParamNames, const HTuple& GenParamValues) const
HSheetOfLightModel HRegion::CreateSheetOfLightModel(const HString& GenParamNames, Hlong GenParamValues) const
HSheetOfLightModel HRegion::CreateSheetOfLightModel(const char* GenParamNames, Hlong GenParamValues) const
void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamNames, const HTuple& GenParamValues)
void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamNames, Hlong GenParamValues)
void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamNames, Hlong GenParamValues)
void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamNames, const HTuple& GenParamValues)
void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamNames, Hlong GenParamValues)
void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamNames, Hlong GenParamValues)
static void HOperatorSet.CreateSheetOfLightModel(HObject profileRegion, HTuple genParamNames, HTuple genParamValues, out HTuple sheetOfLightModelID)
HSheetOfLightModel HRegion.CreateSheetOfLightModel(HTuple genParamNames, HTuple genParamValues)
HSheetOfLightModel HRegion.CreateSheetOfLightModel(string genParamNames, int genParamValues)
public HSheetOfLightModel(HRegion profileRegion, HTuple genParamNames, HTuple genParamValues)
public HSheetOfLightModel(HRegion profileRegion, string genParamNames, int genParamValues)
void HSheetOfLightModel.CreateSheetOfLightModel(HRegion profileRegion, HTuple genParamNames, HTuple genParamValues)
void HSheetOfLightModel.CreateSheetOfLightModel(HRegion profileRegion, string genParamNames, int genParamValues)
The operator create_sheet_of_light_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel 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_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam. 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
SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelID, 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:
- ProfileRegionProfileRegionProfileRegionProfileRegionProfileRegionprofileRegion: defines the region of the
profile images, which will be processed by the operator
measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLight. This region should be rectangular
and can be generated e.g. by using the operator gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1.
If the region passed to ProfileRegionProfileRegionProfileRegionProfileRegionProfileRegionprofileRegion 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:
-
'method'"method""method""method""method""method"
-
is set to
'center_of_gravity'"center_of_gravity""center_of_gravity""center_of_gravity""center_of_gravity""center_of_gravity"
-
'min_gray'"min_gray""min_gray""min_gray""min_gray""min_gray":
-
is set to 100
-
'score_type'"score_type""score_type""score_type""score_type""score_type"
-
is set to 'none'"none""none""none""none""none"
-
'ambiguity_solving'"ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving"
-
is set to 'first'"first""first""first""first""first"
-
'num_profiles'"num_profiles""num_profiles""num_profiles""num_profiles""num_profiles"
-
is set to 512
-
'calibration'"calibration""calibration""calibration""calibration""calibration"
-
is set to 'none'"none""none""none""none""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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel provides the generic parameters
GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames and GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues 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_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam. 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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel. Refer to
set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam 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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel, and thus have to be set with
the operator set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam: 'camera_parameter'"camera_parameter""camera_parameter""camera_parameter""camera_parameter""camera_parameter",
'camera_pose'"camera_pose""camera_pose""camera_pose""camera_pose""camera_pose", 'lightplane_pose'"lightplane_pose""lightplane_pose""lightplane_pose""lightplane_pose""lightplane_pose", and
'movement_pose'"movement_pose""movement_pose""movement_pose""movement_pose""movement_pose".
It is possible to query the value of the model parameters with the
operator get_sheet_of_light_paramget_sheet_of_light_paramGetSheetOfLightParamget_sheet_of_light_paramGetSheetOfLightParamGetSheetOfLightParam. The names of all supported
model parameters are returned by the operator
query_sheet_of_light_paramsquery_sheet_of_light_paramsQuerySheetOfLightParamsquery_sheet_of_light_paramsQuerySheetOfLightParamsQuerySheetOfLightParams.
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_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam to
'offset_scale'"offset_scale""offset_scale""offset_scale""offset_scale""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_x""scale_x""scale_x""scale_x""scale_x", 'scale_y'"scale_y""scale_y""scale_y""scale_y""scale_y", 'scale_z'"scale_z""scale_z""scale_z""scale_z""scale_z", 'offset_x'"offset_x""offset_x""offset_x""offset_x""offset_x",
'offset_y'"offset_y""offset_y""offset_y""offset_y""offset_y",'offset_z'"offset_z""offset_z""offset_z""offset_z""offset_z". Refer to
set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam 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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel and during the following operations,
the model should be freed explicitly by the operator
clear_sheet_of_light_modelclear_sheet_of_light_modelClearSheetOfLightModelclear_sheet_of_light_modelClearSheetOfLightModelClearSheetOfLightModel as soon as it is no longer used.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
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'
"min_gray"
"min_gray"
"min_gray"
"min_gray"
"min_gray"
List of values: 'min_gray'"min_gray""min_gray""min_gray""min_gray""min_gray", 'method'"method""method""method""method""method", 'ambiguity_solving'"ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving", 'score_type'"score_type""score_type""score_type""score_type""score_type", 'num_profiles'"num_profiles""num_profiles""num_profiles""num_profiles""num_profiles", 'calibration'"calibration""calibration""calibration""calibration""calibration", 'scale'"scale""scale""scale""scale""scale", 'scale_x'"scale_x""scale_x""scale_x""scale_x""scale_x", 'scale_y'"scale_y""scale_y""scale_y""scale_y""scale_y", 'scale_z'"scale_z""scale_z""scale_z""scale_z""scale_z", 'offset_x'"offset_x""offset_x""offset_x""offset_x""offset_x", 'offset_y'"offset_y""offset_y""offset_y""offset_y""offset_y", 'offset_z'"offset_z""offset_z""offset_z""offset_z""offset_z"
Values of the generic parameters that can be
adjusted for the sheet-of-light model.
Default value: 50
List of values: 'default'"default""default""default""default""default", 'center_of_gravity'"center_of_gravity""center_of_gravity""center_of_gravity""center_of_gravity""center_of_gravity", 'last'"last""last""last""last""last", 'first'"first""first""first""first""first", 'brightest'"brightest""brightest""brightest""brightest""brightest", 'none'"none""none""none""none""none", 'intensity'"intensity""intensity""intensity""intensity""intensity", 'width'"width""width""width""width""width", 'offset_scale'"offset_scale""offset_scale""offset_scale""offset_scale""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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModel returns the value 2 (H_MSG_TRUE)
if the given parameters are correct.
Otherwise, an exception will be raised.
gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1
set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParam,
measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLight
clear_sheet_of_light_modelclear_sheet_of_light_modelClearSheetOfLightModelclear_sheet_of_light_modelClearSheetOfLightModelClearSheetOfLightModel
3D Metrology