\ .\" This man page was generated by the Netpbm tool 'makeman' from HTML source. .\" Do not hand-hack it! If you have bug fixes or improvements, please find .\" the corresponding HTML page on the Netpbm website, generate a patch .\" against that, and send it to the Netpbm maintainer. .TH "Pgmmedian User Manual" 0 "28 August 2005" "netpbm documentation" .PP .SH NAME pgmmedian - apply a median filter to a PGM file .UN synopsis .SH SYNOPSIS \fBpgmmedian\fP [\fB-width=\fP\fIn\fP] [\fB-height=\fP\fIn\fP] [\fB-type=\fP\fImedian_type\fP] [\fB-cutoff=\fP\fIint\fP] [\fIpnmfile\fP] .PP Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. .UN description .SH DESCRIPTION .PP This program is part of .BR Netpbm (1) . .PP \fBpgmmedian\fP applies a median filter to a PGM image, using either the histogram sort or select kth value method to determine the median. .PP A median filter is a convolution filter in which the value of a pixel in the output is the median of a certain set of pixels in the neighborhood of the corresponding input pixel. The effect is to eliminate locally extreme values. Such pixels typically show up as speckles. .PP See the \fB-type\fP and \fB-cutoff\fP options for information on how \fBpgmmedian\fP chooses between the two methods. .UN options .SH OPTIONS .TP \fB-cutoff\fP \fIint\fP This option provides the cutoff value that \fBpgmmedian\fP uses to decide between using the histogram sort or select kth value method to find the median. If (\fImaxval\fP / ((\fIwidth\fP * \fIheight\fP) - 1)), where \fImaxval\fP is the maxval of the image and \fIwidth\fP and \fIheight\fP are the dimensions of the mask, is less than the cutoff value, \fBpgmmedian\fP uses histogram sort. Otherwise, it uses kth value. .sp This option has no effect if you specify \fB-type\fP. .sp The default is 250 .TP \fB-width=\fP\fIn\fP Width of the median mask to apply. .sp Default is 3. .TP \fB-height=\fP\fIn\fP Height of the median mask to apply. .sp Default is 3. .TP \fB-type\fP \fImedian_type\fP This option selects which method to use to find median regardless of cutoff value. Choices are \fBhistogram_sort\fP and \fBselect\fP. .sp By default, \fBpgmmedian\fP decides which method to use as described under the \fB-cutoff\fP option. .UN references .SH REFERENCES .IP \(bu \&'Collected Algorithms from ACM' Volume II, Algorithm 489 by Robert W. Floyd .IP \(bu \&'A Fast Two-Dimensional Median Filtering Algorithm' in \&'IEEE Transactions on Acoustics, Speech, and Signal Processing' Vol. ASSP-27, No. 1, February 1979 .IP \(bu \&'Digital Image Processing Algorithms' by Ioannis Pitas, Prentice Hall, 1993 ISBN 0-13-145814-0 .UN seealso .SH SEE ALSO .BR pgmnoise (1) , .BR pamaddnoise (1) , .BR pnmconvol (1) , .BR pgmmorphconv (1) , .BR pgm (5) .UN history .SH HISTORY .PP \fBpgmmedian\fP was added to Netpbm in Version 10.29 (August 2005). It had been distributed by Mike Burns via his own web site before that (and continued to be so). .UN author .SH AUTHOR Copyright (C) 1996 by Mike Burns <\fIburns@cac.psu.edu\fP>