NLM-P (使用积分图像进行算法的优化)

本文探讨了NLM-P算法利用积分图像进行优化的方法,通过实例展示了如何提高图像处理的PSNR值,达到31.436的优秀效果。
摘要由CSDN通过智能技术生成
#include<opencv2/opencv.hpp>
#include<iostream>
using namespace std;
using namespace cv;

void nonlocal_fast_intergalImage(Mat noiseImage,Mat& resultImage,int DS);//利用积分图像进行快速非局部均值滤波
Mat st_function(Mat noiseImage,int DS,int NS,Point2i t) ;
void main()
{
	Mat srcImage = imread("F:/picture/lena.jpg",0);
	Mat noiseImage = imread("F:/picture/noiseImage.jpg",0);
	imshow("srcImage",srcImage);
	imshow("noiseImage",noiseImage);
	Mat resultImage;
	nonlocal_fast_intergalImage(noiseImage,resultImage,5);
	imshow("result",resultImage);
	cout<<PSNR(srcImage,resultImage)<<endl;
	waitKey(0);
	system("pause");
}

void nonlocal_fast_intergalImage(Mat noiseImage,Mat& resultImage,int DS)
{
	float h = 10.0f;//平滑衰减系数
	int NS = 1; //邻域的半径
	int nRows2NS = noiseImage.rows+2*NS;
	int nCols2NS = noiseImage.cols+2*NS;
	noiseImage.convertTo(noiseImage,CV_32FC1);
	Mat Vsym_noiseImage ;
	copyMa
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值