From c9e3219384229f3c02726df0ed7d116c95437c71 Mon Sep 17 00:00:00 2001 From: yikestone Date: Sun, 16 Jun 2019 13:10:29 +0530 Subject: [PATCH] Added object id --- msg/Object.msg | 1 + src/main.cpp | 1 + src/test.cpp | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/msg/Object.msg b/msg/Object.msg index 6bb7bc7..eb9916f 100644 --- a/msg/Object.msg +++ b/msg/Object.msg @@ -1,4 +1,5 @@ string label +int32 id #confidence of result float32 confidence diff --git a/src/main.cpp b/src/main.cpp index 3914b01..2538257 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,6 +71,7 @@ bool getObjects(openvino_object_detection::Objects::Request &req, openvino_object_detection::Object tmp; tmp.confidence = object.confidence; tmp.label = labels[object.class_id]; + tmp.id = object.class_id; tmp.x = (object.xmin + object.xmax) / 2.0; tmp.y = (object.ymin + object.ymax) / 2.0; tmp.w = object.xmax - object.xmin; diff --git a/src/test.cpp b/src/test.cpp index 319ddcc..52f140d 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -40,7 +40,8 @@ int main(int argc, char **argv) { } cv::imshow("view", frame); - cv::waitKey(300); + + cv::waitKey(1); } ros::spinOnce(); }