Initial OCR to support ALPR mode with country support
This commit is contained in:
@@ -378,6 +378,13 @@ std::vector<ANSCENTER::OCRObject> ANSRTOCR::RunInference(const cv::Mat& input, c
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<std::string, float> ANSRTOCR::RecognizeText(const cv::Mat& croppedImage) {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
if (!_isInitialized || !_engine || croppedImage.empty()) return {"", 0.0f};
|
||||
auto result = _engine->recognizeOnly(croppedImage);
|
||||
return {result.text, result.score};
|
||||
}
|
||||
|
||||
ANSRTOCR::~ANSRTOCR() {
|
||||
try {
|
||||
Destroy();
|
||||
|
||||
Reference in New Issue
Block a user