图形算法与实战:1.滤波专题 (5)双边滤波

5 双边滤波

本文作者:图像与视觉InSight 行者 杨尚朋 转载请注明

目录

5 双边滤波

5.1 处理效果展示

图像处理前后对比1

图像处理前后对比2

5.2 原理

5.3 代码展示


5.1 处理效果展示

图像处理前后对比1

处理前

处理后

图像处理前后对比2

处理前

处理后

5.2 原理

5.3 代码展示

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
int main()
{
	// 载入原图
	Mat image = imread("C:\\Users\\SYYSP\\Desktop\\BLOG\\滤波专题\\双边滤波\\queban.jpg");
	//创建窗口
	namedWindow("双边滤波【原图】");
	namedWindow("双边滤波【效果图】");
	//显示原图
	imshow("双边滤波【原图】", image);
	//进行双边滤波操作
	Mat out;
	bilateralFilter(image, out, 15, 50, 12.5);
	//显示效果图
	imshow("双边滤波【效果图】", out);
	imwrite("C:\\Users\\SYYSP\\Desktop\\BLOG\\滤波专题\\双边滤波\\queban_bilateralfilter.jpg",out);
	waitKey(0);
}

猜你喜欢

转载自blog.csdn.net/qq_32391345/article/details/106755021