Install Opencv2.4.9 in CentOS

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.