From 5a48305471a4c10ec1191eecdeb0484defc82180 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 2 Jul 2014 21:04:10 -0400 Subject: [PATCH] Using usleep rather than waitkey --- src/main.cpp | 7 ++++--- src/openalpr/alpr_impl.cpp | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6d9ca2a..5541d5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -154,7 +154,7 @@ int main( int argc, const char** argv ) while (cap.read(frame)) { detectandshow(&alpr, frame, "", outputJson); - cv::waitKey(1); + usleep(1000); framenum++; } } @@ -177,7 +177,8 @@ int main( int argc, const char** argv ) detectandshow( &alpr, latestFrame, "", outputJson); } - cv::waitKey(10); + // Sleep 10ms + usleep(10000); } videoBuffer.disconnect(); @@ -205,7 +206,7 @@ int main( int argc, const char** argv ) detectandshow( &alpr, frame, "", outputJson); //create a 1ms delay - cv::waitKey(1); + usleep(1000); framenum++; } } diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index ae72216..e04b26f 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -146,7 +146,9 @@ AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img) displayImage(config, "Main Image", img); - cv::waitKey(1); + + // Sleep 1ms + usleep(1000); }