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) {
#####################
不积硅步,无以至千里
好记性不如烂笔头