Open xinyee1997 opened 4 years ago
Yes. But you'll have to provide a bit more details.
Typically darknet gives you back the midpoint X, Y, as well as the width and height. So you'd use OpenCV to set a RoI, and then do whatever you want with it. Save it as a new image, pass it to a function, ... What exactly are you having trouble with?
You mention video and webcam, so I assume you're already doing something like:
cv::VideoCapture cap("sample.mp4");
while (true)
{
cv::Mat frame;
cap >> frame;
...do something here with the frame, such as detection and then crop all the bounding boxes....
?
@stephanecharette I have tried the method of #2319. But it only works when i detect image but not video.
Can you teach me how to do that in details? My detection is done in real time with webcam. I hope the detected object can be cropped and saved to a folder
I suggest you hire someone with the necessary skills, @xinyee1997. Or maybe search online for some tutorials and spend some time learning it? Trying to teach people OpenCV using comments on github issue tickets is unlikely to be very successful.
My suggestion is you start with the code I posted 2 comments above. Take a look at OpenCV's cv::VideoCapture
class, and see what it does and how it works. There are tutorials available that show people how to get still frames from videos, and you can then pass those frames into darknet.
Do you use darknet as dll? Or just change darknet itself?
anyone know how to crop detected object (bounding box) in video or in webcam??