在出错的程序里面添加相应的头文件即可
1.‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
#include "opencv2/imgcodecs/legacy/constants_c.h"
2.‘CV_FILLED’ was not declared in this scope
#include <opencv2/imgproc/imgproc_c.h>
3.‘CV_AA’ was not declared in this scope
#include "opencv2/imgproc/imgproc_c.h"
4.‘CV_RGB2GRAY’ was not declared in this scope
#include<opencv2/imgproc/types_c.h>
5.‘CV_MINMAX’ was not declared in this scope
#include<opencv2/opencv.hpp>
6…‘CV_RGB2GRAY ’ was not declared in this scope
#include <opencv2/highgui/highgui_c.h>
7.‘CV_GRAY2RGB’ was not declared in this scope
#include<opencv2/imgproc/types_c.h>
8.CV_ADAPTIVE_THRESH_MEAN_C’ was not declared in this scope
#include <opencv2/calib3d/calib3d_c.h>
9.‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
#include"opencv2/imgcodecs/legacy/constants_c.h"
10.error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
CV_FONT_HERSHEY_SIMPLEX替换为cv::FONT_HERSHEY_SIMPLEX
11.#include "opencv/cxeigen.hpp"报错
#include <opencv2/core/eigen.hpp>
12 could not find opencv (missing aruco)
Hi Yes I did! After you git clone the moveit_calibration, go into the moveit calibration folder, then moveit_calibration_plugin. Edit the cmakelist.txt:
#find_package(OpenCV REQUIRED imgcodecs aruco)
find_package(OpenCV 4)
You will also need to git clone opencv_contrib to your src folder/same workspace afterwards.
Then open the opencv_contrib folder, go into the modules folder, then the aruco folder, and then the include folder.
Copy the opencv2 folder found inside the include folder and paste the folder in the moveit calibration package inside moveit_calibration_plugins/handeye_calibration_target/include and every single sub folder inside the include folder too just to make sure the header file can find the aruco.
I'm not sure exactly where to put the opencv2 folder so i pasted everywhere inside here. And this should solve this particular error.
若还不行,重装opencv
https://learningsky.io/install-opencv-on-nvidia-jetson-agx-xavier/
安装OpenCV时提示缺少boostdesc_bgm.i文件的问题解决方案(附带百度云资源)_有菜的博客-CSDN博客
先试一下
sudo apt install pkg-config libopencv-dev
aucro 报错
opencv opencv-contrib版本问题
4.5.2
4.6.0 某几个函数变了
4.7 好多函数都变了