Error: "varName" was not declared in this area

I want to find a larger outline in my image (with opencv and C ++). I read this topic: Looking for circuits in OpenCV? and Draw the largest element related to using areaContours (OpenCV) , but I got an error: varName 'was not declared in this area, which means that the compiler believes that I did not declare this variable right? So this piece of my code:

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

I got this error:

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

Line 50 is the code:

    vector<vector<Point>> varName;

My question is. Why does the compiler set this variable without declaring in a string, I declare this variable. can someone help me?

+2
source share
2 answers

pre ++ 11 ( ). , >>, , operator>>(). , :

vector<vector<Point> > varName;
                 // ^ Note the space
+2

Yups, , , πάντα ῥεῖ. , " > " " > ". :

   vector<vector<Point>> varName;

:

   vector<vector<Point> > varName;

" > " " > ", . . πάντα ῥεῖ

0

All Articles