Emmanuel Pastor bio photo

Emmanuel Pastor

Software polymath, application architect, code craftsman.

Twitter

LinkedIn

Github

Installing OpenCV on Mac OS X Mavericks with MacPorts

After finding out that OpenCV 2.4.7 has broken support for QTKit, which is used by default in Mac OS X for video I/O, and that Brew could not link it due to unrelated permission errors, I went ahead and gave MacPorts a shot.

   

From the MacPorts website:

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the OS X operating system.

I’m going to try to make this short and sweet, since we’ve already covered the basics in a previous post.

  • Install MacPorts. Please refer to the latest installation guide at MacPort’s website
  • Install OpenCV using MacPorts:
$ sudo port install opencv
  • Add the OpenCV libraries to the PKG_CONFIG_PATH and LD_LIBRARY_PATH variables:
$ export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
$ export LD_LIBRARY_PATH=/opt/local/lib

You should be all set!, let’s try writing out first OpenCV program to make sure.



comments powered by Disqus