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