CONTRA_MEAN_CVIP

contra_mean_cvip() - performs a contra-harmonic mean filter.

Contents

SYNTAX

new_image = contra_mean_cvip( imageP,  mask_size, R)

Input Parameters include :

Output Parameter include :

DESCRIPTION

This filter works well for images containing salt or pepper type noise depending on the filter order. This function scans the whole image using blocks of size mask_size and performs contra-harmonic mean filtering inside each block and replaces the center pixel value with the result. mask_size needs to be an odd integer between 3-11.The contra-harmonic method also requires another parameter R which should be given as input. For negative values of R, it eliminates salt-type noise, while for positive values of R, it eliminates pepper-type noise.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read image

 imageP = imread('Flowers.bmp_saltpepper.bmp'); %input image with Pepper noise added

% Mask size

 mask_size = 7;

% Filter order

 R = 3;

% Call function

 new_image = contra_mean_cvip( imageP,  7, 3);

% Display input image

 figure;imshow(imageP);title('imageP');title('Input Image with pepper noise');

% Display output image

 figure; imshow(remap_cvip(new_image));title('Output Image');

CREDITS

Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website