From d09b987b0f2e16ac3e84e81611e2f6b1cce63c84 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 16 Mar 2017 10:21:49 +0000
Subject: [PATCH] Fix in bbox_t coords from (float) to (unsigned int)

---
 src/yolo_v2_class.hpp |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/yolo_v2_class.hpp b/src/yolo_v2_class.hpp
index 0116cce..f1c6576 100644
--- a/src/yolo_v2_class.hpp
+++ b/src/yolo_v2_class.hpp
@@ -8,10 +8,6 @@
 #include "opencv2/imgproc/imgproc_c.h"	// C
 #endif	// OPENCV
 
-//extern "C" {
-//#include "image.h"
-//}
-
 #ifdef YOLODLL_EXPORTS
 #define YOLODLL_API __declspec(dllexport) 
 #else
@@ -19,7 +15,7 @@
 #endif
 
 struct bbox_t {
-	float x, y, w, h;
+	unsigned int x, y, w, h;
 	float prob;
 	unsigned int obj_id;
 };
@@ -39,13 +35,12 @@
 	YOLODLL_API Detector(std::string cfg_filename, std::string weight_filename, int gpu_id = 0);
 	YOLODLL_API ~Detector();
 
-	YOLODLL_API std::vector<bbox_t> Detector::detect(std::string image_filename, float thresh = 0.2);
-
+	YOLODLL_API std::vector<bbox_t> detect(std::string image_filename, float thresh = 0.2);
 	YOLODLL_API std::vector<bbox_t> detect(image_t img, float thresh = 0.2);
 
-
 #ifdef OPENCV
-	std::vector<bbox_t> detect(cv::Mat mat, float thresh = 0.2) {
+	std::vector<bbox_t> detect(cv::Mat mat, float thresh = 0.2) 
+	{
 		std::shared_ptr<image_t> image_ptr(new image_t, [](image_t *img) { free_image(*img); } );
 		*image_ptr = mat_to_image(mat);
 		return detect(*image_ptr, thresh);

--
Gitblit v1.10.0