SaigeVision C/C++  1.4.7
SaigeVision API document for C/C++

Functions

eErrorType SR_GetDetTestResultNumberOfBoxes (DetTestResult detTestResult, int *numDetectedBoxes)
 Get the number of detected boxes. More...
 
eErrorType SR_GetDetTestResultDetectedBoxes (DetTestResult detTestResult, const int numDetectedBoxes, SR_DetectedBox *detectedBoxes)
 Get SR_DetectedBox. More...
 
eErrorType SR_GetDetTestResultAllBoxesInfo (DetTestResult detTestResult, const int numDetectedBoxes, int *classIndices, float *scores, int *coordinatesXYXY)
 Get all the detected boxes. More...
 
eErrorType SR_GetDetTestResultOneBoxInfo (DetTestResult detTestResult, const int boxIndex, int *classIndex, float *score, int *coordinateXYXY)
 Get a single detected box. More...
 
eErrorType SR_GetDetTestResultNumberOfBoxesBeforeFiltered (DetTestResult detTestResult, int numClasses, int *numRawBoxes)
 Get the number of raw detected boxes before filtered by Max number of boxes for each class. More...
 
eErrorType SR_GetDetTestInspectionTime (DetTestResult detTestResult, long *inspectionTimeInLong)
 Get the inspection time. More...
 
eErrorType SR_GetDetTestInspectionTimeInDouble (DetTestResult detTestResult, double *inspectionTimeInDouble)
 Get the inspection time. More...
 
eErrorType SR_GetDetTestLoadImageTime (DetTestResult detTestResult, long *imageLoadingTimeInLong)
 Get the image loading time. More...
 
eErrorType SR_GetDetTestLoadImageTimeInDouble (DetTestResult detTestResult, double *imageLoadingTimeInDouble)
 Get the image loading time. More...
 

Detailed Description

Detection's inspection result is a list of detected boxes. Information contained in detected boxes are as follows:

// Get the number of detected boxes
int numBoxes = 0;
eErrorType error = SR_GetDetTestResultNumberOfBoxes(testResult, &numBoxes);
int* classIndices = new int[numBoxes];
float* scores = new float[numBoxes];
int* coordinateXYXY = new int[numBoxes*4];
// Get box data
error = SR_GetDetTestResultAllBoxesInfo(testResult, numBoxes, classIndices, scores, coordinateXYXY);
// check i-th box info.
for (int i = 0; i < numBoxes; i++){
int classIndex = classIndices[i];
float score = scores[i];
int x_tl = coordinateXYXY[4 * i];
int y_tl = coordinateXYXY[4 * i + 1];
int x_br = coordinateXYXY[4 * i + 2];
int y_br = coordinateXYXY[4 * i + 3];
int width = x_br - x_tl;
int height = y_br - y_tl;
}
delete[] classIndices;
delete[] scores;
delete[] coordinateXYXY;

Function Documentation

◆ SR_GetDetTestInspectionTime()

eErrorType SR_GetDetTestInspectionTime ( DetTestResult  detTestResult,
long *  inspectionTimeInLong 
)

Get the inspection time.

Parameters
detTestResult
[out]inspectionTimeInLong
Examples
ExampleDetRuntime.cpp, and ExampleDetRuntimeSimple.cpp.

◆ SR_GetDetTestInspectionTimeInDouble()

eErrorType SR_GetDetTestInspectionTimeInDouble ( DetTestResult  detTestResult,
double *  inspectionTimeInDouble 
)

Get the inspection time.

Parameters
detTestResult
[out]inspectionTimeInDouble

◆ SR_GetDetTestLoadImageTime()

eErrorType SR_GetDetTestLoadImageTime ( DetTestResult  detTestResult,
long *  imageLoadingTimeInLong 
)

Get the image loading time.

Parameters
detTestResult
[out]imageLoadingTimeInLong
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTestLoadImageTimeInDouble()

eErrorType SR_GetDetTestLoadImageTimeInDouble ( DetTestResult  detTestResult,
double *  imageLoadingTimeInDouble 
)

Get the image loading time.

Parameters
detTestResult
[out]imageLoadingTimeInDouble

◆ SR_GetDetTestResultAllBoxesInfo()

eErrorType SR_GetDetTestResultAllBoxesInfo ( DetTestResult  detTestResult,
const int  numDetectedBoxes,
int *  classIndices,
float *  scores,
int *  coordinatesXYXY 
)

Get all the detected boxes.

It is recommended to use SR_GetDetTestResultDetectedBoxes instead.

Parameters
detTestResult
numDetectedBoxes
[out]classIndicesmemory address receiving class indices. The length of memory must be equal to numDetectedBoxes
[out]scoresmemory address receiving scores. The length of memory must be equal to numDetectedBoxes
[out]coordinatesXYXYmemory address receiving coordinates. The length of memory must be equal to 4 x numDetectedBoxes

◆ SR_GetDetTestResultDetectedBoxes()

eErrorType SR_GetDetTestResultDetectedBoxes ( DetTestResult  detTestResult,
const int  numDetectedBoxes,
SR_DetectedBox *  detectedBoxes 
)

Get SR_DetectedBox.

Parameters
detTestResult
numDetectedBoxes
[out]detectedBoxesmemory address receiving SR_DetectedBox. The length of memory must be equal to numDetectedBoxes
Examples
ExampleDetRuntime.cpp, and ExampleDetRuntimeSimple.cpp.

◆ SR_GetDetTestResultNumberOfBoxes()

eErrorType SR_GetDetTestResultNumberOfBoxes ( DetTestResult  detTestResult,
int *  numDetectedBoxes 
)

Get the number of detected boxes.

Parameters
detTestResult
[out]numDetectedBoxes
Examples
ExampleDetRuntime.cpp, and ExampleDetRuntimeSimple.cpp.

◆ SR_GetDetTestResultNumberOfBoxesBeforeFiltered()

eErrorType SR_GetDetTestResultNumberOfBoxesBeforeFiltered ( DetTestResult  detTestResult,
int  numClasses,
int *  numRawBoxes 
)

Get the number of raw detected boxes before filtered by Max number of boxes for each class.

Parameters
detTestResult
numClasses
[out]numRawBoxesmemory address receiving number of raw detected boxes. The length of memory must be equal to numClasses.
Examples
ExampleDetRuntime.cpp.

◆ SR_GetDetTestResultOneBoxInfo()

eErrorType SR_GetDetTestResultOneBoxInfo ( DetTestResult  detTestResult,
const int  boxIndex,
int *  classIndex,
float *  score,
int *  coordinateXYXY 
)

Get a single detected box.

It is recommended to use SR_GetDetTestResultDetectedBoxes instead.

Parameters
detTestResult
boxIndex
[out]classIndexmemory address receiving a class index.
[out]scorememory address receiving a score.
[out]coordinateXYXYmemory address receiving coordinates. The length of memory must be equal to 4.
SR_GetDetTestResultNumberOfBoxes
eErrorType SR_GetDetTestResultNumberOfBoxes(DetTestResult detTestResult, int *numDetectedBoxes)
Get the number of detected boxes.
eErrorType
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:25
SR_GetDetTestResultAllBoxesInfo
eErrorType SR_GetDetTestResultAllBoxesInfo(DetTestResult detTestResult, const int numDetectedBoxes, int *classIndices, float *scores, int *coordinatesXYXY)
Get all the detected boxes.