CSI camera with darknet

asked 2020-04-17 07:31:38 -0600

Hi,

I want to use a CSI Camera with darknet, but I don't know how he can recognize this camera.

When I try a simple "./darknet detector demo" with yolov3-tiny, I get 3 warnings telling me about cap_gstreamer.cpp : -module v4l2src0 reported : internalt data stream error -unable to start pipeline -pipelin have not been created

then a "million lines" of : VIDIOC_QBUF: Invalid argument.

Sincerely,

edit retag flag offensive close merge delete

Comments

What computer, webcam and OS are you using?

I suggest to test a simple camera capture program to be sure the camera works before doing darknet.

[edit] BTW, if you want to do Yolo on a Raspberry Pi, be prepared that it will be vvvvveeeeeeeeerrrrryyyyy slow!

kbarni gravatar imagekbarni ( 2020-04-20 01:35:18 -0600 )edit

I'm using a Jetson Nano with a derived version of Ubuntu 18.04 : L4T 32.3.1 I already tried the camera with others programs and it's working, I just don't know where it's possible to tell to darknet that I use a CSI camera.

elementdl gravatar imageelementdl ( 2020-04-20 02:52:53 -0600 )edit

If you have the OpenCV camera capture example working, just use the darknet API; replace the processing part (cvtColor(...)) in the example above with the darknet object detector: boxes = detector.detect(frame);

Of course, you'll need to add #include <darknet/yolo_v2_class.hpp>, Detector detector;, std::vector<bbox> boxes; and so on.

kbarni gravatar imagekbarni ( 2020-04-21 09:02:09 -0600 )edit

I'm a begginer to this domain, if I understand well, I have to create a code that calls darknet with the API, and then I will be able to select the camera i'm using, with the help of openCV?

elementdl gravatar imageelementdl ( 2020-04-22 04:32:59 -0600 )edit

it's more the contrary. You create a code that reads camera frames in a loop (so you can be sure the camera works), then add a processing step for each frame, which in this case is object detection using Darknet. And you are lucky, as it's a single function call that does all the processing.

kbarni gravatar imagekbarni ( 2020-04-24 02:24:54 -0600 )edit