#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main()
{
//载入图片
Mat image = imread("1.jpg");
//创建窗口
namedWindow("均值滤波【原图】");
namedWindow("均值滤波【效果图】");
//显示原图
imshow("均值滤波【原图】",image);
//进行滤波操作
Mat out;
boxFilter(image, out, -1, Size(5, 5));
//显示效果图
imshow("均值滤波【效果图】",out);
waitKey(0);
}
评论0