SaigeVision C/C++ 1.5.0
SaigeVision API document for C/C++
 
Loading...
Searching...
No Matches
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
52typedef void* OCRTestHandle;
67typedef void* OCRTestResult;
68
76DLLTYPE_OCR OCRTestHandle SR_CreateOCRTestHandle( const char* ocrBoxFilePath,
77 const char* ocrTextFilePath);
78
87 const char* ocrBoxFilePath,
88 const char* ocrTextFilePath);
89
97DLLTYPE_OCR OCRTestHandle SR_CreateOCRTestHandleByWideCharPath(const wchar_t* ocrBoxFilePath,
98 const wchar_t* ocrTextFilePath);
99
108 const wchar_t* ocrBoxFilePath,
109 const wchar_t* ocrTextFilePath);
110
115
130 int GPUNumber);
131
134 eAlgorithmType* boxAlgoTypeOut,
135 eAlgorithmType* textAlgoTypeOut);
136
139
147 int* trainedVersionMajor,
148 int* trainedVersionMinor,
149 int* trainedVersionPatch);
150
171 int* scoreThreshold);
172
180 int scoreThreshold,
181 bool writeOnModelFile = true);
201 int* areaThreshold);
202
210 int areaThreshold,
211 bool writeOnModelFile = true);
236 int nCharsToExclude,
237 wchar_t* charsToExclude,
238 bool writeOnModelFile = true);
257 int maxInspectionHeight,
258 int maxInspectionWidth,
259 bool writeOnModelFile = true);
260
269 int* maxInspectionHeight,
270 int* maxInspectionWidth);
286 float* forwardTimeLimit); /* milliseconds */
287
294 bool* bIsToUseForwardTimeLimit);
295
305 float* forwardTimeLimit, /* milliseconds */
306 bool* bIsToUseForwardTimeLimit);
307
315 float forwardTimeLimit, /* milliseconds */
316 bool writeOnModelFile = true);
317
325 bool bIsToUseForwardTimeLimit,
326 bool writeOnModelFile = true);
327
338 float forwardTimeLimit, /* milliseconds */
339 bool bIsToUseForwardTimeLimit,
340 bool writeOnModelFile = true);
364 const char* imagePath,
365 OCRTestResult ocrTestResult);
366
373 const wchar_t* imagePath,
374 OCRTestResult ocrTestResult);
375
385 const void* imageData,
386 const int height,
387 const int width,
388 const int channels,
389 OCRTestResult ocrTestResult);
422 int* numberOfOCRTextBoxes);
423
430 SR_OCRTextBox* ocrTextBoxes);
431
437 long* inspectionTimeInLong); /* milliseconds */
438
444 double* inspectionTimeInDouble); /* milliseconds */
445
451 long* imageLoadingTimeInLong); /* milliseconds */
452
458 double* imageLoadingTimeInDouble); /* milliseconds */
469
482
485
486/***********************************************************
487* For SaigeVision software
488***********************************************************/
490DLLTYPE_OCR eErrorType SR_SetOCRTestResizeFactor(OCRTestHandle handle, float resizeFactor, bool writeOnModelFile);
491
493DLLTYPE_OCR eErrorType SR_SetOCRTestROIParameters(OCRTestHandle handle, int roiType, float* simpleROIParams, int* adROIParams, int numOfRectMask,
494 float* rectMaskXMin, float* rectMaskYMin, float* rectMaskWidth, float* rectMaskHeight, int numOfEllipseMask,
495 float* ellipseMaskXMin, float* ellipseMaskYMin, float* ellipseMaskWidth, float* ellipseMaskHeight, bool writeOnModelFile = true);
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
eErrorType SR_SetOCRTestOptionsAsDefault(OCRTestHandle handle)
Reset inspection options(OCR's area threshold, OCR's score threshold) as default values.
eErrorType SR_SetOCRTestResizeFactor(OCRTestHandle handle, float resizeFactor, bool writeOnModelFile)
Set resize factor for default model.
eErrorType SR_GetOCRTestAlgorithmType(OCRTestHandle handle, eAlgorithmType *boxAlgoTypeOut, eAlgorithmType *textAlgoTypeOut)
Get a algorithm type(ex, standard, deep) of OCR models.
eErrorType SR_PrintOCRTestParameters(OCRTestHandle handle)
Print a model parameters (inspection options...)
eErrorType SR_GetOCRTrainedVersion(OCRTestHandle handle, int *trainedVersionMajor, int *trainedVersionMinor, int *trainedVersionPatch)
Get a trained version of model file, -1 means before v1.4.8.
eErrorType SR_WriteOCRTestOptionsOnModelFile(OCRTestHandle handle)
Write inspection options(OCR's area threshold, OCR's score threshold) on model file.
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.
eErrorType SR_LoadOCRTestNetworkInGPU(OCRTestHandle handle, int GPUNumber)
Allocate required cpu & gpu memory.
eErrorType SR_SetOCRTestAreaThreshold(OCRTestHandle handle, int areaThreshold, bool writeOnModelFile=true)
Get OCR's area threshold.
eErrorType SR_GetOCRTestAreaThreshold(OCRTestHandle handle, int *areaThreshold)
Get OCR's area threshold.
eErrorType SR_SetOCRTestCharsToExclude(OCRTestHandle handle, int nCharsToExclude, wchar_t *charsToExclude, bool writeOnModelFile=true)
검사에서 제외할 문자(OCR's excluded characters)를 설정합니다.
eErrorType SR_SetOCRTestIsToUseForwardTimeLimit(OCRTestHandle handle, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the boolean whether the current model is using time limit or not.
eErrorType SR_GetOCRTestIsToUseForwardTimeLimit(OCRTestHandle handle, bool *bIsToUseForwardTimeLimit)
Get the boolean whether the current model is using time limit or not.
eErrorType SR_GetOCRTestForwardTimeLimit(OCRTestHandle handle, float *forwardTimeLimit)
Get the Forward time limit.
eErrorType SR_GetOCRTestForwardTimeLimitVariables(OCRTestHandle handle, float *forwardTimeLimit, bool *bIsToUseForwardTimeLimit)
Get the Forward time limit variables.
eErrorType SR_SetOCRTestForwardTimeLimit(OCRTestHandle handle, float forwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit.
eErrorType SR_SetOCRTestForwardTimeLimitVariables(OCRTestHandle handle, float forwardTimeLimit, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit variables.
OCRTestResult SR_MakeOCRTestResult()
Construct a OCRTestResult.
OCRTestHandle SR_CreateOCRTestHandle(const char *ocrBoxFilePath, const char *ocrTextFilePath)
Create a OCRTestHandle via multi byte char path.
void * OCRTestHandle
OCR file handler.
Definition: OCRTestDLL.h:52
eErrorType SR_CreateOCRTestHandleByWideCharPath_ErrorType(OCRTestHandle *ocrTestHandle, const wchar_t *ocrBoxFilePath, const wchar_t *ocrTextFilePath)
Create a OCRTestHandle via wide char path.
void * OCRTestResult
OCR inspection results handler.
Definition: OCRTestDLL.h:67
OCRTestHandle SR_CreateOCRTestHandleByWideCharPath(const wchar_t *ocrBoxFilePath, const wchar_t *ocrTextFilePath)
Create a OCRTestHandle via wide char path.
eErrorType SR_MakeOCRTestResult_ErrorType(OCRTestResult *ocrTestResult)
Construct a OCRTestResult.
eErrorType SR_CreateOCRTestHandle_ErrorType(OCRTestHandle *ocrTestHandle, const char *ocrBoxFilePath, const char *ocrTextFilePath)
Create a OCRTestHandle via multi byte char path.
eErrorType SR_DestroyOCRTestHandle(OCRTestHandle handle)
Destruct a OCRTestHandle.
eErrorType SR_DeleteOCRTestResult(OCRTestResult ocrTestResult)
Destruct a OCRTestResult.
eErrorType SR_ApplyOCRTestFromImageFile(OCRTestHandle handle, const char *imagePath, OCRTestResult ocrTestResult)
Apply OCR algorithm to image by file path.
eErrorType SR_ApplyOCRTestFromImageFileByWideCharPath(OCRTestHandle handle, const wchar_t *imagePath, OCRTestResult ocrTestResult)
Apply OCR algorithm to image by file path.
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.
eErrorType SR_GetOCRTestLoadImageTime(OCRTestResult ocrTestResult, long *imageLoadingTimeInLong)
Get the image loading time.
eErrorType SR_GetOCRTestLoadImageTimeInDouble(OCRTestResult ocrTestResult, double *imageLoadingTimeInDouble)
Get the image loading time.
eErrorType SR_GetOCRTestInspectionTime(OCRTestResult ocrTestResult, long *inspectionTimeInLong)
Get the inspection time.
eErrorType SR_GetOCRTestNumberOfTextBoxes(OCRTestResult ocrTestResult, int *numberOfOCRTextBoxes)
Get the number of SR_OCRTextBox.
eErrorType SR_GetOCRTestInspectionTimeInDouble(OCRTestResult ocrTestResult, double *inspectionTimeInDouble)
Get the inspection time.
eErrorType SR_GetOCRTestTextBoxes(OCRTestResult ocrTestResult, SR_OCRTextBox *ocrTextBoxes)
Get SR_OCRTextBox s.
eErrorType SR_GetOCRTestMaxInspectionSize(OCRTestHandle handle, int *maxInspectionHeight, int *maxInspectionWidth)
Get OCR's max inspection size.
eErrorType SR_SetOCRTestMaxInspectionSize(OCRTestHandle handle, int maxInspectionHeight, int maxInspectionWidth, bool writeOnModelFile=true)
Set OCR's max inspection size.
eErrorType SR_GetOCRTestScoreThreshold(OCRTestHandle handle, int *scoreThreshold)
Get OCR's score threshold.
eErrorType SR_SetOCRTestScoreThreshold(OCRTestHandle handle, int scoreThreshold, bool writeOnModelFile=true)
Set OCR's score threshold.
Structure describing features of a OCR object.
Definition: CommonHeaderDLL.h:277