mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 03:32:56 +08:00
Check for invalid images before attempting to detect
This commit is contained in:
@@ -70,6 +70,15 @@ std::vector<AlprResult> AlprImpl::recognize(cv::Mat img)
|
||||
getTime(&startTime);
|
||||
|
||||
|
||||
if (!img.data)
|
||||
{
|
||||
// Invalid image
|
||||
if (this->config->debugGeneral)
|
||||
std::cerr << "Invalid image" << std::endl;
|
||||
|
||||
vector<AlprResult> emptyVector;
|
||||
return emptyVector;
|
||||
}
|
||||
|
||||
// Find all the candidate regions
|
||||
vector<PlateRegion> plateRegions = plateDetector->detect(img);
|
||||
|
Reference in New Issue
Block a user