#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace cv;
int main()
{
Mat img = imread("1.jpg");
Mat element =getStructuringElement(MORPH_RECT,Size(15,15));
Mat img2;
erode(img,img2,element);
imshow("图片测试",img2);
waitKey(6000);
return 0;
}
getStructuringElement()函数