Laser Line Extraction
A Laser Line Extraction (LLE) algorithm is required to create a depth map from a sequence of profiles of the object captured by the camera sensor.
The objective of an LLE algorithm is to measure the line position along a vertical profile in every column of a sensor frame, within a user-defined region of interest (ROI).
For every step of the object position, the detection analyzes each column of a frame individually and produces a row of output positions, stored as gray values.
The figure below illustrates a depth map generation.
The ELaserLineExtractor class provides the laser line extraction functionality in Open eVision. It implements several algorithms to extract the laser line:
□ | Maximum detection returns the position of the pixel of maximum intensity. It’s the fastest method but it doesn’t support sub-pixel precision. |
□ | Peak detection approach detects local maxima. If several maxima are detected, the one with the highest intensity is returned. The position is returned with sub-pixel precision. |
□ | Center of gravity algorithm is suitable when the laser line is spread over several pixels. The position is returned with sub-pixel precision. |
You can also set a threshold to exclude pixels with low intensity.
The line position returned by the laser line extraction algorithms is relative to the bottom of the region of interest. So, values in the depth map range from 0 (bottom of the ROI) to the height of the ROI.
Low-pass linear filter
Optionally, you can apply a low-pass linear filter in front of the line extraction in order to reduce noise and high frequencies in the image.
The low-pass filter applies a convolution operator on a 1 x 3 sliding window. The 3 elements of the convolution kernel (A, B and C) are configurable, accepting any positive integer. The figure below illustrates the positioning of the convolution kernel elements within a given ROI.
You can activate the low-pass filter for any of the laser line extraction methods with the method ELaserLineExtractor::SetEnableSmoothing(true/false)
. Parameters A, B and C are set with ELaserLineExtractor::SetSmoothingParameters(A, B, C)
.