Skip to content

SaigeVisionAPI.h

Go to the source code of this file.

  • #include <stdint.h>
  • #include "saige_error.h"

SaigeVision 추론 기능에 필요한 핵심적인 함수, 상수, 구조체, 플래그 등이 정의되어 있습니다.

Classes

Type Name
struct SaigeHandleConfig
Structure containing configuration settings for the inference handle, which can impact GPU memory and inference time.
struct SaigeRoiInfo
Structure containing ROI information. Composed of the ROI mode and corresponding parameters, along with common blind mask information.
struct SaigeModelInfo
Structure containing model information.
struct SaigeTextFormatting
(OCR) Option for specifying the format of text to be recognized. There are two approaches: setting a character set for recognition regardless of character count, or defining character sets based on character position.
struct SaigeInferenceOption
inference options struct
struct SaigeRotatedBox
Structure containing information about a rotatable rectangle.
struct SaigeDetectedObject
Structure containing information about a detected area from Object Detection (DET).
struct SaigeEllipse
Structure containing information about an ellipse.
struct SaigeSegmentedObject
Structure containing information about a detected area from Segmentation (SEG) or Anomaly Detection (IAD).
struct SaigeTextObject
SaigeTextObject.

Public Types

Type Name
typedef void * SaigeInferenceHandle
A handle used to manage information and perform inference.
typedef void * SaigeInferenceResult
A handle used to manage inference results.

Public Attributes

Type Name
constexpr int kProjectTypeCLS = = 0
Constant value indicating Classification project.
constexpr int kProjectTypeDET = = 1
Constant value indicating Detection project.
constexpr int kProjectTypeSEG = = 2
Constant value indicating Segmentation project.
constexpr int kProjectTypeIAD = = 3
Constant value indicating Anomaly Detection project.
constexpr int kProjectTypeOCR = = 4
Constant value indicating OCR project.
constexpr int kProjectTypeIEN = = 5
Constant value indicating IEN project.
constexpr int kMaxLenOfClassName = = 63
Constant value indicating the max length of class name.
constexpr int kMaxNumOfClasses = = 255
Maximum number of classes.
constexpr int kMaxLenOfModelName = = 63
Constant value indicating the max length of model name.
constexpr int kMaxLenOfCameraName = = 63
Constant value indicating the max length of camera name.
constexpr int kMaxLenOfTrainedVersion = = 63
Constant value indicating the max length of version information string.
constexpr int kMaxLenOfToolName = = 63
kMaxLenOfToolName
constexpr int kMaxLenOfTextFormatting = = 200
(OCR) Maximum length of recognized text. A recognized text in a single SaigeTextObject cannot exceed this length.

Public Functions

