视觉SLAM十四讲 报错 Could not find a configuration file for package “OpenCV“ that is compatible with reques

安装Sophus缺少fmt问题及解决方法 1.安装方法 进入终端后: git clone https://github.com/strasdat/Sophus.git cd Sophus mkdir build cd build cmake .. make sudo make install 2.遇到问题 当进行到cmake ..时,会显示以下问题: CMake Error at CMakeLists.txt:42 (find_package): By not providing "Findfmt.cmake" in CMAK.. 阅读详情
AI摘要

在编译高博的视觉SLAM教程时遇到OpenCV版本不兼容的问题,错误提示找不到合适的OpenCV4配置文件。原因是之前安装的OpenCV版本为3.4.16。解决方案包括修改CMakeLists.txt,将查找OpenCV4改为OpenCV3,或者选择编译OpenCV4。此外,可能还会遇到Sophus或G2o版本过高导致的fmt库问题。通过这些调整,可以成功编译并运行程序。

视觉SLAM十四讲 报错 Could not find a configuration file for package "OpenCV" that is compatible with requested version "4".

1. 问题

在编译高博的视觉SLAM十四讲ch8的optical_flow.cpp时,编译报错:

CMake Error at CMakeLists.txt:8 (find_package):
  Could not find a configuration file for package "OpenCV" that is compatible
  with requested version "4".

  The following configuration files were considered but not accepted:

    /usr/local/share/OpenCV/OpenCVConfig.cmake, version: 3.4.16

-- Configuring incomplete, errors occurred!

2. 原因

在第八讲的这个程序里,CMakeLists.txt中编译find_package查找的是OpenCV4,而十四讲前面使用的opencv包括自己编译的都是opencv3版本,所以编译过程找不到相应的库文件以及链接,报错。

3. 解决方案

3.1 修改CMakeLists.txt

简单粗暴,虽然opencv版本不同,但是3到4大部分接口函数都是一样的,所以在CMakeLists.txt中将查找OpenCV4改为查找OpenCV3:

# find_package(OpenCV 4 REQUIRED)
find_package(OpenCV 3 REQUIRED)

然后就可以编译成功了。由于安装的Sophus版本或者G2o版本过高,还可能会出现fmt::v8的链接问题,解决方案在这里。

3.2 编译OpenCV4版本

编译OpenCV以及多版本共存问题

OpenCV找不到config.cmake(简单直接的解决方法):Could not find a package configuration file provided by “OpenCV“ 背景: ROS功能包调用OpenCV,实现运动检测。 从结果上看,其它类似情况应该也可以用此方法解决(因为是根据终端报错信息找到错误)。 报错:! 简单来说就是catkin_make编译时找不到需要的OpenCVconfig文件。 . . . 解决方法: 既然需要config文件,首先需要在OpenCV库中找到它。对此每个人情况不同,我按照论坛上许多方法都找不到,最后直接全文件搜索:opencvconfig(大家要是搜索不到可以进入最有可能的opt文件夹下搜索) 然后在功能包的 阅读详情

相关推荐

ROS 编译发生错误:Could not find a package configuration file provided by... Could not find the required

总结: 你缺少什么包,就安装什么包即可:sudo apt-get install ros-kinetic-*** 错误一: -- Could not find the required component 'moveit_ros_planning_interface'. The following CMake error indicates that you either need t...

Tim的嵌入式之旅 3万+

Could not find a configuration file for package “OpenCV“ that is compatible with requested version “

3. 更新OpenCV版本:如果系统中没有安装所需版本的OpenCV,可以尝试更新OpenCV到所需版本,或者安装所需版本的OpenCV。1. 确认OpenCV版本:首先需要确认所需的OpenCV版本是多少,然后检查系统中是否已经安装了该版本的OpenCV。其中,/usr/local/share/OpenCV是OpenCV配置文件的路径,3.0是所需的OpenCV版本号。这个错误提示是在使用CMake构建项目时出现的,原因是CMake无法找到与所需OpenCV版本兼容的配置文件。

k1419197516的博客 3976

Hermes深入理解及源码解析(二):Hermes的记忆机制

