diff --git a/runtime_data/openalpr.conf b/runtime_data/openalpr.conf index e352b6d..d6e7cee 100644 --- a/runtime_data/openalpr.conf +++ b/runtime_data/openalpr.conf @@ -46,6 +46,7 @@ color_filter = 0 ocr = 0 postprocess = 0 show_images = 0 +pause_on_frame = 0 ;;; Country Specific variables ;;;; diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index e7e67ef..ec5df5e 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -136,10 +136,14 @@ std::vector AlprImpl::recognize(cv::Mat img) displayImage(config, "Main Image", img); - // Pause indefinitely until they press a key cv::waitKey(1); - //while ((char) cv::waitKey(50) == -1) - // {} + + if (config->debugPauseOnFrame) + { + // Pause indefinitely until they press a key + while ((char) cv::waitKey(50) == -1) + {} + } } diff --git a/src/openalpr/config.cpp b/src/openalpr/config.cpp index 38fb13f..f439ac9 100644 --- a/src/openalpr/config.cpp +++ b/src/openalpr/config.cpp @@ -135,6 +135,7 @@ void Config::loadValues(string country) debugOcr = getBoolean("debug", "ocr", false); debugPostProcess = getBoolean("debug", "postprocess", false); debugShowImages = getBoolean("debug", "show_images", false); + debugPauseOnFrame = getBoolean("debug", "pause_on_frame", false); } diff --git a/src/openalpr/config.h b/src/openalpr/config.h index 27614a2..8ea25fe 100644 --- a/src/openalpr/config.h +++ b/src/openalpr/config.h @@ -104,6 +104,7 @@ class Config bool debugOcr; bool debugPostProcess; bool debugShowImages; + bool debugPauseOnFrame; void debugOff();