MyriadFilter
Compute the Myriad filtering for specific sample and parameters.
Contents
Definition.
For ,
and
the defined objective function is
The myriad filtering of sample with weights
and parameter
is defined as
The generalized myriad filtering of sample with weights
is defined as
Syntax.
filtred = MyriadFilter( X , gamma); [filtred, gamma] = MyriadFilter( X );
Description.
filtred = MyriadFilter( X, gamma ) computes the myriad filtering of sample vector X with parameter gamma.
[filtred, gamma] = MyriadFilter( X ) computes the generalized myriad filtering of sample vector X and estimates the parameter gamma for each pixel.
X is a three dimensional matrix of size MxNxK. MxN is the image size. K is the size sample in each pixel.
Values of weights: ,
.
Example: compute Myriad filtering with known
parameter.
% Define parameter. gamma= 5; % Define a sample. sample_in_one_pixel = [64 47 56 56 57 69 56 61 47 48 50 49 44 63 50 55 61 38 51 62]; % Make a one-pixel sample. sample_in_one_pixel=... reshape(sample_in_one_pixel, [1, 1, length(sample_in_one_pixel(:))]); % Compute Myriad filtering. filtred = MyriadFilter(sample_in_one_pixel, gamma); % Compute the objective function for drawing. [Q,t] = ComputeObjectiveFunction(sample_in_one_pixel,... 'Gamma', gamma); % Compute the objective function for the Myriad filter output. [y,x] = ComputeObjectiveFunction(sample_in_one_pixel,... 'Gamma', gamma,... 'Theta', filtred); % Compute the objective function for sample points. [ y1, x1 ] = ComputeObjectiveFunction( sample_in_one_pixel ,... 'Theta', sample_in_one_pixel,... 'Gamma', gamma); % Draw the objective function and the interest points. figure, plot(t, Q), hold on, plot(x1(:), y1(:), 'x','Color', [0,100,0]/255) plot(x, y, 'or') legend('Objective function',... 'Sample points',... 'Myriad filtering of the sample')
-------------------------- Call Myriad filter -------------------------- size image: 1 x 1 gamma= 5.000000 --------------------------

Example: compute Myriad filtering and estimate
parameter.
% Read image. init= imread('squared.png'); % Add Cauchy noise and display. gamma=5; input=addCauchyNoise(init, gamma); figure, imshow(uint8(input)), title('Image with Cauchy noise.') % Compute local samples with 6 radius window. sampleLocal= localSample(input, 6); % Compute Myriad filtering. [filtred, Gamma] = MyriadFilter(sampleLocal); % Plot the filtred image and the local $\gamma$ parameter estimation. figure, imshow(uint8(filtred)), title('Myriad filtering') figure, imagesc(Gamma), colormap jet, axis off, axis image title('\gamma parameter.')
------------------------------ Call Generalized Myriad filter ------------------------------ size image: 256 x 256 --------------------------


