mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 17:07:39 +08:00
Replaced usleep with platform independent sleep function
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "tclap/CmdLine.h"
|
||||
#include "support/filesystem.h"
|
||||
#include "support/timing.h"
|
||||
#include "support/platform.h"
|
||||
#include "video/videobuffer.h"
|
||||
#include "alpr.h"
|
||||
|
||||
@@ -154,7 +155,7 @@ int main( int argc, const char** argv )
|
||||
while (cap.read(frame))
|
||||
{
|
||||
detectandshow(&alpr, frame, "", outputJson);
|
||||
usleep(1000);
|
||||
sleep_ms(1000);
|
||||
framenum++;
|
||||
}
|
||||
}
|
||||
@@ -179,7 +180,7 @@ int main( int argc, const char** argv )
|
||||
}
|
||||
|
||||
// Sleep 10ms
|
||||
usleep(10000);
|
||||
sleep_ms(10000);
|
||||
}
|
||||
|
||||
videoBuffer.disconnect();
|
||||
@@ -207,7 +208,7 @@ int main( int argc, const char** argv )
|
||||
|
||||
detectandshow( &alpr, frame, "", outputJson);
|
||||
//create a 1ms delay
|
||||
usleep(1000);
|
||||
sleep_ms(1000);
|
||||
framenum++;
|
||||
}
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img, std::vector<cv::Rect
|
||||
displayImage(config, "Main Image", img);
|
||||
|
||||
// Sleep 1ms
|
||||
usleep(1000);
|
||||
sleep_ms(1000);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,7 @@
|
||||
|
||||
|
||||
#include "support/tinythread.h"
|
||||
#include "support/platform.h"
|
||||
|
||||
#define DEFAULT_TOPN 25
|
||||
#define DEFAULT_DETECT_REGION false
|
||||
|
@@ -135,7 +135,7 @@ void imageCollectionThread(void* arg)
|
||||
}
|
||||
|
||||
// Delay 1 second
|
||||
usleep(1000000);
|
||||
sleep_ms(1000000);
|
||||
|
||||
}
|
||||
|
||||
@@ -189,10 +189,10 @@ void getALPRImages(cv::VideoCapture cap, VideoDispatcher* dispatcher)
|
||||
|
||||
|
||||
// Delay 15ms
|
||||
usleep(15000);
|
||||
sleep_ms(15000);
|
||||
}
|
||||
|
||||
// Delay 100ms
|
||||
usleep(100000);
|
||||
sleep_ms(100000);
|
||||
}
|
||||
}
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "support/filesystem.h"
|
||||
#include "support/tinythread.h"
|
||||
#include "support/platform.h"
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user