| outImg,outParams = | patchBasedBilateral2dImg (inImg) |
| PatchBasedBilateralParams = | patchBasedBilateral2dImg (inImg,outImg) |
| outImg,outParams = | patchBasedBilateral2dImg (inImg,params) |
| PatchBasedBilateralParams = | patchBasedBilateral2dImg (inImg,params,outImg) |
Patch-based bilateral filter on 2d image.
Patch-based bilateral filter is an algorithm used for image denoising. Like the Bilateral smoothing 2d, each pixel value is replaced by a weighted average of the values of its neighbours, and the weight is a product of two gaussian functions, one depending on the spatial distance between the 2 pixels, and the other one depending on intensity similarities. But contrary to the original version of the bilateral filter, the intensity similarity is not computed between 2 pixels, but between their 2 square neighbourhoods.
In term of results, this algorithm outperforms the original bilateral filter(better preservation of details and structures in the image) and gives results similar to the non-local means filter when one of the parameters, the spatial sigma, is great enough.
On output image values are given by:
where:
is the weight function; 
is the space function; 
is the intensity similarity function; 
is a disk-shaped kernel of a given radius, specified by the user through the parameter field PatchBasedBilateralParams::KernelRadius
is defined by PatchBasedBilateralParams::PatchSimilaritySigma parameter field
is defined by PatchBasedBilateralParams::SpaceSigma parameter field
stands for the standard deviation of the gaussian noise in the image and is defined by PatchBasedBilateralParams::NoiseSigma parameter fieldInput and output images must have same size.
Adjusting the parameters of the filter requires some expertise. To simplify the user's task, it is possible to execute the filter in semi-automatic or in full-automatic mode:
These 2 modes usually give satisfying results, provided the noise of the input image follows a gaussian distribution. If this is not the case, using one of the 2 automatic modes may be a good starting point, but it will be certainly necessary to adjust manually the parameters afterward.
Here is an example of a patch-based bilateral filter (parameters were automatically computed by the filter itself, and equal to:
,
,
and
) applied to an 8-bits grey levels input image with an artificially added gaussian noise (
):