mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:16:56 +08:00
Fixed API bugs caused by missing RegionOfInterest values
This commit is contained in:
@@ -51,8 +51,7 @@ namespace alpr
|
|||||||
|
|
||||||
AlprResults Alpr::recognize(std::vector<char> imageBytes)
|
AlprResults Alpr::recognize(std::vector<char> imageBytes)
|
||||||
{
|
{
|
||||||
std::vector<AlprRegionOfInterest> regionsOfInterest;
|
return impl->recognize(imageBytes);
|
||||||
return impl->recognize(imageBytes, regionsOfInterest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AlprResults Alpr::recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
AlprResults Alpr::recognize(unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
|
@@ -68,13 +68,6 @@ namespace alpr
|
|||||||
return config->loaded;
|
return config->loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img)
|
|
||||||
{
|
|
||||||
std::vector<cv::Rect> 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<cv::Rect> regionsOfInterest)
|
AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest)
|
||||||
{
|
{
|
||||||
@@ -274,11 +267,11 @@ namespace alpr
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
AlprResults AlprImpl::recognize( std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest )
|
AlprResults AlprImpl::recognize( std::vector<char> imageBytes)
|
||||||
{
|
{
|
||||||
cv::Mat img = cv::imdecode(cv::Mat(imageBytes), 1);
|
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<AlprRegionOfInterest> regionsOfInterest)
|
AlprResults AlprImpl::recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest)
|
||||||
@@ -298,9 +291,16 @@ namespace alpr
|
|||||||
return this->recognize(img, this->convertRects(regionsOfInterest));
|
return this->recognize(img, this->convertRects(regionsOfInterest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AlprResults AlprImpl::recognize(cv::Mat img)
|
||||||
|
{
|
||||||
|
std::vector<cv::Rect> 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<cv::Rect> regionsOfInterest)
|
AlprResults AlprImpl::recognize(cv::Mat img, std::vector<cv::Rect> regionsOfInterest)
|
||||||
{
|
{
|
||||||
|
|
||||||
AlprFullDetails fullDetails = recognizeFullDetails(img, regionsOfInterest);
|
AlprFullDetails fullDetails = recognizeFullDetails(img, regionsOfInterest);
|
||||||
return fullDetails.results;
|
return fullDetails.results;
|
||||||
}
|
}
|
||||||
|
@@ -68,11 +68,11 @@ namespace alpr
|
|||||||
AlprImpl(const std::string country, const std::string configFile = "", const std::string runtimeDir = "");
|
AlprImpl(const std::string country, const std::string configFile = "", const std::string runtimeDir = "");
|
||||||
virtual ~AlprImpl();
|
virtual ~AlprImpl();
|
||||||
|
|
||||||
AlprFullDetails recognizeFullDetails(cv::Mat img);
|
|
||||||
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
||||||
|
|
||||||
AlprResults recognize( std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
AlprResults recognize( std::vector<char> imageBytes );
|
||||||
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||||
|
AlprResults recognize( cv::Mat img );
|
||||||
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
||||||
|
|
||||||
void applyRegionTemplate(AlprPlateResult* result, std::string region);
|
void applyRegionTemplate(AlprPlateResult* result, std::string region);
|
||||||
|
Reference in New Issue
Block a user