From d8b59fcafe2e8bab35358deeb50627b10c2f2710 Mon Sep 17 00:00:00 2001
From: Howard Stark <howard@getcoffee.io>
Date: Mon, 19 Feb 2018 22:26:53 +0000
Subject: [PATCH] Changed definition location to adhere to compatability promises

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

diff --git a/src/yolo_v2_class.hpp b/src/yolo_v2_class.hpp
index f93abaa..4e27b00 100644
--- a/src/yolo_v2_class.hpp
+++ b/src/yolo_v2_class.hpp
@@ -453,7 +453,14 @@
 
 #ifdef OPENCV
 
-cv::Scalar obj_id_to_color(int obj_id);
+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;
+	cv::Scalar color(colors[offset][0], colors[offset][1], colors[offset][2]);
+	color *= color_scale;
+	return color;
+}
 
 class preview_boxes_t {
 	enum { frames_history = 30 };	// how long to keep the history saved

--
Gitblit v1.10.0