Skip to content

File SaigeVisionUtil.h

Go to the documentation of this file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef SAIGE_VISION_WRAPPER_SAIGE_VISION_UTIL_H_
#define SAIGE_VISION_WRAPPER_SAIGE_VISION_UTIL_H_

#include "SaigeVisionAPI.h"

#ifdef __linux__
#define SAIGE_VISION_API extern "C"
#elif defined(SAIGEVISIONWRAPPER_EXPORTS)
#define SAIGE_VISION_API extern "C" __declspec(dllexport)
#else
#define SAIGE_VISION_API extern "C" __declspec(dllimport)
#endif

typedef enum _SaigeImageType { SV_U8 = 0, SV_U16 = 1, SV_F32 = 2, SV_F64 = 3, SV_FILEPATH = 4 } SaigeImageType;
SAIGE_VISION_API void* SaigeGetImageData(const char* imagePath, int* width, int* height,
                                         int* channels, int* type);
SAIGE_VISION_API int SaigeFreeImageData(void* image);

SAIGE_VISION_API int SaigeColorCodeToRGB(const char* color, unsigned char* r, unsigned char* g,
                                         unsigned char* b);

SAIGE_VISION_API int SaigeDrawDetectedObjects(const void* image, const SaigeDetectedObject* objects,
                                              SaigeModelInfo* modelInfo,
                                              const int numOfDetectedObjects, const int width,
                                              const int height, const int channels, const int type,
                                              const int waitMS);

SAIGE_VISION_API int SaigeDrawSegmentedObjects(const void* image,
                                               const SaigeSegmentedObject* objects,
                                               SaigeModelInfo* modelInfo,
                                               const int numOfSegmentedObjects, const int width,
                                               const int height, const int channels, const int type,
                                               const double overlayAlpha, const int waitMS);

SAIGE_VISION_API int SaigeDrawTextObjects(const void* image, const SaigeTextObject* objects,
                                          const int numBoxes, const int width, const int height,
                                          const int channels, const int type, const int waitMS);
SAIGE_VISION_API int SaigeDrawHeatmap(const float* image, const int width, const int height,
                                      const int waitMS);

SAIGE_VISION_API int SaigeDrawImage(const void* image, const int width, const int height,
                                    const int channels, const double alpha, const int type,
                                    const bool invert, const int waitMS);

SAIGE_VISION_API int SaigeDrawImageOverBase(const void* base_img, const void* img, const int width,
                                            const int height, const int channels_base,
                                            const int channels_img, const int type_base,
                                            const int type_img, const double alpha,
                                            const bool invert, const int waitMS);
SAIGE_VISION_API void SaigeInitTextFormatting(SaigeTextFormatting* formatting);

SAIGE_VISION_API unsigned int SaigeConvertImageType(const int channel, const int type);

SAIGE_VISION_API int SaigeOverlaySegmentedObjects(
    const void* baseImage, const SaigeSegmentedObject* objects, SaigeModelInfo* modelInfo,
    const int numOfSegmentedObjects, const int width, const int height, const int channels,
    const int type, const bool isRGB, const double overlayAlpha, void* resultImage);

SAIGE_VISION_API int SaigeOverlayDetectedObjects(
    const void* baseImage, const SaigeDetectedObject* objects, SaigeModelInfo* modelInfo,
    const int numOfDetectedObjects, const int width, const int height, const int channels,
    const int type, const bool withClassName, const bool isRGB, const double overlayAlpha,
    void* resultImage);

SAIGE_VISION_API int SaigeOverlayTextObjects(const void* baseImage, const SaigeTextObject* objects,
                                             const int numOfTextObjects, const int width,
                                             const int height, const int channels, const int type,
                                             const bool isRGB, const double overlayAlpha,
                                             const double textScale, void* resultImage);
SAIGE_VISION_API int SaigeOverlayHeatmap(const void* baseImage, const float* heatmap, const int width,
                                         const int height, const int channels, const int type,
                                         const bool isRGB, const double overlayAlpha,
                                         void* resultImage);

SAIGE_VISION_API int SaigeShowImage(const void* image, const int width, const int height,
                                    const int channels, const int type, const bool isRGB,
                                    const bool invert, const double alpha, const int waitMS);


#endif  // SAIGE_VISION_WRAPPER_SAIGE_VISION_UTIL_H_