SaigeVision C/C++ 1.5.0
SaigeVision API document for C/C++
 
Loading...
Searching...
No Matches
CommonHeaderDLL.h
Go to the documentation of this file.
1
4#pragma once
5#include <stdio.h>
6
7#define SAIGEVISION_MAJOR_DIGIT 1000
8#define SAIGEVISION_MINOR_DIGIT 100
9
11#define SAIGEVISION_MAJOR 1
13#define SAIGEVISION_MINOR 6
15#define SAIGEVISION_PATCHLEVEL 0
17#define SAIGEVISION_MINORPATCHLEVEL 0
19#define SAIGEVISION_VERSION (SAIGEVISION_MAJOR * SAIGEVISION_MAJOR_DIGIT + SAIGEVISION_MINOR * SAIGEVISION_MINOR_DIGIT + SAIGEVISION_PATCHLEVEL)
20
26#define SR_USE_DEPRECATED_FUNCTIONS
27
29typedef enum
30{
32 NO_LICENCE = 101,
37 NULL_INPUT = 106,
53
55typedef enum
56{
75
77typedef enum
78{
92
94typedef enum
95{
100
105typedef enum
106{
112
114typedef enum
115{
116 SR_NONE = 0,
117 SR_SIMPLE = 1,
119
121typedef struct
122{
124 unsigned int xCenter;
125
127 unsigned int yCenter;
128
130 unsigned int area;
131
133 unsigned int width;
134
136 unsigned int height;
137
140
143
149
155
158
160 unsigned int classIdx;
161
172 double scores[3];
173
182 double averageColor[3];
183
184
203 int nContours; /* number of contours */
204 int* nPointsOnContour; /* array of number of points on each contour (ex, nPointsOnContour[1]: # of points on the second contour)*/
205 int* pointsOnContour; /* array of x, y coordinates of all points on contours */
206
212
216
218typedef struct
219{
221 float x;
223 float y;
224
226 float width;
228 float height;
229
231 float x_tl;
233 float y_tl;
235 float x_br;
237 float y_br;
238
240 float angle;
241
243 float score;
247
249typedef struct
250{
253
274
276typedef struct
277{
280
282 const wchar_t* wtext;
284 const char* text;
286
288typedef struct
289{
307 void* camImage;
310
311static void PrintErrorType(eErrorType errorType, int verbosity = 2)
312{
313 if (errorType == NO_ERROR_OUT)
314 {
315 if (verbosity >= 2)
316 {
317 printf("Saige Vision SUCCESS, NO_ERROR_OUT, %d \n", NO_ERROR_OUT);
318 }
319 }
320 else if (errorType == NO_LICENCE)
321 {
322 printf("Saige Vision FAILED, NO_LICENCE: FEATURE NOT FOUND, %d \n", NO_LICENCE);
323 }
324 else if (errorType == LOW_VERSION_LICENSE)
325 {
326 printf("Saige Vision FAILED, LOW_VERSION_LICENSE, %d \n", LOW_VERSION_LICENSE);
327 }
328 else if (errorType == NO_LICENSE_DONGLE)
329 {
330 printf("Saige Vision FAILED, NO_LICENSE_DONGLE: USB DONGLE NOT FOUND, %d \n", NO_LICENSE_DONGLE);
331 }
332 else if (errorType == USE_NOT_ALLOCATED_HANDLER)
333 {
334 printf("Saige Vision FAILED, USE_NOT_ALLOCATED_HANDLER, %d \n", USE_NOT_ALLOCATED_HANDLER);
335 }
336 else if (errorType == INAPPROPRIATE_HANDLER)
337 {
338 printf("Saige Vision FAILED, INAPPROPRIATE_HANDLER, %d \n", INAPPROPRIATE_HANDLER);
339 }
340 else if (errorType == OUT_OF_GPU_MEMORY)
341 {
342 printf("Saige Vision FAILED, OUT_OF_GPU_MEMORY, %d \n", OUT_OF_GPU_MEMORY);
343 }
344 else if (errorType == INAPPROPRIATE_GPU_NUMBER)
345 {
346 printf("Saige Vision FAILED, INAPPROPRIATE_GPU_NUMBER, %d \n", INAPPROPRIATE_GPU_NUMBER);
347 }
348 else if (errorType == NULL_INPUT)
349 {
350 printf("Saige Vision FAILED, NULL_INPUT, %d \n", NULL_INPUT);
351 }
352 else if (errorType == INAPPROPRIATE_INPUT)
353 {
354 printf("Saige Vision FAILED, INAPPROPRIATE_INPUT, %d \n", INAPPROPRIATE_INPUT);
355 }
356 else if (errorType == FILE_NOT_FOUND)
357 {
358 printf("Saige Vision FAILED, FILE_NOT_FOUND, %d \n", FILE_NOT_FOUND);
359 }
360 else if (errorType == NULL_HANDLE_FILE_PATH)
361 {
362 printf("Saige Vision FAILED, NULL_HANDLE_FILE_PATH, %d \n", NULL_HANDLE_FILE_PATH);
363 }
364 else if (errorType == EMPTY_IMAGE)
365 {
366 printf("Saige Vision FAILED, EMPTY_IMAGE, %d \n", EMPTY_IMAGE);
367 }
368 else if (errorType == SMALL_IMAGE)
369 {
370 printf("Saige Vision FAILED, SMALL_IMAGE, %d \n", SMALL_IMAGE);
371 }
372 else if (errorType == NOT_LOAD_NETWORK_IN_GPU)
373 {
374 printf("Saige Vision FAILED, NOT_LOAD_NETWORK_IN_GPU, %d \n", NOT_LOAD_NETWORK_IN_GPU);
375 }
376 else if (errorType == FORWARD_ALGO_TIMEOUT)
377 {
378 printf("Saige Vision FAILED, FORWARD_ALGO_TIMEOUT, %d \n", FORWARD_ALGO_TIMEOUT);
379 }
380 else if (errorType == INAPPROPRIATE_OUTPUT)
381 {
382 printf("Saige Vision FAILED, INAPPROPRIATE_OUTPUT, %d \n", INAPPROPRIATE_OUTPUT);
383 }
384 else if (errorType == LOW_VERSION_FILE)
385 {
386 printf("Saige Vision FAILED, LOW_VERSION_FILE, %d \n", LOW_VERSION_FILE);
387 }
388 else if (errorType == LICENSE_EXPIRED)
389 {
390 printf("Saige Vision FAILED, LICENSE_EXPIRED, %d \n", LICENSE_EXPIRED);
391 }
392 else
393 {
394 printf("Saige Vision FAILED, UNKNOWN_ERROR, %d \n", UNKNOWN_ERROR);
395 }
396}
397
eAlgorithmType
Enumerator indicating a type of model.
Definition: CommonHeaderDLL.h:56
@ Segmentation_V2
Definition: CommonHeaderDLL.h:65
@ DefectGenerator_V1
Definition: CommonHeaderDLL.h:68
@ Detection_V2
Definition: CommonHeaderDLL.h:62
@ Segmentation_V3
Definition: CommonHeaderDLL.h:66
@ Classification_V3
Definition: CommonHeaderDLL.h:59
@ Detection_V1
Definition: CommonHeaderDLL.h:61
@ OCR_Box_V1
Definition: CommonHeaderDLL.h:70
@ Classification_V1
Definition: CommonHeaderDLL.h:57
@ OCR_Text_V1
Definition: CommonHeaderDLL.h:71
@ SuperResolution_V1
Definition: CommonHeaderDLL.h:73
@ Classification_V2
Definition: CommonHeaderDLL.h:58
@ Segmentation_V1
Definition: CommonHeaderDLL.h:64
eHandlerType
Enumerator indicating a type of handler.
Definition: CommonHeaderDLL.h:78
@ ClsTestType
Definition: CommonHeaderDLL.h:80
@ DetTestType
Definition: CommonHeaderDLL.h:82
@ SuperResolutionTestType
Definition: CommonHeaderDLL.h:90
@ GenTestType
Definition: CommonHeaderDLL.h:86
@ DetTrainType
Definition: CommonHeaderDLL.h:81
@ OCRTrainType
Definition: CommonHeaderDLL.h:87
@ GenTrainType
Definition: CommonHeaderDLL.h:85
@ SegTrainType
Definition: CommonHeaderDLL.h:83
@ SuperResolutionTrainType
Definition: CommonHeaderDLL.h:89
@ ClsTrainType
Definition: CommonHeaderDLL.h:79
@ OCRTestType
Definition: CommonHeaderDLL.h:88
@ SegTestType
Definition: CommonHeaderDLL.h:84
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:30
@ INAPPROPRIATE_HANDLER
Definition: CommonHeaderDLL.h:34
@ LOW_VERSION_FILE
Definition: CommonHeaderDLL.h:48
@ OUT_OF_GPU_MEMORY
Definition: CommonHeaderDLL.h:35
@ NULL_HANDLE_FILE_PATH
Definition: CommonHeaderDLL.h:40
@ LICENSE_EXPIRED
Definition: CommonHeaderDLL.h:49
@ FORWARD_ALGO_TIMEOUT
Definition: CommonHeaderDLL.h:44
@ NO_ERROR_OUT
Definition: CommonHeaderDLL.h:31
@ NO_LICENCE
Definition: CommonHeaderDLL.h:32
@ NULL_INPUT
Definition: CommonHeaderDLL.h:37
@ LOW_VERSION_LICENSE
Definition: CommonHeaderDLL.h:46
@ UNKNOWN_ERROR
Definition: CommonHeaderDLL.h:51
@ INAPPROPRIATE_GPU_NUMBER
Definition: CommonHeaderDLL.h:36
@ NOT_LOAD_NETWORK_IN_GPU
Definition: CommonHeaderDLL.h:43
@ EMPTY_IMAGE
Definition: CommonHeaderDLL.h:41
@ FILE_NOT_FOUND
Definition: CommonHeaderDLL.h:39
@ USE_NOT_ALLOCATED_HANDLER
Definition: CommonHeaderDLL.h:33
@ SMALL_IMAGE
Definition: CommonHeaderDLL.h:42
@ NO_LICENSE_DONGLE
Definition: CommonHeaderDLL.h:47
@ INAPPROPRIATE_INPUT
Definition: CommonHeaderDLL.h:38
@ NOT_SUPPORTED_FUNCTION
Definition: CommonHeaderDLL.h:50
@ INAPPROPRIATE_OUTPUT
Definition: CommonHeaderDLL.h:45
eModeOfPixelSizeFilter
Enumerator indicating a mode of filtering by object's area in segmentation.
Definition: CommonHeaderDLL.h:95
@ SR_PIXELSIZE_FILTER_MODE_ON_FAST
Definition: CommonHeaderDLL.h:97
@ SR_PIXELSIZE_FILTER_MODE_ON_EXACT
Definition: CommonHeaderDLL.h:98
@ SR_PIXELSIZE_FILTER_MODE_OFF
Definition: CommonHeaderDLL.h:96
eFilterObjByRegionType
Enumerator indicating a filtering object by region type in detection and segmentation.
Definition: CommonHeaderDLL.h:115
eModeOfCropLargeObjects
Enumerator indicating a mode of cropping large objects in segmentation.
Definition: CommonHeaderDLL.h:106
@ SR_CROP_BY_OBJECTSIZE_N_RESIZE_TO_CROPSIZE
Definition: CommonHeaderDLL.h:107
@ SR_CROP_CENTER_BY_CROPSIZE
Definition: CommonHeaderDLL.h:109
@ SR_CROP_BY_OBJECTSIZE_NOT_SQUARE
Definition: CommonHeaderDLL.h:110
@ SR_CROP_BY_OBJECTSIZE
Definition: CommonHeaderDLL.h:108
Struct describing result of classification.
Definition: CommonHeaderDLL.h:289
int camImageHeight
height of a cam image
Definition: CommonHeaderDLL.h:305
int numClass
number of classes
Definition: CommonHeaderDLL.h:297
int * scoresIncludingAdd
scores including additional scores for each class
Definition: CommonHeaderDLL.h:295
int camImageWidth
width of a cam image
Definition: CommonHeaderDLL.h:303
int classIdx
index of the classified result
Definition: CommonHeaderDLL.h:291
int * scoresOriginal
original scores for each class
Definition: CommonHeaderDLL.h:293
void * camImage
data of a cam image
Definition: CommonHeaderDLL.h:307
Struct describing features of a detected box.
Definition: CommonHeaderDLL.h:250
void * croppedImage
data of a cropped image
Definition: CommonHeaderDLL.h:268
int croppedImageChannels
# of channels of a cropped image
Definition: CommonHeaderDLL.h:266
float filteringObjectRatio
ratio of overlapping area with the set region when the filtering object function is applied (in [0,...
Definition: CommonHeaderDLL.h:272
int croppedImageHeight
height of a cropped image
Definition: CommonHeaderDLL.h:264
int croppedImageWidth
width of a cropped image
Definition: CommonHeaderDLL.h:262
SR_RotatedBox box
detected box
Definition: CommonHeaderDLL.h:252
Structure describing features of a OCR object.
Definition: CommonHeaderDLL.h:277
const wchar_t * wtext
text information of a OCR object in wide characters
Definition: CommonHeaderDLL.h:282
SR_RotatedBox box
geometrical information of a OCR object
Definition: CommonHeaderDLL.h:279
const char * text
text information of a OCR object in multi-byte characters
Definition: CommonHeaderDLL.h:284
Structure describing features for a rotated rectangle.
Definition: CommonHeaderDLL.h:219
float x_tl
x coordinate of the top-left corner
Definition: CommonHeaderDLL.h:231
float x_br
x coordinate of the bottom-right corner
Definition: CommonHeaderDLL.h:235
float height
height of the object
Definition: CommonHeaderDLL.h:228
float y_tl
y coordinate of the top-left corner
Definition: CommonHeaderDLL.h:233
float angle
rotated angle of the object in degree (counter-clockwise)
Definition: CommonHeaderDLL.h:240
float x
x coordinate of the center of the object
Definition: CommonHeaderDLL.h:221
float width
width of the object
Definition: CommonHeaderDLL.h:226
float y_br
y coordinate of the bottom-right corner
Definition: CommonHeaderDLL.h:237
int classIdx
index of the object's class
Definition: CommonHeaderDLL.h:245
float score
feature score of the object (0 - 100)
Definition: CommonHeaderDLL.h:243
float y
y coordinate of the center of the object
Definition: CommonHeaderDLL.h:223
Struct describing features of a segmentation object.
Definition: CommonHeaderDLL.h:122
int nContours
Definition: CommonHeaderDLL.h:203
int croppedImageHeight
height of a cropped image
Definition: CommonHeaderDLL.h:195
float ellipseAngle
angle of the fitted ellipse to the object
Definition: CommonHeaderDLL.h:157
unsigned int yCenter
y coordinate of the center of the object
Definition: CommonHeaderDLL.h:127
float ellipseWidth
width of the fitted ellipse to the object
Definition: CommonHeaderDLL.h:148
unsigned int area
area of the object
Definition: CommonHeaderDLL.h:130
int croppedImageChannels
# of channels of a cropped image
Definition: CommonHeaderDLL.h:197
unsigned int width
width of the object
Definition: CommonHeaderDLL.h:133
float ellipseHeight
height of the fitted ellipse to the object
Definition: CommonHeaderDLL.h:154
int * hierarchies
Array of hierarchies for all contours of segmented object.
Definition: CommonHeaderDLL.h:211
unsigned int classIdx
class index of the object (except for background)
Definition: CommonHeaderDLL.h:160
void * croppedImage
data of a cropped image
Definition: CommonHeaderDLL.h:199
float ellipseYCenter
y coordinate of the center of the fitted ellipse to the object
Definition: CommonHeaderDLL.h:142
int croppedImageWidth
width of a cropped image
Definition: CommonHeaderDLL.h:193
float ellipseXCenter
x coordinate of the center of the fitted ellipse to the object
Definition: CommonHeaderDLL.h:139
unsigned int height
height of the object
Definition: CommonHeaderDLL.h:136
float filteringObjectRatio
ratio of overlapping area with the set region when the filtering object function is applied (in [0,...
Definition: CommonHeaderDLL.h:214
unsigned int xCenter
x coordinate of the center of the object
Definition: CommonHeaderDLL.h:124