Chapter 8 Reference Manual
Ranger E/D
100 ©SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
iCon API
8.5.2 Extraction Filter
An extraction filter is the simplest form of filter. You can use it to extract one component
from a multi component buffer. You can choose to extract all the subcomponents or one
specified by name. The output IconBuffer will have the Subcomponent layout. You deter-
mine what the filter should extract when you call its constructor. The two examples below
create an extraction filter to extract the range subcomponent from a Hi3D component
named “Hi3D 1” and all subcomponents from another Hi3D component named “Hi3D 2”.
ExtractionFilter extractionFilter1("Hi3D 1", "range");
ExtractionFilter extractionFilter2("Hi3D 2");
A minimum example on how to create and apply an extraction filter could look like this
// Include file for extraction filter.
#include "filter/extraction.h"
[…]
// Create a result buffer
IconBuffer outBufferExtraction;
// Create an extractino filter object
ExtractionFilter extractionFilter("Hi3D 1", "range");
// Configure the input of the filter to use the data format of the buffer we
will use as input and the number of scans per buffer used by the grabber
ret = extractionFilter.setInput(*(inBuffer->getDataFormat()), numberOfScans);
// Tell the filter to use the IconBuffer pointed out by inBuffer as input
extractionFilter.prepareResult(outBufferExtraction);
[…]
// Apply the filter to the input buffer and store the result in the output
buffer
extractionFilter.apply(*inBuffer, outBufferExtraction);
8.5.3 Calibration Filter
A calibration filter is used to turn the raw data from the camera into a set of calibrated
points. To do so, the filter requires a calibration lookup-table to translate from sensor
coordinates to real-world coordinates. If you are using a Ruler the lookup-table (LUT) is
already stored in the camera’s flash memory. If you are using a Ranger camera you need
to generate a LUT for your physical configuration. You do this using the Coordinator tool.
You have an option to store the LUT on disk (on the PC side) or in flash (on the camera
side).
A minimum example to load a LUT from camera flash and set up a filter to use it could look
like this:
// Include file for calibration filter.
#include "filter/calibration.h"
[…]
// Create a string and load the LUT into it. The LUT is stored in a User Data
area of the camera flash
std::string calibrationLUT;
ret = cam->flashGetUserData(calibrationLUT);
// Create an empty iCon Buffer which will be used to store the calibrated
// data produced by the calibration filter.
IconBuffer outBufferCalibrated;
// Create a calibration filter and configure it to use the LUT retrieved from
// flash. df is a DataFormat format object describing the format of the
// inBuffer. numberOfScans is the number of rows per buffer used by the frame
// grabber
CalibrationFilter calibrationFilter;
calibrationFilter.initFromData(calibrationLUT, df, numberOfScans);
// Prepare the filter for filtering to avoid a delay during the first execution
calibrationFilter.prepareResult(outBufferCalibrated);