GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanCalDetector.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanCalDetector.h
3 * @brief Declares a GoWebScanCalDetector object.
4 *
5 * @internal
6 * Copyright (C) 2017-2018 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_DETECTOR_H
12 #define GO_WEB_SCAN_CAL_DETECTOR_H
13 
17 
18 kBeginHeader()
19 
20 /**
21 * @struct GoWebScanCalDetectorState
22 * @extends kValue
23 * @ingroup GoWebScanSdk-Calibration
24 * @brief Represents states of calibration bar detection state machine.
25 *
26 * The following enumerators are defined:
27 * - #GO_WEB_SCAN_CAL_DETECTOR_STATE_SEARCHING
28 * - #GO_WEB_SCAN_CAL_DETECTOR_STATE_SCANNING
29 * - #GO_WEB_SCAN_CAL_DETECTOR_STATE_ENDING
30 */
32 /** @name GoWebScanCalDetectorState
33 *@{*/
34 #define GO_WEB_SCAN_CAL_DETECTOR_STATE_SEARCHING (0) ///< Detector is searching for the start of the object.
35 #define GO_WEB_SCAN_CAL_DETECTOR_STATE_SCANNING (1) ///< Detector has found the object and is scanning.
36 #define GO_WEB_SCAN_CAL_DETECTOR_STATE_ENDING (2) ///< Detector has found the end of the object.
37 /**@}*/
38 
39 /**
40 * @struct GoWebScanCalDetectorParams
41 * @extends kValue
42 * @ingroup GoWebScanSdk-Calibration
43 * @brief Represents parameters of the calibration detector algorithm.
44 */
46 {
47  k32s minTiles; ///< Minimum count of tiles needed for detection of the calibration bar.
48  k32s maxTiles; ///< Maximum count of tiles needed for detection of the calibration bar.
49  k32s leadMarginTiles; ///< Leading edge data capture margin in Y for calibration (mils).
50  k32s trailMarginTiles; ///< Trailing edge data capture margin in Y for calibration (mils).
51  k32s minGapTiles; ///< Minimum Y-axis gap between successive objects for calibration object detection (mils).
52  k64f detectionThreshold; ///< Minimum number of non-null profile spots for system calibration bar detection.
54 
55 /**
56 * @class GoWebScanCalDetector
57 * @extends kObject
58 * @ingroup GoWebScanSdk-Calibration
59 * @brief Represents an algorithm for detecting a calibration bar in Y-matched system tiles of raw sensor
60 * messages. This algorithm is similar to GoWebScanDetector but is designed to run with raw sensor
61 * messages. A simple state machine is used to determine when to emit objects. The detection method
62 * for the calibration bar is global; the number of non-null profile points must exceed the
63 * detection threshold, but no condition of contiguity is imposed.
64 */
66 
67 /** Defines the signature for the handler for accepting the output dataset. */
68 typedef kStatus (kCall *GoWebScanCalDetectorDataFunction)(kPointer context, k64s startTile, GoWebScanCalInputTileSet* tilesSets, kSize count);
69 
70 /**
71  * Constructs a GoWebScanCalDetector object.
72  *
73  * @public @memberof GoWebScanCalDetector
74  * @param detector Receives the constructed GoWebScanCalDetector object.
75  * @param args Algorithm parameters.
76  * @param allocator Memory allocator (or kNULL for default).
77  * @return Operation status.
78  */
79 GoWebScanFx(kStatus) GoWebScanCalDetector_Construct(GoWebScanCalDetector* detector, const GoWebScanCalDetectorParams* args, kAlloc allocator);
80 
81 /**
82 * Sets the handler for accepting the output data from the algorithm.
83 *
84 * @public @memberof GoWebScanCalDetector
85 * @param detector GoWebScanCalDetector object.
86 * @param data Callback function
87 * @param context Receiver argument for callback.
88 * @return Operation status.
89 */
90 GoWebScanFx(kStatus) GoWebScanCalDetector_SetDataHandler(GoWebScanCalDetector detector, GoWebScanCalDetectorDataFunction data, kPointer context);
91 
92 /**
93  * Adds a set of input tiles to the detector. Each tiles contains Y-matched raw sensor messages.
94  *
95  * @public @memberof GoWebScanCalDetector
96  * @param detector GoWebScanCalDetector object.
97  * @param tileSet Pointer to input tile sets.
98  * @return Operation status.
99  */
100 GoWebScanFx(kStatus) GoWebScanCalDetector_AddTileSet(GoWebScanCalDetector detector, GoWebScanCalInputTileSet* tileSet);
101 
102 /**
103  * Gets the current state of the detector.
104  *
105  * @public @memberof GoWebScanCalDetector
106  * @param detector GoWebScanCalDetector object.
107  * @return Detector state.
108  */
109 GoWebScanFx(GoWebScanCalDetectorState) GoWebScanCalDetector_GetState(GoWebScanCalDetector detector);
110 
111 kEndHeader()
112 #include <GoWebScanSdk/GoWebScanCalDetector.x.h>
113 
114 #endif
Represents states of calibration bar detection state machine.
k32s minTiles
Minimum count of tiles needed for detection of the calibration bar.
Definition: GoWebScanCalDetector.h:47
k64f detectionThreshold
Minimum number of non-null profile spots for system calibration bar detection.
Definition: GoWebScanCalDetector.h:52
k32s trailMarginTiles
Trailing edge data capture margin in Y for calibration (mils).
Definition: GoWebScanCalDetector.h:50
k32s leadMarginTiles
Leading edge data capture margin in Y for calibration (mils).
Definition: GoWebScanCalDetector.h:49
Essential GoWebScan declarations.
k32s minGapTiles
Minimum Y-axis gap between successive objects for calibration object detection (mils).
Definition: GoWebScanCalDetector.h:51
Represents an algorithm for detecting a calibration bar in Y-matched system tiles of raw sensor messa...
kStatus GoWebScanCalDetector_SetDataHandler(GoWebScanCalDetector detector, GoWebScanCalDetectorDataFunction data, kPointer context)
Sets the handler for accepting the output data from the algorithm.
Represents a Y-matched tile spanning a system plane for a particular data type. These tile sets are p...
Represents parameters of the calibration detector algorithm.
Definition: GoWebScanCalDetector.h:45
k32s maxTiles
Maximum count of tiles needed for detection of the calibration bar.
Definition: GoWebScanCalDetector.h:48
kStatus GoWebScanCalDetector_Construct(GoWebScanCalDetector *detector, const GoWebScanCalDetectorParams *args, kAlloc allocator)
Constructs a GoWebScanCalDetector object.
kStatus GoWebScanCalDetector_AddTileSet(GoWebScanCalDetector detector, GoWebScanCalInputTileSet *tileSet)
Adds a set of input tiles to the detector.
Declares a GoWebScanCalInputTileSet object.
GoWebScanCalDetectorState GoWebScanCalDetector_GetState(GoWebScanCalDetector detector)
Gets the current state of the detector.
kStatus(kCall * GoWebScanCalDetectorDataFunction)(kPointer context, k64s startTile, GoWebScanCalInputTileSet *tilesSets, kSize count)
Defines the signature for the handler for accepting the output dataset.
Definition: GoWebScanCalDetector.h:68
Declares a GoWebScanConfig object.