Lookup Table Setup Procedure
How-to set lookup tables
To setup the lookup table processing, proceed as follows:
- Disable the lookup table
- Define the lookup table configuration
- Define the content of the lookup table
- Upload the lookup table content into a specified lookup table data set
- Enable the lookup table with a specified data set
Disabling the lookup table
To disable the lookup table:
- Set the
LUTEnable
feature to aOff
.
Defining the lookup table configuration
To define the lookup table configuration, set the LUTConfiguration
feature according to:
- The camera pixel type and bit depth
- The required output bit depth.
Refer to Monochrome Lookup Table Processing for configurations applicable to monochrome pixels.
Defining the lookup table content
Refer to Lookup Table Content Definition Methods for a description of the parametric and tabular methods used for defining a lookup table content.
Upload a lookup table content
To upload a lookup table content in one operation:
- Select a lookup table data set to access by assigning the appropriate value to the
LUTSet
feature. For instanceSet1
. - Set the
LUTIndex
feature to 0. - Write a string of
LUTLength
values to theLUTValue
feature.
Reading back a lookup table data set
To read back the lookup table data set in one operation:
- Select a lookup table data set to access by assigning the appropriate value to the
LUTSet
feature. For instanceSet1
. - Set the
LUTIndex
feature to 0. - Set the
LUTReadBlockLength
feature to the value returned byLUTLength
. - Get a string of
LUTReadBlockLength
values from theLUTValue
feature.
Enabling the lookup table
To enable the lookup table:
- Set the
LUTEnable
feature to a value designating the lookup table data set to use.
Configuration Script Example
The following script is an example illustrating how to configure the lookup table for monochrome 8-bit to 8-bit operation and to define and upload 4 lookup table data sets using different lookup table definition methods.
function configure(g) {
// Disable the lookup table
g.StreamPort.set('LUTEnable', 'Off');
// Configure the lookup table
g.StreamPort.set('LUTConfiguration', 'M_8x8');
// Build lookup table data set 1: response control
g.StreamPort.set('LUTSet', 'Set1');
require('coaxlink://lut/response-control')(g, { Contrast: 0.94
, Brightness: 0.14
, Visibility: 0.25
, Negative: false });
// Build lookup table data set 2: emphasis
g.StreamPort.set('LUTSet', 'Set2');
require('coaxlink://lut/emphasis')(g, { Emphasis: 0.5
, Negative: true });
// Build lookup table data set 3: threshold
g.StreamPort.set('LUTSet', 'Set3');
require('coaxlink://lut/threshold')(g, { SlicingLevel: 0.5
, SlicingBand: 0.5
, LightResponse: 0.75
, BandResponse: 0.5
, DarkResponse: 0.25 });
// Build lookup table data set 4: table
g.StreamPort.set('LUTSet', 'Set4');
var i;
for (i = 0; i < 256; ++i) {
g.StreamPort.set('LUTIndex', i);
g.StreamPort.set('LUTValue', String(255 - i));
}
}
configure(grabbers[0]);
See also in the Reference