Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you could get the boundingRect for the endpoints of your lines, like this:

vector<Point> pts;
for (unsigned int i = 0; i < lines.size(); ++i)
{
    pts.push_back( Point(lines[i][0], lines[i][1]) );
    pts.push_back( Point(lines[i][2], lines[i][3]) );
}
Rect box = boundingRect(pts);