OpenCV on Mac OSX Yosemite
Installing OpenCV on OS X Yosemite (10.10)
Mainly thanks to this chap I was able to install OpenCV on my Mac Yosemite installation.
After using his walk trough I had the error when running some of the OpenCV samples:
AttributeError: 'module' object has no attribute 'CV_AA'
After some search it turned out to be the fact that OpenGL was not enabled. I had it checked, but for it to properly work QT should be enabled as well. So these are in the end the steps that should make it work:
- Download Cmake and drag to application directory.
- Download OpenCV beta zip and extract.
- Download MacPorts and install the qt5-mac package.
- Go to the extracted folder of OpenCV and make a directory called StaticLibs
- Open Cmake 'Browse Source...' pick the path of the extracted zip 'Browse Build...' pick the newly created StaticLibs folder
- Check:
- WITH_QT
- WITH_FFMPEG (I guess this is optional)
- INSTALL_PYTHON_EXAMPLES (this definitely is optional)
- Uncheck:
- BUILD_SHARED_LIBS
- BUILD_TESTS
- WITH_1394
- Fill in properly (some of these might already be filled in properly)
- CMAKE_OSX_SYSROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk (or another SDK path)
- CMAKE_OSX_ARCHITECTURES: x86_64
- QT_QMAKE_EXECUTABLE: /opt/local/bin/qmake (this is the qmake install from MacPorts)
- PYTHON2_EXECUTABLE: /usr/bin/python2.7
- PYTHON2_PACKAGES_PATH: /Library/Python/2.7/site-packages
- Click Configure, then click Generate
- Open a terminal and type:
- cd <path/to/your/opencv/staticlibs/folder/>
- make (This will take awhile)
- sudo make install
Enjoy! R