简体   繁体   中英

Copy vector to vector in OpenCV

I have to acomplish an elementary copy of one vector to another when to points of the one vector lay in a contour. Here are the two vectors and the code:

vector<Vec4i> lines,sheaf[10][200];

for (size_t j = 0; j < contours.size(); j++){
    for (size_t i = 0; i < lines.size(); i++)
    {
        Vec4i l = lines[i];
        if ((pointPolygonTest(contours[j], Point2f(l[0], l[1]), false) >= 0) && (pointPolygonTest(contours[j], Point2f(l[2], l[3]), false) >= 0))
        {
            sheaf[j][n] = lines[i];
            n++;
        }
    }

I got this massage for this line sheaf[j][n] = lines[i];

Error 3 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'cv::Vec' (or there is no acceptable conversion) C:\\Users\\Eltimir\\documents\\visual studio 2013\\Projects\\OpenCV_2_4_10\\vanishingPoints\\Source.cpp 88 1 vanishingPoints

sheaf[10][200] declares a bidimensional array of vector. Your declarations should be:

vector<Vec4i> lines;
Vec4i sheaf[10][200];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM