GoWebScan API
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-2026 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 (filtered 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 separated 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 the number of profile issues that occurred during system calibration processing.
204 *
205 * @public @memberof GoWebScanCalProcessorNode
206 * @param node GoWebScanCalProcessorNode object.
207 * @return Count of issues.
208 */
210 
211 /**
212 * Gets the profile issue that occurred during system calibration processing at the specified index.
213 *
214 * @public @memberof GoWebScanCalProcessorNode
215 * @param node GoWebScanCalProcessorNode object.
216 * @param index Index of profile issue.
217 * @param activity Stage or activity in the system calibration processing during which the profile issue occurred.
218 * @param status Type of profile issue.
219 * @return Operation status.
220 */
222 
223 /**
224 * Gets the number of vision issues that occurred during system calibration processing.
225 *
226 * @public @memberof GoWebScanCalProcessorNode
227 * @param node GoWebScanCalProcessorNode object.
228 * @return Count of issues.
229 */
231 
232 /**
233 * Gets the vision issue that occurred during system calibration processing at the specified index.
234 *
235 * @public @memberof GoWebScanCalProcessorNode
236 * @param node GoWebScanCalProcessorNode object.
237 * @param index Index of vision issue.
238 * @param activity Stage or activity in the system calibration processing during which the vision issue occurred.
239 * @param status Type of vision issue..
240 * @return Operation status.
241 */
243 
244 /**
245 * Gets a flag for whether the profile processing completed without errors (warnings
246 * may be present).
247 *
248 * @public @memberof GoWebScanCalProcessorNode
249 * @param node GoWebScanCalProcessorNode object.
250 * @return Boolean for whether profile processing completed without errors.
251 */
253 
254 /**
255 * Gets a flag for whether any warnings were generated during the profile processing.
256 *
257 * @public @memberof GoWebScanCalProcessorNode
258 * @param node GoWebScanCalProcessorNode object.
259 * @return Boolean for whether profile processing had warnings.
260 */
262 
263 /**
264 * Gets a flag for whether any errors were generated during the profile processing.
265 *
266 * @public @memberof GoWebScanCalProcessorNode
267 * @param node GoWebScanCalProcessorNode object.
268 * @return Boolean for whether profile processing had errors.
269 */
271 
272 /**
273 * Gets a flag for whether the vision processing completed without errors (warnings
274 * may be present).
275 *
276 * @public @memberof GoWebScanCalProcessorNode
277 * @param node GoWebScanCalProcessorNode object.
278 * @return Boolean for whether vision processing completed without errors.
279 */
281 
282 /**
283 * Gets a flag for whether any warnings were generated during the vision processing.
284 *
285 * @public @memberof GoWebScanCalProcessorNode
286 * @param node GoWebScanCalProcessorNode object.
287 * @return Boolean for whether vision processing had warnings.
288 */
290 
291 /**
292 * Gets a flag for whether any errors were generated during the vision processing.
293 *
294 * @public @memberof GoWebScanCalProcessorNode
295 * @param node GoWebScanCalProcessorNode object.
296 * @return Boolean for whether vision processing had errors.
297 */
299 
300 /**
301  * Gets the node configuration.
302  *
303  * @public @memberof GoWebScanCalProcessorNode
304  * @param node GoWebScanCalProcessorNode object.
305  * @return GoWebScanConfigNode object representing the node configuration.
306  */
308 
309 #include <GoWebScanSdk/GoWebScanCalProcessorNode.x.h>
310 
311 #endif
kSize GoWebScanCalProcessorNode_ProfileIssueCount(GoWebScanCalProcessorNode node)
Gets the number of profile issues that occurred during system calibration processing.
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)...
Represents a type of error or warning that occurred during system calibration processing of a node...
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 a stage or activity in the system calibration processing pipeline.
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)...
kSize GoWebScanCalProcessorNode_VisionIssueCount(GoWebScanCalProcessorNode node)
Gets the number of vision issues that occurred during system calibration processing.
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.
kStatus GoWebScanCalProcessorNode_ProfileIssueAt(GoWebScanCalProcessorNode node, kSize index, GoWebScanCalActivity *activity, GoWebScanCalNodeStatus *status)
Gets the profile issue that occurred during system calibration processing at the specified index...
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.
kStatus GoWebScanCalProcessorNode_VisionIssueAt(GoWebScanCalProcessorNode node, kSize index, GoWebScanCalActivity *activity, GoWebScanCalNodeStatus *status)
Gets the vision issue that occurred during system calibration processing at the specified index...