Opencv was originally developed in windows, but TME code runs in Ubuntu. to run that code, you can only port the entire development environment to CentOS, the entire process is quite difficult, because many dependent packages are not imported, resulting in the final failure. Therefore, follow the steps below to install Opencv. 1. security
Opencv was originally developed in windows, but TME code runs in Ubuntu. to run that code, you can only port the entire development environment to CentOS, the entire process is quite difficult, because many dependent packages are not imported, resulting in the final failure. Therefore, follow the steps below to install Opencv.
1. install dependencies
Sudoyum install gcc-c ++ gtk2-devel gimp-develgimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devellibpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-develjasper-devel jasper- utils swig python libtool nasm
Here is one thing to note, gtk was originally gtk-devel looks like the gtk source has been upgraded, so the use of gtk2-devel, is not good, use "sudo yum install gtk *" directly. although it is rude, kill one thousand by mistake and never release one!
2. download opencv
Http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
3. command: "cd ~ /Downloads
4. command: "unzip opencv-2.4.9.zip" to extract the opencv source code
5. command: "cd opencv-2.4.9" to enter the source code folder
6. run the "cmake CMakeLists.txt" command to generate the build file.
7. run the "make" command to compile opencv.
8. command: "sudo make install" to complete the installation of opencv
After the installation is complete, the header file of Opencv is under the "/usr/local/include" directory.
The library file of Opencv is in the "/ust/local/lib" directory.
9. command: "cd/etc/ldso. conf. d/": enter the environment variable configuration folder of the warehouse file, and run the" ls "command to view the existing library file configuration in the current folder.
10. command: "sudo vimopencv. conf", press "I", enter the library file directory "/usr/local/lib" of opencv, save and exit
11. ldconfig load library file configuration