create_sheet_of_light_modelT_create_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model (Operator)

Name

create_sheet_of_light_modelT_create_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model — Create a model to perform 3D-measurements using the sheet-of-light technique.

Signature

create_sheet_of_light_model(ProfileRegion : : GenParamName, GenParamValue : SheetOfLightModelID)

Herror T_create_sheet_of_light_model(const Hobject ProfileRegion, const Htuple GenParamName, const Htuple GenParamValue, Htuple* SheetOfLightModelID)

void CreateSheetOfLightModel(const HObject& ProfileRegion, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* SheetOfLightModelID)

HSheetOfLightModel HRegion::CreateSheetOfLightModel(const HTuple& GenParamName, const HTuple& GenParamValue) const

HSheetOfLightModel HRegion::CreateSheetOfLightModel(const HString& GenParamName, Hlong GenParamValue) const

HSheetOfLightModel HRegion::CreateSheetOfLightModel(const char* GenParamName, Hlong GenParamValue) const

HSheetOfLightModel HRegion::CreateSheetOfLightModel(const wchar_t* GenParamName, Hlong GenParamValue) const   (Windows only)

void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamName, const HTuple& GenParamValue)

void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamName, Hlong GenParamValue)

void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamName, Hlong GenParamValue)

void HSheetOfLightModel::HSheetOfLightModel(const HRegion& ProfileRegion, const wchar_t* GenParamName, Hlong GenParamValue)   (Windows only)

void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamName, const HTuple& GenParamValue)

void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamName, Hlong GenParamValue)

void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamName, Hlong GenParamValue)

void HSheetOfLightModel::CreateSheetOfLightModel(const HRegion& ProfileRegion, const wchar_t* GenParamName, Hlong GenParamValue)   (Windows only)

static void HOperatorSet.CreateSheetOfLightModel(HObject profileRegion, HTuple genParamName, HTuple genParamValue, out HTuple sheetOfLightModelID)

HSheetOfLightModel HRegion.CreateSheetOfLightModel(HTuple genParamName, HTuple genParamValue)

HSheetOfLightModel HRegion.CreateSheetOfLightModel(string genParamName, int genParamValue)

public HSheetOfLightModel(HRegion profileRegion, HTuple genParamName, HTuple genParamValue)

public HSheetOfLightModel(HRegion profileRegion, string genParamName, int genParamValue)

void HSheetOfLightModel.CreateSheetOfLightModel(HRegion profileRegion, HTuple genParamName, HTuple genParamValue)

void HSheetOfLightModel.CreateSheetOfLightModel(HRegion profileRegion, string genParamName, int genParamValue)

def create_sheet_of_light_model(profile_region: HObject, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_sheet_of_light_modelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelCreateSheetOfLightModelcreate_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_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_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 SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id, 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:

- ProfileRegionProfileRegionProfileRegionProfileRegionprofileRegionprofile_region: defines the region of the profile images, which will be processed by the operator measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLightMeasureProfileSheetOfLightmeasure_profile_sheet_of_light. This region should be rectangular and can be generated e.g. by using the operator gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1. If the region passed to ProfileRegionProfileRegionProfileRegionProfileRegionprofileRegionprofile_region is not rectangular, its smallest enclosing rectangle (bounding box) will be used. Note that ProfileRegionProfileRegionProfileRegionProfileRegionprofileRegionprofile_region is only taken into account by the operator measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLightMeasureProfileSheetOfLightmeasure_profile_sheet_of_light and is ignored when disparity images are processed.

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 (refer to set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param for a detailed description of all supported generic parameters):

'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

'num_profiles'"num_profiles""num_profiles""num_profiles""num_profiles""num_profiles"

is set to 512

'ambiguity_solving'"ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving"

is set to 'first'"first""first""first""first""first"

'score_type'"score_type""score_type""score_type""score_type""score_type"

is set to 'none'"none""none""none""none""none"

'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_modelCreateSheetOfLightModelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model provides the generic parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value 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_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model. Refer to set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_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_modelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model, and thus have to be set with the operator set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param: '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_paramGetSheetOfLightParamGetSheetOfLightParamGetSheetOfLightParamget_sheet_of_light_param. The names of all supported model parameters are returned by the operator query_sheet_of_light_paramsquery_sheet_of_light_paramsQuerySheetOfLightParamsQuerySheetOfLightParamsQuerySheetOfLightParamsquery_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_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param 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_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param for a detailed description of all supported generic parameters.

Use of a handle in multiple threads

Please note that you have to take special care when using a handle of a sheet-of-light-model 'SheetOfLightModelID'"SheetOfLightModelID""SheetOfLightModelID""SheetOfLightModelID""SheetOfLightModelID""SheetOfLightModelID" in multiple threads. One and the same handle cannot be used concurrently in different threads if they modify the handle. Thus, you have to be careful especially if the threads call operators that change the data of the handle. You can find an according hint in the 'Attention' section of the operators. Anyway, if you still want to use the same handle in operators that concurrently write into the handle in different threads you have to synchronize the threads to assure that they do not access the same handle simultaneously. If you are not sure if the usage of the same handle is thread-safe, please see the 'Attention' section of the respective reference manual entry if it contains a warning pointing to this problem. However, different handles can be used independently and safely in different threads.

Execution Information

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

ProfileRegionProfileRegionProfileRegionProfileRegionprofileRegionprofile_region (input_object)  region objectHRegionHObjectHRegionHobject

Region of the images containing the profiles to be processed. If the provided region is not rectangular, its smallest enclosing rectangle will be used.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

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: 'ambiguity_solving'"ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving""ambiguity_solving", 'calibration'"calibration""calibration""calibration""calibration""calibration", 'method'"method""method""method""method""method", 'min_gray'"min_gray""min_gray""min_gray""min_gray""min_gray", 'num_profiles'"num_profiles""num_profiles""num_profiles""num_profiles""num_profiles", '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", '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", 'score_type'"score_type""score_type""score_type""score_type""score_type"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Values of the generic parameters that can be adjusted for the sheet-of-light model.

Default value: 50

Suggested 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

SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id (output_control)  sheet_of_light_model HSheetOfLightModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle for using and accessing the sheet-of-light model.

Example (HDevelop)

* 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

Result

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

Possible Predecessors

gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1

Possible Successors

set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param, measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLightMeasureProfileSheetOfLightmeasure_profile_sheet_of_light

See also

clear_sheet_of_light_modelclear_sheet_of_light_modelClearSheetOfLightModelClearSheetOfLightModelClearSheetOfLightModelclear_sheet_of_light_model, calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light

Module

3D Metrology