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.
我用 findContours 从二进制图像中找到了轮廓,将它们放在二维向量中。这就是我所做的:
vector<vector<Point>> contours; findContours(image,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);
现在我想将它们从大到小排序:我该如何处理?谢谢大家!
看来您必须使用cvContourArea来计算每个轮廓的面积,然后使用任何排序算法对它们进行排序。
祝你好运!