ClassesClasses | | Operators

set_structured_light_model_paramset_structured_light_model_paramSetStructuredLightModelParamSetStructuredLightModelParam (Operator)

Name

set_structured_light_model_paramset_structured_light_model_paramSetStructuredLightModelParamSetStructuredLightModelParam — Set parameters of a structured light model.

Signature

set_structured_light_model_param( : : StructuredLightModel, GenParamName, GenParamValue : )

Herror set_structured_light_model_param(const Hlong StructuredLightModel, const char* GenParamName, const Hlong GenParamValue)

Herror T_set_structured_light_model_param(const Htuple StructuredLightModel, const Htuple GenParamName, const Htuple GenParamValue)

void SetStructuredLightModelParam(const HTuple& StructuredLightModel, const HTuple& GenParamName, const HTuple& GenParamValue)

void HStructuredLightModel::SetStructuredLightModelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HStructuredLightModel::SetStructuredLightModelParam(const HString& GenParamName, Hlong GenParamValue) const

void HStructuredLightModel::SetStructuredLightModelParam(const char* GenParamName, Hlong GenParamValue) const

static void HOperatorSet.SetStructuredLightModelParam(HTuple structuredLightModel, HTuple genParamName, HTuple genParamValue)

void HStructuredLightModel.SetStructuredLightModelParam(HTuple genParamName, HTuple genParamValue)

void HStructuredLightModel.SetStructuredLightModelParam(string genParamName, int genParamValue)

Description

The operator set_structured_light_model_paramset_structured_light_model_paramSetStructuredLightModelParamSetStructuredLightModelParamSetStructuredLightModelParam is used to manipulate the parameters of a structured light model StructuredLightModelStructuredLightModelStructuredLightModelStructuredLightModelstructuredLightModel. The current parameter settings can be queried with the operator get_structured_light_model_paramget_structured_light_model_paramGetStructuredLightModelParamGetStructuredLightModelParamGetStructuredLightModelParam.

For an explanation of the concept of structured light and its supported applications, see the introduction of chapter Inspection / Structured Light.

General parameters:

'persistence'"persistence""persistence""persistence""persistence":

Enables (GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue='true'"true""true""true""true") or disables (GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue='false'"false""false""false""false") the 'persistence'"persistence""persistence""persistence""persistence" mode of the structured light model. When in persistence mode, the model stores intermediate results of the decoding, which can be inspected later by get_structured_light_objectget_structured_light_objectGetStructuredLightObjectGetStructuredLightObjectGetStructuredLightObject.

Note that the model might need significant memory space in this mode. Therefore, we recommend to enable this mode only during the setup and for debugging a structured light model setup.

If 'persistence'"persistence""persistence""persistence""persistence" is changed, all results of the model are cleared.

Values: 'true'"true""true""true""true", 'false'"false""false""false""false", 1, 0

Default: 'false'"false""false""false""false"

Parameters which influence the appearance of the generated pattern images:

'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width":

Sets the width of the pattern images that are generated while calling gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern. Usually, the value should be set to the width of the monitor that is used to display the pattern images.

The value of 'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width" has to be larger than the value 'min_stripe_width'"min_stripe_width""min_stripe_width""min_stripe_width""min_stripe_width"/2.

If 'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: integer values larger or equal to 1

Default: 1024

'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height":

Sets the height of the pattern images that are generated while calling gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern. Usually, the value should be set to the height of the monitor that is used to display the pattern images.

The value of 'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height" has to be larger than the value 'min_stripe_width'"min_stripe_width""min_stripe_width""min_stripe_width""min_stripe_width"/2.

If 'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: integer values larger or equal to 1

Default: 1024

'min_stripe_width'"min_stripe_width""min_stripe_width""min_stripe_width""min_stripe_width":

Sets the width (in pixels) of the finest stripe of the pattern images that are generated while calling gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern.