Type Name
int SaigeInferFromImageFile (SaigeInferenceHandle handle, const char * imagePath, SaigeInferenceResult result)
Performs inference using the specified image file path.
int SaigeInferFromByteArray (SaigeInferenceHandle handle, const unsigned char * imageData, const int width, const int height, const unsigned int flags, SaigeInferenceResult result)
Performs inference on a single image data array. For 3-channel color images, RGB ordering is preferred for speed in real-time applications. If images are acquired in RGB, it is recommended to use RGB.
int SaigeInferFromByteArrayWithProductId (SaigeInferenceHandle handle, const unsigned char * imageData, const int width, const int height, const unsigned int flags, const char * productId, SaigeInferenceResult result)
Performs inference on a single image data array with an additional product identifier. This is similar to SaigeInferFromByteArray, with the addition of a product ID, which is a user-defined identifier for the inspection target.
int SaigeInferFromMultipleByteArray (SaigeInferenceHandle handle, const int numOfImages, const unsigned char ** imageData, const int width, const int height, const unsigned int flags, SaigeInferenceResult * results)
Performs batch inference on multiple images of the same size.
int SaigeInferFromMultiPageByteArray (SaigeInferenceHandle handle, const int numOfPages, const unsigned char ** imageData, const int width, const int height, const int * channels, const unsigned int flags, SaigeInferenceResult result)
Performs inference using multiple pages of image data.
int SaigeGetInferenceResultScore (SaigeInferenceResult result, float * scores, bool includeAddScore)
(CLS) Retrieves an array of scores per class.
int SaigeGetInferenceResultClass (SaigeInferenceResult result, int * classIndex)
(CLS) Retrieves the index of the class with the highest final score, including additional score.
int SaigeGetInferenceResultClassActivationMap (SaigeInferenceResult result, unsigned char ** classActivationMap)
(CLS) Retrieves the class activation map array.
int SaigeGetInferenceResultNumOfDetectedObjects (SaigeInferenceResult result, int * numOfObjects)
(DET) Retrieves the number of detected objects from Object Detection.
int SaigeGetInferenceResultDetectedObjects (SaigeInferenceResult result, SaigeDetectedObject * detectedObjects)
(DET) Retrieves an array of detected objects from Object Detection.
int SaigeGetInferenceResultNumOfSegmentedObjects (SaigeInferenceResult result, int * num)
Retrieves the number of segmented objects detected by Segmentation (SEG) or Anomaly Detection (IAD).
int SaigeGetInferenceResultSegmentedObjects (SaigeInferenceResult result, SaigeSegmentedObject * segObjects)
Retrieves an array of segmented objects detected by Segmentation (SEG) or Anomaly Detection (IAD).
int SaigeGetInferenceResultMask (SaigeInferenceResult result, unsigned char ** mask)
Retrieves a Mask array from Segmentation (SEG) or Anomaly Detection (IAD).
int SaigeGetInferenceResultScoremapSEG (SaigeInferenceResult result, unsigned char ** scoremap)
Retrieves the Scoremap array for Segmentation (SEG).
int SaigeGetInferenceResultIsOversized (SaigeInferenceResult result, bool * isOversized)
Checks if the input image size exceeded the inspection size set in SaigeHandleConfig.
int SaigeGetInferenceResultAnomalyScores (SaigeInferenceResult result, double * anomalyScore, double * minScore, double * maxScore)
Retrieves three types of scores for Anomaly Detection (IAD).
int SaigeGetInferenceResultIsNg (SaigeInferenceResult result, bool * isNg)
Retrieves the normal/abnormal classification result for the image in Anomaly Detection (IAD).
int SaigeGetInferenceResultScoremapIAD (SaigeInferenceResult result, float ** scoremap)
Retrieves the Scoremap array for Anomaly Detection (IAD).
int SaigeGetInferenceResultHeatmap (SaigeInferenceResult result, float ** heatmap)
SaigeGetInferenceResultHeatmap.
int SaigeGetInferenceResultNumOfTextObjects (SaigeInferenceResult result, int * num)
SaigeGetInferenceResultNumOfTextObjects.
int SaigeGetInferenceResultTextObjects (SaigeInferenceResult result, SaigeTextObject * textObjects)
SaigeGetInferenceResultTextObjects.
int SaigeGetInferenceResultEnhancedImage (SaigeInferenceResult result, unsigned char ** image)
SaigeGetInferenceResultEnhancedImage.
int SaigeGetInferenceResultInspectionTime (SaigeInferenceResult result, long long * imreadTime, long long * inferenceTime, long long * postProcessingTime)
SaigeGetInferenceResultInspectionTime.
int SaigeGetInferenceResultProductId (SaigeInferenceResult result, const char ** productId, unsigned int * length)
SaigeGetInferenceResultProductId.
int SaigeInitializeAlignModule (const int gpuIndex, const int sourceWidth, const int sourceHeight, const int targetWidth, const int targetHeight)
Function to activate the Saige Alignment function.
int SaigeFinalizeAlignModule ()
Function to terminate the Saige Alignment function. Releases the GPU memory used by the function.
int SaigeAlignImageFromByteArray (const unsigned char * sourceImage, const int sourceWidth, const int sourceHeight, const int sourceChannel, const unsigned char * targetImage, const int targetWidht, const int targetHeight, const int targetChannel, unsigned int flag, unsigned char * croppedSourceImage)
Function to adjust the position of the Source image to match the Target image.
int SaigeAlignImageFromFile (const char * sourceImagePath, const char * targetImagePath, int * cropWidth, int * cropHeight, int * cropChannel, unsigned char * croppedSourceImage)
Not Implemented.
int SaigeCreateInferenceHandle (SaigeInferenceHandle * handle, const int projectType, const char * modelFilePath, const int deviceIndex, SaigeHandleConfig * config, const unsigned int flags)
Creates an inference handle.
int SaigeDestroyInferenceHandle (SaigeInferenceHandle handle)
Destroys an inference handle.
int SaigeCreateInferenceResult (SaigeInferenceResult * result)
Creates a result handle.
int SaigeDestroyInferenceResult (SaigeInferenceResult result)
Destroys a result handle.
int SaigeGetModelInfo (SaigeInferenceHandle handle, SaigeModelInfo * info)
Retrieves model information from the inference handle.
int SaigeSetInferenceOption (SaigeInferenceHandle handle, SaigeInferenceOption * option, const unsigned int flags)
Sets inference option values on the inference handle.
int SaigeGetInferenceOption (SaigeInferenceHandle handle, SaigeInferenceOption * option)
Retrieves inference option values from the inference handle.
const char * SaigeStrError (const int errnum)
SaigeStrError.
const char * SaigeGetModuleVersion ()
SaigeGetModuleVersion.
int SaigeSetHandleMetadata (SaigeInferenceHandle handle, const char * key, const char * value)
SaigeSetHandleMetadata.
int SaigeSetInferenceMetadata (SaigeInferenceResult result, const char * key, const char * value)
SaigeSetInferenceMetadata.
int SaigeSetResultMetadata (SaigeInferenceResult result, const char * key, const char * value)
SaigeSetResultMetadata.

Macros

