[英]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];
我为这条sheaf[j][n] = lines[i];
得到了这个按摩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错误 3 错误 C2679:二进制“=”:未找到采用“cv::Vec”类型的右侧操作数的运算符(或没有可接受的转换)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. sheaf[10][200] 声明了一个二维向量数组。 Your declarations should be:您的声明应该是:
vector<Vec4i> lines;
Vec4i sheaf[10][200];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.