Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在这样的轮廓上画一个框
我用这段代码找到轮廓
vector < vector<Point> > contours; findContours(Iat, contours, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
以及如何用rectangle指令画一个盒子
rectangle
不知道怎么用vector < vector<Point> > contours谁能描述一下
vector < vector<Point> > contours
谢谢先进。
您可以使用 boundingRect 方法:
Rect boundingRect(InputArray points) Parameters: points – Input 2D point set, stored in std::vector or Mat.
该函数计算并返回指定点集的最小垂直边界矩形。
有了这个,您将能够使用您想要的方法。