about summary refs log tree commit diff
path: root/pgmmorphconv.html
blob: 91148deeefe9ed36de366d7f526966d6b192ffc4 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD><TITLE>Pgmmorphconv User Manual</TITLE></HEAD>
<BODY>
<H1>pgmmorphconv</H1>
Updated: 29 October 2002
<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> ]
<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.

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

<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/compphys0/2001.htm"> K. Michielsen and
H. De Raedt, "Integral-Geometry Morphological Image Analysis", 
Phys. Rep. 347, 461-538 (2001).</a>

<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>
</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="#seealso">SEE ALSO</A>
<LI><A HREF="#authors">AUTHORS</A>
</UL>
</BODY>
</HTML>