当前位置:网站首页>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
边栏推荐
- Eps32+platform+arduino running lantern
- STM32 MDK (keil5) contents mismatch error summary
- Intelligent shelf safety monitoring system
- Dp1332e multi protocol highly integrated contactless read-write chip
- The difference between torch.tensor and torch.tensor
- V-Ray 5 acescg workflow settings
- Tb6600+stm32f407 test
- [beauty of software engineering - column notes] 23 | Architect: programmers who don't want to be architects are not good programmers
- Lora opens a new era of Internet of things -asr6500s, asr6501/6502, asr6505, asr6601
- Importerror: no module named XX
猜你喜欢

RPC和REST

Ga-rpn: recommended area network for guiding anchors

DC motor speed regulation system based on 51 single chip microcomputer (use of L298)

Implementation of support vector machine with ml11 sklearn

(视频+图文)机器学习入门系列-第5章 机器学习实践

Unity多人联机框架Mirro学习记录(一)
![[beauty of software engineering - column notes] 28 | what is the core competitiveness of software engineers? (next)](/img/c1/49b4610c483933442fb96b8e3f5315.png)
[beauty of software engineering - column notes] 28 | what is the core competitiveness of software engineers? (next)

Simulation of four way responder based on 51 single chip microcomputer
![[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient](/img/d1/5b980d8b9580b9808b2b3f51d5b9c6.png)
[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient

深度学习(1):银行客户流失预测
随机推荐
MySQL rownum implementation
Cs5340 domestic alternative dp5340 multi bit audio a/d converter
Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning
Simplefoc parameter adjustment 2- speed and position control
torch.Tensor.to的用法
Back up Google or other browser plug-ins
UE4 principle and difference between skylight and reflecting sphere
[beauty of software engineering - column notes] 29 | automated testing: how to kill bugs in the cradle?
V-Ray 5 acescg workflow settings
Hal library learning notes - 8 concept of serial communication
Beautiful girls
HC-SR04超声波测距模块使用方法和例程(STM32)
Simulation of four way responder based on 51 single chip microcomputer
[beauty of software engineering - column notes] 24 | technical debt: continue to make do with it, or overthrow it and start over?
[academic related] why can't many domestic scholars' AI papers be reproduced?
node:文件写入数据(readFile、writeFile),覆盖与增量两种模式
SQL 面试碰到的一个问题
Tle5012b+stm32f103c8t6 (bluepill) reading angle data
Some simple uses of crawler requests Library
ROS common instructions