Type Name
define SAIGE_WRITE_ON_MODEL_FILE 0x01
(Common) When setting inference option values using SaigeSetInferenceOption, this flag saves the option values to the model file as well.
define SAIGE_SET_CALC_TIME 0x2
(Common) Flag to set the calcTime option.
define SAIGE_SET_OVERSIZED_IMAGE_HANDLING 0x4
(SEG, OCR, IEN) Flag to set the oversizedImageHandling option.
define SAIGE_SET_ADDITIONAL_SCORES 0x8
(CLS) Flag to set the additionalScores option.
define SAIGE_SET_CALC_CLASS_ACTIVATION_MAP 0x10
(CLS) Flag to set the calcClassActivationMap option.
define SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS 0x20
(DET) Flag to set the maxNumOfDetectedObjects option.
define SAIGE_SET_CALC_SCOREMAP 0x40
(SEG) Flag to set the calcScoremap option.
define SAIGE_SET_CALC_OBJECT 0x80
(SEG, IAD) Flag to set the calcObject option.
define SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD 0x100
(SEG, IAD) Flag to set the calcObjectAreaAndApplyThreshold option.
define SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD 0x200
(SEG, IAD) Flag to set the calcObjectScoreAndApplyThreshold option.
define SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD 0x400
(SEG, IAD) Flag to set objectBoundaryThresholdPerClass in SEG and objectBoundaryThreshold in IAD.
define SAIGE_SET_OBJECT_AREA_THRESHOLD 0x800
(SEG, DET, IAD) Flag to set objectAreaThresholdPerClass in SEG and DET, and objectAreaThreshold in IAD.
define SAIGE_SET_OBJECT_SCORE_THRESHOLD 0x1000
(SEG, DET, IAD) Flag to set objectScoreThresholdPerClass in SEG and DET, and objectScoreThreshold in IAD.
define SAIGE_SET_CALC_MASK 0x2000
(SEG, IAD) Flag to set the calcMask option.
define SAIGE_SET_CALC_HEATMAP 0x4000
(IAD) Flag to set the calcHeatmap option.
define SAIGE_SET_ANOMALY_SCORE_THRESHOLD 0x8000
(IAD) Flag to set the anomalyScoreThreshold option.
define SAIGE_SET_HEATMAP_COLOR_RANGE 0x10000
(IAD) Flag to set heatmapColorRangeMin and heatmapColorRangeMax options.
define SAIGE_SET_POLYGON_SCORE_THRESHOLD 0x20000
(OCR) Flag to set the polygonScoreThreshold option.
define SAIGE_SET_TEXT_SIZE_RANGE 0x40000
(OCR) Flag to set textSizeRangeMin and textSizeRangeMax options.
define SAIGE_SET_NUM_OF_TEXT_OBJECTS 0x80000
(OCR) Flag to set the maxNumOfTextObjects option.
define SAIGE_SET_TEXT_SCORE_THRESHOLD 0x100000
(OCR) Flag to set the textScoreThreshold option.
define SAIGE_SET_TEXT_FORMATTING 0x200000
(OCR) Flag to set the textFormatting option.
define SAIGE_IMAGE_COLOR 0x01
Flag indicating color image data.
define SAIGE_IMAGE_16BIT 0x02
Flag indicating 16-bit per channel image data.
define SAIGE_IMAGE_ALPHA 0x04
Flag indicating data with an alpha channel.
define SAIGE_IMAGE_BGR 0x08
Flag indicating the color channel order is Blue, Green, Red.
define SAIGE_IMAGE_8BIT_GRAY 0x00
Macro indicating 8-bit grayscale image data. It is a single-channel array with a size of Width x Height.
define SAIGE_IMAGE_24BIT_RGB (SAIGE_IMAGE_COLOR)
Macro indicating 24-bit RGB color image data. It is an array of size Width x Height x Channels (3) with channels ordered as R, G, B.
define SAIGE_IMAGE_24BIT_BGR (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_BGR)
Macro indicating 24-bit BGR color image data. It is an array of size Width x Height x Channels (3) with channels ordered as B, G, R.
define SAIGE_IMAGE_32BIT_RGBA (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_ALPHA)
Macro indicating 32-bit RGBA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as R, G, B, A.
define SAIGE_IMAGE_32BIT_BGRA (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_ALPHA | SAIGE_IMAGE_BGR)
Macro indicating 32-bit BGRA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as B, G, R, A.
define SAIGE_IMAGE_16BIT_GRAY (SAIGE_IMAGE_16BIT)
Macro indicating 16-bit grayscale image data. It is a single-channel array of size Width x Height, with each pixel represented as an unsigned short.
define SAIGE_IMAGE_48BIT_RGB (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT)
Macro indicating 48-bit RGB color image data. It is an array of size Width x Height x Channels (3) with channels ordered as R, G, B, and each pixel represented as an unsigned short.
define SAIGE_IMAGE_48BIT_BGR (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_BGR)
Macro indicating 48-bit BGR color image data. It is an array of size Width x Height x Channels (3) with channels ordered as B, G, R, and each pixel represented as an unsigned short.
define SAIGE_IMAGE_64BIT_RGBA (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_ALPHA)
Macro indicating 64-bit RGBA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as R, G, B, A, and each pixel represented as an unsigned short.
define SAIGE_IMAGE_64BIT_BGRA (SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_ALPHA | SAIGE_IMAGE_BGR)
Macro indicating 64-bit BGRA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as B, G, R, A, and each pixel represented as an unsigned short.
define SAIGEVISION_RUNTIME_VERSION_MAJOR 2
Major version of the SAIGE VISION Runtime C/C++ SDK.
define SAIGEVISION_RUNTIME_VERSION_MINOR 12
Minor version of the SAIGE VISION Runtime C/C++ SDK.
define SAIGEVISION_RUNTIME_VERSION_PATCH 3
Patch version of the SAIGE VISION Runtime C/C++ SDK.
define SV_STR (x) #x
define SV_VER (M, m, p) SV_STR(M) "." SV_STR(m) "." SV_STR(p)
define SAIGEVISION_RUNTIME_VERSION "2.12.3"
The version of the SaigeVision Runtime C/C++ SDK (deprecated). Please use MAJOR, MINOR, and PATCH versions instead.
define SAIGE_SET_BATCH_SIZE 0x01
(CLS, DET, SEG, IAD) Flag to set batch size for inference. Used when batch inference API is applied.
define SAIGE_SET_INSPECTION_SIZE 0x02
(SEG, OCR) Flag to set the width and height of images for inference.
define SAIGE_OPTIMIZE_HANDLE 0x04
(Common) Flag to apply optimization to the inference handle. Applying inference optimization reduces inference time but may slightly alter results.
define SAIGE_DO_NOT_INSPECT "do_not_inspect"
(SEG) An option for oversizedImageHandling, where inference is not performed and an error is raised.
define SAIGE_DO_NOT_ENHANCE "do_not_enhance"
(IEN) An option for oversizedImageHandling, where inference is not performed and an error is raised.
define SAIGE_RESIZE_TO_FIT "resize_to_fit"
(SEG) An option for oversizedImageHandling. When set, the image is resized to fit within the inspection size, maintaining its aspect ratio, and then inference is performed.
define SAIGE_CROP_INTO_TILES "crop_into_tiles"
(SEG, IEN) An option for oversizedImageHandling. When set, the image is cropped into tiles based on the inspection size. Inference is performed on each tile, and results are combined.

Public Types Documentation

SaigeInferenceHandle

A handle used to manage information and perform inference.

void * SaigeInferenceHandle;

SaigeInferenceResult

A handle used to manage inference results.

void * SaigeInferenceResult;

Public Attributes Documentation

kProjectTypeCLS

Constant value indicating Classification project.

constexpr int kProjectTypeCLS;

kProjectTypeDET

Constant value indicating Detection project.

constexpr int kProjectTypeDET;

kProjectTypeSEG

Constant value indicating Segmentation project.

constexpr int kProjectTypeSEG;

kProjectTypeIAD

Constant value indicating Anomaly Detection project.

constexpr int kProjectTypeIAD;

kProjectTypeOCR

Constant value indicating OCR project.

constexpr int kProjectTypeOCR;

kProjectTypeIEN

Constant value indicating IEN project.

constexpr int kProjectTypeIEN;

kMaxLenOfClassName

Constant value indicating the max length of class name.

constexpr int kMaxLenOfClassName;

kMaxNumOfClasses

Maximum number of classes.

constexpr int kMaxNumOfClasses;

kMaxLenOfModelName

Constant value indicating the max length of model name.

constexpr int kMaxLenOfModelName;

kMaxLenOfCameraName

Constant value indicating the max length of camera name.

constexpr int kMaxLenOfCameraName;

kMaxLenOfTrainedVersion

