usb camera settings on opencv

0

Good morning. I have a Dragon board using Linaro. I'm using a python and opencv program for facial detection. But I do not know why the camera does not focus anymore and the resolution is super bad.

For my python cod I tried to force a higher resolution:

codec = 1196444237.0 # MJPG
capture.set(cv2.CAP_PROP_FOURCC, codec)
capture.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 960)
capture.set(cv2.CAP_PROP_FPS, 30)

on my command line using v4l2:

root@linaro-alip:/media/sd/share/face# v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture Multiplanar
        Pixel Format: 'NV12'
        Name        : Y/CbCr 4:2:0
                Size: Stepwise 64x64 - 1920x1088 with step 1/1

Is there any command to reset all webcam settings? or does anyone know how to improve quality?

These are the settings supported by my camera

root@linaro-alip:/home/linaro/facestream/OpenCV-Video-Stream-With-Face-Recognition-master# v4l2-ctl --list-formats-ext --device=/dev/video2
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'MJPG' (compressed)
        Name        : Motion-JPEG
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                Size: Discrete 1280x960
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)

        Index       : 1
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUYV 4:2:2
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.100s (10.000 fps)
                Size: Discrete 1280x960
                        Interval: Discrete 0.111s (9.000 fps)
    
asked by anonymous 07.09.2018 / 15:25

0 answers