简单的几个程序,先带学者进入神奇的opencv世界
#include<opencv2/opencv.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main()
{
Mat srcImage = imread("G:\\group.jpg");
imshow("【原图】", srcImage);
//图像腐蚀操作
//首先建立一个内核矩阵
Mat element = getStructuringElement(MORPH_RECT, Size(3, 3));
Mat dstImage;
erode(srcImage, dstImage, element);
imshow("【腐蚀后的图像】", dstImage);
waitKey(0);
}