ObjectDetection.h¶
Go to the source code of this file.
Object Detection finds objects in an image and displays the location of the object as a Bounding Box.
SAIGE VISION returns the inspection results of Object Detection as a SaigeDetectedObject structure. This structure includes a class ID, Score, and a structure representing a rectangular Bounding Box. Inside SaigeDetectedObject, the Bounding Box is represented as a SaigeRotatedBox, which includes information such as the center point, vertices, width, height, and rotation angle.
Note
Object Detection does not represent the rotation angle.
Inference Options¶
Object Detection has the following inference options.
- SaigeInferenceOption::maxNumOfDetectedObjects
- SaigeInferenceOption::calcObjectScoreAndApplyThreshold
- SaigeInferenceOption::calcObjectAreaAndApplyThreshold
- SaigeInferenceOption::objectScoreThresholdPerClassj
- SaigeInferenceOption::objectAreaThresholdPerClass
The following example shows how to set the option values.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
Note
Object Detection starts class id from 1. This is because the class id 0 (OK) that indicates that no object was detected is excluded in the defect inspection. The important point to note here is that the SaigeModelInfo::numOfClasses value represents the total number of classes including class id 0.
Inference Results¶
To get the detected objects, first get the number of objects and then use the SaigeDetectedObject structure array to get the object information. Here, we use the C++ STL vector to handle memory allocation/deallocation in the vector.
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |