Cannot change Opencv Webcam Setting

Source: Internet
Author: User

I have encountered a problem if I use OPENCV APIs, I cannot change the width and height of

Webcam output:

     the );     );

But after seaching the internet, I had found the key point:

The webcam on Linux usually uses the V4L API, and I has not install the library for v4l.

When OpenCV was built, it does not includes the V4L API interface.

So, that ' s the solution:

1.install v4l Dev Library on Ubuntu:libv4l-dev

2. Enter OpenCV sourcecode dir, and reinstall it:

cmake-d cmake_build_type=release-d cmake_install_prefix=/usr/local-  D with_ipp=off. Makesudo make Install

After using CMake, I can see the output for v4l:

--Video i/O:--DC13941. X:no--DC13942. X:no--Ffmpeg:yes--Codec:yes (ver53.35.0)--Format:yes (ver53.21.1)--Util:yes (ver51.22.2)--Swscale:yes (ver2.1.0)--gentoo-Style:yes--Gstreamer:no--Openni:no--Openni primesensor Modules:no--Openni2:no--Pvapi:no--Gigevisionsdk:no--Unicap:no--Unicap Ucil:no--V4l/v4l2:using libv4l (ver0.8.6)--Ximea:no--Xine:no--

3. After the rebuilt your program, it'll work well.

I can see my 720P camera works well:

Have fun!

(IBUs not installed, can only type 中文版 on Ubuntu 12.04)

Cannot change Opencv Webcam Setting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.