当前位置:网站首页>Clion+opencv+aruco+cmake configuration
Clion+opencv+aruco+cmake configuration
2022-07-29 08:19:00 【_ Salt Baked Chicken】
First, list the software configuration used in this article :
- clion 2020.0.1 ( No money
- opencv 4.5.2
- aruco3.10, Don't download the latest version , Some function names have changed
- cmake 3.24
- win10
One 、 To configure opencv
opencv I'm not as good and detailed as this person , So you can read his article directly .
https://blog.csdn.net/bby1987/article/details/108985356
But one thing is worth noting , His CMakeList There's something wrong with the writing , One quotation mark is missing , This will result in failure to compile , I will release two packages later CMakeList.
Two 、aruco compile
Download link :https://sourceforge.net/projects/aruco/files/、
Configuration and opencv The same as , download , use cmake compile , And then use mingw Generate , See... For details opencv Documents
mingw32-make
or
mingw32-make -j8
// compile
mingw32-make install
// copy to install, Easy to use
There is no need to configure aruco Environment variables of , Just use it
3、 ... and 、CMakeList
cmake_minimum_required(VERSION 3.16)# The version is greater than 3.16
project(arucotest)# Create project , My project is arucotest, You can change it to your own project name at that time
set(CMAKE_CXX_STANDARD 20)# Set up Cpp edition
set(OpenCV_DIR "D:\\opencv isn\\opencv-4.5.2\\build_mingw64\\install")#opencv The address of the library
# seek opencv Kuhe aruco library
find_package(OpenCV REQUIRED)
find_package(aruco REQUIRED )
# Include and link opencvlib
include_directories(${OpenCV_INCLUDE_DIRS})
set(OpenCV_LIBS opencv_core opencv_imgproc opencv_highgui opencv_imgcodecs)
# This line is
add_executable(arucotest main.cpp)
# link arucolib
target_link_libraries(arucotest ${OpenCV_LIBS} ${aruco_LIBS})
This CMakeList I have practiced , Run through code , The test code is as follows
#include <iostream>
#include "aruco.h"
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(){
string imagePath = "D:\\Pictures\\1.JPG";// Be careful , Inside imagepath Change to your picture address
Mat image = imread(imagePath);
resize(image, image, Size(1024, 1024));
namedWindow("TestOpenCV", 0);
imshow("TestOpenCV", image);
waitKey(0);
destroyAllWindows();
return 0;
}
PS: If someone wants to learn cmake, My suggestion is to watch this video and GitHub, After reading it for an hour, you can probably write it yourself cmake 了
https://www.bilibili.com/video/BV14h41187FZ?spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=1ef56da7b9f25f108ff0dc3ccaf38102
边栏推荐
- Random lottery turntable wechat applet project source code
- [robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
- Hal library learning notes - 8 concept of serial communication
- Si12t and si14t low power capacitive touch chips
- Simulation of four way responder based on 51 single chip microcomputer
- What is the working principle of the noise sensor?
- Use the cloud code to crack the problem of authentication code encountered during login
- BiSeNet v2
- 125kHz wake-up function 2.4GHz single transmitter chip-si24r2h
- Intelligent temperature control system
猜你喜欢
Charging pile charging technology new energy charging pile development
Privacy is more secure in the era of digital RMB
Alibaba political commissar system - Chapter 4: political commissars are built on companies
MySQL rownum implementation
Inclination monitoring solution of Internet of things
pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
Proteus simulation based on msp430f2491 (realize water lamp)
The computer video pauses and resumes, and the sound suddenly becomes louder
[beauty of software engineering - column notes] 29 | automated testing: how to kill bugs in the cradle?
[academic related] why can't many domestic scholars' AI papers be reproduced?
随机推荐
Cs4344 domestic substitute for dp4344 192K dual channel 24 bit DA converter
[noi simulation] computational geometry (convex hull, violence, and search set)
RPC和REST
网络安全之安全基线
Network Security Learning chapter
Low cost 2.4GHz wireless transceiver chip -- ci24r1
深度学习(2):图片文字识别
数仓分层设计及数据同步问题,,220728,,,,
Unity多人联机框架Mirro学习记录(一)
Simulation of four way responder based on 51 single chip microcomputer
Unity Shader学习(六)实现雷达扫描效果
Dp4301-sub-1g highly integrated wireless transceiver chip
随机抽奖转盘微信小程序项目源码
[beauty of software engineering - column notes] 25 | what methods can improve development efficiency?
Tensorboard use
Segment paging and segment page combination
Dynamically load data
数字人民币时代隐私更安全
Tb6600+stm32f407 test
Huawei wireless device configuration uses WDS technology to deploy WLAN services