Chapter 8 Reference Manual
Ranger E/D
102 ©SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
iCon API
channel in one scan are acquired from different sensor rows – and thus from slightly
different cross-sections on the object.
If any extended mark data is available in the buffer, the registration filter uses this infor-
mation to adjust for speed variations. If no mark data or normal mark data is available,
fixed offsets are used.
To set up the registration filter you need an input buffer and the registration parameters
that specify how much to shift each color channel.
The registration parameter for one of the channels must be 0, while the other must have
positive values. In addition, the buffer size must be larger than the maximum amount of
shifting. For example, with a buffer size of 32 scans, no color channel can be shifted more
than 32 pixels.
The values of the registration parameters are interpreted differently depending on whether
the input buffer contains mark data or not:
If extended mark data is available in the buffer, the registration parameters specify the
number of encoder ticks that represent the distance between the areas (cross-sections)
from which the color data is acquired.
If no mark data or normal mark data is available, the registration parameters specify
the number of scans to shift the color channel.
Note that the registration parameters are passed as float, and that the filter can handle
sub-pixel shifts.
The result from the registration filter is a buffer containing the same sub-components as
the original buffer – that is, the color channels are still separated. To merge the color data
into 24 (32) bit color information, use a color generation filter on the registered buffer, as
described in section section 8.5.6 “Color Generation Filter”.
A minimum example may look like this:
// Include file for registration filter
#include "filter\registration.h"
[…]
// Create a list specifying the sub-components that should be registered
// (The registration parameters are stored in the pShifts array)
std::list<icon::RegistrationFilter::subcomponentAndShift> subcomponentList;
subcomponentList.push_back(icon::RegistrationFilter::subcomponentAndShift
("red", pShifts[0]));
subcomponentList.push_back(icon::RegistrationFilter::subcomponentAndShift
("green", pShifts[1]));
subcomponentList.push_back(icon::RegistrationFilter::subcomponentAndShift
("blue", pShifts[2]));
// Create and setup the registration filter using the list of sub-components
// as input
// Also specify how to handle sub-pixel shifts - LINEAR or NEAREST_NEIGHBOR
icon::RegistrationFilter registrationFilter("Color 1", subcomponentList,
icon::RegistrationFilter::LINEAR);
registrationFilter.setInput(*(inBuffer->getDataFormat()), inBuffer-
>getNoScans());
// Create an output buffer to store the filter result
IconBuffer outBufferRegistered;
// Prepare the registration filter to not let initiation and allocation slow
// down processing of the first buffer
registrationFilter.prepareResult(outBufferRegistered);
[…]
// Register the color channels in inBuffer using the filter
registrationFilter.apply(*inBuffer, outBufferRegistered);