diff --git a/src/openalpr/textdetection/platemask.cpp b/src/openalpr/textdetection/platemask.cpp index c746610..f95734d 100644 --- a/src/openalpr/textdetection/platemask.cpp +++ b/src/openalpr/textdetection/platemask.cpp @@ -176,13 +176,12 @@ namespace alpr hasPlateMask = true; this->plateMask = mask; - } - - hasPlateMask = false; - Mat fullMask = Mat::zeros(pipeline_data->thresholds[0].size(), CV_8U); - bitwise_not(fullMask, fullMask); - - this->plateMask = fullMask; + } else { + hasPlateMask = false; + Mat fullMask = Mat::zeros(pipeline_data->thresholds[0].size(), CV_8U); + bitwise_not(fullMask, fullMask); + this->plateMask = fullMask; + } } -} \ No newline at end of file +}