SaigeVision C/C++  1.4.7
SaigeVision API document for C/C++
OCRTestDLL.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #ifdef __linux__
7  #define DLLTYPE_OCR
8 #elif _WIN32
9  #ifdef DLLEXPORT_OCR
10  #define DLLTYPE_OCR extern "C" __declspec(dllexport)
11  #else
12  #define DLLTYPE_OCR extern "C" __declspec(dllimport)
13  #endif
14 #endif
15 
16 #include "CommonHeaderDLL.h"
17 
52 typedef void* OCRTestHandle;
67 typedef void* OCRTestResult;
68 
76 DLLTYPE_OCR OCRTestHandle SR_CreateOCRTestHandle( const char* ocrBoxFilePath,
77  const char* ocrTextFilePath);
78 
86 DLLTYPE_OCR OCRTestHandle SR_CreateOCRTestHandleByWideCharPath(const wchar_t* ocrBoxFilePath,
87  const wchar_t* ocrTextFilePath);
88 
102  int GPUNumber);
103 
106  eAlgorithmType* boxAlgoTypeOut,
107  eAlgorithmType* textAlgoTypeOut);
108 
111 
132  int* scoreThreshold);
133 
141  int scoreThreshold,
142  bool writeOnModelFile = true);
162  int* areaThreshold);
163 
171  int areaThreshold,
172  bool writeOnModelFile = true);
197  int nCharsToExclude,
198  wchar_t* charsToExclude,
199  bool writeOnModelFile = true);
218  int maxInspectionHeight,
219  int maxInspectionWidth,
220  bool writeOnModelFile = true);
221 
230  int* maxInspectionHeight,
231  int* maxInspectionWidth);
247  float* forwardTimeLimit); /* milliseconds */
248 
255  bool* bIsToUseForwardTimeLimit);
256 
266  float* forwardTimeLimit, /* milliseconds */
267  bool* bIsToUseForwardTimeLimit);
268 
276  float forwardTimeLimit, /* milliseconds */
277  bool writeOnModelFile = true);
278 
286  bool bIsToUseForwardTimeLimit,
287  bool writeOnModelFile = true);
288 
299  float forwardTimeLimit, /* milliseconds */
300  bool bIsToUseForwardTimeLimit,
301  bool writeOnModelFile = true);
325  const char* imagePath,
326  OCRTestResult ocrTestResult);
327 
334  const wchar_t* imagePath,
335  OCRTestResult ocrTestResult);
336 
346  const void* imageData,
347  const int height,
348  const int width,
349  const int channels,
350  OCRTestResult ocrTestResult);
383  int* numberOfOCRTextBoxes);
384 
391  SR_OCRTextBox* ocrTextBoxes);
392 
398  long* inspectionTimeInLong); /* milliseconds */
399 
405  double* inspectionTimeInDouble); /* milliseconds */
406 
412  long* imageLoadingTimeInLong); /* milliseconds */
413 
419  double* imageLoadingTimeInDouble); /* milliseconds */
430 
443 
446 
447 /***********************************************************
448 * For SaigeVision software
449 ***********************************************************/
451 DLLTYPE_OCR eErrorType SR_SetOCRTestResizeFactor(OCRTestHandle handle, float resizeFactor, bool writeOnModelFile);
452 
454 DLLTYPE_OCR eErrorType SR_SetOCRTestROIParameters(OCRTestHandle handle, int roiType, float* simpleROIParams, int* adROIParams, int numOfRectMask,
455  float* rectMaskXMin, float* rectMaskYMin, float* rectMaskWidth, float* rectMaskHeight, int numOfEllipseMask,
456  float* ellipseMaskXMin, float* ellipseMaskYMin, float* ellipseMaskWidth, float* ellipseMaskHeight, bool writeOnModelFile = true);
SR_SetOCRTestCharsToExclude
eErrorType SR_SetOCRTestCharsToExclude(OCRTestHandle handle, int nCharsToExclude, wchar_t *charsToExclude, bool writeOnModelFile=true)
Set OCR's excluded characters.
SR_DestroyOCRTestHandle
eErrorType SR_DestroyOCRTestHandle(OCRTestHandle handle)
Destruct a OCRTestHandle.
SR_GetOCRTestInspectionTime
eErrorType SR_GetOCRTestInspectionTime(OCRTestResult ocrTestResult, long *inspectionTimeInLong)
Get the inspection time.
SR_GetOCRTestMaxInspectionSize
eErrorType SR_GetOCRTestMaxInspectionSize(OCRTestHandle handle, int *maxInspectionHeight, int *maxInspectionWidth)
Get OCR's max inspection size.
SR_GetOCRTestAlgorithmType
eErrorType SR_GetOCRTestAlgorithmType(OCRTestHandle handle, eAlgorithmType *boxAlgoTypeOut, eAlgorithmType *textAlgoTypeOut)
Get a algorithm type(ex, standard, deep) of OCR models.
eAlgorithmType
eAlgorithmType
Enumerator indicating a type of model.
Definition: CommonHeaderDLL.h:49
SR_ApplyOCRTestFromImageFileByWideCharPath
eErrorType SR_ApplyOCRTestFromImageFileByWideCharPath(OCRTestHandle handle, const wchar_t *imagePath, OCRTestResult ocrTestResult)
Apply OCR algorithm to image by file path.
SR_LoadOCRTestNetworkInGPU
eErrorType SR_LoadOCRTestNetworkInGPU(OCRTestHandle handle, int GPUNumber)
Allocate required cpu & gpu memory.
SR_GetOCRTestLoadImageTime
eErrorType SR_GetOCRTestLoadImageTime(OCRTestResult ocrTestResult, long *imageLoadingTimeInLong)
Get the image loading time.
OCRTestResult
void * OCRTestResult
OCR inspection results handler.
Definition: OCRTestDLL.h:67
SR_SetOCRTestAreaThreshold
eErrorType SR_SetOCRTestAreaThreshold(OCRTestHandle handle, int areaThreshold, bool writeOnModelFile=true)
Get OCR's area threshold.
SR_SetOCRTestResizeFactor
eErrorType SR_SetOCRTestResizeFactor(OCRTestHandle handle, float resizeFactor, bool writeOnModelFile)
Set resize factor for default model.
SR_GetOCRTestInspectionTimeInDouble
eErrorType SR_GetOCRTestInspectionTimeInDouble(OCRTestResult ocrTestResult, double *inspectionTimeInDouble)
Get the inspection time.
SR_SetOCRTestScoreThreshold
eErrorType SR_SetOCRTestScoreThreshold(OCRTestHandle handle, int scoreThreshold, bool writeOnModelFile=true)
Set OCR's score threshold.
SR_GetOCRTestAreaThreshold
eErrorType SR_GetOCRTestAreaThreshold(OCRTestHandle handle, int *areaThreshold)
Get OCR's area threshold.
SR_DeleteOCRTestResult
eErrorType SR_DeleteOCRTestResult(OCRTestResult ocrTestResult)
Destruct a OCRTestResult.
SR_WriteOCRTestOptionsOnModelFile
eErrorType SR_WriteOCRTestOptionsOnModelFile(OCRTestHandle handle)
Write inspection options(OCR's area threshold, OCR's score threshold) on model file.
SR_GetOCRTestIsToUseForwardTimeLimit
eErrorType SR_GetOCRTestIsToUseForwardTimeLimit(OCRTestHandle handle, bool *bIsToUseForwardTimeLimit)
Get the boolean whether the current model is using time limit or not.
SR_SetOCRTestOptionsAsDefault
eErrorType SR_SetOCRTestOptionsAsDefault(OCRTestHandle handle)
Reset inspection options(OCR's area threshold, OCR's score threshold) as default values.
SR_ApplyOCRTestFrom8bitImageData
eErrorType SR_ApplyOCRTestFrom8bitImageData(OCRTestHandle handle, const void *imageData, const int height, const int width, const int channels, OCRTestResult ocrTestResult)
Apply OCR algorithm to 1 or 3 or 4 channels image by 8-bit data.
SR_GetOCRTestScoreThreshold
eErrorType SR_GetOCRTestScoreThreshold(OCRTestHandle handle, int *scoreThreshold)
Get OCR's score threshold.
SR_MakeOCRTestResult
OCRTestResult SR_MakeOCRTestResult()
Construct a OCRTestResult.
SR_PrintOCRTestParameters
eErrorType SR_PrintOCRTestParameters(OCRTestHandle handle)
Print a model parameters (inspection options...)
SR_CreateOCRTestHandleByWideCharPath
OCRTestHandle SR_CreateOCRTestHandleByWideCharPath(const wchar_t *ocrBoxFilePath, const wchar_t *ocrTextFilePath)
Create a OCRTestHandle via wide char path.
SR_SetOCRTestIsToUseForwardTimeLimit
eErrorType SR_SetOCRTestIsToUseForwardTimeLimit(OCRTestHandle handle, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the boolean whether the current model is using time limit or not.
SR_GetOCRTestNumberOfTextBoxes
eErrorType SR_GetOCRTestNumberOfTextBoxes(OCRTestResult ocrTestResult, int *numberOfOCRTextBoxes)
Get the number of SR_OCRTextBox.
CommonHeaderDLL.h
Header file for Commonly used variables.
SR_ApplyOCRTestFromImageFile
eErrorType SR_ApplyOCRTestFromImageFile(OCRTestHandle handle, const char *imagePath, OCRTestResult ocrTestResult)
Apply OCR algorithm to image by file path.
SR_SetOCRTestForwardTimeLimitVariables
eErrorType SR_SetOCRTestForwardTimeLimitVariables(OCRTestHandle handle, float forwardTimeLimit, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit variables.
eErrorType
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:25
SR_SetOCRTestROIParameters
eErrorType SR_SetOCRTestROIParameters(OCRTestHandle handle, int roiType, float *simpleROIParams, int *adROIParams, int numOfRectMask, float *rectMaskXMin, float *rectMaskYMin, float *rectMaskWidth, float *rectMaskHeight, int numOfEllipseMask, float *ellipseMaskXMin, float *ellipseMaskYMin, float *ellipseMaskWidth, float *ellipseMaskHeight, bool writeOnModelFile=true)
Set ROI parameters for inspection in label tab.
SR_GetOCRTestTextBoxes
eErrorType SR_GetOCRTestTextBoxes(OCRTestResult ocrTestResult, SR_OCRTextBox *ocrTextBoxes)
Get SR_OCRTextBox s.
SR_OCRTextBox
Structure describing features of a OCR object.
Definition: CommonHeaderDLL.h:237
SR_SetOCRTestForwardTimeLimit
eErrorType SR_SetOCRTestForwardTimeLimit(OCRTestHandle handle, float forwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit.
SR_GetOCRTestLoadImageTimeInDouble
eErrorType SR_GetOCRTestLoadImageTimeInDouble(OCRTestResult ocrTestResult, double *imageLoadingTimeInDouble)
Get the image loading time.
SR_SetOCRTestMaxInspectionSize
eErrorType SR_SetOCRTestMaxInspectionSize(OCRTestHandle handle, int maxInspectionHeight, int maxInspectionWidth, bool writeOnModelFile=true)
Set OCR's max inspection size.
SR_GetOCRTestForwardTimeLimitVariables
eErrorType SR_GetOCRTestForwardTimeLimitVariables(OCRTestHandle handle, float *forwardTimeLimit, bool *bIsToUseForwardTimeLimit)
Get the Forward time limit variables.
OCRTestHandle
void * OCRTestHandle
OCR file handler.
Definition: OCRTestDLL.h:52
SR_CreateOCRTestHandle
OCRTestHandle SR_CreateOCRTestHandle(const char *ocrBoxFilePath, const char *ocrTextFilePath)
Create a OCRTestHandle via multi byte char path.
SR_GetOCRTestForwardTimeLimit
eErrorType SR_GetOCRTestForwardTimeLimit(OCRTestHandle handle, float *forwardTimeLimit)
Get the Forward time limit.