杂记5--一些oponcv相关的坑
Posted 鸿_H
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了杂记5--一些oponcv相关的坑相关的知识,希望对你有一定的参考价值。
1、坑1
error: ‘accumulate’ was not declared in this scope; did you mean ‘cv::accumulate’?
解决方式,添加头文件
#include <numeric>
参考:https://github.com/rpng/calc/issues/8
2、坑2
error: ‘CV_GRAY2RGB’ was not declared in this scope
457 | cv::cvtColor(imTrack, imTrack, CV_GRAY2RGB);
解决:在报错文件上添加头文件 #include<opencv2/imgproc/types_c.h>
参考:https://wenda.ncnynl.com/article/5
3、坑3
error: ‘iota’ is not a member of ‘std’
166 | std::iota(sort_idx.begin(), sort_idx.end(), 0);
解决方式:在对应文件中添加
#include
4、坑4
error: ‘CV_EVENT_LBUTTONDOWN’ was not declared in this scope
41 | if (event == CV_EVENT_LBUTTONDOWN)
解决方式:将CV_修改为cv::
// if (event == CV_EVENT_LBUTTONDOWN)
if (event == cv::EVENT_LBUTTONDOWN)
#####################
不积硅步,无以至千里
好记性不如烂笔头
以上是关于杂记5--一些oponcv相关的坑的主要内容,如果未能解决你的问题,请参考以下文章
VS Code insiders 连接远程服务器的坑(杂记)