Added object id

This commit is contained in:
yikestone 2019-06-16 13:10:29 +05:30
parent 9e57a18bd6
commit c9e3219384
3 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
string label string label
int32 id
#confidence of result #confidence of result
float32 confidence float32 confidence

View File

@ -71,6 +71,7 @@ bool getObjects(openvino_object_detection::Objects::Request &req,
openvino_object_detection::Object tmp; openvino_object_detection::Object tmp;
tmp.confidence = object.confidence; tmp.confidence = object.confidence;
tmp.label = labels[object.class_id]; tmp.label = labels[object.class_id];
tmp.id = object.class_id;
tmp.x = (object.xmin + object.xmax) / 2.0; tmp.x = (object.xmin + object.xmax) / 2.0;
tmp.y = (object.ymin + object.ymax) / 2.0; tmp.y = (object.ymin + object.ymax) / 2.0;
tmp.w = object.xmax - object.xmin; tmp.w = object.xmax - object.xmin;

View File

@ -40,7 +40,8 @@ int main(int argc, char **argv) {
} }
cv::imshow("view", frame); cv::imshow("view", frame);
cv::waitKey(300);
cv::waitKey(1);
} }
ros::spinOnce(); ros::spinOnce();
} }