| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pgmmedian User Manual" 1 "20 January 2022" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pgmmedian - apply a median filter to a PGM file |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
|
| 14 |
\fBpgmmedian\fP |
| 15 |
|
| 16 |
[\fB-width=\fP\fIn\fP] |
| 17 |
|
| 18 |
[\fB-height=\fP\fIn\fP] |
| 19 |
|
| 20 |
[\fB-type=\fP\fImedian_type\fP] |
| 21 |
|
| 22 |
[\fB-cutoff=\fP\fIint\fP] |
| 23 |
|
| 24 |
[\fIpnmfile\fP] |
| 25 |
.PP |
| 26 |
Minimum unique abbreviation of option is acceptable. You may use double |
| 27 |
hyphens instead of single hyphen to denote options. You may use white |
| 28 |
space in place of the equals sign to separate an option name from its value. |
| 29 |
|
| 30 |
|
| 31 |
.UN description |
| 32 |
.SH DESCRIPTION |
| 33 |
.PP |
| 34 |
This program is part of |
| 35 |
.BR "Netpbm" (1)\c |
| 36 |
\&. |
| 37 |
.PP |
| 38 |
\fBpgmmedian\fP applies a median filter to a PGM image, using either |
| 39 |
the histogram sort or select kth value method to determine the median. |
| 40 |
.PP |
| 41 |
A median filter is a convolution filter in which the value of a pixel in |
| 42 |
the output is the median of a certain set of pixels in the neighborhood of the |
| 43 |
corresponding input pixel. The effect is to eliminate locally extreme values. |
| 44 |
Such pixels typically show up as speckles. |
| 45 |
.PP |
| 46 |
Pixels at the edges of the image, pixels where the convolution kernel would |
| 47 |
go off the edge of the image, are just copied. For example, if \fB-height\fP |
| 48 |
is 9, the first 4 and last 4 rows of the input image are just copied to the |
| 49 |
output. |
| 50 |
|
| 51 |
.PP |
| 52 |
See the \fB-type\fP and \fB-cutoff\fP options for information on |
| 53 |
how \fBpgmmedian\fP chooses between the two methods. |
| 54 |
|
| 55 |
|
| 56 |
.UN options |
| 57 |
.SH OPTIONS |
| 58 |
.PP |
| 59 |
In addition to the options common to all programs based on libnetpbm |
| 60 |
(most notably \fB-quiet\fP, see |
| 61 |
.UR index.html#commonoptions |
| 62 |
Common Options |
| 63 |
.UE |
| 64 |
\&), \fBpgmmedian\fP recognizes the following |
| 65 |
command line options: |
| 66 |
|
| 67 |
|
| 68 |
.TP |
| 69 |
\fB-cutoff\fP \fIint\fP |
| 70 |
This option provides the cutoff value that \fBpgmmedian\fP uses |
| 71 |
to decide between using the histogram sort or select kth value method |
| 72 |
to find the median. |
| 73 |
|
| 74 |
If (\fImaxval\fP / ((\fIwidth\fP * \fIheight\fP) - 1)), where |
| 75 |
\fImaxval\fP is the maxval of the image and \fIwidth\fP and |
| 76 |
\fIheight\fP are the dimensions of the mask, is less than the cutoff |
| 77 |
value, \fBpgmmedian\fP uses histogram sort. Otherwise, it uses kth |
| 78 |
value. |
| 79 |
.sp |
| 80 |
This option has no effect if you specify \fB-type\fP. |
| 81 |
.sp |
| 82 |
The default is 250 |
| 83 |
|
| 84 |
.TP |
| 85 |
\fB-width=\fP\fIn\fP |
| 86 |
Width of the median mask to apply. |
| 87 |
.sp |
| 88 |
Maximum allowed is the width of the input image. |
| 89 |
.sp |
| 90 |
Default is 3. |
| 91 |
|
| 92 |
.TP |
| 93 |
\fB-height=\fP\fIn\fP |
| 94 |
Height of the median mask to apply. |
| 95 |
.sp |
| 96 |
Maximum allowed is the height of the input image. |
| 97 |
.sp |
| 98 |
Default is 3. |
| 99 |
|
| 100 |
.TP |
| 101 |
\fB-type\fP \fImedian_type\fP |
| 102 |
This option selects which method to use to find median regardless |
| 103 |
of cutoff value. Choices are \fBhistogram_sort\fP and \fBselect\fP. |
| 104 |
.sp |
| 105 |
By default, \fBpgmmedian\fP decides which method to use as described |
| 106 |
under the \fB-cutoff\fP option. |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
.UN references |
| 111 |
.SH REFERENCES |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
.IP \(bu |
| 116 |
"Collected Algorithms from ACM" Volume II, Algorithm 489 |
| 117 |
by Robert W. Floyd |
| 118 |
|
| 119 |
.IP \(bu |
| 120 |
"A Fast Two-Dimensional Median Filtering Algorithm" in |
| 121 |
"IEEE Transactions on Acoustics, Speech, and Signal |
| 122 |
Processing" Vol. ASSP-27, No. 1, February 1979 |
| 123 |
|
| 124 |
.IP \(bu |
| 125 |
"Digital Image Processing Algorithms" by Ioannis |
| 126 |
Pitas, Prentice Hall, 1993 ISBN 0-13-145814-0 |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
.UN seealso |
| 132 |
.SH SEE ALSO |
| 133 |
.BR "pgmnoise" (1)\c |
| 134 |
\&, |
| 135 |
.BR "pamaddnoise" (1)\c |
| 136 |
\&, |
| 137 |
.BR "pnmconvol" (1)\c |
| 138 |
\&, |
| 139 |
.BR "pgmmorphconv" (1)\c |
| 140 |
\&, |
| 141 |
.BR "pgm" (1)\c |
| 142 |
\& |
| 143 |
|
| 144 |
.UN history |
| 145 |
.SH HISTORY |
| 146 |
.PP |
| 147 |
\fBpgmmedian\fP was added to Netpbm in Version 10.29 (August 2005). |
| 148 |
It had been distributed by Mike Burns via his own web site before that |
| 149 |
(and continued to be so). |
| 150 |
|
| 151 |
|
| 152 |
.UN author |
| 153 |
.SH AUTHOR |
| 154 |
|
| 155 |
Copyright (C) 1996 by Mike Burns <\[email protected]\fP> |
| 156 |
.SH DOCUMENT SOURCE |
| 157 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 158 |
source. The master documentation is at |
| 159 |
.IP |
| 160 |
.B http://netpbm.sourceforge.net/doc/pgmmedian.html |
| 161 |
.PP |