Evo 7.12.0-TM26061101
Evo LPR Engine
Loading...
Searching...
No Matches
Basic.h
Go to the documentation of this file.
1#ifndef EVO_BASIC_HPP_
2#define EVO_BASIC_HPP_
3
4//
5// Check platforms and compilers are valid.
6//
7#if defined(_WIN64)
8# if !defined(_MSC_VER) || (_MSC_VER < 1900)
9# error This compiler not tested.
10# endif
11# if !defined(_M_AMD64)
12# error Not supported CPU architecture
13# endif
14#elif defined(__linux__)
15# if !defined(__GNUC__) || (__GNUC__ < 7) || (__GNUC_MINOR__ < 3)
16# error This compiler not tested.
17# endif
18# if !defined(__x86_64__) && !defined(__aarch64__)
19# error Not supported CPU architecture
20# endif
21#else
22# error Target platform not supported.
23#endif
24
25#ifndef __cplusplus
26# include <stdint.h>
27# include <stddef.h>
28#else
29# include <cstdint>
30# include <cstddef>
31#endif
32
33
34#ifdef __cplusplus
35# define EVO_RMV_COPY_CONST(CLASS_NAME) CLASS_NAME(const CLASS_NAME&) = delete
36# define EVO_RMV_COPY_ASSIGNMENT(CLASS_NAME) CLASS_NAME& operator=(const CLASS_NAME&) = delete
37# define EVO_RMV_SPECIAL_METHODS(CLASS_NAME) EVO_RMV_COPY_CONST(CLASS_NAME); EVO_RMV_COPY_ASSIGNMENT(CLASS_NAME);
38#endif
39
40#ifdef _WIN64
41# define EVO_DEPRECATED __declspec(deprecated("Don't use any more because it's deprecated."))
42
43# define EVO_ENABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(1:4996))
44# define EVO_DISABLE_DEPRECATION_WARNINGS __pragma(warning(pop))
45#else // __linux__
46# define EVO_DEPRECATED __attribute__((deprecated))
47
48# define EVO_ENABLE_DEPRECATION_WARNINGS
49# define EVO_DISABLE_DEPRECATION_WARNINGS
50#endif
51
52
59{
60 // Success Code
61 EVORC_OK,
62
63 // Generic Errors
64 EVORC_INV_ARG = 50,
65 EVORC_NOT_INIT,
66 EVORC_DISABLED,
67 EVORC_NOT_FOUND,
68 EVORC_ALREADY_DONE,
69 EVORC_NOT_IMPLEMENTED,
70 EVORC_NOT_SUPPORTED,
71 EVORC_TOO_SMALL_BUF,
72 EVORC_RESOURCE_IN_USE,
73 EVORC_INTERNAL_DATA_ERR,
74 EVORC_NO_MORE_DATA,
75 EVORC_TIMEOUT,
76 EVORC_IN_PROGRESS,
77 EVORC_OUT_OF_RANGE,
78 EVORC_OPER_CANCELED,
79 EVORC_UNKNOWN_VALUES,
80 EVORC_RETRY,
81
82 // License related errors
83 EVORC_LIC_UNKNOWN_ERR = 100,
84 EVORC_LIC_NO_DEV,
85 EVORC_LIC_MULTI_USBDEV,
86 EVORC_LIC_MISMATCH,
87 EVORC_LIC_INV_FILE,
88 EVORC_LIC_INV_CONTEXT,
89 EVORC_LIC_TRIAL_EXPIRED,
90 EVORC_LIC_SUPPORT_EXPIRED,
91
92 // File reltaed errors
93 EVORC_FILE_UNKNOWN_ERR = 150,
94 EVORC_FILE_NOT_EXIST,
95 EVORC_FILE_ALREADY_EXIST,
96 EVORC_FILE_PERM_ERR,
97 EVORC_FILE_IO_ERR,
98 EVORC_FILE_TOO_LONG_PATH,
99
100 // DNN related errors
101 EVORC_DNN_UNKNOWN_ERR = 200,
102 EVORC_DNN_NO_DEV,
103 EVORC_DNN_INV_MODEL,
104 EVORC_DNN_INV_INPUT,
105 EVORC_DNN_INV_DEV_DESC,
106 EVORC_DNN_UNSUPPORTED_DEV,
107 EVORC_DNN_UNSUPPORTED_FMT,
108 EVORC_DNN_OV_ERR,
109 EVORC_DNN_IO_ERR,
110
111 // Input-Image related errors
112 EVORC_IMG_UNKNOWN_ERR = 250,
113 EVORC_IMG_DEC_ERR,
114 EVORC_IMG_INV_SIZE,
115 EVORC_IMG_INV_SEARCH_AREA,
116
117 // Trained Model Data related errors
118 EVORC_TMD_UNKNOWN_ERR = 300,
119 EVORC_TMD_CONF_NOT_FOUND,
120 EVORC_TMD_NOT_COMPATABLE,
121
122 // Multi-Country related errors
123 EVORC_MC_UNKNOWN_ERR = 350,
124 EVORC_MC_NOT_SUPPORTED,
125 EVORC_MC_NOT_REGISTERED,
126 EVORC_MC_NO_CCODE,
127
128 // Video Input Output related errors
129 EVORC_VIO_UNKNOWN_ERR = 400,
130 EVORC_VIO_AV_ERR,
131 EVORC_VIO_LV_MOD_ERR,
132 EVORC_VIO_STREAM_CLOSED,
133
134 // IP Protocol Streaming relateed errors
135 EVORC_IPPS_UNKNOWN_ERR = 450,
136 EVORC_IPPS_CONN_ERR,
137 EVORC_IPPS_HW_CODEC_ERR,
138 EVORC_IPPS_UNSUPPORTED_CODEC,
139 EVORC_IPPS_INV_VIDEO_FMT,
140
141 // Live View related errors
142 EVORC_LV_UNKNOWN_ERR = 500,
143 EVORC_LV_WIN_ERR,
144 EVORC_LV_OGL_ERR,
145 EVORC_LV_FORMAT_ERR,
146 EVORC_LV_SA_NOT_SET,
147 EVORC_LV_WIN_NOT_OPEN,
148
149 // Library Module related errors
150 EVORC_MOD_UNKNOWN_ERR = 550,
151 EVORC_MOD_NOT_LOADED,
152 EVORC_MOD_NOT_FOUND,
153 EVORC_MOD_INV_FUNC_NAME,
154
155 // GenICam related errors
156 EVORC_GIC_UNKNOWN_ERR = 600,
157 EVORC_GIC_TL_INIT_ERR,
158 EVORC_GIC_TL_ADDR_BIND_ERR,
159 EVORC_GIC_SYS_MOD_ERR,
160 EVORC_GIC_IFC_MOD_ERR,
161 EVORC_GIC_DEV_MOD_ERR,
162 EVORC_GIC_DS_MOD_ERR,
163 EVORC_GIC_BUF_ERR,
164 EVORC_GIC_EVT_ERR,
165 EVORC_GIC_PORT_ERR,
166 EVORC_GIC_DEV_ERR,
167 EVORC_GIC_SFNC_ERR,
168 EVORC_GIC_INV_ENV_VAR,
169 EVORC_GIC_DEV_NOT_SEL,
170 EVORC_GIC_NO_READY_DS,
171 EVORC_GIC_LESS_NUM_BUF,
172
173 // All Other Errors
174 EVORC_UNKNOWN_ERR = 1000,
175};
176
177#ifndef __cplusplus
178typedef enum EvoRC EvoRC;
179#endif
180
181//
182// Protable Boolean Data Type
183//
184typedef int EvoBool;
185
186//
187// Available values of the type 'EvoBool'.
188//
189#define EVO_TRUE 1
190#define EVO_FALSE 0
191
268
269#ifndef __cplusplus
270typedef enum EvoParam EvoParam;
271#endif
272
277{
287
288 // These are not heading directions.
289 EVOHD_NUM,
290 EVOHD_INVALID = EVOHD_NUM,
291};
292
293#ifndef __cplusplus
294typedef enum EvoHeadDir EvoHeadDir;
295#endif
296
301{
305 EvoBool headDir;
306
307#ifdef __cplusplus
308 EvoOutput(void) : headDir(EVO_FALSE) {}
309#endif
310};
311
312#ifndef __cplusplus
313typedef struct EvoOutput EvoOutput;
314#endif
315
316// Miss-Stages for Debugging
317enum EvoMS
318{
319 EVOMS_NONE = 0,
320 EVOMS_LPD = (1 << 0),
321 EVOMS_LPBQD = (1 << 1),
322 EVOMS_LPR = (1 << 2),
323};
324
331{
332 EVOPF_INVALID = -1,
333
338
344
350
357
364
372
380
386
392
398
404};
405
406#ifndef __cplusplus
407typedef enum EvoPixFmt EvoPixFmt;
408#endif
409
427
428#ifndef __cplusplus
429typedef enum EvoTimeUnit EvoTimeUnit;
430#endif
431
436{
437 int width;
438 int height;
439
440#ifdef __cplusplus
441 EvoSize(void) : width(0), height(0) {}
442 EvoSize(int _width, int _height) : width(_width), height(_height) {}
443
444 inline bool IsEmpty(void) const;
445 inline bool IsValid(void) const;
446#endif
447};
448
449#ifndef __cplusplus
450typedef struct EvoSize EvoSize;
451#endif
452
463{
464 int x;
465 int y;
466 int width;
467 int height;
468
469#ifdef __cplusplus
470 EvoRect(void) : x(0), y(0), width(0), height(0) {}
471 EvoRect(int _x, int _y, int _width, int _height)
472 : x(_x), y(_y), width(_width), height(_height) {}
473
474 inline bool IsEmpty(void) const;
475 inline bool IsValid(void) const;
476#endif
477};
478
479#ifndef __cplusplus
480typedef struct EvoRect EvoRect;
481#endif
482
487{
488 uint8_t r;
489 uint8_t g;
490 uint8_t b;
491 uint8_t a;
492
493#ifdef __cplusplus
494 EvoColor(void) : r(0), g(0), b(0), a(0) {}
495 EvoColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
496 : r(red), g(green), b(blue), a(alpha) {}
497#endif
498};
499
500#ifndef __cplusplus
501typedef struct EvoColor EvoColor;
502#endif
503
510{
511#define EVO_MAX_IMG_PLANES 4
512
514 const uint8_t *planes[EVO_MAX_IMG_PLANES];
515
517 int width;
518
521
524
531 int strides[EVO_MAX_IMG_PLANES];
532
533#ifdef __cplusplus
534 EvoImage(void)
535 : planes{ NULL },
536 width(0),
537 height(0),
538 pf(EVOPF_INVALID),
539 strides{ 0 }
540 {
541 }
542
543 EvoImage(int _width,
544 int _height,
545 EvoPixFmt _pf)
546 : planes{ NULL },
547 width(_width),
548 height(_height),
549 pf(_pf),
550 strides{ 0 }
551 {
552 }
553
554 EvoImage(const uint8_t *_plane,
555 int _width,
556 int _height,
557 EvoPixFmt _pf,
558 int _stride)
559 : planes{ _plane },
560 width(_width),
561 height(_height),
562 pf(_pf),
563 strides{ _stride }
564 {
565 }
566
567 EvoImage(const uint8_t *_planes[],
568 int _width,
569 int _height,
570 EvoPixFmt _pf,
571 const int _strides[])
572 : width(_width), height(_height), pf(_pf)
573 {
574 for (int i = 0; i < EVO_MAX_IMG_PLANES; i++)
575 {
576 planes[i] = _planes[i];
577 strides[i] = _strides[i];
578 }
579 }
580
581 inline void ResetStrides(void);
582 inline void Reset(void);
583 inline int GetMinStride(void) const;
584 inline bool IsValid(void) const;
585 inline operator bool() const;
586#endif
587};
588
589#ifndef __cplusplus
590typedef struct EvoImage EvoImage;
591#endif
592
598typedef int EvoLPT;
599
640typedef void (*EvoLPDJudgeCB)(const EvoRect *szImage,
641 const EvoRect rects[],
642 const float confidences[],
643 const int num,
644 int results[]);
645
646#endif // EVO_BASIC_HPP_
EvoParam
Engine's Realtime Parameters
Definition Basic.h:199
@ EVOPARAM_LPD_JUDGE_CB
Definition Basic.h:212
@ EVOPARAM_SEARCH_RECT
Definition Basic.h:224
@ EVOPARAM_STAY_TIMEOUT
Definition Basic.h:256
@ EVOPARAM_SEARCH_POLY
Definition Basic.h:237
@ EVOPARAM_OUTPUT
Definition Basic.h:205
@ EVOPARAM_MIN_SEARCH
Definition Basic.h:266
@ EVOPARAM_GOP_SIZE
Definition Basic.h:246
EvoHeadDir
Automobile's Heading Directions.
Definition Basic.h:277
@ EVOHD_NE
To Northeast.
Definition Basic.h:280
@ EVOHD_N
To North.
Definition Basic.h:281
@ EVOHD_SE
To Southeast.
Definition Basic.h:286
@ EVOHD_SW
To Southwest.
Definition Basic.h:284
@ EVOHD_E
To East.
Definition Basic.h:279
@ EVOHD_W
To West.
Definition Basic.h:283
@ EVOHD_S
To South.
Definition Basic.h:285
@ EVOHD_UNK
Unknown.
Definition Basic.h:278
@ EVOHD_NW
To Northwest.
Definition Basic.h:282
EvoTimeUnit
Time Precision.
Definition Basic.h:416
@ EVOTU_MS
Definition Basic.h:425
@ EVOTU_SEC
Definition Basic.h:420
EvoRC
Return Codes.
Definition Basic.h:59
int EvoLPT
License Plate Type.
Definition Basic.h:598
EvoPixFmt
Pixel Formats.
Definition Basic.h:331
@ EVOPF_NV12
Definition Basic.h:356
@ EVOPF_NV21
Definition Basic.h:363
@ EVOPF_BGR24
Definition Basic.h:385
@ EVOPF_YV12
Definition Basic.h:379
@ EVOPF_YUY2
Definition Basic.h:343
@ EVOPF_RGB24
Definition Basic.h:391
@ EVOPF_BGRA
Definition Basic.h:397
@ EVOPF_I420
Definition Basic.h:371
@ EVOPF_GRAY
Definition Basic.h:337
@ EVOPF_UYVY
Definition Basic.h:349
@ EVOPF_RGBA
Definition Basic.h:403
void(* EvoLPDJudgeCB)(const EvoRect *szImage, const EvoRect rects[], const float confidences[], const int num, int results[])
Callback for License Plate Detection Judgement.
Definition Basic.h:640
Color Value of 32bit RGBA.
Definition Basic.h:487
uint8_t g
8bit Quantity of Green Channel
Definition Basic.h:489
uint8_t a
8bit Quantity of Alpha Channel
Definition Basic.h:491
uint8_t r
8bit Quantity of Red Channel
Definition Basic.h:488
uint8_t b
8bit Quantity of Blue Channel
Definition Basic.h:490
Image Descriptor.
Definition Basic.h:510
const uint8_t * planes[EVO_MAX_IMG_PLANES]
Memory buffer to contain each plane.
Definition Basic.h:514
int width
Width Size by the Pixel.
Definition Basic.h:517
int strides[EVO_MAX_IMG_PLANES]
Stride Size by the Byte.
Definition Basic.h:531
EvoPixFmt pf
Pixel Format.
Definition Basic.h:523
int height
Height Size by the Pixel.
Definition Basic.h:520
Engine's Output Configurations.
Definition Basic.h:301
EvoBool headDir
Definition Basic.h:305
Rectangle Descriptor.
Definition Basic.h:463
int height
Height Size.
Definition Basic.h:467
int x
X Coordinate of Top-Left.
Definition Basic.h:464
int y
Y Coordinate of Top-Left.
Definition Basic.h:465
int width
Width Size.
Definition Basic.h:466
Size Descriptor.
Definition Basic.h:436
int height
Height Size.
Definition Basic.h:438
int width
Width Size.
Definition Basic.h:437