Operator Reference

Structured Light

List of Sections ↓

This chapter describes the usage of structured light for 3D reconstruction.

Concept of 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 (e.g., perform an inspection Inspection / Structured Light) or reconstruct the surfaces.

For non-specular (lambertian or diffuse) 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.

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

or queried with

The pattern parameters 'pattern_width'"pattern_width""pattern_width""pattern_width""pattern_width", 'pattern_height'"pattern_height""pattern_height""pattern_height""pattern_height", 'pattern_orientation'"pattern_orientation""pattern_orientation""pattern_orientation""pattern_orientation", and '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" and 'single_stripe_width'"single_stripe_width""single_stripe_width""single_stripe_width""single_stripe_width" the specifications of the pattern images to be used to illuminate the surface. Finally, the '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_patterngen_structured_light_patternGenStructuredLightPatternGenStructuredLightPatterngen_structured_light_pattern after setting all relevant parameters. Please ensure that the output images are as needed in the particular setup.

Use the patterns to illuminate the surface and acquire the camera images:

At this stage, the pattern images are projected. The respective image of the illuminated surface is acquired by the camera for each pattern image.

When calibrating the system, images of the illuminated calibration object need to be acquired. The calibration process is shown in detail in the example program structured_light_calibration.hdev. The obtained calibration information can then be specified with the parameter 'camera_setup_model'"camera_setup_model""camera_setup_model""camera_setup_model""camera_setup_model" of set_structured_light_model_paramset_structured_light_model_paramSetStructuredLightModelParamSetStructuredLightModelParamset_structured_light_model_param.

Decode the acquired images:

The acquired CameraImagesCameraImagesCameraImagescameraImagescamera_images can be decoded with decode_structured_light_patterndecode_structured_light_patternDecodeStructuredLightPatternDecodeStructuredLightPatterndecode_structured_light_pattern. Upon calling this operator, the correspondence images are created and stored in the model StructuredLightModelStructuredLightModelStructuredLightModelstructuredLightModelstructured_light_model.

Get the results:

The decoded 'correspondence_image'"correspondence_image""correspondence_image""correspondence_image""correspondence_image", as well as other results can be queried with get_structured_light_objectget_structured_light_objectGetStructuredLightObjectGetStructuredLightObjectget_structured_light_object. For more details of the different objects that can be queried, please refer to the operator's documentation.

Perform the reconstruction:

The reconstructed surface can be obtained with reconstruct_surface_structured_lightreconstruct_surface_structured_lightReconstructSurfaceStructuredLightReconstructSurfaceStructuredLightreconstruct_surface_structured_light.

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_modelwrite_structured_light_modelWriteStructuredLightModelWriteStructuredLightModelwrite_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_modelread_structured_light_modelReadStructuredLightModelReadStructuredLightModelread_structured_light_model.

Furthermore, it is possible to serialize and deserialize the structured light model using serialize_structured_light_modelserialize_structured_light_modelSerializeStructuredLightModelSerializeStructuredLightModelserialize_structured_light_model and deserialize_structured_light_modeldeserialize_structured_light_modelDeserializeStructuredLightModelDeserializeStructuredLightModeldeserialize_structured_light_model.

Further Information

See also the “Solution Guide Basics” for further details. For a list of operators, please refer to Inspection / Structured Light.


List of Sections