Initial OCR to support ALPR mode with country support
This commit is contained in:
@@ -126,5 +126,11 @@ std::vector<OCRPredictResult> PaddleOCRV5Engine::ocr(const cv::Mat& img) {
|
||||
return results;
|
||||
}
|
||||
|
||||
TextLine PaddleOCRV5Engine::recognizeOnly(const cv::Mat& croppedImage) {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mutex);
|
||||
if (!_initialized || !recognizer_ || croppedImage.empty()) return { "", 0.0f };
|
||||
return recognizer_->Recognize(croppedImage);
|
||||
}
|
||||
|
||||
} // namespace onnxocr
|
||||
} // namespace ANSCENTER
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
// Returns results matching PaddleOCR::OCRPredictResult format
|
||||
std::vector<OCRPredictResult> ocr(const cv::Mat& img);
|
||||
|
||||
// Run recognizer only on a pre-cropped text image (no detection step)
|
||||
TextLine recognizeOnly(const cv::Mat& croppedImage);
|
||||
|
||||
// Configuration setters (matching OCRModelConfig parameters)
|
||||
void SetDetMaxSideLen(int val) { _maxSideLen = val; }
|
||||
void SetDetDbThresh(float val) { _detDbThresh = val; }
|
||||
|
||||
Reference in New Issue
Block a user