The value has to be a power of two. Furthermore, it has to be smaller or equal the minimum of the parameters 'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width" and 'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height" after rounding both up to their next power of two.

If 'min_stripe_width'"min_stripe_width""min_stripe_width""min_stripe_width""min_stripe_width" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: integer values larger or equal to 4 and a power of 2

Default: 32

'normalization'"normalization""normalization""normalization""normalization":

Sets the normalization mode of the structured light model. If the parameter is set to 'global'"global""global""global""global", gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern generates two additional pattern images composed of a black and a white image. These images are then used in the decoding process to determine the actual pattern region. If instead, the value 'inverted_pattern'"inverted_pattern""inverted_pattern""inverted_pattern""inverted_pattern" is chosen, each Gray code image is additionally inverted and the pattern region is segmented iteratively using the Gray code images and their inverted version.

If 'normalization'"normalization""normalization""normalization""normalization" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: 'global'"global""global""global""global", 'inverted_pattern'"inverted_pattern""inverted_pattern""inverted_pattern""inverted_pattern"

Default: 'global'"global""global""global""global"

'pattern_orientation'"pattern_orientation""pattern_orientation""pattern_orientation""pattern_orientation":

Sets the orientation of the pattern images that are generated while calling gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern. If the parameter is set to 'both'"both""both""both""both", pattern images with vertical stripes as well as pattern images with horizontal stripes are created. For 'vertical'"vertical""vertical""vertical""vertical" the pattern images consist of vertical stripes only, whereas for 'horizontal'"horizontal""horizontal""horizontal""horizontal" only horizontal stripes are generated.

If 'pattern_orientation'"pattern_orientation""pattern_orientation""pattern_orientation""pattern_orientation" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: 'both'"both""both""both""both", 'vertical'"vertical""vertical""vertical""vertical", 'horizontal'"horizontal""horizontal""horizontal""horizontal"

Default: 'both'"both""both""both""both"

'pattern_type'"pattern_type""pattern_type""pattern_type""pattern_type":

Sets the type of the pattern images that are generated while calling gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern. If the parameter is set to 'gray_code_and_phase_shift'"gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift" not only Gray code images but also phase shift images are generated. If instead, the parameter is set to 'gray_code'"gray_code""gray_code""gray_code""gray_code" only Gray code images are created.

Usually, 'gray_code_and_phase_shift'"gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift" leads to more accurate results because the combination between Gray code and phase images yields sub-pixel precise monitor coordinates.

If 'pattern_type'"pattern_type""pattern_type""pattern_type""pattern_type" is changed, the model is not decodable anymore and all possibly available results are cleared. Therefore, gen_structured_light_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatternGenStructuredLightPattern has to be called before decoding the model using decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern.

Values: 'gray_code_and_phase_shift'"gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift", 'gray_code'"gray_code""gray_code""gray_code""gray_code"

Default: 'gray_code_and_phase_shift'"gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift"

Parameters which influence the segmentation of the pattern region:

'min_gray_difference'"min_gray_difference""min_gray_difference""min_gray_difference""min_gray_difference":

Sets the minimum gray value difference for the Gray code images. This value is used within decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatternDecodeStructuredLightPattern to determine the binarized images. Thereby, for each pixel of the camera images the gray value difference between the lighted and the unlighted case is calculated. If the gray value difference of a pixel is smaller than 'min_gray_difference'"min_gray_difference""min_gray_difference""min_gray_difference""min_gray_difference", it is excluded from the domain of the binarized images (see get_structured_light_objectget_structured_light_objectGetStructuredLightObjectGetStructuredLightObjectGetStructuredLightObject) and thus also from further calculations.

If 'min_gray_difference'"min_gray_difference""min_gray_difference""min_gray_difference""min_gray_difference" is set to the value 0, the segmented region is identical to the input region of the camera images with the only exception that pixels with a decoding result outside the pattern images are excluded.

Values: integer values larger or equal to 0

Default: 30

Parameters which influence the defect image:

