From 815e7a127b062aa8bc4f4ba7af2cfd97c232f34c Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Wed, 02 Aug 2017 21:48:29 +0000
Subject: [PATCH] Supported OpenCV 3.0 and 2.4.13. Supported Windows and Linux.

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

diff --git a/src/data.c b/src/data.c
index c64bbce..f3fa04f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -42,7 +42,11 @@
 inline unsigned int random_gen()
 {
 	unsigned int Num = 0;
+#ifdef WIN32
 	rand_s(&Num);
+#else
+	Num = rand();
+#endif
 	return Num;
 }
 
@@ -723,7 +727,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;
@@ -767,7 +771,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