I have been mixing in Ubuntu recently, and I have also seen that OpenCV is already in version 2.2 (it is estimated that it has been upgraded for a long time, but I am ignorant). Let's start installing it ~ 1. Download The OpenCV2.2 source code package. 2.
I have been mixing in Ubuntu recently, and I have also seen that OpenCV is already in version 2.2 (it is estimated that it has been upgraded for a long time, but I am ignorant). Let's start installing it ~
1. Download The OpenCV 2.2 source code package at http://www.opencv.org.cn/download/opencv-2.2.0.tar.bz2. You can use the apt-get install command to find the opencv package and install it directly. However, we recommend that you start from the source code package.
2. Install cmake. keystore. This is the "makefile" of cmake. Through this file, cmake first configures the source code to the regular installation package and generates the Makefile file of make of gcc.
Well, first, create a folder OpenCV-build in the directory at the same level as the source code package, and then install cmake. Sudo apt-get install cmake under the terminal, and then sudo apt-get install cmake-qt-gui. After the installation is successful, enter cmake-gui on the terminal to open an interface:
Click "Browse Source" to select the extracted Source code folder, click "Browse Build" to select the OpenCV-build folder you just created, and click "configure". Then, you can click "Generate, however, the Generate button is still gray. Click the configure button again. You can click Generate to see the success prompt below.
3. Open the OpenCV-build folder and the Makefile file appears, as shown in the following figure:
Open the terminal, go to OpenCV-build, and enter make. This series of sharp installation processes should appear...
4. Finally, enter sudo make install to complete the installation.
5. Now, let's test whether the installation is successful:
Terminal to the decompressed OpenCV-2.2.0 \ samples \ c folder, there is a build_all.sh script, execute it: bash. /build_all.sh. After successful execution, the ls command is used to view and generate a facedetect execution file ,. /execute facedetect! If a face capture window pops up, congratulations, you have succeeded.
Note: If the last execution of facedetect reports an error:./facedetect: error while loading shared libraries: libopencv_core.so.2.2: cannot open shared object file: No such file or directory.
This is because you have not installed ffmpeg. It is easy to run. Enter sudo-apt-get install ffmpeg to install ffmpeg. After the installation is successful, execute facedectect!