Use the command to see the current opencv version:
It comes with opencv-2.4.9
Install opencv3.1
Install the dependencies of opencv
Enter the decompressed opencv installation package, create a new directory, the directory name is build, and enter the directory
input the command
Here, the installation directory of opencv3.3 is placed in the /usr/local/opencv310 folder, and the parts related to CUDA are also annotated (the currently installed CUDA7.5 cannot be compiled when compiling)
Next, you need to configure the file, and set PKG_ CONFIG_PATH by modifying the bashrc file (later found that you need to change LD_LIBRARY_PATH) <quote>
After saving, use the command
At this time, using the command, the opencv version has become 3.1
When you are using the cmake tool, you can use opencv3.1 by adding the path to CMakeLists.txt
set(OpenCV_DIR /usr/local/opencv310/share/OpenCV)
find_package(OpenCV 3.1 REQUIRED)
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS} /usr/local/opencv310/include)
find_package("/usr/local/opencv310/include/opencv2")
When you want to go back to using opencv2, replace find_package(OpenCV 3.1 REQUIRED ) with find_package(OpenCV REQUIRED ), and delete the upper and lower lines of the code.