User:Lixx0607b/sandbox

Non-local means filtering is an algorithm in image processing for image denoising. Unlike other local smoothing filters, Non-local means filter averages all observed pixels to recover a single pixel. The weight of each pixel depends on the distance between its intensity grey level vector and that of the target pixel. Non-local mean algorithm was published by Antoni Buades,et al. in 2005.

Definition
Suppose $$\Omega$$ is the area of certain image $$I$$. $$x$$ is the location inside $$\Omega$$, $$u(x)$$ and $$ v(x)$$ are the clean and observed noisy image value at location $$x$$ respectively. Then the non-local mean algorithm can be defined as

$$NL \left [ u \right ] (x) = {1 \over C(x)}\int_\Omega e^{-{{(G_a* \left \vert v(x+.)-v(y+.)\right \vert ^2)(0)}\over h^2}}v(y)dy.$$

where $$G_a$$ is a Gaussian function with standard deviation $$a$$, $${C(x)}={\int_\Omega e^{-{{(G_a* \left \vert v(x+.)-v(y+.)\right \vert ^2)(0)}\over h^2}}}dz$$ and $$h$$ is the filtering parameter.

Discrete Algorithm
If image $$I$$ is discrete, the non-local mean algorithm can be represented as

$$NL \left [ u \right ](i)= \sum_{j \in I}w(i,j)v(j),$$

where the weight $$ w_{i,j}$$ depends on the distance between observed gray level vectors at points $$i$$ and $$j$$. Such distance can be represented as

$$ d={\lVert v(\mathcal{N}_i)-v(\mathcal{N}_j)\rVert}_{2,a}^2 .$$

So the weight can be defined as

$$w(i,j)= {1 \over Z(i)}e^{-{{\lVert v(\mathcal{N}_i)-v(\mathcal{N}_j)\rVert}_{2,a}^2\over h^2}},$$

where $$ Z(i)= \sum_j e^{-{{\lVert v(\mathcal{N}_i)-v(\mathcal{N}_j)\rVert}_{2,a}^2\over h^2}}.$$