HARMONIC_MEAN_CVIP
harmonic_mean_cvip() - performs a harmonic mean filtering operation.
Contents
SYNTAX%
new_image = harmonic_mean_cvip( imageP, mask_size, ignore_zeros)
Input Parameter include :
- imageP Input image can be gray image or rgb image of MxN 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 ignored when calculating the harmonic mean. Any value other than 0, results in calculating the harmonic mean without changing the pixel values in any window.
Output parameter include :
- new_image The output image after filtering.
DESCRIPTION
This function implemnets the Harmonic mean filtering operation on a degraded image to restore it to its original state. The Hamonic mean filter works well with gaussian noise and salt noise images. The function scans the image with a window of size mask_size and applies the harmonic filter to each window separately.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image imageP = imread('Flowers_saltnoise.bmp'); % Mask size mask_size = 7; % Call function new_image = harmonic_mean_cvip( imageP,mask_size); % Display input image figure;imshow(imageP);title('Input image'); % Display output image figure;imshow(new_image);title('Output image');
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website