#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main()
{
Mat image=imread("d:/test/opencv/binary.bmp");
if(!image.data)
return 0;
namedWindow("orginal binary");
imshow("orginal binary",image);
Mat eroded,dilated;
erode(image,eroded,Mat());
dilate(image,dilated,Mat());
namedWindow("Eroded Image");
imshow("Eroded Image",eroded);
namedWindow("Dilated Image");
imshow("Dilated Image",dilated);
waitKey();
return 0;
}