如下是source.jpg
void CMFCworkDlg::OnBnClickedButton10()
{
// TODO: 在此添加控件通知处理程序代码
// TODO: 在此添加控件通知处理程序代码
Mat image = imread("source.jpg", 0);
Mat structure_element = getStructuringElement(0, Size(13, 12));
Mat dst_erode, dst_dilate;
dst_erode.create(image.size(), CV_8UC1);
dst_dilate.create(image.size(), CV_8SC1);
erode(image, dst_erode, structure_element);
dilate(dst_erode, dst_dilate, structure_element);
imshow("image", image);
imshow("erode", dst_erode);
imshow("dailate", dst_dilate);
_cprintf("pass");
}