Using debugDetector config option in detectors

This commit is contained in:
Matt Hill
2015-03-18 18:17:02 -04:00
parent f5b795ebe3
commit c04dd4104d
3 changed files with 7 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ namespace alpr
// The frame is too wide // The frame is too wide
this->scale_factor = ((float) config->maxDetectionInputWidth) / ((float) frame.cols); this->scale_factor = ((float) config->maxDetectionInputWidth) / ((float) frame.cols);
if (config->debugGeneral) if (config->debugDetector)
std::cout << "Input detection image is too wide. Resizing with scale: " << this->scale_factor << endl; std::cout << "Input detection image is too wide. Resizing with scale: " << this->scale_factor << endl;
} }
else if (frame.rows > config->maxDetectionInputHeight) else if (frame.rows > config->maxDetectionInputHeight)
@@ -88,7 +88,7 @@ namespace alpr
// The frame is too tall // The frame is too tall
this->scale_factor = ((float) config->maxDetectionInputHeight) / ((float) frame.rows); this->scale_factor = ((float) config->maxDetectionInputHeight) / ((float) frame.rows);
if (config->debugGeneral) if (config->debugDetector)
std::cout << "Input detection image is too tall. Resizing with scale: " << this->scale_factor << endl; std::cout << "Input detection image is too tall. Resizing with scale: " << this->scale_factor << endl;
} }

View File

@@ -76,7 +76,7 @@ namespace alpr
// The frame is too wide // The frame is too wide
this->scale_factor = ((float) config->maxDetectionInputWidth) / ((float) frame.cols); this->scale_factor = ((float) config->maxDetectionInputWidth) / ((float) frame.cols);
if (config->debugGeneral) if (config->debugDetector)
std::cout << "Input detection image is too wide. Resizing with scale: " << this->scale_factor << endl; std::cout << "Input detection image is too wide. Resizing with scale: " << this->scale_factor << endl;
} }
else if (frame.rows > config->maxDetectionInputHeight) else if (frame.rows > config->maxDetectionInputHeight)
@@ -84,7 +84,7 @@ namespace alpr
// The frame is too tall // The frame is too tall
this->scale_factor = ((float) config->maxDetectionInputHeight) / ((float) frame.rows); this->scale_factor = ((float) config->maxDetectionInputHeight) / ((float) frame.rows);
if (config->debugGeneral) if (config->debugDetector)
std::cout << "Input detection image is too tall. Resizing with scale: " << this->scale_factor << endl; std::cout << "Input detection image is too tall. Resizing with scale: " << this->scale_factor << endl;
} }

View File

@@ -50,7 +50,7 @@ namespace alpr
img_result = frame_gray - img_open; img_result = frame_gray - img_open;
if (config->debugShowImages) if (config->debugDetector && config->debugShowImages)
{ {
imshow("Opening", img_result); imshow("Opening", img_result);
} }
@@ -59,7 +59,7 @@ namespace alpr
Mat img_threshold, img_open2; Mat img_threshold, img_open2;
threshold(img_result, img_threshold, 0, 255, CV_THRESH_OTSU + CV_THRESH_BINARY); threshold(img_result, img_threshold, 0, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
if (config->debugShowImages) if (config->debugDetector && config->debugShowImages)
{ {
imshow("Threshold Detector", img_threshold); imshow("Threshold Detector", img_threshold);
} }
@@ -69,7 +69,7 @@ namespace alpr
Mat rectElement = getStructuringElement(cv::MORPH_RECT, Size(20, 4)); Mat rectElement = getStructuringElement(cv::MORPH_RECT, Size(20, 4));
morphologyEx(img_open2, img_threshold, CV_MOP_CLOSE, rectElement, cv::Point(-1, -1)); morphologyEx(img_open2, img_threshold, CV_MOP_CLOSE, rectElement, cv::Point(-1, -1));
if (config->debugShowImages) if (config->debugDetector && config->debugShowImages)
{ {
imshow("Close", img_threshold); imshow("Close", img_threshold);
waitKey(0); waitKey(0);