源码位置:tools/memory_tool.py存储内容为两个文件,放在 ~/.hermes/memories/:MEMORY.md:Agent 自己的笔记(环境事实、项目约定、工具坑、学到的东西)—— 上限 2200 字符USER.md:关于用户的画像(角色、偏好、沟通风格)—— 上限 1375 字符作为一个独立的工具注册在系统中(为了让智能体正确使用它,System Prompt()中明确下达了禁令存储目标存储位置数据类型持久偏好/事实MEMORY.md我是谁、我喜欢什么、环境配置。

qq_41984117的博客 572

ORB_SLAM3编译报错问题-找不到OpenCV4.4

CMake Warning at CMakeLists.txt:33 (find_package): Could not find a configuration file for package "OpenCV" that is compatible with requested version "4.4". The following configuration files were considered but not accepted: /usr/share/OpenCV/.

m0_57013986的博客 8158

【MFRC522】STM32与MFRC522的SPI通信优化及常见问题解析

本文深入解析了STM32与MFRC522进行SPI通信的优化方法与常见问题。从基础的硬件连接到SPI时序优化,再到关键的寄存器配置(如RFCfgReg设为0x4F以提升读卡稳定性),文章提供了详细的调试技巧和实战排坑指南,帮助开发者实现稳定高效的IC读卡应用。

yhn45678901的博客 851

[机器学习-回归实例] 李宏毅机器学习作业一:PM2.5 预测实例

[机器学习-回归实例] 李宏毅机器学习作业一:PM2.5 预测实例 简介   这是一个回归预测的实例,数据集来自李宏毅的《机器学习》课程的第一次作业,可以用来训练一个线性回归模型或者其他的回归模型,动手实践学习到的理论知识,在实践中去发现问题。这篇文章主要包括数据集的解释、数据的预处理过程及线性回归模型的代码实现这三个部分。由于这个数据集并不能直接使用,还需进行一些重构,为了对初学者更友好一些,我会提供重构完的可以读取后就直接使用的数据集,我也会提供 Matlab\rm MatlabMatlab 可直接使用

qq_27309515的博客 3582

视觉SLAM十四讲-第八讲调试笔记及问题解决(LK光流)

编译过程中,cmake ..报错如下: CMake Error at CMakeLists.txt:8 (find_package): Could not find a configuration file for package "OpenCV" that is compatible with requested version "4". The following configuration files were considered but not accepted:

weixin_43728093的博客 3126

C语言手写HTTPD网站服务器

零基础手写C语言http网站服务器,快速入门C/C++后端开发、服务器开发。

程序员Rock的博客 1万+

ORB_SLAM3 ROS编译及使用D435I运行

本文介绍ORB_SLAM3编译、运行中遇到问题,尤其涉及到ORB_SLAM3 ROS编译遇到的问题。最后通过使用D435I完成在室内环境下运行。

u010196944的博客 8155

瑞芯微RK3576开发实战:固件烧录与内核启动的典型问题解析

本文详细解析了瑞芯微RK3576开发板在固件烧录与内核启动过程中遇到的典型问题及解决方案。从开发工具版本检查、DDR配置调整到内核启动异常的设备树适配和电源管理问题,提供了系统性的调试方法和实用技巧,帮助开发者高效解决RK3576开发中的常见挑战。

weixin_33700350的博客 461

【ArcGIS Pro微课1000例】0067:ArcGIS Pro3.4.2学习版下载及安装教程

【ArcGIS Pro微课1000例】0067:ArcGIS Pro3.4.2学习版网盘下载及安装教程

智慧空间实验室 2422

Linux下项目构建编译时OpenCV 找不到报错

OpenCV 找不到或者系统版本不符合当前项目需求,报错如下: cmake .. # 输出如下: CMake Error at example/CMakeLists.txt:2 (find_package): Could not find a configuration file for package "OpenCV" that is compatible with requested version "3.0.0". The following configuration files we

专注于AI领域前沿技术学习与分享:目标检测、图像修复、超分重建、AI工程化 4605

基于深度学习的树木种类识别

本文介绍了基于深度学习的树木种类识别技术。我们将通过深度学习模型和图像处理技术实现对树木的自动识别与分类。首先,我们将介绍深度学习的基本原理和相关算法。接着,我们将详细说明树木种类识别的数据准备、模型构建和训练过程。最后,我们将给出代码示例,帮助读者深入了解和实践该技术。

一键难忘的博客 2329

opencv 3.1和2.4的共生调用

参考博客:http://blog.csdn.net/hansry/article/details/75309906 报错:CMakeErroratCMakeLists.txt:7(find_package): Couldnotfindaconfigurationfileforpackage"OpenCV"thatiscompatible withre...

工大机器人工作室 1179

QGraphicsView通过鼠标操作来绘制图元

在Visio和MindManager等类似的图元操作软件中,很多时候我们会通过鼠标操作来添加自定义的图元。这里就介绍一下如何在QT的图形视图框架中通过鼠标绘制来添加图元。

yang1fei2的博客 3583

inori mmd 7z

楪祈的模型资源....................................................................................................................................................................................................................

cmake opencv 路径问题

 cmake配置出现如下问题: CMake Error at CMakeLists.txt:12 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file pr

yangpan011的博客 2万+

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

PCL cmake报错,The following configuration files were considered but not accepted:

买了《点云库PCL从入门到精通》,第一个例子就是安装pcl,在cmake跑一下代码,检查PCL是否安装完成,然后就报错了。 搜了很多地方都没有找到解决方案,现在记下来。 错误: 初次安装PCL1.8.1,使用cmake 3.14.2,跑代码之后报错 Could not find a configuration file for package "VTK" that is compatible ...

sparkleyn的博客 9274

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

ROS——编译PCL相关程序报错:Could not find a package configuration file provided by “PCL“

报错截图 解决方法 参考文章:PCL 安装问题 sudo apt-get install libpcl-dev pcl-tools 其他过程中的编译报错 sudo apt-get install ros-melodic-pcl-conversions

Irving.Gao的博客 2549

Jetson tx1 下编译ros zed 驱动报错

使用的是16.04 ubuntu ,刷机完成后按照官网编译zed_wraper ,报错: CMake Error at zed-ros-wrapper-master/CMakeLists.txt:22 (find_package):   Could not find a configuration file for package "OpenCV" that is compatible  

朗云星空 647

Could not find a configuration file for package opencv2解决 方法

Remove OpenCv Opencv2 etc. from your run and build depends (in package.xml) as well as from the line find_package( catkin REQUIRED COMPONENTS .... (in CMakeLists.txt) With catkin in groovy/hydro Open

无穷山色 7601

SLAM十四讲编译全过程记录与错误与解决方案汇总

SLAM十四讲(第二版)错误与解决方案汇总

LNSTOP的博客 8971

qt 错误Could not find a configuration file for package XXX that is compatible with requested version

结果反复检查发现是这个项目设置的编译器为32bit,我的VTK和环境全都是64bit的,所以这里要选择成下面的MSVC2017 64bit(红色圈内为错误的哈)还会提示The following configuration files were considered but not accepted。一开始还以为是自己安装的VTK有问题。但是检查之后发现正常安装,然后还在cmakelists里面添加库查找路径,如下图。

ney18781902474的博客 799

PUTN catkin报错CMake Error 解决

解决办法:打开putn/src/putn/putn_rviz_plugins/CMakeLists.txt文件,找到这段。endif()”删除其中的${rviz_QT_VERSION}将其改成。原因是找不到5.9.5版本的Qt。在编译PUTN项目时出现如下报错。

twc16670334539的博客 945

Qt5.8.0--cmake error...编译报错提示无法找到对应版本的Qt

错误信息: CMake Error at CMakeLists.txt:76 (find_package): Could not find a configuration file for package “Qt5” that is compatible with requested version “5.8.0”. The following configuration files were c...

weixin_44401286的博客 7116

ubuntu18.04编译安装orb-slam3及ros下运行

编译运行orb-slam3

weixin_68063596的博客 3877

EAO-SLAM安装

Error: CMake Warning at CMakeLists.txt:189 (FIND_PACKAGE): By not providing "FindRapidJSON.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "RapidJSON", but CMake did not find one. Could not

SLAM的博客 5717
上一篇: 视觉SLAM 第7讲 本质矩阵 基础矩阵 单应矩阵 知识点/证明/理解/秩/自由度
下一篇: 视觉SLAM十四讲 第5讲 相机与图像
LYF0816LYF
博客等级 码龄9年 2314粉丝 34原创
评论 11
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址