Getting Started
Quick start guide
1. Check system requirements
- Windows
Windows system requirements
- Operating system: Windows 10 or later, 64-bit required
- Compiler: A compiler that supports C++17 or later
- Processor: i7-8700K or higher recommended
- Memory: 8 GB RAM or more (16 GB recommended)
- Storage: 4 GB or more (SSD recommended)
- Other: Microsoft Visual C++ 2015–2022 Redistributable required
Detailed system requirements
See Supported operating systems for details.
2. License activation
License activation proceeds as follows.
Detailed license guide
See the License guide for license types and management.
3. Install prerequisites
Common prerequisites
- Libtorch library: Required to use the OCR SDK
- Encoding settings: Use an appropriate encoding such as UTF-8
Detailed installation guide
See Common prerequisites for installation instructions.
4. SDK initialization methods
- IMR file
- Step-by-step initialization
Initialize with an integrated resource file
// Initialize with an IMR file
void *obj = nullptr;
std::string runtimeLicensePath = "../bin64/Hancom.trial.license";
std::string engineLibPath = "../bin64/libs/CPU/modulelibs";
std::string imrResourcePath = "../assets/Hancom.25.12.01.cpu.imr";
std::string objName = "Sample";
bool isRecovery = true;
bool isSelfCheck = false;
int enginesCount = 1;
bool isSuccess = HOCR_SDK_CPU_CreateFromImrModelFile(
&obj,
runtimeLicensePath.data(),
engineLibPath.data(),
imrResourcePath.data(),
objName.data(),
isRecovery,
isSelfCheck,
enginesCount
);
Step-by-step initialization
// Create the SDK object and then initialize
std::string runtimeLicensePath = "../bin64/Hancom.trial.license";
std::string engineLibPath = "../bin64/libs/CPU/modulelibs";
std::string logFilePath = "./logs";
void* obj = nullptr;
obj = HOCR_SDK_CPU_CreateArgoSDK(
runtimeLicensePath.data(),
engineLibPath.data(),
logFilePath.data()
);
std::string imrResourcePath = "../assets/Hancom.25.12.01.cpu.imr";
std::string objName = "Sample";
bool isRecovery = true;
bool isSelfCheck = false;
int enginesCount = 1;
bool isSuccess = HOCR_SDK_CPU_initFromImrModelFile(
obj,
imrResourcePath.data(),
objName.data(),
isRecovery,
isSelfCheck,
enginesCount
);
5. Basic OCR processing example
For image processing, OpenCV is used as an external library example.
/* ... */
#include "HOCR_SDK_COMMON.h"
#include "HOCR_SDK_CPU.h"
int main() {
// Variables required for initialization
void* obj = nullptr;
std::string licensePath = ".\\Hancom.trial.license";
std::string engineLibPath = ".\\libs\\CPU\\modulelibs";
std::string imrModelDataPath = "..\\assets\\Hancom.25.11.18.cpu.imr";
std::string objName = "Sample";
bool isRecovery = true;
bool isSelfCheck = false;
int engineCount = 1;
// Initialize SDK
bool isSuccess = HOCR_SDK_CPU_CreateFromImrModelFile(
&obj,
licensePath.data(),
engineLibPath.data(),
imrModelDataPath.data(),
objName.data(),
isRecovery,
isSelfCheck,
engineCount
);
if (!isSuccess) return 1;
// OCR test
cv::Mat mat = cv::imread("ocr1.png", cv::IMREAD_COLOR);
char *resultJsonStr = nullptr;
std::string openApiName = "TEXT_RECOGNITION";
std::string requestId = "request-id";
char *dataMat = reinterpret_cast<char*>(temp.data);
std::string requestOptionJsonStr = "{}";
int resultSize = HOCR_SDK_run(
obj,
&resultJsonStr,
openApiName.data(),
requestId.data(),
mat.cols,
mat.rows,
2, /* RGB 0, RGBA 1, BGR 2, BGRA 3, YUV 4, GRAY 5 */
dataMat,
requestOptionJsonStr.data()
);
std::string resultJson(resultJsonStr, resultSize);
std::cout << resultJson << std::endl;
// Release SDK
HOCR_SDK_freePointer(&resultJsonStr);
isSuccess = HOCR_SDK_releaseArgoSDK(obj);
if (!isSuccess) return 1;
return 0;
}
Sample program
You can test the SampleWindowsMain.exe sample program that uses the example above. See OCR SDK details.
SDK components
Distribution components
HANCOM OCRSDK
├─assets (OCRSDK resource directory)
│
├─bin64 (OCRSDK binary directory)
│ │
│ └─libs
│ └─CPU
│ └─modulelibs (OCRSDK module binary directory)
│
├─include (OCRSDK header file directory)
│
└─notice (OCRSDK open-source license notice directory)
Detailed components
See all components in OCR SDK details.