Constant value indicating the max length of version information string.

constexpr int kMaxLenOfTrainedVersion;

kMaxLenOfToolName

kMaxLenOfToolName

constexpr int kMaxLenOfToolName;

kMaxLenOfTextFormatting

(OCR) Maximum length of recognized text. A recognized text in a single SaigeTextObject cannot exceed this length.

constexpr int kMaxLenOfTextFormatting;

Public Functions Documentation

SaigeInferFromImageFile

Performs inference using the specified image file path.

int SaigeInferFromImageFile (
    SaigeInferenceHandle handle,
    const char * imagePath,
    SaigeInferenceResult result
) 

Parameters:

  • handle The inference handle to use for inference.
  • imagePath Path to the image file for inference. Supported extensions are jpg, jpeg, png, ppm, bmp, pgm, tif, tiff, and webp.
  • result The result handle to store the inference results.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeInferFromByteArray

Performs inference on a single image data array. For 3-channel color images, RGB ordering is preferred for speed in real-time applications. If images are acquired in RGB, it is recommended to use RGB.

int SaigeInferFromByteArray (
    SaigeInferenceHandle handle,
    const unsigned char * imageData,
    const int width,
    const int height,
    const unsigned int flags,
    SaigeInferenceResult result
) 

Parameters:

  • handle The inference handle to use.
  • imageData The image data to be used for inference.
  • width Width of the image data.
  • height Height of the image data.
  • flags Flags to set the color and bit depth of the image.
  • result The result handle to store inference results.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SAIGE_IMAGE_8BIT_GRAY, SAIGE_IMAGE_24BIT_RGB

SaigeInferFromByteArrayWithProductId

Performs inference on a single image data array with an additional product identifier. This is similar to SaigeInferFromByteArray, with the addition of a product ID, which is a user-defined identifier for the inspection target.

int SaigeInferFromByteArrayWithProductId (
    SaigeInferenceHandle handle,
    const unsigned char * imageData,
    const int width,
    const int height,
    const unsigned int flags,
    const char * productId,
    SaigeInferenceResult result
) 

Parameters:

  • handle The inference handle to use.
  • imageData The image data to be used for inference.
  • width Width of the image data.
  • height Height of the image data.
  • flags Flags to set the color and bit depth of the image.
  • productId The product ID for the item to be inferred.
  • result The result handle to store inference results.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SAIGE_IMAGE_8BIT_GRAY, SAIGE_IMAGE_24BIT_RGB

SaigeInferFromMultipleByteArray

Performs batch inference on multiple images of the same size.

int SaigeInferFromMultipleByteArray (
    SaigeInferenceHandle handle,
    const int numOfImages,
    const unsigned char ** imageData,
    const int width,
    const int height,
    const unsigned int flags,
    SaigeInferenceResult * results
) 

Parameters:

  • handle The inference handle to use.
  • numOfImages Number of images in the data.
  • imageData Array of image data for inference.
  • width Width of the image data.
  • height Height of the image data.
  • flags Flags to set the color and bit depth of the image.
  • results Array of result handles to store inference results.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SAIGE_IMAGE_24BIT_RGB, SaigeHandleConfig::batchSize

SaigeInferFromMultiPageByteArray

Performs inference using multiple pages of image data.

int SaigeInferFromMultiPageByteArray (
    SaigeInferenceHandle handle,
    const int numOfPages,
    const unsigned char ** imageData,
    const int width,
    const int height,
    const int * channels,
    const unsigned int flags,
    SaigeInferenceResult result
) 

Parameters:

  • handle The inference handle to use.
  • numOfPages Number of pages of image data.
  • imageData Array of image data for inference.
  • width Width of the image data.
  • height Height of the image data.
  • channels Array of the number of channels in the image data. Each element represents the number of channels for each page.
  • flags Flags to set the color and bit depth of the image.
  • result The result handle to store inference results.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultScore

(CLS) Retrieves an array of scores per class.

int SaigeGetInferenceResultScore (
    SaigeInferenceResult result,
    float * scores,
    bool includeAddScore
) 

Parameters:

  • result The result handle containing inference results.
  • scores [out] Array containing scores for each class.
  • includeAddScore If set to true, retrieves scores including additional scores. if false, retrieves original scores only.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultClass

(CLS) Retrieves the index of the class with the highest final score, including additional score.

int SaigeGetInferenceResultClass (
    SaigeInferenceResult result,
    int * classIndex
) 

Parameters:

  • result The result handle containing inference results.
  • classIndex [out] Index of the class with the highest score.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultClassActivationMap

(CLS) Retrieves the class activation map array.

int SaigeGetInferenceResultClassActivationMap (
    SaigeInferenceResult result,
    unsigned char ** classActivationMap
) 

  • The class activation map is a heatmap that shows which image areas contributed most to a specific classification.
  • Pixel values range from 0 to 255, with higher values indicating a greater contribution to the classification result.
  • Shape is (original image height H, original image width W).
  • Internally, this is represented as a 1D array using row-major order. The value at row i, column j is located at data[W*i + j].

Parameters:

  • result The result handle containing inference results.
  • classActivationMap [out] Array containing the class activation map.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultNumOfDetectedObjects

(DET) Retrieves the number of detected objects from Object Detection.

int SaigeGetInferenceResultNumOfDetectedObjects (
    SaigeInferenceResult result,
    int * numOfObjects
) 

Parameters:

  • result The result handle containing inference results.
  • numOfObjects [out] The number of detected objects.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultDetectedObjects

(DET) Retrieves an array of detected objects from Object Detection.

int SaigeGetInferenceResultDetectedObjects (
    SaigeInferenceResult result,
    SaigeDetectedObject * detectedObjects
) 

Parameters:

  • result The result handle containing inference results.
  • detectedObjects [out] Array of detected objects.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultNumOfSegmentedObjects

Retrieves the number of segmented objects detected by Segmentation (SEG) or Anomaly Detection (IAD).

int SaigeGetInferenceResultNumOfSegmentedObjects (
    SaigeInferenceResult result,
    int * num
) 

Parameters:

  • result The result handle containing inference results.
  • num [out] The number of detected segmented objects.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultSegmentedObjects

