GEOMETRIC_MEAN_CVIP
geometric_mean_cvip() - performs geometric mean filtering on an image.
Contents
SYNTAX
new_image = geometric_mean_cvip( imageP, mask_size, ignore_zeros)
Input Parameters include :
- imageP - Input image can be a gray image or a rgb image of MxNx3 size.
- mask_size - Block size of the filter. An odd integer between 3-11.
- ignore_zeros - [Optional] if 0(default value) then the zero pixels in the window are replaced by one before calculating the geometric mean. Any value other than 0, results in calculating the GM without changing the pixel values in any window.
Output Parameter include :
- new_image - The output image after filtering.
DESCRIPTION
Geometric mean filter is a non-linear mean filter which is better at removing gaussian type of noise and preserving edge features than the mean filter. The function scans the input image by windows of size mask_size and calculates the geometric mean of the elements in the window. The formula for geometric mean of N elements is as follows:
Whenever there is a zero pixel in the window, the GM would be zero. Zeros can be replaced by 1 before calculation, using the optional argument ignore_zeros. The default value for ignore_zeros is 0. Any value other than 0 for ignore_zeros results in replacing zeros with 1 in the calculations.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read Image imageP = imread('Butterfly.gaussian.tif');% Input image with gaussian noise added. % Mask size mask_size = 7; % Call function new_image = geometric_mean_cvip(imageP,7,1); % Display input image figure;imshow(imageP);title('Input Image'); % Dispaly output image figure; imshow(new_image,[]);title('Output Geometric mean filtered Image');
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website