当前位置:网站首页>Opencv3.2 and opencv2.4 installation
Opencv3.2 and opencv2.4 installation
2022-07-04 14:22:00 【wu_ zhiyuan】
OpenCV2 and 3 coexistence :
If 2 The default compilation installs , that 2 The location of the library should be /usr/local/lib , Again CMakeLists.txt in find_package, By default, the system will find /usr/local/share/OpenCVConfig.cmake
Download again 3 Source code , After decompressing
mkdir build
cd build
Change the installation directory ( First in /usr/local I'm gonna go ahead and create a new folder opencv3)
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local/opencv3 ..
compile :
make -j
sudo make install
This way 3 Installed in the opencv3 The folder (bin lib share include)
In use , stay CMakelists.txt in , For use 3, stay find_package Front indicated path :
set(OpenCV_DIR /usr/local/opencv3/share/OpenCV)
find_package(OpenCV 3 REQUIRED)
use 2 When :
find_package(OpenCV 2 REQUIRED)
If you want to use gdb debugging , Need to be in txt in :
SET(CMAKE_BUILD_TYPE "Debug")
However, this will slow down compilation
If you want to use C++11:
add_definitions(-std=c++11)
The simplest process :
cmake_minimum_required(VERSION 2.8)
project(XXX)
# Specify compiler :
SET(CMAKE_C_COMPILER g++)
# Find the bag you want to use :
find_package(OpenCV 3 REQUIRED)
include_directories(
${
PROJECT_SOURCE_DIR}
# Other header file paths
)
# Create a library :
add_library(${
PROJECT_NAME} SHARED
XXXXX.cpp
)
\# Link the library to the open source library
target_link_libraries(${
PROJECT_NAME}
${
OpenCV_LIBS}
)
# Generate executable files , Link to the created library
add_executable(main main.cpp)
target_link_libraries(main ${
PROJECT_NAME})
eigen Use
First of all, it needs to be in the root directory
mkdir cmake_modules
And in cmake_modules Put it in FindEigen3.cmake file
then :
set(CMAKE_MODULE_PATH ${
PROJECT_SOURCE_DIR}/cmake_modules)
# perhaps LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
find_package(Eigen3 REQUIRED)
include_directories( ${
EIGEN3_INCLUDE_DIR} )
Add :
opencv solve ippicv Download question , offline :ippicv_2019_lnx_intel64_general_20180723.tgz
https://blog.csdn.net/orDream/article/details/84311697
OpenCV must make install Install elsewhere , Otherwise, the relevant header file cannot be found , Also, you must specify the header file path , Otherwise I can't find it .
set(OpenCV_DIR /usr/local/opencv3/share/OpenCV)
# This kind of annotation is not good , Not recommended
#set(OpenCV_DIR /home/guoxianzheng/opencv-3.4/build)
find_package(OpenCV 3 REQUIRED)
message(STATUS "This is opencvdir ${OpenCV_DIR}")
include_directories(
${
OpenCV_DIR}
)
include_directories(/usr/local/opencv3/include)
边栏推荐
- QT how to detect whether the mouse is on a control
- Learning projects are self-made, and growth opportunities are self created
- [matlab] summary of conv, filter, conv2, Filter2 and imfilter convolution functions
- Ws2818m is packaged in cpc8. It is a special circuit for three channel LED drive control. External IC full-color double signal 5v32 lamp programmable LED lamp with outdoor engineering
- Golang uses JSON unmarshal number to interface{} number to become float64 type (turn)
- 迅为IMX6Q开发板QT系统移植tinyplay
- Unity Shader学习(三)试着绘制一个圆
- GCC [6] - 4 stages of compilation
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- Error in find command: paths must precede expression (turn)
猜你喜欢
CVPR 2022 | greatly reduce the manual annotation required for zero sample learning, and propose category semantic embedding rich in visual information (source code download)
Innovation and development of independent industrial software
学内核之三:使用GDB跟踪内核调用链
Introducing testfixture into unittest framework
China Post technology rushes to the scientific innovation board: the annual revenue is 2.058 billion, and the postal group is the major shareholder
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
Hardware Basics - diode Basics
Understand chisel language thoroughly 06. Chisel Foundation (III) -- registers and counters
Test process arrangement (2)
Unity Shader学习(三)试着绘制一个圆
随机推荐
Install MySQL
Learning projects are self-made, and growth opportunities are self created
QT how to detect whether the mouse is on a control
What is the real meaning and purpose of doing things, and what do you really want
数据埋点的一些问题和想法
Leetcode T47: 全排列II
R语言使用dplyr包的group_by函数和summarise函数基于分组变量计算目标变量的均值、标准差
AI与生命科学
R language uses follow up of epidisplay package The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The col parameter specifies the
Data warehouse interview question preparation
China Post technology rushes to the scientific innovation board: the annual revenue is 2.058 billion, and the postal group is the major shareholder
数据湖(十三):Spark与Iceberg整合DDL操作
docker-compose公网部署redis哨兵模式
R language uses the mutation function of dplyr package to standardize the specified data column (using mean function and SD function), and calculates the grouping mean of the standardized target varia
Test evaluation of software testing
Rich text editing: wangeditor tutorial
Mask wearing detection based on yolov1
R language uses bwplot function in lattice package to visualize box plot and par Settings parameter custom theme mode
海外游戏代投需要注意的
2022 game going to sea practical release strategy