GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanDetector.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanDetector.h
3 * @brief Declares a GoWebScanDetector 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_DETECTOR_H
12 #define GO_WEB_SCAN_DETECTOR_H
13 
19 #include <kApi/Data/kArrayList.h>
20 
21 kBeginHeader()
22 
23 /**
24 * @struct GoWebScanDetectorParams
25 * @extends kValue
26 * @ingroup GoWebScanSdk-Algorithms
27 * @brief Represents parameters of the detection algorithm.
28 */
30 {
31  kSSize tileColumns; ///< Expected width of input web tiles
32  kSSize tileRows; ///< Expected length of input web tiles
33  GoWebScanDetectionStyle detectionStyle; ///< Method for triggering start of board
34  k32s detectionColumns; ///< Threshold for minimum number of non-null columns to trigger start of board
35  kSSize minRows; ///< Minimum number of rows of detected board
36  kSSize maxRows; ///< Maximum number of rows of detected board
37  kSSize minGapRows; ///< Minimum number of rows between consecutive detected boards
38  kSSize marginRows; ///< Size of top and bottom margin added to detected board output
40 
41 /**
42 * @class GoWebScanDetector
43 * @extends kObject
44 * @ingroup GoWebScanSdk-Algorithms
45 * @brief Represents an algorithm for detecting discrete objects (typically boards) within web tiles.
46 * The algorithm maintains an internal queue of web messages (tiles), and examines presence
47 * data one row at a time to determine if an object is currently detected. A simple state
48 * machine is used to determine when to emit objects.
49 *
50 * The start of a board is triggered by a minimum number of non-null profiles. The detection
51 * style can either be global, meaning the non-null profiles can be disconnected, or local,
52 * which imposes the condition than the non-null profiles are contiguous.
53 */
55 
56 /** Defines the signature for the handler for accepting the completed board. */
57 typedef kStatus(kCall *GoWebScanDetectorDataFx)(kPointer context, k64s tileIndex, GoWebScanSystemMsg* tiles, kSSize tileCount);
58 
59 /**
60 * Constructs a GoWebScanDetector object.
61 *
62 * @public @memberof GoWebScanDetector
63 * @param detector Receives the constructed GoWebScanDetector object.
64 * @param args Detector algorithm parameters.
65 * @param allocator Memory allocator (or kNULL for default).
66 * @return Operation status.
67 */
68 GoWebScanFx(kStatus) GoWebScanDetector_Construct(GoWebScanDetector* detector, const GoWebScanDetectorParams* args, kAlloc allocator);
69 
70 /**
71 * Sets the handler for accepting the completed board.
72 *
73 * @public @memberof GoWebScanDetector
74 * @param detector GoWebScanDetector object.
75 * @param data Callback function
76 * @param context Receiver argument for callback.
77 * @return Operation status.
78 */
80 
81 /**
82 * Adds an input web tile to processing queue.
83 *
84 * @public @memberof GoWebScanDetector
85 * @param detector GoWebScanDetector object.
86 * @param msg Tile message to add.
87 * @return Operation status.
88 */
90 
91 /**
92 * Clears and relinquishes input tile queue.
93 *
94 * @public @memberof GoWebScanDetector
95 * @param detector GoWebScanDetector object.
96 * @return Operation status.
97 */
99 
100 kEndHeader()
101 #include <GoWebScanSdk/GoWebScanDetector.x.h>
102 
103 #endif
Represents a style of triggering the start of an object when in detection mode. The start of an objec...
kStatus(kCall * GoWebScanDetectorDataFx)(kPointer context, k64s tileIndex, GoWebScanSystemMsg *tiles, kSSize tileCount)
Defines the signature for the handler for accepting the completed board.
Definition: GoWebScanDetector.h:57
kStatus GoWebScanDetector_Construct(GoWebScanDetector *detector, const GoWebScanDetectorParams *args, kAlloc allocator)
Constructs a GoWebScanDetector object.
Declares the GoWebScanPipeMsg class.
kStatus GoWebScanDetector_SetDataHandler(GoWebScanDetector detector, GoWebScanDetectorDataFx data, kPointer context)
Sets the handler for accepting the completed board.
Essential GoWebScan declarations.
GoWebScanDetectionStyle detectionStyle
Method for triggering start of board.
Definition: GoWebScanDetector.h:33
Represents an algorithm for detecting discrete objects (typically boards) within web tiles...
Represents a container of GoWebScanPipeMsg tile messages of each tile type (profile, tracheid, and vision) and each system plane (top and bottom). This message is used to contain the X and Y-axis matched tile output of merging, and also of board detection (where the tiles represent a detected board).
Declares a GoWebScanSystemMsg object.
k32s detectionColumns
Threshold for minimum number of non-null columns to trigger start of board.
Definition: GoWebScanDetector.h:34
kSSize minRows
Minimum number of rows of detected board.
Definition: GoWebScanDetector.h:35
kSSize tileRows
Expected length of input web tiles.
Definition: GoWebScanDetector.h:32
Defines GoWebScan utility functions.
kSSize minGapRows
Minimum number of rows between consecutive detected boards.
Definition: GoWebScanDetector.h:37
Declares a GoWebScanProfileTileMsg object.
kStatus GoWebScanDetector_Clear(GoWebScanDetector detector)
Clears and relinquishes input tile queue.
Base class for a msg that can be processed with a GoWebScanPipeTask and submitted to the GoWebScanPip...
kStatus GoWebScanDetector_AddTile(GoWebScanDetector detector, GoWebScanPipeMsg msg)
Adds an input web tile to processing queue.
Represents parameters of the detection algorithm.
Definition: GoWebScanDetector.h:29
kSSize tileColumns
Expected width of input web tiles.
Definition: GoWebScanDetector.h:31
kSSize maxRows
Maximum number of rows of detected board.
Definition: GoWebScanDetector.h:36
kSSize marginRows
Size of top and bottom margin added to detected board output.
Definition: GoWebScanDetector.h:38