简体   繁体   中英

How to find x,y coordinates of an object detected using yolov3?

I need to find the x,y coordinates of the object detected using YoloV3 in real time. For example I'm doing real time object detection using my computer camera. I'm taking the camera as reference point say (0,0). As I am moving the object, the coordinates need to change. So basically I want to get the x,y coordinates with respect to my camera.

Any help would be much appreciated. Thanks in advance.

If you want to get the coordinates of one detection you can use -ext_output flag of AlexeyAB/darknet code:

darknet detector test data/obj.data cfg/yolov4.cfg yolov4.weights -ext_output data/person.jpg

Or you can save it directly on a text file:

darknet detector test data/obj.data cfg/yolov4.cfg yolov4.weights -ext_output data/person.jpg > output.txt

But if you have a big number of images, you need to detect them all at once and save it on a JSON file:

darknet detector test data/obj.data cfg/yolov4.cfg yolov4.weights -ext_output -out train.json < data/train.txt

Train.json is the JSON file where the results are saved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM