//图像腐蚀
#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;int main(){ Mat srcImage = imread("1.jpg"); imshow("原图",srcImage); Mat element=getStructuringElement(MORPH_RECT,Size(15,15)); Mat dstImage; erode(srcImage,dstImage,element); //腐蚀操作 imshow("效果图",dstImage); waitKey(0); //等待按键按下 return 0;}参考来自《opencv3编程入门》