summary refs log tree commit diff
path: root/pgmmorphconv.html
blob: 687869e54409c70844dfd0a078b75091218c74d0 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html>
<head><title>Pgmmorphconv User Manual</title></head>
<body>
<h1>pgmmorphconv</h1>
Updated: 29 March 2015
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pgmmorphconv - perform morphological convolutions: dilation, erosion

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

<b>pgmmorphconv</b>
[
 <b>-erode</b> |
 <b>-dilate</b> |
 <b>-open</b> |
 <b>-close</b> |
 <b>-gradient</b>
]
<i>templatefile</i>
[<i>pgmfile</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>pgmmorphconv</b> performs morphological convolutions on a
PGM image: dilation and erosion.

<p><b>pgmmorphconv</b> performs a "topological" convolution.  For each
pixel of the input, <b>pgmmorphconv</b> generates an output pixel in
the same position.  To determine the intensity of the output pixel,
<b>pgmmorphconv</b> lays the template image over the input image such
that the middle pixel of the template is over the input pixel in
question.  <b>pgmmorphconv</b> looks at the input pixels underneath each
white pixel in the template.  For a dilation, the maximum intensity of
all those pixels is the intensity of the output pixel.  For an erosion,
it is the minimum.

<p>Thus, the dilation effect is that bright areas of the input get bigger
and dark areas smaller.  The erosion effect is the opposite.  The simplest
template image would be one with a white pixel in the middle and the rest
black.  This would produce an output image identical to the input.  Another
simple template image is a fully white square.  This causes bright or dark
areas to expand in all directions.  A template image that is white on the
left side and black on the right would smear the image to the right.

<p>The template file named by <i>templatefile</i> contains the
template image as a PBM image.  It must have an odd number of rows and
an odd number of columns, so there is a definite middle pixel.  It
must contain at least one white pixel.

<p>This is similar to the continuous convolution done by
<b>pnmconvol</b>, except that with <b>pnmconvol</b> the output intensity is
a weighted average of nearby input pixels instead of a minimum or maximum.

<p>This convolution changes the three Minkowski integrals in a predefined
way, and can be used to filter an image to enhance certain features, to
ease their automatic recognition.

<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>pgmmorphconv</b> recognizes the following
command line options:

<p>The options <b>-erode</b> and <b>-dilate</b> obviously produce an
erosion or dilation, respectively.  <p>The <b>-open</b> option causes
<b>pgmmorphconv</b> to perform first an erode and then a dilate
operation.  The <b>-close</b> option causes a dilate first and then an
erode.  If you specify none of these options, it is the same as
<b>-dilate</b>.

<p>With <b>-gradient</b>, <b>pgmmorphconv</b> produces an image which is the
difference between the eroded image and the dilated image.  <b>-gradient</b>
was new in Netpbm 10.70 (March 2015).

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

<ul>
<li><b><a href="pgmminkowski.html">pgmminkowski</a></b>
<li><b><a href="pnmconvol.html">pnmconvol</a></b>
<li><b><a href="pgm.html">pgm</a></b>
</ul>

<p>For more information about morphological convolutions, see e.g.
<ul>
<li><a href="http://rugth30.phys.rug.nl/pdf/prechaos.pdf">
J.S. Kole, K. Michielsen, and H. De Raedt,
"Morphological Image Analysis of Quantum Motion in Billiards",
Phys. Rev. E 63, 016201-1 - 016201-7 (2001)
</a>
<li>K. Michielsen and
H. De Raedt, "Integral-Geometry Morphological Image Analysis",
Phys. Rep. 347, 461-538 (2001).

</ul>


<h2 id="authors">AUTHORS</h2>

Luuk van Dijk, 2001.

<p>Based on work which is Copyright (C) 1989, 1991 by Jef Poskanzer.

<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="#seealso">SEE ALSO</a>
<li><a href="#authors">AUTHORS</a>
</ul>
</body>
</html>