SaigeVision C/C++  1.4.7
SaigeVision API document for C/C++
Segmentation's class information

Functions

eErrorType SR_GetSegTestNumberOfClassesWithoutBG (SegTestHandle handle, int *numberOfClasses)
 Get the number of classes. More...
 
eErrorType SR_GetSegTestMaxStrLenOfClassName (SegTestHandle handle, int *len)
 Get a maximum length of class name. More...
 
eErrorType SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG (SegTestHandle handle, const int classIdx, wchar_t *className)
 Get a wide char name of certain class by given index. More...
 
eErrorType SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG (SegTestHandle handle, const int classIdx, char *className)
 Get a multi byte char name of certain class by given index. More...
 
eErrorType SR_GetSegTestOneClassColorByIdxWithoutBG (SegTestHandle handle, const int classIdx, int *classColor)
 Get a color of certain class by given index. More...
 

Detailed Description

Get Segmentation's Class information.

int numOfClasses = 0;
// Get number of classes
eErrorType error = SR_GetSegTestNumberOfClassesWithoutBG(handle, &numOfClasses);
int lengthOfClassName = 0;
error = SR_GetSegTestMaxStrLenOfClassName(handle, &lengthOfClassName);
for (int i = 0; i < numOfClasses; i++){
// Get class name by wchar_t
wchar_t* w_name = new wchar_t[lengthOfClassName];
delete[] w_name;
// Get class name by char
char* name = new char[lengthOfClassName];
delete[] name;
// Get class color
int class_color = 0;
error = SR_GetSegTestOneClassColorByIdxWithoutBG(handle, i, &class_color);
unsigned char R = (class_color >> 16) & 0xFF;
unsigned char G = (class_color >> 8) & 0xFF;
unsigned char B = (class_color) & 0xFF;
}

Function Documentation

◆ SR_GetSegTestMaxStrLenOfClassName()

eErrorType SR_GetSegTestMaxStrLenOfClassName ( SegTestHandle  handle,
int *  len 
)

Get a maximum length of class name.

Parameters
handlesegmentation file handler
[out]lenmaximum length of class name
Examples
ExampleSegPostProcess.cpp, ExampleSegRuntime.cpp, ExampleSegRuntimeBatchInspection.cpp, ExampleSegRuntimeMultiPage.cpp, and ExampleSuperResolution+SegRuntime.cpp.

◆ SR_GetSegTestNumberOfClassesWithoutBG()

eErrorType SR_GetSegTestNumberOfClassesWithoutBG ( SegTestHandle  handle,
int *  numberOfClasses 
)

◆ SR_GetSegTestOneClassColorByIdxWithoutBG()

eErrorType SR_GetSegTestOneClassColorByIdxWithoutBG ( SegTestHandle  handle,
const int  classIdx,
int *  classColor 
)

Get a color of certain class by given index.

Parameters
handlesegmentation file handler
classIdx
[out]classColor
Examples
ExampleSegPostProcess.cpp, ExampleSegRuntime.cpp, ExampleSegRuntimeBatchInspection.cpp, ExampleSegRuntimeMultiPage.cpp, and ExampleSuperResolution+SegRuntime.cpp.

◆ SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG()

eErrorType SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG ( SegTestHandle  handle,
const int  classIdx,
char *  className 
)

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

Parameters
handlesegmentation file handler
classIdx
[out]className
Examples
ExampleSegPostProcess.cpp, ExampleSegRuntime.cpp, ExampleSegRuntimeBatchInspection.cpp, ExampleSegRuntimeMultiPage.cpp, and ExampleSuperResolution+SegRuntime.cpp.

◆ SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG()

eErrorType SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG ( SegTestHandle  handle,
const int  classIdx,
wchar_t *  className 
)

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

Parameters
handlesegmentation file handler
classIdx
[out]className
Examples
ExampleSegPostProcess.cpp, ExampleSegRuntime.cpp, ExampleSegRuntimeBatchInspection.cpp, ExampleSegRuntimeMultiPage.cpp, and ExampleSuperResolution+SegRuntime.cpp.
SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG
eErrorType SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG(SegTestHandle handle, const int classIdx, char *className)
Get a multi byte char name of certain class by given index.
SR_GetSegTestOneClassColorByIdxWithoutBG
eErrorType SR_GetSegTestOneClassColorByIdxWithoutBG(SegTestHandle handle, const int classIdx, int *classColor)
Get a color of certain class by given index.
eErrorType
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:25
SR_GetSegTestMaxStrLenOfClassName
eErrorType SR_GetSegTestMaxStrLenOfClassName(SegTestHandle handle, int *len)
Get a maximum length of class name.
SR_GetSegTestNumberOfClassesWithoutBG
eErrorType SR_GetSegTestNumberOfClassesWithoutBG(SegTestHandle handle, int *numberOfClasses)
Get the number of classes.
SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG
eErrorType SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG(SegTestHandle handle, const int classIdx, wchar_t *className)
Get a wide char name of certain class by given index.