2017年1月29日 星期日

Install the library of OpenCV in windows 7

Before using the OpenCV library, we need to build that via CMake.
Here we will introduce "How to build/install OpenCV library in windows"

Actually, we will use Code:Block on windows7 in this introduction, and the steps as follow:

Step 1. Install CMake.
Step 1.1. Download the CMake software via website http://www.cmake.org/
Step 1.2. Install CMake.
(Actually you just need to install this normally, so we don't introduce this in this selection)

Step 2. Download the source of openCV.
Step 2.1. Download the source of OpenCV via website http://opencv.org/downloads.html
Step 2.2. Decompress the compressed packet of OpenCV.
Step 2.3. Create the directory for OpenCV library.

Step 3. Build the mingw32-make of OpenCV with CMake
Step 3.1. Search keyword "IPP" and disable it, if your computer can't support Interl IPP(just like AMD CPU).
Step 3.2. Modify the file "OpenCVCompilerOptions.cmake" in the directory of OpenCV source if the version of OpenCV is 3.0.0 or higher. Search "add_extra_compiler_option(-Werror=non-virtual-dtor)" and comment this line just like
#add_extra_compiler_option(-Werror=non-virtual-dtor)
Step 3.3. Execute the CMake and configure the directory.
Step 3.4. Delete the cache if you has configure this.
Step 3.5. Configure and choose the gcc compiler you use.
Step 3.6. Check the information and the list of function, and press "Generate" if there has no issue.(If there has error for this, you could search the key word with google)

Step 4. Install openCV Library with mingw32-make.
Step 4.1. Execute Command Prompt and enter to the directory of OpenCV library.
Actually it will generate mingw32-make by step 3, and we will use it for generating OpenCV library.
Step 4.2. Send command "mingw32-make"
Step 4.2. Send command "mingw32-make install", if step 4.2 is successful.

Step 5. Configure OS environment.
Step 5.1. 

Step 6. Verify OpenCV library by coding.
Step 6.1. 

沒有留言:

張貼留言