'derivative_sigma'"derivative_sigma""derivative_sigma""derivative_sigma""derivative_sigma":

Sets the sigma of the Gaussian (i.e. the amount of smoothing) that is used for the convolution of the correspondence image(s) to calculate the defect image.

Values: float or integer value larger or equal 0.01

Default: 2

Execution Information

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

StructuredLightModelStructuredLightModelStructuredLightModelStructuredLightModelstructuredLightModel (input_control, state is modified)  structured_light_model HStructuredLightModel, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Handle of the structured light model.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Name of the model parameter to be adjusted.

Default value: 'min_stripe_width' "min_stripe_width" "min_stripe_width" "min_stripe_width" "min_stripe_width"

List of values: 'derivative_sigma'"derivative_sigma""derivative_sigma""derivative_sigma""derivative_sigma", 'min_gray_difference'"min_gray_difference""min_gray_difference""min_gray_difference""min_gray_difference", 'min_stripe_width'"min_stripe_width""min_stripe_width""min_stripe_width""min_stripe_width", 'normalization'"normalization""normalization""normalization""normalization", 'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height", 'pattern_orientation'"pattern_orientation""pattern_orientation""pattern_orientation""pattern_orientation", 'pattern_type'"pattern_type""pattern_type""pattern_type""pattern_type", 'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width", 'persistence'"persistence""persistence""persistence""persistence"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

New value of the model parameter.

Default value: 32

Suggested values: 0, 0.01, 0.5, 0.7, 1, 1.4, 5, 50.0, 64, 128, 256, 1024, 'true'"true""true""true""true", 'false'"false""false""false""false", 'both'"both""both""both""both", 'vertical'"vertical""vertical""vertical""vertical", 'horizontal'"horizontal""horizontal""horizontal""horizontal", 'global'"global""global""global""global", 'inverted_pattern'"inverted_pattern""inverted_pattern""inverted_pattern""inverted_pattern", 'gray_code_and_phase_shift'"gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift""gray_code_and_phase_shift", 'gray_code'"gray_code""gray_code""gray_code""gray_code"

Example (HDevelop)

* Create the model
create_structured_light_model ('deflectometry', StructuredLightModel)
* Set the size of the monitor
set_structured_light_model_param (StructuredLightModel, \
                                  'pattern_width', 1600)
set_structured_light_model_param (StructuredLightModel, \
                                  'pattern_height', 1200)
* Set the smallest width of the stripes in the pattern
set_structured_light_model_param (StructuredLightModel, \
                                  'min_stripe_width', 8)
* Generate the patterns to project
gen_structured_light_pattern (PatternImages, StructuredLightModel)
* Set the expected black/white contrast in the region of interest
set_structured_light_model_param (StructuredLightModel, \
                                  'min_gray_difference', 70)
* Decode the camera images
decode_structured_light_pattern (CameraImages, StructuredLightModel)
* Get the computed correspondences and defects
get_structured_light_object (CorrespondenceImages, StructuredLightModel, \
                             'correspondence_image')
set_structured_light_model_param (StructuredLightModel, 'derivative_sigma', \
                                  Sigma)
get_structured_light_object (DefectImage, StructuredLightModel, \
                             'defect_image')
* Clean up
clear_structured_light_model (StructuredLightModel)

Result

The operator set_structured_light_model_paramset_structured_light_model_paramSetStructuredLightModelParamSetStructuredLightModelParamSetStructuredLightModelParam returns the value 2 (H_MSG_TRUE) if the given parameters are valid and within acceptable range. Otherwise, an exception will be raised.

Possible Predecessors

create_structured_light_modelcreate_structured_light_modelCreateStructuredLightModelCreateStructuredLightModelCreateStructuredLightModel

See also

get_structured_light_model_paramget_structured_light_model_paramGetStructuredLightModelParamGetStructuredLightModelParamGetStructuredLightModelParam

Module

3D Metrology


ClassesClasses | | Operators