Retrieves an array of segmented objects detected by Segmentation (SEG) or Anomaly Detection (IAD).

int SaigeGetInferenceResultSegmentedObjects (
    SaigeInferenceResult result,
    SaigeSegmentedObject * segObjects
) 

Parameters:

  • result The result handle containing inference results.
  • segObjects [out] Array of detected segmented objects.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultMask

Retrieves a Mask array from Segmentation (SEG) or Anomaly Detection (IAD).

int SaigeGetInferenceResultMask (
    SaigeInferenceResult result,
    unsigned char ** mask
) 

  • (IAD) Pixels classified as normal are 0, while those classified as abnormal are 1.
  • (SEG) Pixels classified as OK class are 0, while those classified under other classes are represented by their class index.
  • The array shape is (image height H, image width W).
  • This is a single pointer 1D array with row-major order. For row i and column j, the value is data[W*i + j].

Parameters:

  • result The result handle containing inference results.
  • mask [out] The Mask array.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultScoremapSEG

Retrieves the Scoremap array for Segmentation (SEG).

int SaigeGetInferenceResultScoremapSEG (
    SaigeInferenceResult result,
    unsigned char ** scoremap
) 

  • Scoremap for SEG, which differs from that of IAD.
  • Shape is (number of classes including OK, image height H, image width W).
  • If pixel (i, j) is predicted as class c, then (c, i, j) contains the score as an integer in the range 0–255.
  • This is a single pointer 1D array with row-major order, where the value for class c, row i, column j is data[W*H*c + W*i + j].

Parameters:

  • result The result handle containing inference results.
  • scoremap [out] The Scoremap array.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultIsOversized

Checks if the input image size exceeded the inspection size set in SaigeHandleConfig.

int SaigeGetInferenceResultIsOversized (
    SaigeInferenceResult result,
    bool * isOversized
) 

Parameters:

  • result The result handle containing inference results.
  • isOversized [out] true if the input image size exceeded the inspection size, otherwise false.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultAnomalyScores

Retrieves three types of scores for Anomaly Detection (IAD).

int SaigeGetInferenceResultAnomalyScores (
    SaigeInferenceResult result,
    double * anomalyScore,
    double * minScore,
    double * maxScore
) 

Parameters:

  • result The result handle containing inference results.
  • anomalyScore [out] The representative anomaly score of the image.
  • minScore [out] The minimum pixel-level score in the image.
  • maxScore [out] The maximum pixel-level score in the image.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultIsNg

Retrieves the normal/abnormal classification result for the image in Anomaly Detection (IAD).

int SaigeGetInferenceResultIsNg (
    SaigeInferenceResult result,
    bool * isNg
) 

Parameters:

  • result The result handle containing inference results.
  • isNg [out] true if the image is classified as abnormal, false if normal.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultScoremapIAD

Retrieves the Scoremap array for Anomaly Detection (IAD).

int SaigeGetInferenceResultScoremapIAD (
    SaigeInferenceResult result,
    float ** scoremap
) 

  • Scoremap specific to IAD, different from SEG’s scoremap.
  • Each pixel's score is represented as a non-negative floating-point number.
  • The array shape is (image height H, image width W).
  • This is a single pointer 1D array with row-major order, where the value for row i and column j is data[W*i + j].

Parameters:

  • result The result handle containing inference results.
  • scoremap [out] The Scoremap array.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultHeatmap

SaigeGetInferenceResultHeatmap.

int SaigeGetInferenceResultHeatmap (
    SaigeInferenceResult result,
    float ** heatmap
) 

  • Returns a Heatmap array that is normalized between heatmapColorRangeMin and heatmapColorRangeMax. Each pixel value is represented as a floating-point number within the range 0 to 1.
  • The shape is (image height H, image width W).
  • Implemented as a single pointer 1D array in row-major order. Thus, the value at row i and column j is data[W*i + j].

Parameters:

  • result The result handle containing inference results.
  • heatmap [out] The Heatmap array.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeGetInferenceResultNumOfTextObjects

SaigeGetInferenceResultNumOfTextObjects.

int SaigeGetInferenceResultNumOfTextObjects (
    SaigeInferenceResult result,
    int * num
) 

Retrieves the number of detected text areas in the image analyzed by OCR.

Parameters:

  • result The handle containing inference results.
  • num [out] The number of detected text areas.

Returns:

errorCode Returns 0 on successful execution, or an error code if an error occurs.

SaigeGetInferenceResultTextObjects

SaigeGetInferenceResultTextObjects.

int SaigeGetInferenceResultTextObjects (
    SaigeInferenceResult result,
    SaigeTextObject * textObjects
) 

Retrieves an array of detected text areas (SaigeTextObject) from OCR inference results.

Parameters:

Returns:

errorCode Returns 0 on successful execution, or an error code if an error occurs.

SaigeGetInferenceResultEnhancedImage

SaigeGetInferenceResultEnhancedImage.

int SaigeGetInferenceResultEnhancedImage (
    SaigeInferenceResult result,
    unsigned char ** image
) 

Retrieves the enhanced quality image for Image Enhancement (IEN) results.

Parameters:

  • result The handle containing inference results.
  • image [out] The pointer to store the enhanced image data.

Returns:

errorCode Returns 0 on successful execution, or an error code if an error occurs.

SaigeGetInferenceResultInspectionTime

SaigeGetInferenceResultInspectionTime.

int SaigeGetInferenceResultInspectionTime (
    SaigeInferenceResult result,
    long long * imreadTime,
    long long * inferenceTime,
    long long * postProcessingTime
) 

Retrieves the time spent on various stages of the inference API execution, measured in milliseconds.

Parameters:

  • result The handle containing inference results.
  • imreadTime [out] Time spent reading the image.
  • inferenceTime [out] Time spent on image preprocessing and deep learning inference.
  • postProcessingTime [out] Time spent on post-processing.

Returns:

errorCode Returns 0 on successful execution, or an error code if an error occurs.

See also: SaigeInferenceOption::calcTime

SaigeGetInferenceResultProductId

SaigeGetInferenceResultProductId.

int SaigeGetInferenceResultProductId (
    SaigeInferenceResult result,
    const char ** productId,
    unsigned int * length
) 

