gpt4 book ai didi

c++ - 错误 : 'varName' was not declared in this scope

转载 作者:搜寻专家 更新时间:2023-10-31 02:23:25 27 4
gpt4 key购买 nike

<分区>

我想在我的图像中找到最大的轮廓(使用 opencv 和 C++)。我已经读过这个线程: Finding Contours in OpenCV?Draw the biggest element conncted using areaContours (OpenCV )但是我得到了错误:'varName' 没有在此范围内声明,这意味着编译器认为我没有正确声明该变量?所以我的这段代码:

    threshold(Img, Img, t, 255, CV_THRESH_BINARY_INV);
vector<vector<Point>> varName;
findContours(Img, varName, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);

我遇到了这个错误:

   D:\OpencvWorkspace\....|50|error: 'varName' was not declared in this scope|

第 50 行是这段代码:

    vector<vector<Point>> varName;

我的问题。为什么编译器在我声明该变量的那一行询问这个变量还没有声明。有人可以帮助我吗?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com