当前位置:网站首页>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)
边栏推荐
- 利用Shap值进行异常值检测
- Test evaluation of software testing
- Product identification of intelligent retail cabinet based on paddlex
- 【FAQ】華為帳號服務報錯 907135701的常見原因總結和解决方法
- 2022 practice questions and mock exams for the main principals of hazardous chemical business units
- Ruiji takeout notes
- ML之shap:基于boston波士顿房价回归预测数据集利用Shap值对LiR线性回归模型实现可解释性案例
- 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
- Map of mL: Based on Boston house price regression prediction data set, an interpretable case is realized by using the map value to the LIR linear regression model
猜你喜欢

使用CLion编译OGLPG-9th-Edition源码

Install MySQL

Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value

【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制

NowCoder 反转链表
![去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]](/img/af/a1dcba6f45eb4ccc668cd04a662e9c.png)
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]

The font of markdown grammar is marked in red

【信息检索】分类和聚类的实验

数据湖(十三):Spark与Iceberg整合DDL操作

Introducing testfixture into unittest framework
随机推荐
AI and Life Sciences
R language ggplot2 visualization: gganimate package creates dynamic line graph animation (GIF) and uses transition_ The reveal function displays data step by step along a given dimension in the animat
Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value
php 日志调试
Leetcode T49: 字母异位词分组
按照功能对Boost库进行分类
The font of markdown grammar is marked in red
[matlab] summary of conv, filter, conv2, Filter2 and imfilter convolution functions
R语言dplyr包summarise_if函数计算dataframe数据中所有数值数据列的均值和中位数、基于条件进行数据汇总分析(Summarize all Numeric Variables)
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
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
【MySQL从入门到精通】【高级篇】(五)MySQL的SQL语句执行流程
Gorm data insertion (transfer)
Supprimer les lettres dupliquées [avidité + pile monotone (maintenir la séquence monotone avec un tableau + Len)]
瑞吉外卖笔记
R语言使用dplyr包的group_by函数和summarise函数基于分组变量计算目标变量的均值、标准差
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
第十七章 进程内存
2022游戏出海实用发行策略
AI与生命科学