Retrieves the Product ID used or generated during inference execution.

Parameters:

  • result The handle containing inference results.
  • productId [out] Pointer to the Product ID string.
  • length [out] Length of the Product ID string.

Returns:

errorCode Returns 0 on successful execution, or an error code if an error occurs.

See also: SaigeInferFromByteArrayWithProductId

SaigeInitializeAlignModule

Function to activate the Saige Alignment function.

int SaigeInitializeAlignModule (
    const int gpuIndex,
    const int sourceWidth,
    const int sourceHeight,
    const int targetWidth,
    const int targetHeight
) 

The Alignment function adjusts the position of the Source image to match the Target image and Crop it. Therefore, the Source image must be larger than the Target image.

Parameters:

  • gpuIndex This function uses the GPU, and is the index of the GPU to use.
  • sourceWidth
  • sourceHeight
  • targetWidth
  • targetHeight

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeFinalizeAlignModule

Function to terminate the Saige Alignment function. Releases the GPU memory used by the function.

int SaigeFinalizeAlignModule () 

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeAlignImageFromByteArray

Function to adjust the position of the Source image to match the Target image.

int SaigeAlignImageFromByteArray (
    const unsigned char * sourceImage,
    const int sourceWidth,
    const int sourceHeight,
    const int sourceChannel,
    const unsigned char * targetImage,
    const int targetWidht,
    const int targetHeight,
    const int targetChannel,
    unsigned int flag,
    unsigned char * croppedSourceImage
) 

The croppedSourceImage should be targetWidth * targetHeight * sourceChannel

Parameters:

  • sourceImage The byte array of the Source image.
  • sourceWidth The width of the Source image.
  • sourceHeight The height of the Source image.
  • sourceChannel The channel of the Source image.
  • targetImage The byte array of the Target image.
  • targetWidht The width of the Target image.
  • targetHeight The height of the Target image.
  • targetChannel The channel of the Target image.
  • flag Whether to detect the edges of the cropped Source image.
  • croppedSourceImage The byte array of the cropped Source image.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeAlignImageFromFile

Not Implemented.

int SaigeAlignImageFromFile (
    const char * sourceImagePath,
    const char * targetImagePath,
    int * cropWidth,
    int * cropHeight,
    int * cropChannel,
    unsigned char * croppedSourceImage
) 

SaigeCreateInferenceHandle

Creates an inference handle.

int SaigeCreateInferenceHandle (
    SaigeInferenceHandle * handle,
    const int projectType,
    const char * modelFilePath,
    const int deviceIndex,
    SaigeHandleConfig * config,
    const unsigned int flags
) 

Ensure that the project type and model file path are correctly set according to the intended task. An error will occur if the specified project type and the project information in the model file do not match.

Parameters:

  • handle [out] The inference handle to use.
  • projectType Integer value representing the project type.
  • modelFilePath Path to the model file.
  • deviceIndex Index of the device to use for inference. Use the GPU index (non-negative integer) for GPU or -1 for CPU.
  • config Structure containing inference handle configuration settings.
  • flags Items to configure.

Returns:

errorCode Returns 0 on success, or an error code if an error occurs.

See also: SaigeInferenceHandle, SaigeHandleConfig, SaigeDestroyInferenceResult

SaigeDestroyInferenceHandle

Destroys an inference handle.

int SaigeDestroyInferenceHandle (
    SaigeInferenceHandle handle
) 

Parameters:

  • handle The inference handle that has completed usage.

Returns:

errorCode Returns 0 on success, or an error code if an error occurs.

See also: SaigeInferenceHandle, SaigeCreateInferenceHandle

SaigeCreateInferenceResult

Creates a result handle.

int SaigeCreateInferenceResult (
    SaigeInferenceResult * result
) 

Parameters:

  • result [out] The result handle to use.

Returns:

errorCode Returns 0 on success, or an error code if an error occurs.

See also: SaigeInferenceResult, SaigeDestroyInferenceResult

SaigeDestroyInferenceResult

Destroys a result handle.

int SaigeDestroyInferenceResult (
    SaigeInferenceResult result
) 

Parameters:

  • result The result handle that has completed usage.

Returns:

errorCode Returns 0 on success, or an error code if an error occurs.

See also: SaigeInferenceResult, SaigeCreateInferenceResult

SaigeGetModelInfo

Retrieves model information from the inference handle.

int SaigeGetModelInfo (
    SaigeInferenceHandle handle,
    SaigeModelInfo * info
) 

Parameters:

  • handle The inference handle from which to retrieve information.
  • info [out] Structure to store model information.

Returns:

errorCode Returns 0 on success, or an error code if an error occurs.

See also: SaigeModelInfo

SaigeSetInferenceOption

Sets inference option values on the inference handle.

int SaigeSetInferenceOption (
    SaigeInferenceHandle handle,
    SaigeInferenceOption * option,
    const unsigned int flags
) 

Parameters:

  • handle The inference handle to use.
  • option The structure containing the option values to set.
  • flags The specific option items to set.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SaigeInferenceOption

SaigeGetInferenceOption

Retrieves inference option values from the inference handle.

int SaigeGetInferenceOption (
    SaigeInferenceHandle handle,
    SaigeInferenceOption * option
) 

Parameters:

  • handle The inference handle from which to retrieve option values.
  • option [out] The structure to hold the retrieved option values.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SaigeInferenceOption

SaigeStrError

SaigeStrError.

const char * SaigeStrError (
    const int errnum
) 

Retrieves the message corresponding to a given SaigeVision error code.

Parameters:

  • errnum The error code.

Returns:

errorMessage Returns the error message associated with the error code.

SaigeGetModuleVersion

SaigeGetModuleVersion.

const char * SaigeGetModuleVersion () 

Retrieves the version of the modules used by SaigeVision.

Returns:

Format: (feature)version; (feature)version; ...

SaigeSetHandleMetadata

SaigeSetHandleMetadata.

int SaigeSetHandleMetadata (
    SaigeInferenceHandle handle,
    const char * key,
    const char * value
) 

Sets metadata for the image collected during data collection. Once set, this metadata is retained.

Parameters:

  • handle The inference handle.
  • key The metadata key. Only keys recognized by the monitoring system will be reflected.
  • value The metadata value, interpreted according to the monitoring system's defined types.

