diff --git a/src/openalpr/alpr.cpp b/src/openalpr/alpr.cpp index 8bd94f3..ee09865 100644 --- a/src/openalpr/alpr.cpp +++ b/src/openalpr/alpr.cpp @@ -51,8 +51,7 @@ namespace alpr AlprResults Alpr::recognize(std::vector imageBytes) { - std::vector regionsOfInterest; - return impl->recognize(imageBytes, regionsOfInterest); + return impl->recognize(imageBytes); } AlprResults Alpr::recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector regionsOfInterest) diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index 6c7c8f6..0b9680b 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -68,13 +68,6 @@ namespace alpr return config->loaded; } - AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img) - { - std::vector regionsOfInterest; - regionsOfInterest.push_back(cv::Rect(0, 0, img.cols, img.rows)); - - return this->recognizeFullDetails(img, regionsOfInterest); - } AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img, std::vector regionsOfInterest) { @@ -274,11 +267,11 @@ namespace alpr - AlprResults AlprImpl::recognize( std::vector imageBytes, std::vector regionsOfInterest ) + AlprResults AlprImpl::recognize( std::vector imageBytes) { cv::Mat img = cv::imdecode(cv::Mat(imageBytes), 1); - return this->recognize(img, this->convertRects(regionsOfInterest)); + return this->recognize(img); } AlprResults AlprImpl::recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector regionsOfInterest) @@ -298,9 +291,16 @@ namespace alpr return this->recognize(img, this->convertRects(regionsOfInterest)); } + AlprResults AlprImpl::recognize(cv::Mat img) + { + std::vector regionsOfInterest; + regionsOfInterest.push_back(cv::Rect(0, 0, img.cols, img.rows)); + + return this->recognize(img, regionsOfInterest); + } + AlprResults AlprImpl::recognize(cv::Mat img, std::vector regionsOfInterest) { - AlprFullDetails fullDetails = recognizeFullDetails(img, regionsOfInterest); return fullDetails.results; } diff --git a/src/openalpr/alpr_impl.h b/src/openalpr/alpr_impl.h index 41951d9..93a35dc 100644 --- a/src/openalpr/alpr_impl.h +++ b/src/openalpr/alpr_impl.h @@ -68,11 +68,11 @@ namespace alpr AlprImpl(const std::string country, const std::string configFile = "", const std::string runtimeDir = ""); virtual ~AlprImpl(); - AlprFullDetails recognizeFullDetails(cv::Mat img); AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector regionsOfInterest); - AlprResults recognize( std::vector imageBytes, std::vector regionsOfInterest ); + AlprResults recognize( std::vector imageBytes ); AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector regionsOfInterest ); + AlprResults recognize( cv::Mat img ); AlprResults recognize( cv::Mat img, std::vector regionsOfInterest ); void applyRegionTemplate(AlprPlateResult* result, std::string region);