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.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
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.
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |