我最近在Ubuntu12.04中安装了OpenCV 2.4.2。
cap = VideoCapture(0)起作用了。但我不能从某个视频源抓取画面。
cap = VideoCapture("input.avi")
img = cap.read() 给了我一个所有零元素的小数。
我还安装了ffmpeg 0.11,x264的最新快照,v4l-0.8.8 (都是最新的稳定版本)
cmake -D WITH_QT=ON -D WITH_FFMPEG=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D BUILD_EXAMPLES=OFF WITH_V4L=ON ..
make
sudo make install当我做这个的时候,我会得到这个
-检测到的GNU GCC版本: 46 (406) -找到OpenEXR: /usr/lib/libIlmImf.so -寻找linux/ Looking dev.h -寻找linux/ Looking dev.h-找不到 -寻找linux/ Looking dev2.h -寻找linux/ Looking dev2.h-找到 -寻找libavformat/avformat.h -寻找libavformat/avformat.h -找到 -寻找ffmpeg/avformat.h -寻找ffmpeg/avformat.h -找不到 -检查模块“tbb” -找不到'tbb‘包裹
和
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.0)
-- FFMPEG: YES
-- codec: YES (ver 54.23.100)
-- format: YES (ver 54.6.100)
-- util: YES (ver 51.54.100)
-- swscale: YES (ver 2.1.100)
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.36)
-- app: YES (ver 0.10.36)
-- video: YES (ver 0.10.36)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l (ver 0.8.8)
-- XIMEA: NO
-- Xine: NO我寻找视频等
但我找不到ffmpeg/avformat.h
这里有什么问题?
发布于 2012-07-13 06:15:04
所以我意识到ffmpeg有问题。我重建并安装了ffmpeg,然后更改了cmake的标志,以制作opencv。
对芬伯来说,
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
make
sudo make install对于OpenCV,
cmake -D CMAKE_BUILD_TYPE=RELEASE ..
make
sudo make install下面是安装OpenCV 2.4.2 2.sh的完整脚本
这是我关于OpenCV 2.4.2安装的博客,详细介绍了http://jayrambhia.com/blog/install-opencv-2-4-in-ubuntu-12-04-precise-pangolin/
发布于 2016-05-31 11:10:12
要运行OpenCV的完整安装,请尝试以下操作:
sudo apt-get install libopencv-dev python-opencv
有关更多详细信息,请参阅以下链接http://milq.github.io/install-opencv-ubuntu-debian/
https://stackoverflow.com/questions/11444926
复制相似问题