SaigeVision C/C++ 1.5.0
SaigeVision API document for C/C++
 
Loading...
Searching...
No Matches
DetectorTestDLL.h
Go to the documentation of this file.
1
4#pragma once
5
6#ifdef __linux__
7 #define DLLTYPE_DETECTION
8#elif _WIN32
9 #ifdef DLLEXPORT_DETECTION
10 #define DLLTYPE_DETECTION extern "C" __declspec(dllexport)
11 #else
12 #define DLLTYPE_DETECTION extern "C" __declspec(dllimport)
13 #endif
14#endif
15
16#include "CommonHeaderDLL.h"
17
52typedef void* DetTestHandle;
67typedef void* DetTestResult;
68
75DLLTYPE_DETECTION DetTestHandle SR_CreateDetTestHandle(const char* filePath);
76
83DLLTYPE_DETECTION eErrorType SR_CreateDetTestHandle_ErrorType(DetTestHandle* detTestHandle, const char* filePath);
84
91DLLTYPE_DETECTION DetTestHandle SR_CreateDetTestHandleByWideCharPath(const wchar_t* filePath);
92
99DLLTYPE_DETECTION eErrorType SR_CreateDetTestHandleByWideCharPath_ErrorType(DetTestHandle* detTestHandle, const wchar_t* filePath);
100
105
120 int GPUNumber);
121
124 eAlgorithmType* algoType);
125
128
164 int* numberOfClasses);
165
171 int* len);
172
179 const int classIdx,
180 wchar_t* className);
181
188 const int classIdx,
189 char* className);
190
197 const int classIdx,
198 int* classColor);
199
207 int* trainedVersionMajor,
208 int* trainedVersionMinor,
209 int* trainedVersionPatch);
232 int* maxNumBoxes);
233
241 int numOfClasses,
242 int* maxNumBoxes,
243 bool writeOnModelFile = true);
267 const int classIdx,
268 int* scoreThreshold);
269
276 int* scoreThreshold);
277
286 int numOfClasses,
287 int* scoreThreshold,
288 bool writeOnModelFile = true);
308 int* areaThreshold);
309
317 int* areaThreshold,
318 bool writeOnModelFile = true);
329 int* numHorizontalCroppedPatches,
330 int* numVerticalCroppedPatches);
331
373 bool isToStoreCroppedImage,
374 int defaultCropSize = -1,
376 float margin = 0.00,
377 bool writeOnModelFile = true);
378
379
394
400DLLTYPE_DETECTION eErrorType SR_GetDetFilterObjSimpleParameters(DetTestHandle handle, float* simpleParams);
401
408DLLTYPE_DETECTION eErrorType SR_SetDetFilterObjByRegion(DetTestHandle handle, eFilterObjByRegionType filterObjType, bool writeOnModelFile = true);
409
416DLLTYPE_DETECTION eErrorType SR_SetDetFilterObjSimpleParameters(DetTestHandle handle, float* simpleParams, bool writeOnModelFile = true);
417
434 float* forwardTimeLimit); /* milliseconds */
435
442 bool* bIsToUseForwardTimeLimit);
443
453 float* forwardTimeLimit, /* milliseconds */
454 bool* bIsToUseForwardTimeLimit);
455
463 float forwardTimeLimit, /* milliseconds */
464 bool writeOnModelFile = true);
465
473 bool bIsToUseForwardTimeLimit,
474 bool writeOnModelFile = true);
475
486 float forwardTimeLimit, /* milliseconds */
487 bool bIsToUseForwardTimeLimit,
488 bool writeOnModelFile = true);
515 const char* imagePath,
516 DetTestResult detTestResult);
517
524 const wchar_t* imagePath,
525 DetTestResult detTestResult);
526
535 const unsigned char* imageData,
536 const int height,
537 const int width,
538 DetTestResult detTestResult);
539
548 const unsigned char* imageData,
549 const int height,
550 const int width,
551 DetTestResult detTestResult);
552
561 const unsigned int* imageData,
562 const int height,
563 const int width,
564 DetTestResult detTestResult);
614 int* numDetectedBoxes);
615
622 const int numDetectedBoxes,
623 SR_DetectedBox* detectedBoxes);
624
625
636 const int numDetectedBoxes,
637 int* classIndices,
638 float* scores,
639 int* coordinatesXYXY);
640
651 const int boxIndex,
652 int* classIndex,
653 float* score,
654 int* coordinateXYXY);
655
662 int numClasses,
663 int* numRawBoxes);
664
670 long* inspectionTimeInLong); /* milliseconds */
676 double* inspectionTimeInDouble); /* milliseconds */
677
683 long* imageLoadingTimeInLong); /* milliseconds */
689 double* imageLoadingTimeInDouble); /* milliseconds */
701
703DLLTYPE_DETECTION eErrorType SR_DeleteDetTestResult(DetTestResult detTestResult);
715
718
719
720#ifdef SR_USE_DEPRECATED_FUNCTIONS
721/***********************************************************
722* These functions will be deprecated in version 2.0.0
723***********************************************************/
724/* This function behaves identically with SR_GetDetTestOneClassNameWithMultiByteChar*/
725DLLTYPE_DETECTION eErrorType SR_GetDetTestOneClassNameWith1byteCharacter(DetTestHandle handle, const int index, char* className);
726
727/* This function behaves identically with SR_GetDetTestOneClassNameWithWideChar*/
728DLLTYPE_DETECTION eErrorType SR_GetDetTestOneClassName(DetTestHandle handle, const int index, wchar_t* className);
729
730/* This function behaves identically with SR_GetDetTestMinScoreThresholdForSingleClass*/
731DLLTYPE_DETECTION eErrorType SR_GetDetTestOneThresholdScore(DetTestHandle handle, const int index, int* scoreThreshold);
732
733/* This function behaves identically with SR_GetDetTestMinScoreThreshold*/
734DLLTYPE_DETECTION eErrorType SR_GetDetTestThresholdScore(DetTestHandle handle, int* scoreThreshold);
735
736/* This function behaves identically with SR_SetDetTestMinScoreThreshold*/
737DLLTYPE_DETECTION eErrorType SR_SetDetTestThresholdScore(DetTestHandle handle, int numberOfClasses, int* scoreThreshold);
738#endif
739
740/* For Developer - Set score and area threshold as zeros, filter object as none */
741DLLTYPE_DETECTION eErrorType SR_SetDetTestOptionsForDeveloper(DetTestHandle handle);
Header file for Commonly used variables.
eAlgorithmType
Enumerator indicating a type of model.
Definition: CommonHeaderDLL.h:56
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:30
eFilterObjByRegionType
Enumerator indicating a filtering object by region type in detection and segmentation.
Definition: CommonHeaderDLL.h:115
eModeOfCropLargeObjects
Enumerator indicating a mode of cropping large objects in segmentation.
Definition: CommonHeaderDLL.h:106
@ SR_CROP_BY_OBJECTSIZE_NOT_SQUARE
Definition: CommonHeaderDLL.h:110
eErrorType SR_GetDetTestCropSize(DetTestHandle handle, int *numHorizontalCroppedPatches, int *numVerticalCroppedPatches)
Get the number of horizontally and vertically cropped patches.
eErrorType SR_PrintDetTestParameters(DetTestHandle handle)
Print a model parameters (Detection's class information, inspection options...)
eErrorType SR_GetDetTestAlgorithmType(DetTestHandle handle, eAlgorithmType *algoType)
Get a algorithm type(ex, standard, deep) of a detection model.
eErrorType SR_GetDetTestPixelSizeThreshold(DetTestHandle handle, int *areaThreshold)
Get Detection's area threshold for each class.
eErrorType SR_SetDetTestPixelSizeThreshold(DetTestHandle handle, int *areaThreshold, bool writeOnModelFile=true)
Set Detection's area threshold for each class.
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_GetDetTrainedVersion(DetTestHandle handle, int *trainedVersionMajor, int *trainedVersionMinor, int *trainedVersionPatch)
Get a trained version of model file, -1 means before v1.4.8.
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.
eErrorType SR_SetDetTestCropDetectedBoxesOptions(DetTestHandle handle, bool isToStoreCroppedImage, int defaultCropSize=-1, eModeOfCropLargeObjects modeOfCropLargeObjects=SR_CROP_BY_OBJECTSIZE_NOT_SQUARE, float margin=0.00, bool writeOnModelFile=true)
Set the parameters of Detection's crop box.
eErrorType SR_SetDetTestOptionsAsDefault(DetTestHandle handle)
Reset inspection options(Forward time limit, Detection's score threshold etc) as default values.
eErrorType SR_WriteDetTestOptionsOnModelFile(DetTestHandle handle)
Write inspection options(Forward time limit, Detection's score threshold etc) on model file.
eErrorType SR_GetDetFilterObjSimpleParameters(DetTestHandle handle, float *simpleParams)
Get the simple parameters of filtering object by Detection's filter object by region.
eErrorType SR_SetDetFilterObjSimpleParameters(DetTestHandle handle, float *simpleParams, bool writeOnModelFile=true)
Set the simple parameters of filtering object by Detection's filter object by region.
eErrorType SR_SetDetFilterObjByRegion(DetTestHandle handle, eFilterObjByRegionType filterObjType, bool writeOnModelFile=true)
Set the filtering object type by Detection's filter object by region.
eErrorType SR_GetDetFilterObjByRegion(DetTestHandle handle, eFilterObjByRegionType *filterObjType)
Get the filtering object type by Detection's filter object by region.
eErrorType SR_SetDetTestForwardTimeLimitVariables(DetTestHandle handle, float forwardTimeLimit, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit variables.
eErrorType SR_SetDetTestForwardTimeLimit(DetTestHandle handle, float forwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit.
eErrorType SR_GetDetTestForwardTimeLimitVariables(DetTestHandle handle, float *forwardTimeLimit, bool *bIsToUseForwardTimeLimit)
Get the Forward time limit variables.
eErrorType SR_GetDetTestIsToUseForwardTimeLimit(DetTestHandle handle, bool *bIsToUseForwardTimeLimit)
Get the boolean whether the current model is using time limit or not.
eErrorType SR_GetDetTestForwardTimeLimit(DetTestHandle handle, float *forwardTimeLimit)
Get the Forward time limit.
eErrorType SR_SetDetTestIsToUseForwardTimeLimit(DetTestHandle handle, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the boolean whether the current model is using time limit or not.
eErrorType SR_CreateDetTestHandle_ErrorType(DetTestHandle *detTestHandle, const char *filePath)
Create a DetTestHandle via multi byte char path.
eErrorType SR_MakeDetTestResult_ErrorType(DetTestResult *detTestResult)
Construct a DetTestResult.
DetTestResult SR_MakeDetTestResult()
Construct a DetTestResult.
eErrorType SR_CreateDetTestHandleByWideCharPath_ErrorType(DetTestHandle *detTestHandle, const wchar_t *filePath)
Create a DetTestHandle via wide char path.
DetTestHandle SR_CreateDetTestHandle(const char *filePath)
Create a DetTestHandle via multi byte char path.
void * DetTestResult
Detection inspection results handler.
Definition: DetectorTestDLL.h:67
DetTestHandle SR_CreateDetTestHandleByWideCharPath(const wchar_t *filePath)
Create a DetTestHandle via wide char path.
void * DetTestHandle
Detection file handler.
Definition: DetectorTestDLL.h:52
eErrorType SR_DestroyDetTestHandle(DetTestHandle handle)
Destruct a DetTestHandle.
eErrorType SR_DeleteDetTestResult(DetTestResult detTestResult)
Destruct a DetTestResult.
eErrorType SR_ApplyDetTestFrom8bitCharGrayArray(DetTestHandle handle, const unsigned char *imageData, const int height, const int width, DetTestResult detTestResult)
Apply detection algorithm to 1-channel image by 8-bit data.
eErrorType SR_ApplyDetTestFrom8bitCharColorArray(DetTestHandle handle, const unsigned char *imageData, const int height, const int width, DetTestResult detTestResult)
Apply detection algorithm to 3-channels(BGR) image by 8-bit data.
eErrorType SR_ApplyDetTestFromImageFile(DetTestHandle handle, const char *imagePath, DetTestResult detTestResult)
Apply detection algorithm to image by file path.
eErrorType SR_ApplyDetTestFromImageFileByWideCharPath(DetTestHandle handle, const wchar_t *imagePath, DetTestResult detTestResult)
Apply detection algorithm to image by file path.
eErrorType SR_ApplyDetTestFromUnsignedIntColorArray(DetTestHandle handle, const unsigned int *imageData, const int height, const int width, DetTestResult detTestResult)
Apply detection algorithm to 4-channels(BGRA) image by 8-bit data.
eErrorType SR_GetDetTestLoadImageTimeInDouble(DetTestResult detTestResult, double *imageLoadingTimeInDouble)
Get the image loading time.
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.
eErrorType SR_GetDetTestLoadImageTime(DetTestResult detTestResult, long *imageLoadingTimeInLong)
Get the image loading time.
eErrorType SR_GetDetTestInspectionTimeInDouble(DetTestResult detTestResult, double *inspectionTimeInDouble)
Get the inspection time.
eErrorType SR_GetDetTestInspectionTime(DetTestResult detTestResult, long *inspectionTimeInLong)
Get the inspection time.
eErrorType SR_GetDetTestResultOneBoxInfo(DetTestResult detTestResult, const int boxIndex, int *classIndex, float *score, int *coordinateXYXY)
Get a single detected box.
eErrorType SR_GetDetTestResultAllBoxesInfo(DetTestResult detTestResult, const int numDetectedBoxes, int *classIndices, float *scores, int *coordinatesXYXY)
Get all the detected boxes.
eErrorType SR_GetDetTestResultDetectedBoxes(DetTestResult detTestResult, const int numDetectedBoxes, SR_DetectedBox *detectedBoxes)
Get SR_DetectedBox.
eErrorType SR_GetDetTestResultNumberOfBoxes(DetTestResult detTestResult, int *numDetectedBoxes)
Get the number of detected boxes.
eErrorType SR_SetDetTestMaxNumberOfDetectionBoxesForEachClass(DetTestHandle handle, int numOfClasses, int *maxNumBoxes, bool writeOnModelFile=true)
Set Max number of boxes.
eErrorType SR_GetDetTestMaxNumberOfDetectionBoxesForEachClass(DetTestHandle handle, int *maxNumBoxes)
Get Max number of boxes.
eErrorType SR_SetDetTestMinScoreThreshold(DetTestHandle handle, int numOfClasses, int *scoreThreshold, bool writeOnModelFile=true)
Set Detection's score threshold for each class.
eErrorType SR_GetDetTestMinScoreThreshold(DetTestHandle handle, int *scoreThreshold)
Get Detection's score threshold for each class.
eErrorType SR_GetDetTestMinScoreThresholdForSingleClass(DetTestHandle handle, const int classIdx, int *scoreThreshold)
Get Detection's score threshold for single class.
eErrorType SR_LoadDetTestNetworkInGPU(DetTestHandle handle, int GPUNumber)
Allocate required cpu & gpu memory.
Struct describing features of a detected box.
Definition: CommonHeaderDLL.h:250