Last Updated: February 25, 2016
·
1.963K
· sophrinix

Reliably install OpenCV 2.4.9 in OSX 10.7.5 or Linux (ubuntu)

installing dependencies (on ubuntu) Make sure equivalents exist on OSX if the later steps fail

sudo apt-get update
sudo apt-get install git-core subversion cmake build-essential libgtk2.0-dev libjpeg-dev pkg-config libpq-dev libopenssl-ruby

setting up opencv

$ git clone git://github.com/Itseez/opencv.git
$ cd opencv #or whatever you cloned the directory down to
$ mkdir release && cd release
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make && sudo make install && sudo ldconfig

Bonus round

$ gem install opencv 

This should now work! I HIGHLY recommend that you stick with 64 bit everything (ruby, linux, opencv, etc). Also, this is for x86 (64 bit as oppose to arm. I do not vouch for this working on arm).

1 Response
Add your response

Have you ever used managed multiple opencv versions on the same Linux installation? I.e., if I skip the "make install" step, how can I make the linker find the libraries?

over 1 year ago ·