

Name the group OpenCV Frameworks.ĥ) Right click at the folder (group) you just created (i.e., OpenCV Frameworks), and choose File > Add Files to “projectName”… submenu.Ħ) Type / and go to /opt/local/lib directory.ħ) Select these files - libopencv_core2.4.10.dylib, libopencv_highgui2.4.10.dylib - and click Add button. – Under Header Search Paths, set the path to /opt/local/include directory.Ĥ) Add necessary library (*.dylib) to your project by clicking on your project from the Solution Explorer panel and choose File > New > New Group. – In C++ Standard Library, choose Compiler Default option. – In C++ Language Dialect, change values to Compiler Default. Scroll to Apple LLVM 6.0 – Language - C++ section:.

– In Base SDK, change values to Latest OS X (OS X 10.10). – In Architectures, change values to Native Architecture of Build Machine (x86_64). Then, apply the following changes to both debug and release columns: Then, in Python, run: from numpy import *Ĭv2.PCACompute( data) Step 5: Configure Your Xcode Projectġ) Open XCode and select File > New > Project > OS X > Application > Command Line Tool.Ģ) Enter Product Name and select Type in the drop-down-list as C++.ģ) Click on your project from the left solution explorer and choose Build Setting tab. (The example uses PCA to compute the principal component coefficients for a 3-by-3 data matrix.)

Try the following sample codes in Terminal to see if it works. Now you have OpenCV bound with Python v2.7.9.
#Install python 2.7.9 install
Run the following command in Terminal to install OpenCV with Python bindings: sudo port install opencv +python27 Install Python v2.7.9 with NumPy and SciPy: sudo port install pyhton27 numpy scipy Step 4: Install OpenCV with Python Bindings Once MacPorts is correctly installed, run the following commands in Terminal: sudo port -v selfupdate Xcode 4 and later users need to first accept the Xcode EULA by either launching Xcode or running: sudo xcodebuild -licenseĭownload the *.pkg file from MacPorts. This usually means you already have the latest version installed.
#Install python 2.7.9 update
Don’t worry if you see a message telling you the software cannot be installed because it is not currently available from the Software Update Server. Once Xcode is installed, open a terminal, run: xcode-select -installĪnd click the Install button to install the required command line developer tools. Just download it from Apple’s Mac App Store and install it. Therefore, I offer a workaround if you are also suffering this process.
#Install python 2.7.9 mac os
Installing Python and OpenCV on Mac OS X, and using OpenCV in an Xcode project might be painful experiences, at least for me.
