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/image.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/image.c b/src/image.c
index b063a68..35bd8a0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -13,6 +13,10 @@
 #ifdef OPENCV
 #include "opencv2/highgui/highgui_c.h"
 #include "opencv2/imgproc/imgproc_c.h"
+#include "opencv2/core/version.hpp"
+#ifndef CV_VERSION_EPOCH
+#include "opencv2/videoio/videoio_c.h"
+#endif
 #endif
 
 
@@ -291,7 +295,7 @@
 			CvScalar black_color;
 			black_color.val[0] = 0;
 			CvFont font;
-			cvInitFont(&font, CV_FONT_HERSHEY_COMPLEX, font_size, font_size, 0, font_size*3, 8);
+			cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, font_size, font_size, 0, font_size * 3, 8);	
 			cvPutText(show_img, names[class], pt_text, &font, black_color);
 		}
 	}
@@ -535,15 +539,13 @@
 		static CvVideoWriter* output_video = NULL;    // cv::VideoWriter output_video;
 		if (output_video == NULL)
 		{
-			//printf("\n SRC output_video = %p \n", output_video);
 			const char* output_name = "test_dnn_out.avi";
 			//output_video = cvCreateVideoWriter(output_name, CV_FOURCC('H', '2', '6', '4'), 25, size, 1);
 			output_video = cvCreateVideoWriter(output_name, CV_FOURCC('D', 'I', 'V', 'X'), 25, size, 1);
 			//output_video = cvCreateVideoWriter(output_name, CV_FOURCC('M', 'J', 'P', 'G'), 25, size, 1);
-			//printf("\n cvCreateVideoWriter, DST output_video = %p  \n", output_video);
 		}
 
-		//cvWriteFrame(output_video, disp);	// comment this line to improve FPS !!!
+		cvWriteFrame(output_video, disp);	// comment this line to improve FPS !!!
 		printf("\n cvWriteFrame \n");
 	}
 

--
Gitblit v1.10.0