mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 06:46:53 +08:00
Detect and use source grayscale mat if applicable.
This commit is contained in:
@@ -49,7 +49,15 @@ namespace alpr
|
||||
{
|
||||
|
||||
Mat frame_gray;
|
||||
cvtColor( frame, frame_gray, CV_BGR2GRAY );
|
||||
if (frame.channels() > 2)
|
||||
{
|
||||
cvtColor( frame, frame_gray, CV_BGR2GRAY );
|
||||
}
|
||||
else
|
||||
{
|
||||
frame_gray = frame;
|
||||
}
|
||||
|
||||
|
||||
vector<PlateRegion> detectedRegions;
|
||||
for (int i = 0; i < regionsOfInterest.size(); i++)
|
||||
@@ -128,4 +136,4 @@ namespace alpr
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user