You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.2 KiB
C++

#include "pch.h"
#include "OCRConfig.h"
uns::OCRConfig uns::G_OCRConfig;
std::wstring detect_model_path;
std::wstring recognize_model_path;
uns::OCRConfig::OCRConfig()
{
language = easyocr::CharsetType::EN;
gpu_usage = easyocr::GPUUsage::PreferGPU;
}
uns::OCRConfig::OCRConfig(const std::wstring& detect_model, const std::wstring& reco_model, easyocr::CharsetType language, easyocr::GPUUsage gpu)
{
gpu_usage = gpu;
this->language = language;
detect_model_path = detect_model;
recognize_model_path = reco_model;
}
uns::easyocr::GPUUsage uns::OCRConfig::GetGPUUsage() const
{
return gpu_usage;
}
uns::easyocr::CharsetType uns::OCRConfig::GetLanguage() const
{
return language;
}
std::wstring uns::OCRConfig::GetDetectModelPath() const
{
return detect_model_path;
}
std::wstring uns::OCRConfig::GetRecognizeModelPath() const
{
return recognize_model_path;
}
void uns::OCRConfig::SetGPUUsage(easyocr::GPUUsage usage)
{
gpu_usage = usage;
}
void uns::OCRConfig::SetLanguage(easyocr::CharsetType type)
{
language = type;
}
void uns::OCRConfig::SetDetectModelPath(const std::wstring& path)
{
detect_model_path = path;
}
void uns::OCRConfig::SetRecognizeModelPath(const std::wstring& path)
{
recognize_model_path = path;
}