This chapter describes operators for using structured light.
The basic concept behind structured light is to use a structured illumination, i.e. an illumination showing well known patterns. The way those patterns appear in the scene after hitting surfaces helps to further analyze or reconstruct the surfaces.
To use structured light, a model must first be created using
. The model type is specified in
create_structured_light_model
. Currently, the model types ModelType
'deflectometry'
and '3d_reconstruction'
are supported.
Depending on the task, different kinds of illumination should be used:
For deflectometry, i.e. for detecting defects on a specular or shiny surface, a display or monitor should be used.
For 3D surface reconstruction of lambertian or diffuse surfaces a pattern projector should be used.
Deflectometry is the procedure of analyzing the reflections of known patterns from specular or semi-specular surfaces. In such a setup, every pattern image must be shown by the display or monitor. It is then reflected by the specular surface under test, and a camera image of the reflection is acquired. Deformations of the pattern in the camera image are caused by the form of the specular surface which implies that defects on the specular surface can be detected.
For non-specular surfaces, a 3D surface can be reconstructed, using a projector projecting light like an 'inverse camera'. For every projected pattern image, a camera image of the projection on the surface is acquired. Using the decoded correspondence between projector coordinates lighting the camera coordinates, as well as calibration information, the 3D surface is reconstructed.
In the following, the steps that are required to use structured light are described briefly.
In the first step, a structured light model is created with
or read with
The different structured light model parameters can then be set with
or queried with
set_structured_light_model_param
. The pattern parameters
get_structured_light_model_param
'pattern_width'
, 'pattern_height'
,
'pattern_orientation'
, and 'pattern_type'
specify along
with the stripe parameters 'min_stripe_width'
and
'single_stripe_width'
the specifications of the pattern images to
be used to illuminate the surface. Finally, the
'persistence'
parameter can be enabled to debug intermediate
results.
The pattern images are to be generated with
after setting all relevant parameters.
Please ensure that the output images are as needed in the particular setup.
gen_structured_light_pattern
At this stage, the pattern images are shown on the display or projected. The respective image of the illuminated surface is acquired by the camera for each pattern image.
The acquired
can be decoded with
CameraImages
. Upon calling this operator, the
correspondence images are created and stored in the model
decode_structured_light_pattern
.
StructuredLightModel
The decoded 'correspondence_image'
, as well as other results
can be queried with
. For more
details of the different objects that can be queried, please refer
to the operator's documentation.
get_structured_light_object
The 'defect_image'
can be generated and queried with
.
get_structured_light_object
The calibration information can be specified with the parameter
'camera_setup_model'
of
.
The reconstructed surface can then be obtained with
set_structured_light_model_param
.
reconstruct_surface_structured_light
The structured light model offers various other operators that help access and update the various parameters of the model.
The operator
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 write_structured_light_model
.
read_structured_light_model
Furthermore, it is possible to serialize and deserialize the structured
light model using
and
serialize_structured_light_model
.
deserialize_structured_light_model
See also the “Solution Guide Basics”
for further details.
For a list of operators, please refer to Inspection / Structured Light.