AnswerBun.com

OpenCV error in setting resolution with c910

Ask Ubuntu Asked by evan54 on October 19, 2020

I’ve been trying to use OpenCV to control my webcam (Logitech c910) through python. I ‘ve managed to capture images through .read() but they are 640 x 480 and I haven’t managed to set the resolution to the max which is 2592 x 1944.

I used to have opencv 2.4.8 but now I have 3.0.0-dev

Here is the code I try and the outputs:

In [1]: import cv2
In [2]: cap = cv2.VideoCapture(1)
HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
In [3]: cap.open(1)
HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Out[3]: True
In [4]: r,f = cap.read()
VIDIOC_STREAMON: Bad file descriptor
In [5]: r
Out[5]: False

I installed 3.0.0-dev following the instructions from this other question I posted.
How to install opencv 2.9 for python?

The reason I went with the dev version is because in this post someone said that resolved their problem.
http://answers.opencv.org/question/2061/how-to-set-resolution-of-video-capture-in-python/

One Answer

Since you're building opencv from sources, try to follow the build process used by the debian packaging to ensure the compatibility with linux. I'm thinking about the V4L2 support for example:

CMAKE_ARCH_FLAGS += -DWITH_V4L=ON

Answered by Sylvain Pineau on October 19, 2020

Add your own answers!

Related Questions

Ubuntu Focal 20.04 update with kept back files

1  Asked on December 22, 2020 by topper

 

Is Huion Kamvas Pro 13 supported?

2  Asked on December 21, 2020 by gianluca-micchi

   

How do I run memtest86+?

2  Asked on December 21, 2020 by christopher-kyle-horton

   

IOMMU GPU Passthrough

0  Asked on December 20, 2020 by sparta

   

Install and run Zoom Client inside a sandbox

1  Asked on December 20, 2020 by pablo-bianchi

         

Primary button goes back to default on external mouse

2  Asked on December 19, 2020 by flipjacob

   

Could not find driver: com.mysql.jdbc.Driver

0  Asked on December 19, 2020 by nicholas-saunders

         

How to exclude directory with mandb?

0  Asked on December 19, 2020 by goose

   

Intel Display Audio Not Detected

0  Asked on December 18, 2020 by jonathan-heitz

   

How do I manually install a man page file?

4  Asked on December 17, 2020 by flimm

   

Do I need libsnapd-glib1 without snapd?

1  Asked on December 17, 2020 by buntubunny

 

Anyway to manage snap security in Puppet or Ansible?

0  Asked on December 17, 2020 by sam-klein

   

Dual Boot on Dell G5 SE w/ AMD Ryzen 7 4800 – Display Issues

1  Asked on December 17, 2020 by jeff-wilkerson

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP