OpenCV with CUDA not working (VC++ 2010) - opencv

I have installed OpenCV 2.4.3, and used cmake to make sure that CUDA is enabled.
so, I did:
cmake WITH_CUDA .
and I got the following:
-- CUDA detected: 5.0
-- CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode
m_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=
pute_20,code=compute_20
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required
--
-- General configuration for OpenCV 2.4.3 =============================
--
-- Platform:
-- Host: Windows 6.1 x86
-- CMake: 2.8.8
-- CMake generator: Visual Studio 10
-- CMake build tool: C:/PROGRA~2/MICROS~2.0/Common7/IDE/
-- MSVC:
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: cl
-- C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHs /
_SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /wd4251 /M
-- C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHs /
_SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /wd4251 /M
-- C Compiler: cl
-- C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SE
RE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /MP8 /MD /O2 /Ob
-- C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SE
RE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /MP8 /D_DEBUG /M
-- Linker flags (Release): /STACK:10000000 /machine:X86 /INC
-- Linker flags (Debug): /STACK:10000000 /machine:X86 /deb
-- Precompiled headers: YES
--
-- OpenCV modules:
-- To be built: core imgproc flann highgui features
gpu stitching ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera java ocl python
--
-- GUI:
-- QT 4.x: NO
-- Win32 UI: YES
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: build (ver 1.2.7)
-- JPEG: build (ver 62)
-- PNG: build (ver 1.5.12)
-- TIFF: build (ver 42 - 4.0.2)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
--
-- Video I/O:
-- FFMPEG: YES (prebuilt binaries)
-- codec: YES (ver 53.61.100)
-- format: YES (ver 53.32.100)
-- util: YES (ver 51.35.100)
-- swscale: YES (ver 2.1.100)
-- gentoo-style: YES
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- DirectShow: YES
-- XIMEA: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: NO
-- Use C=: NO
-- Use Cuda: YES (ver 5.0)
-- Use OpenCL: NO
-- Use Eigen: NO
--
-- NVIDIA CUDA
-- Use CUFFT: YES
-- Use CUBLAS: NO
-- NVIDIA GPU arch: 11 12 13 20 21 30
-- NVIDIA PTX archs: 20
-- Use fast math: NO
--
-- Python:
-- Interpreter: NO
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: NO
--
-- Install path: C:/opencv/install
--
-- cvconfig.h is in: C:/opencv
-- -----------------------------------------------------------------
So, apparently, CUDA is detected okay.
I also build this stitching program:
https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/stitching.cpp?rev=6683
And, it works, and I can see that it stitches images fine.
However, whether I use WITH_CUDA or not, I don't see a performance difference !
And when I checked for this: gpu::getCudaEnabledDeviceCount()
It returns zero!!! which I believe indicates that it is not using CUDA!
What I am missing? how should I use CUDA with this example? (I tried in both debug/release configuration)
Do I need to build something special for this code to start using CUDA?
Thanks,
--Rudy

Related

cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln - failed

I'm trying to build expat library for 64-bit using VS 2019, for integrating with log4cxx. Downloaded the expat from here. Steps mentioned here are only linux. I tried to follow the steps mentioned in the package. But cmake is failing. There is no pre-built library for 64-bit. Below is the output of cmake
c:\> cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.16299.
-- The C compiler identification is MSVC 19.24.28316.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for getpagesize
-- Looking for getpagesize - not found
-- Looking for mmap
-- Looking for mmap - not found
-- Looking for getrandom
-- Looking for getrandom - not found
-- Looking for arc4random_buf
-- Looking for arc4random_buf - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for off_t
-- Looking for off_t - not found
-- Looking for size_t
-- Looking for size_t - not found
-- Performing Test HAVE_SYSCALL_GETRANDOM
-- Performing Test HAVE_SYSCALL_GETRANDOM - Failed
-- Performing Test FLAG_NO_STRICT_ALIASING
-- Performing Test FLAG_NO_STRICT_ALIASING - Failed
-- Performing Test FLAG_VISIBILITY
-- Performing Test FLAG_VISIBILITY - Failed
-- The CXX compiler identification is MSVC 19.24.28316.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error: File C:/Program Files (x86)/Expat 2.2.9/Source/Changes does not exist.
CMake Error at CMakeLists.txt:478 (configure_file):
configure_file Problem configuring file
-- ===========================================================================
-- Configuration
-- Prefix ..................... C:/Program Files (x86)/expat
-- Build type .................
-- Shared libraries ........... ON
-- Static CRT ................. OFF
-- Character type ............. char (UTF-8)
-- Binary postfix .............
-- Build documentation ........ OFF
-- Build examples ............. ON
-- Build fuzzers .............. OFF
-- Build tests ................ ON
-- Build tools (xmlwf) ........ ON
-- Install files .............. ON
-- Features
-- // Advanced options, changes not advised
-- Attributes info .......... OFF
-- Context bytes ............ 1024
-- DTD support .............. ON
-- Large size ............... OFF
-- Minimum size ............. OFF
-- Namespace support ........ ON
-- Entropy sources
-- rand_s ................... ON
-- ===========================================================================
-- Configuring incomplete, errors occurred!
See also "C:/Program Files (x86)/Expat 2.2.9/Source/build/CMakeFiles/CMakeOutput.log".
See also "C:/Program Files (x86)/Expat 2.2.9/Source/build/CMakeFiles/CMakeError.log".
Looking for suggestion/help in fixing the issue.
Regards,
Vishu
This is issue #409 upstream. It is fixed in libexpat >=2.2.10.

caffe install on ubuntu fail on libtiff not found

I was follow the official install guide CMake Build part met the following error.
/usr/bin/ld: warning: libtiff.so.5, needed by /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9, not found (try using -rpath or -rpath-link)
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libsoxr.so.0: undefined reference to `GOMP_parallel#GOMP_4.0'
tried ldd told in this post
ldd libopencv.so
ldd: ./libopencv.so: No such file or directory
libtiff-dev and libopencv-dev is installed
sudo apt-get install libtiff-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libtiff5-dev' instead of 'libtiff-dev'
libtiff5-dev is already the newest version (4.0.6-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 134 not upgraded.
sudo apt-get install libopencv-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libopencv-dev is already the newest version (2.4.9.1+dfsg-1.5ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 134 not upgraded.
-- OpenCV found (/usr/share/OpenCV)
-- Found Atlas (include: /usr/include library: /usr/lib/libatlas.so lapack: /usr /lib/liblapack.so
-- NumPy ver. 1.12.1 found (include: /root/anaconda2/lib/python2.7/site-packages /numpy/core/include)
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- python
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : 1.0.0
-- Git : 1.0-14-g4efdf7e
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno- unini tialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
-- USE_OPENCV : ON
-- USE_LEVELDB : ON
-- USE_LMDB : ON
-- USE_NCCL : OFF
-- ALLOW_LMDB_NOLOCK : OFF
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.58)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 2.6.1)
-- lmdb : Yes (ver. 0.9.17)
-- LevelDB : Yes (ver. 1.18)
-- Snappy : Yes (ver. 1.1.3)
-- OpenCV : Yes (ver. 2.4.9.1)
-- CUDA : Yes (ver. 8.0)
cmake config info show opencv in /usr/share/ do I need to remove them?
I tried to make from opencv source code,but remove the source code later.
It's also said CPU-ONLY OFF but I want to use CPU-ONLY and I uncomment CPU_ONLY :=1 in Makefile.config Is that right?
tried make clean and make all in source path met follow error
warning: libtiff.so.5, needed by /usr/lib/gcc/x86_64-linux-gnu/5/.. /../../x86_64-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rp ath-link)
.build_release/tools/upgrade_solver_proto_text.o: In function `main':
upgrade_solver_proto_text.cpp:(.text.startup+0x214): undefined reference to `std ::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M _create(unsigned long&, unsigned long)'
.build_release/tools/upgrade_solver_proto_text.o: In function `boost::system::sy stem_error::what() const':
find an answertalk about fix libtiff problem.
locate libtiff.so
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so.5
/root/anaconda2/pkgs/libtiff-4.0.6-3/lib/libtiff.so.5.2.4
/usr/lib/x86_64-linux-gnu/libtiff.so
ldd libopencv_highgui.so.2.4.9 | grep libtiff
libtiff.so.5 => not found
I have tried to install opencv from source code,so maybe the x86_ path is from the source code lib?How do I fix it?just remove them?

Error in installing caffe in Ubuntu 14.04 LTS

Having already required dependencies for caffe installation:
in cmake step, when I use:
cmake ..
I get this error:
-- Python:
-- Interpreter : /home/majid/anaconda/bin/python2.7 (ver..2.7.9)
-- Libraries : /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
-- NumPy : /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include (ver 1.9.2)
which in Libraries it has detected wrong path instead of /home/majid/anaconda/lib/libpython2.7.so
I tried to force to use the correct path by:
cmake -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so ..
but after:
make all -j $(nproc)
I am getting a couple of time this warning:
At end of source: warning: routine is both "inline" and "noinline"
in the end it stops by this error:
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/cpp_classification/classification] Error 1
make[1]: *** [examples/CMakeFiles/classification.dir/all] Error 2
make: *** [all] Error 2
while when installing opencv I used this cmake:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/majid/opencv -D PYTHON_EXECUTABLE=/home/majid/anaconda/bin/python2.7 -D PYTHON_INCLUDE_DIR=/home/majid/anaconda/include/python2.7 -D PYTHON_INCLUDE_DIRS=/home/majid/anaconda/include/python2.7 -D PYTHON_INCLUDE_DIR2=/home/majid/anaconda/include/python2.7 -D PYTHON_LIBRARIES=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_PACKAGES_PATH=/home/majid/anaconda/lib/python2.7/site-packages -D BUILD_EXAMPLES=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D PYTHON2_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so -D PYTHON_NUMPY_INCLUDE_DIRS=/home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy -D BUILD_opencv_python3=OFF -D BUILD_opencv_python2=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_TBB=ON -D WITH_V4L=ON -D BUILD-TIFF=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -D WITH_GTK=ON -D MATLAB_INCLUDE_DIRS=/home/majid/MATLAB/extern/include -D MATLAB_LIBRARY_DIRS=/home/majid/MATLAB/bin -D MATLAB_MEX_SCRIPT=/home/majid/MATLAB/bin -D MATLAB_ROOT_DIR=/home/majid/MATLAB ..
in which it is: LIBTIFF=ON.
after making opencv I set the packages' path by:
export LD_LIBRARY_PATH=/home/majid/opencv/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/majid/opencv/lib/pkgconfig
export PKG_CONFIG_PATH
and also:
sudo /bin/bash -c 'echo "/home/majid/opencv/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
I don't know why I am having this problem from x86-64-linux-gnu while I have the same libopencv-highgui.so in the /home/majid/opencv/lib
I really appreciate it if someone could help me out in this matter.
the result of forced cmake:
cmake -D PYTHON_LIBRARY=/home/majid/anaconda/lib/libpython2.7.so ..
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- system
-- thread
-- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.a)
-- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.so)
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- Found lmdb (include: /usr/local/include, library: /usr/local/lib/liblmdb.so)
-- Found LevelDB (include: /usr/local/include, library: /usr/local/lib/libleveldb.so)
-- Found Snappy (include: /usr/include, library: /usr/lib/libsnappy.so)
-- CUDA detected: 7.0
-- Found cuDNN (include: /usr/local/cuda-7.0/include, library: /usr/local/cuda-7.0/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_21
-- Cuda + Boost 1.55: Applying noinline work around
-- OpenCV found (/usr/share/OpenCV)
-- Found Atlas (include: /usr/include, library: /usr/lib/libatlas.so)
-- Found PythonLibs: /home/majid/anaconda/lib/libpython2.7.so (found suitable version "2.7.6", minimum required is "2.7")
-- NumPy ver. 1.9.2 found (include: /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include)
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- python
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : <TODO> (Caffe doesn't declare its version in headers)
-- Git : rc2-344-g7e5608f-dirty
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compared-Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.55)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.0.0)
-- lmdb : Yes (ver. 0.9.14)
-- Snappy : Yes (ver. 1.1.0)
-- LevelDB : Yes (ver. 1.17)
-- OpenCV : Yes (ver. 2.4.8)
-- CUDA : Yes (ver. 7.0)
--
-- NVIDIA CUDA:
-- Target GPU(s) : Auto
-- GPU arch(s) : sm_21
-- cuDNN : Yes
--
-- Python:
-- Interpreter : /home/majid/anaconda/bin/python2.7 (ver. 2.7.9)
-- Libraries : /home/majid/anaconda/lib/libpython2.7.so (ver 2.7.6)
-- NumPy : /home/majid/anaconda/lib/python2.7/site-packages/numpy/core/include (ver 1.9.2)
--
-- Documentaion:
-- Doxygen : /usr/bin/doxygen (1.8.6)
-- config_file : /home/majid/caffe/.Doxyfile
--
-- Install:
-- Install path : /home/majid/caffe/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/majid/caffe/build

