From 7b7c669f4952479ac7667cf7def4d09109cc6789 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Sat, 19 May 2018 21:39:03 +0000
Subject: [PATCH] Added flag -save_labels to save detections as training labels txt-files (pseudo labeling concept)

---
 src/image.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/image.c b/src/image.c
index 317b246..a1e4c77 100644
--- a/src/image.c
+++ b/src/image.c
@@ -441,6 +441,8 @@
 {
 	int i, j;
 	if (!show_img) return;
+	static int frame_id = 0;
+	frame_id++;
 
 	for (i = 0; i < num; ++i) {
 		char labelstr[4096] = { 0 };
@@ -516,6 +518,16 @@
 			color.val[1] = green * 256;
 			color.val[2] = blue * 256;
 
+			// you should create directory: result_img
+			//static int img_id = 0;
+			//img_id++;
+			//char image_name[1024];
+			//sprintf(image_name, "result_img/img_%d_%d_%d.jpg", frame_id, img_id, class_id);
+			//CvRect rect = cvRect(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);
+			//cvSetImageROI(show_img, rect);
+			//cvSaveImage(image_name, show_img, 0);
+			//cvResetImageROI(show_img);
+
 			cvRectangle(show_img, pt1, pt2, color, width, 8, 0);
 			//printf("left=%d, right=%d, top=%d, bottom=%d, obj_id=%d, obj=%s \n", left, right, top, bot, class_id, names[class_id]);
 			cvRectangle(show_img, pt_text_bg1, pt_text_bg2, color, width, 8, 0);

--
Gitblit v1.10.0