OpenCV C++ 基于均值滤波的图像模糊
程序说明
// 程序描述:使用blur函数进行基于均值滤波的图像模糊操作
// 操作系统: Windows 10 64bit
// 开发语言: C++
// IDE 版 本:Visual Studio 2019
// OpenCV版本:4.20
代码
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main()
{
//【1】载入原始图
Mat srcImage = imread("20.jpg");
//【2】显示原始图
imshow("均值滤波【原图】", srcImage);
//【3】进行均值滤波操作
Mat dstImage;
blur(srcImage, dstImage, Size(7, 7));
//【4】显示效果图
imshow("均值滤波【效果图】", dstImage);
waitKey(0);
}