From d6cb0fcabcece079c6a5b511159127f585897dba Mon Sep 17 00:00:00 2001
From: Tino Hager <tino.hager@nager.at>
Date: Wed, 27 Jun 2018 21:11:33 +0000
Subject: [PATCH] optimize max object definition

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

diff --git a/src/yolo_v2_class.hpp b/src/yolo_v2_class.hpp
index 68482e6..8f7f6ca 100644
--- a/src/yolo_v2_class.hpp
+++ b/src/yolo_v2_class.hpp
@@ -28,6 +28,11 @@
 	float *data;				// pointer to the image data
 };
 
+#define C_SHARP_MAX_OBJECTS 1000
+struct bbox_t_container {
+    bbox_t candidates[C_SHARP_MAX_OBJECTS];
+};
+
 #ifdef __cplusplus
 #include <memory>
 #include <vector>
@@ -40,6 +45,11 @@
 #include "opencv2/imgproc/imgproc_c.h"	// C
 #endif	// OPENCV
 
+extern "C" YOLODLL_API int init(const char *configurationFilename, const char *weightsFilename, int gpu);
+extern "C" YOLODLL_API int detect_image(const char *filename, bbox_t_container &container);
+extern "C" YOLODLL_API int detect_mat(const uint8_t* data, const size_t data_length, bbox_t_container &container);
+extern "C" YOLODLL_API int dispose();
+
 class Detector {
 	std::shared_ptr<void> detector_gpu_ptr;
 	std::deque<std::vector<bbox_t>> prev_bbox_vec_deque;
@@ -57,6 +67,7 @@
 	static YOLODLL_API void free_image(image_t m);
 	YOLODLL_API int get_net_width() const;
 	YOLODLL_API int get_net_height() const;
+	YOLODLL_API int get_net_color_depth() const;
 
 	YOLODLL_API std::vector<bbox_t> tracking_id(std::vector<bbox_t> cur_bbox_vec, bool const change_history = true, 
 												int const frames_story = 10, int const max_dist = 150);
@@ -446,7 +457,7 @@
 
 #ifdef OPENCV
 
-cv::Scalar obj_id_to_color(int obj_id) {
+static cv::Scalar obj_id_to_color(int obj_id) {
 	int const colors[6][3] = { { 1,0,1 },{ 0,0,1 },{ 0,1,1 },{ 0,1,0 },{ 1,1,0 },{ 1,0,0 } };
 	int const offset = obj_id * 123457 % 6;
 	int const color_scale = 150 + (obj_id * 123457) % 100;

--
Gitblit v1.10.0