Improve ALPR_OCR peformance
This commit is contained in:
@@ -159,6 +159,18 @@ namespace ANSCENTER {
|
||||
// Returns recognized text and confidence. Default returns empty.
|
||||
virtual std::pair<std::string, float> RecognizeText(const cv::Mat& croppedImage) { return {"", 0.0f}; }
|
||||
|
||||
// Batch recognition — skips the text-line detector entirely and
|
||||
// runs the whole batch through a single ORT call when possible.
|
||||
// Default implementation falls back to per-image RecognizeText
|
||||
// so existing subclasses keep working without changes.
|
||||
virtual std::vector<std::pair<std::string, float>> RecognizeTextBatch(
|
||||
const std::vector<cv::Mat>& croppedImages) {
|
||||
std::vector<std::pair<std::string, float>> out;
|
||||
out.reserve(croppedImages.size());
|
||||
for (const auto& m : croppedImages) out.push_back(RecognizeText(m));
|
||||
return out;
|
||||
}
|
||||
|
||||
// ALPR configuration methods
|
||||
void SetOCRMode(OCRMode mode);
|
||||
OCRMode GetOCRMode() const;
|
||||
|
||||
Reference in New Issue
Block a user