filterByOuterMask: Re-initialize mask for every contour to get a correct calculation

This commit is contained in:
Kees-V
2015-04-19 20:28:57 +02:00
parent 6a85d895f2
commit 7cd94d2e4c

View File

@@ -549,7 +549,8 @@ namespace alpr
totalChars++;
drawContours(tempFullContour, textContours.contours, i, Scalar(255,255,255), CV_FILLED, 8, textContours.hierarchy);
tempFullContour = Mat::zeros(plateMask.size(), CV_8U);
drawContours(tempFullContour, textContours.contours, i, Scalar(255,255,255), CV_FILLED, 8, textContours.hierarchy);
bitwise_and(tempFullContour, plateMask, tempMaskedContour);
float beforeMaskWhiteness = mean(tempFullContour)[0];