Compile OpenCV 2.4.1 on Mac Os X Lion 1 minute read After looking an episode of TBBT concerning a OCR iPhone app, I was considering to develop a real one or at least a prototype. Install OpenCV 3 on MacOS May 29, 2017 By Vaibhaw Singh Chandel 69 Comments In this post, we will provide step by step instructions for installing OpenCV 3.3.0 (C++ and Python) on MacOS and OSX. Installing OpenCV 2.4.9 on Mac OSX with Python Support. Download and install ffmpeg and it should work, if not you may need to recompile OpenCV after. OpenCV 2.4.3 iOS CvVideoCamera throws build errors cmake install_name_tool absolute path for library on Mac OSX Mac, openCV and kinect - has anybody had success? How To Install OpenCV On Mac OSX. Installing OpenCV might be a bit of a pain. Here is a summary of how you can install OpenCV on Mac OSX. In this article you can figure out how to install c/c++ on your mac. 2) Download and extract OpenCV on your computer. This can be on any folder on your computer, example, /myhome/opencv/.

  1. Which Opencv To Download For Mac Osx Download
  2. Which Opencv To Download For Mac Osx 10
  3. Opencv Mac Xcode

Which Opencv To Download For Mac Osx Download

Install OpenCV 3 + Python 3.5 macOS tutorial

This is a rapid tutorial to install OpenCV 3 on macOS. I have eliminated long description and focused only on installation commands more.

1. Install XCode

In order to compile OpenCV on macOS, we need to install XCode first. The simplest way to get XCode is right from your App Store application in your Mac. Open App Store -> Search “XCode” -> Get.

Although, I prefer to get it from my apple developer account. If you have a developer’s account, then you can download the latest version from here.

Once you are done installing XCode, you need to now agree the developer license. Run the following command in the terminal and follow the instructions in terminal to agree the license:

2. Install Command Line Tools

Next step is to install Apple Command Line Tools. Run the following command in terminal:

Upon executing the above command, a pop will appear. Click “install”.

3. Install Homebrew

Homebrew is a package manager for macOS. To install homebrew run the following command in terminal:

$/usr/bin/ruby-e'$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

Update homebrew

Now we need to update our ~/.bash_profile file. You can run the following command to open up the file in nano editor. I am using nano editor.

Add following lines to the file to update the path variable to look for the libraries in Homebrew path before system path:

2
export PATH=/usr/local/bin:$PATH

Don’t forget to save and exit the file. Then use the source command to with your bash profile:

4. Install Python 3.5

Use the following command to install python:

After installation finishes, create symbolic links:

5. Install Python Virtual Environments and NumPy

In simple terms, virtual environments is something that lets us use different versions of libraries, softwares on same system. For example, in a virtual environment named cv2, I can install OpenCV 2 and in virtual environment cv3, I can install OpenCV 3. Now when I wish to work with the older version of the library then I work in cv2 environment and for newer I use cv3 environment. Similarly, different Python versions in different virtual environments.

Use following command to install virtualenv and virtualenvwrapper.

Once again update the bash profile file:

Add following lines to it:

Use the following commands to install them:

Osx
2
4
6
$python
Python3.5.2(default,Oct112016,04:59:56)[GCC4.2.1Compatible Apple LLVM8.0.0(clang-800.0.38)]on darwin Type'help','copyright','credits'or'license'formore information.
>>>cv2.__version__'3.1.0-dev'

Note: If you are willing to use TensoFlow along with OpenCV and in case, if you have installed TensorFlow using virtualenv tutorial, then you won’t be able to work on both. You will have to install TensorFlow again in the OpenCV virtualenv we created. In our example, we have to install TensoFlow in cv3 virtualenv.

Opencv Mac Xcode

Related