Monday, November 18, 2013

Installing OpenCV 2.4.7 on CentOs 6.4

# login as root & make sure cmake 2.8+ is installed

cd /tmp
mkdir opencv
cd opencv/
wget http://garr.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.7/opencv-2.4.7.tar.gz
tar -xvf opencv-2.4.7.tar.gz
cd opencv-2.4.7
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
make install

2 comments:

The Great Raisin said...

If you are facing any errors while building OpenCV, first do this. Go to terminal and enter:

sudo yum update --skip-broken

To ensure that the OpenCV gets built properly, it is necessary to configure Python as follows during installation:

./configure --enable-share
make
make test
make install

Also, 'cmake' may not be installed - you can get it by entering this in terminal:

sudo yum install cmake

The Great Raisin said...

To prevent errors during installation, do the following in terminal:

sudo yum update --skip-broken

Then, reconfigure Python as follows:

./configure --enable-share
make
make test
make install

Then, install 'cmake':

sudo yum install cmake

Finally, install OpenCV according to the instructions in this article.