Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unfortunately, polylines expects a vector<Point>, not a vector<Point2f>.

while you can easily cast a single Point2f to Point, not so with a whole vector.

so, either draw single lines:

for(int ao=0; ao<t2.size()-1; ao++){
    Point p0 = t2.at(ao);
    Point p1 = t2.at(ao+1);
    line(image,p0,p1,Scalar(0,0,255),2);
}

or copy to a vector<Point> :

vector<Point> pt;
for(int ao=0; ao<t2.size(); ao++){
    pt.push_back( t2.at(ao) );
}
polylines(image,pt,false,Scalar(255,255,255),2,150,0);