Emmanuel Pastor bio photo

Emmanuel Pastor

Software polymath, application architect, code craftsman.

Twitter

LinkedIn

Github

Installing OpenCV on Mac OS X Mavericks

Update: OpenCV 2.4.7 has broken support for QTKit, which is used by default in Mac OS X for video I/O, here’s how to fix it


From Wikipedia:

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real-time computer vision, developed by Intel, and now supported by Willow Garage and Itseez. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing. If the library finds Intel’s Integrated Performance Primitives on the system, it will use these proprietary optimized routines to accelerate itself.

This is the first research post in the BabyCam Series, usually I would start with a very basic version of the project (e.g. Just a WiFi camera that would stream the video and perhaps a Web server to watch the stream from a browser) but in this case, I think the really interesting part of the project (And the reason I’m making the hardware myself) is video processing, and while I’ve fiddled around with Arduinos a lot, this will be my very first Raspberry Pi project and I’m not even sure it will be able to handle the kind of real-time video processing I want to do, so we’ll start with that.

Installing OpenCV on Mac OS X Mavericks

  • Make sure you have the latest XCode installed.
  • Download OpenCV 2.4.7 for MacOS.
  • Extract the OpenCV Package:
$ tar -zxvf opencv-2.4.7.tar.gz
  • Go to the OpenCV folder:
$ cd opencv-2.4.7
  • Generate the Makefile:
$ cmake -G "Unix Makefiles"
  • Build it:
$ make -j8
  • Install it:
$ sudo make install
  • If you don’t see any error messages you should be all set, let’s make sure:
$ pkg-config --modversion opencv
2.4.7

That’s it!, if you come across any installation errors make sure your system satisfies all the prerequisites, but following these steps worked flawlessly for me on a pretty vanilla Mavericks installation.



comments powered by Disqus