Compute Non-Local Myriad filtering for Cauchy denoising.
This page shows a code to extract patches with the Cauchy similarity measure and perform a Myriad filtering of the pixel-wise samples.
Contents
Load noisy image and set the gamma parameter.
Load a gray-scale image and set the gamma parameter.
input= imread('parrotCauchyNoise_K=5.png');
gamma=5;
Extraction of samples from patches with cauchy similarity.
The function K_cauchy_best_patches return a three dimension matrix of size MxNxK. MxN is the image size. K in the number of retained patches in the samples.
sampleFromPatches = kCauchyNearestPatches(input, gamma,... 'SampleSize', 40,... 'PatchWidth', 3,... 'SearchWindowRadius', 15);
Compute the Myriad M-estimator of non-local samples.
The function MyriadFilter has two inputs: * sampleFromPatchesthe is the vector of samples for each pixels, represented in a three dimension matrix of size MxNxK. MxN is the image size. K in the number of samples. * gamma is the parameter of the objective function.
filtred = MyriadFilter(sampleFromPatches, gamma);
-------------------------- Call Myriad filter -------------------------- size image: 256 x 256 gamma= 5.000000 --------------------------
Display the results.
figure, imshow(uint8(input)), title('noisy') figure, imshow(uint8(filtred)), title('filtred')

