杂记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) {

#####################
不积硅步,无以至千里
好记性不如烂笔头

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值