AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.57k stars 7.95k forks source link

Object Tracking using Webcam #491

Open KevCANoe opened 6 years ago

KevCANoe commented 6 years ago

Hi AlexeyAB,

Your tracking algorithm works really great on video! I am wondering if it is feasible to use video stream from a webcam to do object tracking.

I checked yolo-console_dll.cpp, where I can only find tracking for video files and images.

Thank you!

fvlntn commented 6 years ago

Replace at line ~287 cv::VideoCapture cap(filename); by cv::VideoCapture cap(0);

AlexeyAB commented 6 years ago

As said @ralek67 just change this line: https://github.com/AlexeyAB/darknet/blob/101de2b07aa2feefa74f7e73876fd5cc8fc696cf/src/yolo_console_dll.cpp#L286 to this: cv::VideoCapture cap(0); cap >> cur_frame;

KevCANoe commented 6 years ago

It worked! Thank you so much!