GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanCalProcessorNode.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanCalProcessorNode.h
3 * @brief Declares a GoWebScanCalProcessorNode object.
4 *
5 * @internal
6 * Copyright (C) 2017-2021 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 
11 #ifndef GO_WEB_SCAN_CAL_PROCESSOR_NODE_H
12 #define GO_WEB_SCAN_CAL_PROCESSOR_NODE_H
13 
17 
18 /**
19 * @class GoWebScanCalProcessorNode
20 * @extends kObject
21 * @ingroup GoWebScanSdk-Calibration
22 * @brief Represents an algorithm for processing node tiles containing a calibration bar,
23 * and generating node profile Z and Y offsets and vision Y offsets and gains.
24 * Refer to GoWebScanCal for a description of the system calibration outputs and
25 * usage.
26 *
27 * GoWebScanCalProcessorNode executes a sequence of processing tasks for profile
28 * and vision data. If a task fails in the sequence, the processing does not
29 * continue and an error and issue type is recorded. Vision processing will not
30 * proceed if profile processing fails. Any warnings (issues that do not prevent
31 * processing from completing but may result in suboptimal calibration) that
32 * occur are recorded.
33 *
34 * For profile processing, the sequence is as follows:
35 * -# The input profile data is inspected for any frame drops, time and distance
36 * incoherencies, and insufficient data.
37 * -# If user-defined obstructions are enabled, the profile data is masked
38 * (otherwise the chain region is detected automatically later).
39 * -# The input is reoriented in X (depending on X orientation) to standard
40 * system orientation.
41 * -# The input is resampled in Y using the resolution set in
42 * GoWebScanConfig_CalYRes().
43 * -# The input is reoriented (depending on Y orientation) and transposed so the
44 * leading Y edge is vertical.
45 * -# Z range outliers are removed using a histogram. Ranges from the chain should
46 * be removed in this step.
47 * -# Y edge row outliers (of the transposed data) are removed using a histogram.
48 * Removed data is filled (nearest neighbour).
49 * -# A line is fit to the filtered Y edges which forms the <b>Y offsets</b>.
50 * Depending on the travel orientation, the fit edges are first offset by the
51 * calibration bar width.
52 * -# A region of the Z filtered calibration bar data near the leading Y
53 * edge is used to determine the average Z range per spot. These ranges are
54 * filtered again using a histogram (filterd to keep only the 0.25 to 0.75
55 * quantile). Removed data is filled (nearest neighbour).
56 * -# The <b>Z offset</b> for each spot is calculated as the filtered average Z
57 * value. For the top sensors, the Z values are subtracted from the calibration
58 * target height to form the offsets.
59 * .
60 *
61 * For vision processing, the sequence is as follows:
62 * -# The input vision data is inspected for any frame drops, time and distance
63 * incoherencies, and insufficient data.
64 * -# Each input image is reoriented in X (depending on X orientation) to standard
65 * system orientation.
66 * -# Each input image is demosaiced.
67 * -# Input images are resampled in Y using the Y resolution data from the
68 * GoGeoCal file, and a single image containing the calibration bar is formed.
69 * -# The input image is reoriented (depending on Y orientation) and transposed so
70 * the leading Y edge is vertical.
71 * -# Y edge row outliers (of the transposed data) are removed using a histogram.
72 * -# A line is fit to the filtered Y edges and the fit edges are sampled down
73 * to two points which forms the <b>Y offsets</b>.
74 * Depending on the travel orientation, the downsampled edges are offset by the
75 * calibration bar width.
76 * -# If GoWebScanSettings_CalDetectLocators() is enabled, a region near the center
77 * of the calibration bar image is determined, and each column is summed. The
78 * column sums are filtered via a histogram, and a center of gravity calculation
79 * is performed on the column sums to determine center of the hole. The
80 * <b>X offset</b> is calculated as the difference of the hole center (converted
81 * to an X distance) to the nominal X center.
82 * -# A raw input image approximately 1/4 from the leading Y edge is selected for
83 * gain calculations. The color channels are seperated into different images.
84 * -# The individual channel image gradients are checked along X. If all rows have a
85 * large enough edge, this may imply the calibration bar does not span the full
86 * length, so a warning is produced.
87 * -# The channel images are vertically smoothened using a local histogram filter.
88 * -# The <b>gain coefficients</b> are calculated as the target intensity divided
89 * by the smoothened pixel value for each pixel per channel. The target
90 * intensity can be set by the user via
91 * GoWebScanSettings_CalUseVisionIntensity(), otherwise a default of 180 is used.
92 * -# The gain coefficients are downsampled to smaller size for convenient storage
93 * in the calibration file.
94 *
95 * @see GoWebScanCal, GoWebScanCalProcessor, GoWebScanConfig, GoWebScanConfigNode
96 */
98 
99 /**
100  * Constructs a GoWebScanCalProcessorNode object.
101  *
102  * @public @memberof GoWebScanCalProcessorNode
103  * @param node Receives the constructed GoWebScanCalProcessorNode object.
104  * @param configNode Node configuration.
105  * @param allocator Memory allocator (or kNULL for default).
106  * @return Operation status.
107  */
109 
110 /**
111  * Executes the calibration processing for a node.
112  *
113  * @public @memberof GoWebScanCalProcessorNode
114  * @param node GoWebScanCalProcessorNode object.
115  * @param input Input dataset.
116  * @return Operation status.
117  */
119 
120 /**
121  * Sets the X offset in mils.
122  *
123  * @public @memberof GoWebScanCalProcessorNode
124  * @param node GoWebScanCalProcessorNode object.
125  * @param value X offset (mils).
126  * @return Operation status.
127  */
129 
130 /**
131 * Gets the X offset in mils.
132 *
133 * @public @memberof GoWebScanCalProcessorNode
134 * @param node GoWebScanCalProcessorNode object.
135 * @return X offset (mils).
136 */
138 
139 /**
140  * Gets the array of profile Y offsets for each spot.
141  *
142  * @public @memberof GoWebScanCalProcessorNode
143  * @param node GoWebScanCalProcessorNode object.
144  * @return Array of profile Y offsets. Type k32s.
145  */
147 
148 /**
149 * Gets the array of profile Z offsets for each spot.
150 *
151 * @public @memberof GoWebScanCalProcessorNode
152 * @param node GoWebScanCalProcessorNode object.
153 * @return Array of profile Z offsets. Type k16s.
154 */
156 
157 /**
158 * Gets the array of vision Y offsets for each spot.
159 *
160 * @public @memberof GoWebScanCalProcessorNode
161 * @param node GoWebScanCalProcessorNode object.
162 * @return Array of vision Y offsets. Type k32s.
163 */
165 
166 /**
167 * Gets the array of vision red gains for each pixel in the downsampled vision image.
168 *
169 * @public @memberof GoWebScanCalProcessorNode
170 * @param node GoWebScanCalProcessorNode object.
171 * @return Array of vision red gains. Type k64f.
172 */
174 
175 /**
176 * Gets the array of vision green gains for each pixel in the downsampled vision image.
177 *
178 * @public @memberof GoWebScanCalProcessorNode
179 * @param node GoWebScanCalProcessorNode object.
180 * @return Array of vision green gains. Type k64f.
181 */
183 
184 /**
185 * Gets the array of vision blue gains for each pixel in the downsampled vision image.
186 *
187 * @public @memberof GoWebScanCalProcessorNode
188 * @param node GoWebScanCalProcessorNode object.
189 * @return Array of vision blue gains. Type k64f.
190 */
192 
193 /**
194 * Gets the color filter array type of the vision image.
195 *
196 * @public @memberof GoWebScanCalProcessorNode
197 * @param node GoWebScanCalProcessorNode object.
198 * @return Color filter array type.
199 */
201 
202 /**
203 * Gets a flag for whether the profile processing completed without errors (warnings
204 * may be present).
205 *
206 * @public @memberof GoWebScanCalProcessorNode
207 * @param node GoWebScanCalProcessorNode object.
208 * @return Boolean for whether profile processing completed without errors.
209 */
211 
212 /**
213 * Gets a flag for whether any warnings were generated during the profile processing.
214 *
215 * @public @memberof GoWebScanCalProcessorNode
216 * @param node GoWebScanCalProcessorNode object.
217 * @return Boolean for whether profile processing had warnings.
218 */
220 
221 /**
222 * Gets a flag for whether any errors were generated during the profile processing.
223 *
224 * @public @memberof GoWebScanCalProcessorNode
225 * @param node GoWebScanCalProcessorNode object.
226 * @return Boolean for whether profile processing had errors.
227 */
229 
230 /**
231 * Gets a flag for whether the vision processing completed without errors (warnings
232 * may be present).
233 *
234 * @public @memberof GoWebScanCalProcessorNode
235 * @param node GoWebScanCalProcessorNode object.
236 * @return Boolean for whether vision processing completed without errors.
237 */
239 
240 /**
241 * Gets a flag for whether any warnings were generated during the vision processing.
242 *
243 * @public @memberof GoWebScanCalProcessorNode
244 * @param node GoWebScanCalProcessorNode object.
245 * @return Boolean for whether vision processing had warnings.
246 */
248 
249 /**
250 * Gets a flag for whether any errors were generated during the vision processing.
251 *
252 * @public @memberof GoWebScanCalProcessorNode
253 * @param node GoWebScanCalProcessorNode object.
254 * @return Boolean for whether vision processing had errors.
255 */
257 
258 /**
259  * Gets the node configuration.
260  *
261  * @public @memberof GoWebScanCalProcessorNode
262  * @param node GoWebScanCalProcessorNode object.
263  * @return GoWebScanConfigNode object representing the node configuration.
264  */
266 
267 #include <GoWebScanSdk/GoWebScanCalProcessorNode.x.h>
268 
269 #endif
Represents a container for node-level parameters which are translated from user parameters set in GoW...
kBool GoWebScanCalProcessorNode_ProfileIsComplete(GoWebScanCalProcessorNode node)
Gets a flag for whether the profile processing completed without errors (warnings may be present)...
Declares a GoWebScanCalInput object.
kStatus GoWebScanCalProcessorNode_Construct(GoWebScanCalProcessorNode *node, GoWebScanConfigNode configNode, kAlloc allocator)
Constructs a GoWebScanCalProcessorNode object.
kStatus GoWebScanCalProcessorNode_SetXOffset(GoWebScanCalProcessorNode node, k32s value)
Sets the X offset in mils.
kArray1 GoWebScanCalProcessorNode_ProfileZOffsets(GoWebScanCalProcessorNode node)
Gets the array of profile Z offsets for each spot.
kArray2 GoWebScanCalProcessorNode_VisionGGains(GoWebScanCalProcessorNode node)
Gets the array of vision green gains for each pixel in the downsampled vision image.
kBool GoWebScanCalProcessorNode_ProfileHasErrors(GoWebScanCalProcessorNode node)
Gets a flag for whether any errors were generated during the profile processing.
Essential GoWebScan declarations.
kBool GoWebScanCalProcessorNode_VisionHasWarnings(GoWebScanCalProcessorNode node)
Gets a flag for whether any warnings were generated during the vision processing. ...
Represents an algorithm for processing node tiles containing a calibration bar, and generating node p...
Represents Y-matched system data containing a calibration bar, used for calibration processing...
kBool GoWebScanCalProcessorNode_VisionIsComplete(GoWebScanCalProcessorNode node)
Gets a flag for whether the vision processing completed without errors (warnings may be present)...
kArray1 GoWebScanCalProcessorNode_VisionYOffsets(GoWebScanCalProcessorNode node)
Gets the array of vision Y offsets for each spot.
GoWebScanConfigNode GoWebScanCalProcessorNode_ConfigNode(GoWebScanCalProcessorNode node)
Gets the node configuration.
kArray1 GoWebScanCalProcessorNode_ProfileYOffsets(GoWebScanCalProcessorNode node)
Gets the array of profile Y offsets for each spot.
k32s GoWebScanCalProcessorNode_XOffset(GoWebScanCalProcessorNode node)
Gets the X offset in mils.
kArray2 GoWebScanCalProcessorNode_VisionRGains(GoWebScanCalProcessorNode node)
Gets the array of vision red gains for each pixel in the downsampled vision image.
Declares a GoWebScanConfigNode object.
kBool GoWebScanCalProcessorNode_ProfileHasWarnings(GoWebScanCalProcessorNode node)
Gets a flag for whether any warnings were generated during the profile processing.
kBool GoWebScanCalProcessorNode_VisionHasErrors(GoWebScanCalProcessorNode node)
Gets a flag for whether any errors were generated during the vision processing.
kCfa GoWebScanCalProcessorNode_Cfa(GoWebScanCalProcessorNode node)
Gets the color filter array type of the vision image.
kArray2 GoWebScanCalProcessorNode_VisionBGains(GoWebScanCalProcessorNode node)
Gets the array of vision blue gains for each pixel in the downsampled vision image.
kStatus GoWebScanCalProcessorNode_Execute(GoWebScanCalProcessorNode node, GoWebScanCalInput input)
Executes the calibration processing for a node.