SaigeSetInferenceMetadata

SaigeSetInferenceMetadata.

int SaigeSetInferenceMetadata (
    SaigeInferenceResult result,
    const char * key,
    const char * value
) 

Sets one-time metadata for the image collected during data collection.

Parameters:

  • result The inference result handle.
  • key The metadata key. Only keys recognized by the monitoring system will be reflected.
  • value The metadata value, interpreted according to the monitoring system's defined types.

SaigeSetResultMetadata

SaigeSetResultMetadata.

int SaigeSetResultMetadata (
    SaigeInferenceResult result,
    const char * key,
    const char * value
) 

Sets one-time test result metadata for the collected image during data collection.

Parameters:

  • result The inference result handle.
  • key The metadata key. Only keys recognized by the monitoring system will be reflected.
  • value The metadata value, interpreted according to the monitoring system's defined types.

Macro Definition Documentation

SAIGE_WRITE_ON_MODEL_FILE

(Common) When setting inference option values using SaigeSetInferenceOption, this flag saves the option values to the model file as well.

#define SAIGE_WRITE_ON_MODEL_FILE 0x01

SAIGE_SET_CALC_TIME

(Common) Flag to set the calcTime option.

#define SAIGE_SET_CALC_TIME 0x2

See also: SaigeInferenceOption::calcTime

SAIGE_SET_OVERSIZED_IMAGE_HANDLING

(SEG, OCR, IEN) Flag to set the oversizedImageHandling option.

#define SAIGE_SET_OVERSIZED_IMAGE_HANDLING 0x4

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_SET_ADDITIONAL_SCORES

(CLS) Flag to set the additionalScores option.

#define SAIGE_SET_ADDITIONAL_SCORES 0x8

See also: SaigeInferenceOption::additionalScores

SAIGE_SET_CALC_CLASS_ACTIVATION_MAP

(CLS) Flag to set the calcClassActivationMap option.

#define SAIGE_SET_CALC_CLASS_ACTIVATION_MAP 0x10

See also: SaigeInferenceOption::calcClassActivationMap

SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS

(DET) Flag to set the maxNumOfDetectedObjects option.

#define SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS 0x20

SAIGE_SET_CALC_SCOREMAP

(SEG) Flag to set the calcScoremap option.

#define SAIGE_SET_CALC_SCOREMAP 0x40

See also: SaigeInferenceOption::calcScoremap

SAIGE_SET_CALC_OBJECT

(SEG, IAD) Flag to set the calcObject option.

#define SAIGE_SET_CALC_OBJECT 0x80

See also: SaigeInferenceOption::calcObject

SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD

(SEG, IAD) Flag to set the calcObjectAreaAndApplyThreshold option.

#define SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD 0x100

See also: SaigeInferenceOption::calcObjectAreaAndApplyThreshold

SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD

(SEG, IAD) Flag to set the calcObjectScoreAndApplyThreshold option.

#define SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD 0x200

See also: SaigeInferenceOption::calcObjectScoreAndApplyThreshold

SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD

(SEG, IAD) Flag to set objectBoundaryThresholdPerClass in SEG and objectBoundaryThreshold in IAD.

#define SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD 0x400

See also: SaigeInferenceOption::objectBoundaryThresholdPerClass, SaigeInferenceOption::objectBoundaryThreshold

SAIGE_SET_OBJECT_AREA_THRESHOLD

(SEG, DET, IAD) Flag to set objectAreaThresholdPerClass in SEG and DET, and objectAreaThreshold in IAD.

#define SAIGE_SET_OBJECT_AREA_THRESHOLD 0x800

See also: SaigeInferenceOption::objectAreaThresholdPerClass, SaigeInferenceOption::objectAreaThreshold

SAIGE_SET_OBJECT_SCORE_THRESHOLD

(SEG, DET, IAD) Flag to set objectScoreThresholdPerClass in SEG and DET, and objectScoreThreshold in IAD.

#define SAIGE_SET_OBJECT_SCORE_THRESHOLD 0x1000

See also: SaigeInferenceOption::objectScoreThresholdPerClass, SaigeInferenceOption::objectScoreThreshold

SAIGE_SET_CALC_MASK

(SEG, IAD) Flag to set the calcMask option.

#define SAIGE_SET_CALC_MASK 0x2000

See also: SaigeInferenceOption::calcMask

SAIGE_SET_CALC_HEATMAP

(IAD) Flag to set the calcHeatmap option.

#define SAIGE_SET_CALC_HEATMAP 0x4000

See also: SaigeInferenceOption::calcHeatmap

SAIGE_SET_ANOMALY_SCORE_THRESHOLD

(IAD) Flag to set the anomalyScoreThreshold option.

#define SAIGE_SET_ANOMALY_SCORE_THRESHOLD 0x8000

See also: SaigeInferenceOption::anomalyScoreThreshold

SAIGE_SET_HEATMAP_COLOR_RANGE

(IAD) Flag to set heatmapColorRangeMin and heatmapColorRangeMax options.

#define SAIGE_SET_HEATMAP_COLOR_RANGE 0x10000

See also: SaigeInferenceOption::heatmapColorRangeMin, SaigeInferenceOption::heatmapColorRangeMax

SAIGE_SET_POLYGON_SCORE_THRESHOLD

(OCR) Flag to set the polygonScoreThreshold option.

#define SAIGE_SET_POLYGON_SCORE_THRESHOLD 0x20000

See also: SaigeInferenceOption::polygonScoreThreshold

SAIGE_SET_TEXT_SIZE_RANGE

(OCR) Flag to set textSizeRangeMin and textSizeRangeMax options.

#define SAIGE_SET_TEXT_SIZE_RANGE 0x40000

See also: SaigeInferenceOption::textSizeRangeMin, SaigeInferenceOption::textSizeRangeMax

SAIGE_SET_NUM_OF_TEXT_OBJECTS

(OCR) Flag to set the maxNumOfTextObjects option.

#define SAIGE_SET_NUM_OF_TEXT_OBJECTS 0x80000

See also: SaigeInferenceOption::maxNumOfTextObjects

SAIGE_SET_TEXT_SCORE_THRESHOLD

