上级目录表示方法:
…/
#include <vector>
#include <stdio.h>
#include<opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main()
{
Mat Img = imread("../picture/pic.jpg");
imshow("原图",Img);
Mat element = getStructuringElement(MORPH_RECT, Size(15, 15));
Mat dstImage;
erode(Img, dstImage, element);
imshow("腐蚀图1", dstImage);
element = getStructuringElement(MORPH_RECT, Size(2, 2));
erode(Img, dstImage, element);
imshow("腐蚀图2", dstImage);
waitKey(0);
return 0;
}
Size越大(图左),腐蚀越强烈