Does OpenCV support v4l2?

I'm writing a Python program using OpenCV, but I cannot capture images from v4l2 cameras.
I tried with both a PS2 EyeToy and Droidcam (Android virtual webcam), which are both using v4l2, and none of them work: cv.CaptureFromCAM(0) only returns None.
I can use both webcams in other programs (tried VLC and Kamerka).
I guess that OpenCV supports v4l only, not v4l2.
How can I solve this problem? Does a v4l2->v4l converter exist?
EDIT: I read that cv.CaptureFromFile uses ffmpeg to decode video files. Is it possible to manually specify a format, so I can use ffmpeg's video4linux2 demuxer?
For OpenCV 3.2.0, including the following in the cmake options worked for me
from https://github.com/opencv/opencv/issues/7974
-DWITH_V4L=ON
-DWITH_LIBV4L=ON
I'm less sure if this one had an affect, but from VideoCapture Does Not Work in Anaconda
-DWITH_FFMPEG=1
Including all 3 in my cmake options seemed to be what finally made mine work
OpenCV does support V4L2, but maybe not by default.
Download OpenCV's source code and make sure you have v4l2 headers and libraries installed on your system.
After configuring OpenCV with cmake, check it's output:
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.0)
-- FFMPEG: YES
-- codec: YES (ver Unknown)
-- format: YES (ver Unknown)
-- util: YES (ver Unknown)
-- swscale: YES (ver Unknown)
-- gentoo-style: YES
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- QuickTime: NO
-- QTKit: YES
-- V4L/V4L2: NO/NO
If you notice the output above, OpenCV won't be build with support to V4L/V4L2 on my system because I don't have the necessary development files installed.
I had to update the permissions of the camera, then OpenCV started working for me.
sudo chmod 0777 /dev/video0

Compiling OpenCV Source Code for 64 bit (Mac)

I'm having some problems while trying to compile 64 bit OpenCV libraries. This is what I've done so far:
Got the source code using svn
In the opencv I have mkdir build then cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=x86_64 -D CMAKE_C_FLAGS=-m64 -D CMAKE_CXX_FLAGS=-m64 ..
This then leaves me with the output (below), which worries me because a number of packages are not found. I have tried disabling the WITH_CUDA flag as suggest in this post Building EmguCV on OSX Snow Leopard but it doesn't seem to help.
-- Extracting svn version, please wait...
-- SVNVERSION: svn:9029
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named sphinx
--
-- General configuration for OpenCV 2.4.9 =====================================
-- Version control: svn:9029
--
-- Platform:
-- Host: Darwin 11.4.0 i386
-- CMake: 2.8.8
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++
-- C++ flags (Release): -m64 -O3 -DNDEBUG
-- C++ flags (Debug): -m64 -g
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -m64 -O3 -DNDEBUG
-- C flags (Debug): -m64 -g
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: NO
--
-- OpenCV modules:
-- To be built: core imgproc flann highgui features2d calib3d ml video objdetect contrib nonfree legacy gpu photo python stitching ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera java
--
-- GUI:
-- QT 4.x: NO
-- Cocoa: YES
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: build (ver 1.2.6)
-- JPEG: build (ver 62)
-- PNG: build (ver 1.5.9)
-- TIFF: build (ver 42 - 4.0.1)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: NO
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- gentoo-style: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- QuickTime: NO
-- QTKit: YES
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: NO
-- Use Cuda: NO
-- Use Eigen: NO
-- Use Clp: NO
--
-- Python:
-- Interpreter: /usr/bin/python (ver 2.7.1)
-- Libraries: /usr/lib/libpython2.7.dylib (ver 2.7.1)
-- numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.5.1)
-- packages path: lib/python2.7/site-packages
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: /usr/texbin/pdflatex
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
If I then try make -j8 I get something that starts off like this and goes on fo a while:
[ 0%] [ 0%] [ 0%] [ 1%] [ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.o
Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngerror.c.o
Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/png.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.o
[ 1%] [ 1%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_cm.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapimin.c.o
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/zlib.h:34,
from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/compress.c:9:
/Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build/3rdparty/zlib/zconf.h:403:48: error: sys/types.h: No such file or directory
INSTRUCTIONS
Download the zip from https://github.com/Itseez/opencv
When you unzip it you should be left with a folder called 'opencv-master', cd into it.
mkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
make
sudo make install

Resources