SaigeVision C/C++ 1.5.0
SaigeVision API document for C/C++
 
Loading...
Searching...
No Matches
Detection's class information

Functions

eErrorType SR_GetDetTestNumberOfClasses (DetTestHandle handle, int *numberOfClasses)
 Get the number of classes. More...
 
eErrorType SR_GetDetTestMaxStrLenOfClassName (DetTestHandle handle, int *len)
 Get a maximum length of class name. More...
 
eErrorType SR_GetDetTestOneClassNameWithWideChar (DetTestHandle handle, const int classIdx, wchar_t *className)
 Get a wide char name of certain class by given index. More...
 
eErrorType SR_GetDetTestOneClassNameWithMultiByteChar (DetTestHandle handle, const int classIdx, char *className)
 Get a multi byte char name of certain class by given index. More...
 
eErrorType SR_GetDetTestOneClassColor (DetTestHandle handle, const int classIdx, int *classColor)
 Get a color of certain class by given index. More...
 
eErrorType SR_GetDetTrainedVersion (DetTestHandle handle, int *trainedVersionMajor, int *trainedVersionMinor, int *trainedVersionPatch)
 Get a trained version of model file, -1 means before v1.4.8. More...
 

Detailed Description

Get Detection's Class information.

int numOfClasses = 0;
// Get number of classes
eErrorType error = SR_GetDetTestNumberOfClasses(handle, &numOfClasses);
int lengthOfClassName = 0;
error = SR_GetDetTestMaxStrLenOfClassName(handle, &lengthOfClassName);
for (int i = 0; i < numOfClasses; i++){
// Get class name by wchar_t
wchar_t* w_name = new wchar_t[lengthOfClassName];
error = SR_GetDetTestOneClassNameWithWideChar(handle, i, w_name);
delete[] w_name;
// Get class name by char
char* name = new char[lengthOfClassName];
delete[] name;
// Get class color
int class_color = 0;
error = SR_GetDetTestOneClassColor(handle, i, &class_color);
unsigned char R = (class_color >> 16) & 0xFF;
unsigned char G = (class_color >> 8) & 0xFF;
unsigned char B = (class_color) & 0xFF;
}
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:30
eErrorType SR_GetDetTestOneClassNameWithMultiByteChar(DetTestHandle handle, const int classIdx, char *className)
Get a multi byte char name of certain class by given index.
eErrorType SR_GetDetTestMaxStrLenOfClassName(DetTestHandle handle, int *len)
Get a maximum length of class name.
eErrorType SR_GetDetTestNumberOfClasses(DetTestHandle handle, int *numberOfClasses)
Get the number of classes.
eErrorType SR_GetDetTestOneClassColor(DetTestHandle handle, const int classIdx, int *classColor)
Get a color of certain class by given index.
eErrorType SR_GetDetTestOneClassNameWithWideChar(DetTestHandle handle, const int classIdx, wchar_t *className)
Get a wide char name of certain class by given index.

Function Documentation

◆ SR_GetDetTestMaxStrLenOfClassName()

eErrorType SR_GetDetTestMaxStrLenOfClassName ( DetTestHandle  handle,
int *  len 
)

Get a maximum length of class name.

Parameters
handledetection file handler
[out]lenmaximum length of class name
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTestNumberOfClasses()

eErrorType SR_GetDetTestNumberOfClasses ( DetTestHandle  handle,
int *  numberOfClasses 
)

Get the number of classes.

Parameters
handledetection file handler
[out]numberOfClasses
Examples
ExampleDetRuntime.cpp, and ExampleDetRuntimeSimple.cpp.

◆ SR_GetDetTestOneClassColor()

eErrorType SR_GetDetTestOneClassColor ( DetTestHandle  handle,
const int  classIdx,
int *  classColor 
)

Get a color of certain class by given index.

Parameters
handledetection file handler
classIdx
[out]classColor
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTestOneClassNameWithMultiByteChar()

eErrorType SR_GetDetTestOneClassNameWithMultiByteChar ( DetTestHandle  handle,
const int  classIdx,
char *  className 
)

Get a multi byte char name of certain class by given index.

Parameters
handledetection file handler
classIdx
[out]className
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTestOneClassNameWithWideChar()

eErrorType SR_GetDetTestOneClassNameWithWideChar ( DetTestHandle  handle,
const int  classIdx,
wchar_t *  className 
)

Get a wide char name of certain class by given index.

Parameters
handledetection file handler
classIdx
[out]className
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTrainedVersion()

eErrorType SR_GetDetTrainedVersion ( DetTestHandle  handle,
int *  trainedVersionMajor,
int *  trainedVersionMinor,
int *  trainedVersionPatch 
)

Get a trained version of model file, -1 means before v1.4.8.

Parameters
handledetection file handler
[out]trainedversion major
[out]trainedversion minor
[out]trainedversion patch level