From 081863fafff92e33ca0a3a6dc3044bd17df32db3 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 8 Apr 2015 17:32:30 -0400 Subject: [PATCH] Fix bug in CPU detector when provided an already grayscale image[C --- src/openalpr/detection/detectorcpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openalpr/detection/detectorcpu.cpp b/src/openalpr/detection/detectorcpu.cpp index 4f33dc2..da0b568 100644 --- a/src/openalpr/detection/detectorcpu.cpp +++ b/src/openalpr/detection/detectorcpu.cpp @@ -49,13 +49,14 @@ namespace alpr { Mat frame_gray; + if (frame.channels() > 2) { cvtColor( frame, frame_gray, CV_BGR2GRAY ); } else { - frame_gray = frame; + frame.copyTo(frame_gray); }