GoWebScan API
GoWebScanCal Class Reference

Description

Represents a container for the system calibration. The system calibration corrects for mounting differences between sensors and performs a flatfield correction for vision sensors. The calibration file contains Z and Y offsets per spot for profile and tracheid sensors, and Y offsets and gains (for each color channel) for vision sensors. All offsets are stored in hex to save space in the file. Additionally, the calibration file also stores the X offset per camera (in decimal). This is only used when detection of locators is enabled during vision calibration. The algorithm aligns cameras to the centers of holes in the calibration bars, and calculates the X offset accordingly. Non-vision systems will have an X offset of 0. The calibration also contains an X and Y reference (in decimal) which represents the system bias. This reference allows for aligning multiple systems to each other.

The data for all sensors is stored in a single XML file, and this class handles reading and writing the file. For systems with vision, a vision sensor's calibration data is stored under the serial number of the connected profile sensor.

For profile sensors, Z and Y offsets are stored in 4-digit hex per spot. For vision sensors, the Y offsets for the first and last column in the vision image are stored in 4-digit hex; when the calibration is loaded, the offsets are linearly interpolated to the full vision width. The vision gains are also sampled to a lower image resolution (8 x 64) to save space and are linearly interpolated to the larger vision image size when the calibration is loaded. For precision, the log of each gain is calculated and normalized to [0, 1] and scaled to [0, 255] prior to hex conversion and saving. The hex spot offsets of a particular type (e.g. profile Y offsets) are concatenated together and stored as a single text string. Vision gains of the downsampled image are concatenated together and stored as a single string for each row and each channel.

When using the calibration, GoWebScanCal first converts and upsamples the offsets and gains. Calibration data is applied early in processing: offsets are applied after masking and reorienting input data and prior to resampling in X and Y. Vision gains are applied after reorienting input data and prior to demosaicing and resampling. X offsets are used when performing the X-axis layout in GoWebScanConfig.

Internally, GoWebScanCal stores the offsets and gains for individual nodes (cameras) as GoWebScanCalNode objects.

Refer to GoWebScanCalProcessor and GoWebScanCalProcessorNode for a description of the calibration processing algorithm.

See also
GoWebScanCalProcessor, GoWebScanCalProcessorNode
Inheritance diagram for GoWebScanCal:
Inheritance graph

Public Member Functions

kStatus GoWebScanCal_AddNode (GoWebScanCal cal, GoWebScanSystemPlane plane, k32s column, k32s deviceId, k32s bankId, GoWebScanCalNode *node)
 Constructs a calibration node object (GoWebScanCalNode) and adds it to the list of nodes. More...
 
kStatus GoWebScanCal_Construct (GoWebScanCal *cal, kAlloc allocator)
 Constructs a GoWebScanCal object. More...
 
kStatus GoWebScanCal_ExportToString (GoWebScanCal cal, kString str)
 Populates a kString with the text of a GoWebScanCal object. More...
 
GoWebScanCalNode GoWebScanCal_FindNode (GoWebScanCal cal, k32s deviceId, k32s bankId)
 Finds and returns the calibration node with the specified device ID and bank ID. More...
 
kStatus GoWebScanCal_ImportFromString (GoWebScanCal *cal, kString str, kAlloc alloc)
 Constructs and sets the values of a GoWebScanCal object from the given XML kString. More...
 
kStatus GoWebScanCal_ImportFromText (GoWebScanCal *cal, const kChar *str, kAlloc alloc)
 Constructs and sets the values of a GoWebScanCal object from the given XML text. More...
 
kStatus GoWebScanCal_Load (GoWebScanCal *cal, const kChar *fileName, kAlloc alloc)
 Constructs and loads a GoWebScanCal object from a saved XML file. More...
 
GoWebScanCalNode GoWebScanCal_NodeAt (GoWebScanCal cal, kSize index)
 Gets the calibration node at a specified index in the system. More...
 
kSize GoWebScanCal_NodeCount (GoWebScanCal cal)
 Gets the number of nodes in the calibration. More...
 
kStatus GoWebScanCal_SetSystemXRef (GoWebScanCal cal, k32s xRef)
 Sets the system X reference in mils. More...
 
kStatus GoWebScanCal_SetSystemYRef (GoWebScanCal cal, k64s yRef)
 Sets the system Y reference in mils. More...
 
kStatus GoWebScanCal_Store (GoWebScanCal cal, const kChar *fileName)
 Writes and stores a GoWebScanCal object to a XML file. More...
 
k32s GoWebScanCal_SystemXRef (GoWebScanCal cal)
 Gets the system X reference in mils. More...
 
k64s GoWebScanCal_SystemYRef (GoWebScanCal cal)
 Gets the system Y reference in mils. More...
 

The documentation for this class was generated from the following file: