diff --git a/src/openalpr/detection/detectorcuda.cpp b/src/openalpr/detection/detectorcuda.cpp index 39dbfc7..83d4628 100644 --- a/src/openalpr/detection/detectorcuda.cpp +++ b/src/openalpr/detection/detectorcuda.cpp @@ -53,7 +53,15 @@ namespace alpr { Mat frame_gray; - cvtColor( frame, frame_gray, CV_BGR2GRAY ); + + if (frame.channels() > 2) + { + cvtColor( frame, frame_gray, CV_BGR2GRAY ); + } + else + { + frame.copyTo(frame_gray); + } vector detectedRegions; for (int i = 0; i < regionsOfInterest.size(); i++)