Open UsaidPro opened 6 years ago
@UsaidPro Hi,
You can try to use Darknet Yolo as DDL/SO-library and C++ application that uses this library:
cv::VideoCapture cap(0); cap >> cur_frame;
// where 0 - is number of web-camLinux: set LIBSO=1
in the Makefile
to build a library darknet.so and binary runable file uselib
that uses this library. Then you can try to run so LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./uselib data/voc.names cfg/yolo-voc.cfg yolo-voc.weights 0
Windows: at first compile build\darknet\yolo_cpp_dll.sln
and then compile build\darknet\yolo_console_dll.sln
then you can use yolo_console_dll.exe data/voc.names cfg/yolo-voc.cfg yolo-voc.weights 0
Also if you want to decrease delay of your web-cam -
you can try to change these lines: https://github.com/AlexeyAB/darknet/blob/22bf10984cb7940e84db4f086ecbc25d9d5d64b5/src/yolo_console_dll.cpp#L241-L244
to these:
std::unique_lock<std::mutex> lock(mtx);
while (!consumed) cv_detected.wait(lock);
I fixed it. Just update your code from this repo. It was C API bug in OpenCV 3.x.
I've been trying to use Darknet to process images taken through my laptop's webcam using the demo code. The problem I'm having is that the camera opens (through cvCaptureFromCAM) but it doesn't return frames (through cvQueryFrame). I know that the camera works (can access it using other applications).
System: Windows 10, GTX 1050, Opencv 3, MS Visual Studio 2015
I've also noticed that Opencv seems to have dropped support for their C API. Any plans to move to the C++ API?
EDIT: I've confirmed that the camera works fine using the C++ API (same environment).