mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 22:22:50 +08:00
Using debugDetector config option in detectors
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user