I just did the same install on CentOS 6. Since the install instructions are more geared toward Ubuntu, here is what I was able to do to install it:
install all the required packages using yum
yum groupinstall "Development Tools" yum install gcc yum install cmake yum install git yum install gtk2-devel yum install pkgconfig yum install numpy yum install ffmpeg
Create working directory and check out the source code [note: You probably don't want to use the tag below anymore as it is a significantly old version. I had to use that version due to my software requiring it.]
mkdir /opt/working cd /opt/working git clone https://github.com/Itseez/opencv.git cd opencv git checkout tags/2.4.8.2
Create the Makefile
mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
If using cmake version 2.6-patch 4 (check with cmake --version), then you'll need to comment out a line in the build. Comment out string(MD5 hash "$") on line 50 in /opt/working/opencv/cmake/cl2cpp.cmake. Other options (including updating cmake) can be found at here.
Build and install
cd /opt/working/opencv/release make make install