From 84d6533cb8112f23a34d3de76435a10f4620f4b8 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 23 Oct 2017 13:43:03 +0000
Subject: [PATCH] Fixed OpenCV usage in the yolo_console_dll.cpp

---
 src/data.c |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/data.c b/src/data.c
index b11ffff..ad9ef8b 100644
--- a/src/data.c
+++ b/src/data.c
@@ -39,17 +39,6 @@
 }
 */
 
-inline unsigned int random_gen()
-{
-	unsigned int Num = 0;
-#ifdef WIN32
-	rand_s(&Num);
-#else
-	Num = rand();
-#endif
-	return Num;
-}
-
 char **get_random_paths(char **paths, int n, int m)
 {
     char **random_paths = calloc(n, sizeof(char*));
@@ -693,10 +682,10 @@
         int dw = (ow*jitter);
         int dh = (oh*jitter);
 
-        int pleft  = rand_uniform(-dw, dw);
-        int pright = rand_uniform(-dw, dw);
-        int ptop   = rand_uniform(-dh, dh);
-        int pbot   = rand_uniform(-dh, dh);
+        int pleft  = rand_uniform_strong(-dw, dw);
+        int pright = rand_uniform_strong(-dw, dw);
+        int ptop   = rand_uniform_strong(-dh, dh);
+        int pbot   = rand_uniform_strong(-dh, dh);
 
         int swidth =  ow - pleft - pright;
         int sheight = oh - ptop - pbot;
@@ -727,7 +716,7 @@
 
 void *load_thread(void *ptr)
 {
-	srand(time(0));
+	//srand(time(0));
     //printf("Loading data: %d\n", random_gen());
     load_args a = *(struct load_args*)ptr;
     if(a.exposure == 0) a.exposure = 1;
@@ -771,7 +760,7 @@
 
 void *load_threads(void *ptr)
 {
-	srand(time(0));
+	//srand(time(0));
     int i;
     load_args args = *(load_args *)ptr;
     if (args.threads == 0) args.threads = 1;

--
Gitblit v1.10.0