From ab75d5c5783db4792e400f933d584984f3aa7bf0 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Mon, 20 Jun 2016 05:39:37 +0000
Subject: [PATCH] t1

---
 src/yolo_demo.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/yolo_demo.c b/src/yolo_demo.c
index 194a236..377218d 100644
--- a/src/yolo_demo.c
+++ b/src/yolo_demo.c
@@ -8,8 +8,8 @@
 #include <sys/time.h>
 
 #ifdef OPENCV
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/highgui/highgui_c.h"
+#include "opencv2/imgproc/imgproc_c.h"
 image ipl_to_image(IplImage* src);
 void convert_yolo_detections(float *predictions, int classes, int num, int square, int side, int w, int h, float thresh, float **probs, box *boxes, int only_objectness);
 
@@ -98,6 +98,7 @@
     while(1){
         struct timeval tval_before, tval_after, tval_result;
         gettimeofday(&tval_before, NULL);
+        /*
         if(pthread_create(&fetch_thread, 0, fetch_in_thread, 0)) error("Thread creation failed");
         if(pthread_create(&detect_thread, 0, detect_in_thread, 0)) error("Thread creation failed");
         show_image(disp, "YOLO");
@@ -109,6 +110,16 @@
         disp  = det;
         det   = in;
         det_s = in_s;
+        */
+
+        fetch_in_thread(0);
+        det = in;
+        det_s = in_s;
+        detect_in_thread(0);
+        disp = det;
+        show_image(disp, "YOLO");
+        free_image(disp);
+        cvWaitKey(1);
 
         gettimeofday(&tval_after, NULL);
         timersub(&tval_after, &tval_before, &tval_result);

--
Gitblit v1.10.0