#include <opencv2/opencv.hpp>
#include<iostream>
using namespace std;
using namespace cv; int main()
{
Mat img_in,img_out; img_in = imread("1.jpg",); threshold(img_in, img_out, , ,THRESH_BINARY);
Mat img_out2;
vector< vector< Point> > contours;
findContours(img_out2, contours, RETR_TREE, CHAIN_APPROX_NONE);
vector<vector<Point> >::iterator itc = contours.begin();
while (itc != contours.end())
{
if (itc->size()<)
{
itc = contours.erase(itc);
}
else
{
++itc;
}
}
drawContours(img_out2, contours, -, Scalar(),);
imshow("结果图", img_out2);
waitKey();
return ;
}