(OCR) Flag to set the textScoreThreshold option.

#define SAIGE_SET_TEXT_SCORE_THRESHOLD 0x100000

See also: SaigeInferenceOption::textScoreThreshold

SAIGE_SET_TEXT_FORMATTING

(OCR) Flag to set the textFormatting option.

#define SAIGE_SET_TEXT_FORMATTING 0x200000

SAIGE_IMAGE_COLOR

Flag indicating color image data.

#define SAIGE_IMAGE_COLOR 0x01

SAIGE_IMAGE_16BIT

Flag indicating 16-bit per channel image data.

#define SAIGE_IMAGE_16BIT 0x02

SAIGE_IMAGE_ALPHA

Flag indicating data with an alpha channel.

#define SAIGE_IMAGE_ALPHA 0x04

SAIGE_IMAGE_BGR

Flag indicating the color channel order is Blue, Green, Red.

#define SAIGE_IMAGE_BGR 0x08

SAIGE_IMAGE_8BIT_GRAY

Macro indicating 8-bit grayscale image data. It is a single-channel array with a size of Width x Height.

#define SAIGE_IMAGE_8BIT_GRAY 0x00

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_24BIT_RGB

Macro indicating 24-bit RGB color image data. It is an array of size Width x Height x Channels (3) with channels ordered as R, G, B.

#define SAIGE_IMAGE_24BIT_RGB ( SAIGE_IMAGE_COLOR )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_24BIT_BGR

Macro indicating 24-bit BGR color image data. It is an array of size Width x Height x Channels (3) with channels ordered as B, G, R.

#define SAIGE_IMAGE_24BIT_BGR ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_BGR )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_32BIT_RGBA

Macro indicating 32-bit RGBA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as R, G, B, A.

#define SAIGE_IMAGE_32BIT_RGBA ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_ALPHA )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_32BIT_BGRA

Macro indicating 32-bit BGRA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as B, G, R, A.

#define SAIGE_IMAGE_32BIT_BGRA ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_ALPHA | SAIGE_IMAGE_BGR )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_16BIT_GRAY

Macro indicating 16-bit grayscale image data. It is a single-channel array of size Width x Height, with each pixel represented as an unsigned short.

#define SAIGE_IMAGE_16BIT_GRAY ( SAIGE_IMAGE_16BIT )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_48BIT_RGB

Macro indicating 48-bit RGB color image data. It is an array of size Width x Height x Channels (3) with channels ordered as R, G, B, and each pixel represented as an unsigned short.

#define SAIGE_IMAGE_48BIT_RGB ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_48BIT_BGR

Macro indicating 48-bit BGR color image data. It is an array of size Width x Height x Channels (3) with channels ordered as B, G, R, and each pixel represented as an unsigned short.

#define SAIGE_IMAGE_48BIT_BGR ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_BGR )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_64BIT_RGBA

Macro indicating 64-bit RGBA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as R, G, B, A, and each pixel represented as an unsigned short.

#define SAIGE_IMAGE_64BIT_RGBA ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_ALPHA )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGE_IMAGE_64BIT_BGRA

Macro indicating 64-bit BGRA color image data. It is an array of size Width x Height x Channels (4) with channels ordered as B, G, R, A, and each pixel represented as an unsigned short.

#define SAIGE_IMAGE_64BIT_BGRA ( SAIGE_IMAGE_COLOR | SAIGE_IMAGE_16BIT | SAIGE_IMAGE_ALPHA | SAIGE_IMAGE_BGR )

See also: SaigeInferFromByteArray, SaigeInferFromMultipleByteArray

SAIGEVISION_RUNTIME_VERSION_MAJOR

Major version of the SAIGE VISION Runtime C/C++ SDK.

#define SAIGEVISION_RUNTIME_VERSION_MAJOR 2

SAIGEVISION_RUNTIME_VERSION_MINOR

Minor version of the SAIGE VISION Runtime C/C++ SDK.

#define SAIGEVISION_RUNTIME_VERSION_MINOR 12

SAIGEVISION_RUNTIME_VERSION_PATCH

Patch version of the SAIGE VISION Runtime C/C++ SDK.

#define SAIGEVISION_RUNTIME_VERSION_PATCH 3

SV_STR

#define SV_STR (
    x
) #x

SV_VER

#define SV_VER (
    M,
    m,
    p
) SV_STR(M) "." SV_STR(m) "." SV_STR(p)

SAIGEVISION_RUNTIME_VERSION

The version of the SaigeVision Runtime C/C++ SDK (deprecated). Please use MAJOR, MINOR, and PATCH versions instead.

#define SAIGEVISION_RUNTIME_VERSION "2.12.3"

SAIGE_SET_BATCH_SIZE

(CLS, DET, SEG, IAD) Flag to set batch size for inference. Used when batch inference API is applied.

#define SAIGE_SET_BATCH_SIZE 0x01

SAIGE_SET_INSPECTION_SIZE

(SEG, OCR) Flag to set the width and height of images for inference.

#define SAIGE_SET_INSPECTION_SIZE 0x02

SAIGE_OPTIMIZE_HANDLE

(Common) Flag to apply optimization to the inference handle. Applying inference optimization reduces inference time but may slightly alter results.

#define SAIGE_OPTIMIZE_HANDLE 0x04

SAIGE_DO_NOT_INSPECT

(SEG) An option for oversizedImageHandling, where inference is not performed and an error is raised.

#define SAIGE_DO_NOT_INSPECT "do_not_inspect"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_DO_NOT_ENHANCE

(IEN) An option for oversizedImageHandling, where inference is not performed and an error is raised.

#define SAIGE_DO_NOT_ENHANCE "do_not_enhance"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_RESIZE_TO_FIT

(SEG) An option for oversizedImageHandling. When set, the image is resized to fit within the inspection size, maintaining its aspect ratio, and then inference is performed.

#define SAIGE_RESIZE_TO_FIT "resize_to_fit"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_CROP_INTO_TILES

(SEG, IEN) An option for oversizedImageHandling. When set, the image is cropped into tiles based on the inspection size. Inference is performed on each tile, and results are combined.

#define SAIGE_CROP_INTO_TILES "crop_into_tiles"

See also: SaigeInferenceOption::oversizedImageHandling