Structured Light
List of Operators ↓
This chapter describes operators for using structured light.
Concept of Structured Light
The basic concept behind structured light is the display of known
patterns onto a display or projector. The way those patterns appear in the
scene after hitting surfaces helps to further analyze the surfaces.
To use structured light, a model must first be created using
create_structured_light_model
create_structured_light_model
CreateStructuredLightModel
CreateStructuredLightModel
CreateStructuredLightModel
create_structured_light_model
. The model type is specified in
ModelType
ModelType
ModelType
ModelType
modelType
model_type
. Currently, only the model type 'deflectometry'
"deflectometry"
"deflectometry"
"deflectometry"
"deflectometry"
"deflectometry"
is supported. Deflectometry is the procedure of analyzing the reflections
of known patterns from specular or semi-specular surfaces. In
such a setup, for every pattern image projected on the screen, a camera
image of the reflection is acquired. Deformations of the pattern in the
camera image imply a defect on the specular surface.
In the following, the steps that are required to perform defect detection
on specular surfaces are described briefly.
- Create a structured light model:
-
In the first step, a structured light model is created with
or read with
- Set the model parameters:
-
The different structured light model parameters can then be set with
set_structured_light_model_param
set_structured_light_model_param
SetStructuredLightModelParam
SetStructuredLightModelParam
SetStructuredLightModelParam
set_structured_light_model_param
or queried with
get_structured_light_model_param
get_structured_light_model_param
GetStructuredLightModelParam
GetStructuredLightModelParam
GetStructuredLightModelParam
get_structured_light_model_param
. The pattern parameters
'pattern_width'
"pattern_width"
"pattern_width"
"pattern_width"
"pattern_width"
"pattern_width"
, 'pattern_height'
"pattern_height"
"pattern_height"
"pattern_height"
"pattern_height"
"pattern_height"
,
'pattern_orientation'
"pattern_orientation"
"pattern_orientation"
"pattern_orientation"
"pattern_orientation"
"pattern_orientation"
, and 'pattern_type'
"pattern_type"
"pattern_type"
"pattern_type"
"pattern_type"
"pattern_type"
specify along
with the stripe parameters 'min_stripe_width'
"min_stripe_width"
"min_stripe_width"
"min_stripe_width"
"min_stripe_width"
"min_stripe_width"
and
'single_stripe_width'
"single_stripe_width"
"single_stripe_width"
"single_stripe_width"
"single_stripe_width"
"single_stripe_width"
the specifications of the pattern images to
be generated and projected onto the specular surface. Finally, the
'persistence'
"persistence"
"persistence"
"persistence"
"persistence"
"persistence"
parameter can be enabled to debug intermediate
results.
- Generate the pattern images:
-
The pattern images are to be generated with
gen_structured_light_pattern
gen_structured_light_pattern
GenStructuredLightPattern
GenStructuredLightPattern
GenStructuredLightPattern
gen_structured_light_pattern
after setting all relevant parameters.
Please ensure that the output images are as needed in the particular setup.
- Project the patterns and acquire the camera images:
-
At this stage, the pattern images are shown on the display and reflected
by the specular surface. The respective reflected image is acquired by the
camera for each pattern image.
- Decode the acquired images:
-
The acquired CameraImages
CameraImages
CameraImages
CameraImages
cameraImages
camera_images
can be decoded with
decode_structured_light_pattern
decode_structured_light_pattern
DecodeStructuredLightPattern
DecodeStructuredLightPattern
DecodeStructuredLightPattern
decode_structured_light_pattern
. Upon calling this operator, the
correspondence images are created and stored in the model
StructuredLightModel
StructuredLightModel
StructuredLightModel
StructuredLightModel
structuredLightModel
structured_light_model
.
- Get the results:
-
Now the decoded 'correspondence_image'
"correspondence_image"
"correspondence_image"
"correspondence_image"
"correspondence_image"
"correspondence_image"
, as well as other results
can be queried with get_structured_light_object
get_structured_light_object
GetStructuredLightObject
GetStructuredLightObject
GetStructuredLightObject
get_structured_light_object
. The
'defect_image'
"defect_image"
"defect_image"
"defect_image"
"defect_image"
"defect_image"
can be generated and queried with
get_structured_light_object
get_structured_light_object
GetStructuredLightObject
GetStructuredLightObject
GetStructuredLightObject
get_structured_light_object
. For more details of the different
objects that can be queried, please refer to the operator's documentation.
Further operators
The structured light model offers various other operators that help access
and update the various parameters of the model.
The operator write_structured_light_model
write_structured_light_model
WriteStructuredLightModel
WriteStructuredLightModel
WriteStructuredLightModel
write_structured_light_model
enables writing the
structured light model to a file. Please note that previously generated
pattern images are not written in this file. A structured light model file
can be read using read_structured_light_model
read_structured_light_model
ReadStructuredLightModel
ReadStructuredLightModel
ReadStructuredLightModel
read_structured_light_model
.
Furthermore, it is possible to serialize and deserialize the structured
light model using serialize_structured_light_model
serialize_structured_light_model
SerializeStructuredLightModel
SerializeStructuredLightModel
SerializeStructuredLightModel
serialize_structured_light_model
and
deserialize_structured_light_model
deserialize_structured_light_model
DeserializeStructuredLightModel
DeserializeStructuredLightModel
DeserializeStructuredLightModel
deserialize_structured_light_model
.
Further Information
See also the “Solution Guide Basics”
for further details.
List of Operators
clear_structured_light_modelClearStructuredLightModelclear_structured_light_modelClearStructuredLightModelclear_structured_light_model
- Clear a structured light model and free the allocated memory.
create_structured_light_modelCreateStructuredLightModelcreate_structured_light_modelCreateStructuredLightModelcreate_structured_light_model
- Create a structured light model.
decode_structured_light_patternDecodeStructuredLightPatterndecode_structured_light_patternDecodeStructuredLightPatterndecode_structured_light_pattern
- Decode the camera images acquired with a structured light setup.
deserialize_structured_light_modelDeserializeStructuredLightModeldeserialize_structured_light_modelDeserializeStructuredLightModeldeserialize_structured_light_model
- Deserialize a structured light model.
gen_structured_light_patternGenStructuredLightPatterngen_structured_light_patternGenStructuredLightPatterngen_structured_light_pattern
- Generate the pattern images to be displayed in a structured light setup.
get_structured_light_model_paramGetStructuredLightModelParamget_structured_light_model_paramGetStructuredLightModelParamget_structured_light_model_param
- Query parameters of a structured light model.
get_structured_light_objectGetStructuredLightObjectget_structured_light_objectGetStructuredLightObjectget_structured_light_object
- Get (intermediate) iconic results of a structured light model.
read_structured_light_modelReadStructuredLightModelread_structured_light_modelReadStructuredLightModelread_structured_light_model
- Read a structured light model from a file.
serialize_structured_light_modelSerializeStructuredLightModelserialize_structured_light_modelSerializeStructuredLightModelserialize_structured_light_model
- Serialize a structured light model.
set_structured_light_model_paramSetStructuredLightModelParamset_structured_light_model_paramSetStructuredLightModelParamset_structured_light_model_param
- Set parameters of a structured light model.
write_structured_light_modelWriteStructuredLightModelwrite_structured_light_modelWriteStructuredLightModelwrite_structured_light_model
- Write a structured light model to a file.