summary refs log tree commit diff
path: root/pgmmedian.html
blob: e0f20b3647b6b4e003ed68c97113975977ad71c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pgmmedian User Manual</title></head>
<body>
<h1>pgmmedian</h1>
Updated: 28 August 2005
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
pgmmedian - apply a median filter to a PGM file

<h2 id="synopsis">SYNOPSIS</h2>

<b>pgmmedian</b>

[<b>-width=</b><i>n</i>]

[<b>-height=</b><i>n</i>]

[<b>-type=</b><i>median_type</i>]

[<b>-cutoff=</b><i>int</i>]

[<i>pnmfile</i>]


<p>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.


<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pgmmedian</b> applies a median filter to a PGM image, using either
the histogram sort or select kth value method to determine the median.

<p>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.

<p>See the <b>-type</b> and <b>-cutoff</b> options for information on
how <b>pgmmedian</b> chooses between the two methods.


<h2 id="options">OPTIONS</h2>

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pgmmedian</b> recognizes the following
command line options:

<dl compact>
<dt><b>-cutoff</b> <i>int</i>

<dd>This option provides the cutoff value that <b>pgmmedian</b> uses
to decide between using the histogram sort or select kth value method
to find the median.

If (<i>maxval</i> / ((<i>width</i> * <i>height</i>) - 1)), where
<i>maxval</i> is the maxval of the image and <i>width</i> and
<i>height</i> are the dimensions of the mask, is less than the cutoff
value, <b>pgmmedian</b> uses histogram sort.  Otherwise, it uses kth
value.

<p>This option has no effect if you specify <b>-type</b>.

<p>The default is 250

<dt><b>-width=</b><i>n</i>

<dd>Width of the median mask to apply.

<p>Default is 3.

<dt><b>-height=</b><i>n</i>

<dd>Height of the median mask to apply.

<p>Default is 3.

<dt><b>-type</b> <i>median_type</i>

<dd>This option selects which method to use to find median regardless
of cutoff value.  Choices are <b>histogram_sort</b> and <b>select</b>.

<p>By default, <b>pgmmedian</b> decides which method to use as described
under the <b>-cutoff</b> option.

</dl>

<h2 id="references">REFERENCES</h2>

<ul>

<li>"Collected Algorithms from ACM" Volume II, Algorithm 489
by Robert W. Floyd

<li>"A Fast Two-Dimensional Median Filtering Algorithm" in
"IEEE Transactions on Acoustics, Speech, and Signal
Processing" Vol. ASSP-27, No. 1, February 1979

<li>"Digital Image Processing Algorithms" by Ioannis
Pitas, Prentice Hall, 1993 ISBN 0-13-145814-0

</ul>


<h2 id="seealso">SEE ALSO</h2>

<a href="pgmnoise.html">pgmnoise</a>,
<a href="pamaddnoise.html">pamaddnoise</a>,
<a href="pnmconvol.html">pnmconvol</a>,
<a href="pgmmorphconv.html">pgmmorphconv</a>,
<a href="pgm.html">pgm</a>

<h2 id="history">HISTORY</h2>

<p><b>pgmmedian</b> 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).


<h2 id="author">AUTHOR</h2>

Copyright (C) 1996 by Mike Burns &lt;<a
href="mailto:burns@cac.psu.edu">burns@cac.psu.edu</a>&gt;

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#references">REFERENCES</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
<li><a href="#author">AUTHOR</a>
</ul>

</body>
</html>