Open tdurand opened 5 years ago
@tdurand Hi,
I'm working on some project that needs to be able to change the default webcam resolution, I saw that I can do so easily by changing:
((cv::VideoCapture)cap)->set(CV_CAP_PROP_FRAME_WIDTH, 720); ((cv::VideoCapture)cap)->set(CV_CAP_PROP_FRAME_HEIGHT, 405); In http_stream.cpp#481
Yes, you can change these lines, but in most cases the resolution on the camera is set different from the specified one.
Also it would not be better to configure the webcam using the V4L2-ctl utility? https://elinux.org/Thread:Talk:Jetson/Cameras/How_to_do_I_change_the_USB_camera_resolution%3F
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=YUYV
v4l2-ctl --set-fmt-video=width=1920,height=1088,pixelformat=4 # For Raspberry Pi Cam
v4l2-ctl -v width=1280,height=720,pixelformat=BGR3
More: https://www.kurokesu.com/main/2016/01/16/manual-usb-camera-settings-in-linux/
Or install OpenCV with Gstreamer for real-time capture and run Darknet as:
/darknet detector demo cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights "v4l2src ! video/x-raw, framerate=30/1, width=640, height=480, format=RGB ! videoconvert ! appsink"
Thanks for you answer, from what I found out:
v4l2-ctl
doesn't seem to have any effect on OpenCV VideoCapture, it always picks up the default resolution 640x480v4l2-ctl -d 0 --list-formats-ext
I think I will include this flag option like -c_resolution 1280x720
in a fork of your darknet version.. I'll send a PR but feel free to include it or not... I understand it may not be in the interest of this tool to have too much config flags.
@tdurand
Jetson TX2 with Jetpack 3.3
What ~latency do you have for CSI-2 camera on TX2 without Gstreamer?
I think I will include this flag option like -c_resolution 1280x720 in a fork of your darknet version.. I'll send a PR but feel free to include it or not... I understand it may not be in the interest of this tool to have too much config flags.
Ok, try to do more changes in http_stream.cpp
and less in detector.c
.
What ~latency do you have for CSI-2 camera on TX2 without Gstreamer?
I'm using a usb logitech camera, not sure how to measure the latency ?
Ok, try to do more changes in http_stream.cpp and less in detector.c.
👍 , will do likely next week.
Hi @AlexeyAB , thanks a lot for you work, it improve greatly perfs from default darknet implem and add some nice features !
I'm working on some project that needs to be able to change the default webcam resolution, I saw that I can do so easily by changing:
In http_stream.cpp#481
I would like to make it configurable directly via command line with a new option, for example: -c_resolution, would lead to something like:
./darknet detector demo cfg/voc.data cfg/yolo-voc.cfg yolo-voc.weights -c 0 -c_resolution 720x405
What do you think, would you be interested in a PR for this ?
Thanks.