\ .\" 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 "Pgmmorphconv User Manual" 0 "29 March 2015" "netpbm documentation" .SH NAME pgmmorphconv - perform morphological convolutions: dilation, erosion .UN synopsis .SH SYNOPSIS \fBpgmmorphconv\fP [ \fB-erode\fP | \fB-dilate\fP | \fB-open\fP | \fB-close\fP | \fB-gradient\fP ] \fItemplatefile\fP [\fIpgmfile\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)\c \&. .PP \fBpgmmorphconv\fP performs morphological convolutions on a PGM image: dilation and erosion. .PP \fBpgmmorphconv\fP performs a "topological" convolution. For each pixel of the input, \fBpgmmorphconv\fP generates an output pixel in the same position. To determine the intensity of the output pixel, \fBpgmmorphconv\fP lays the template image over the input image such that the middle pixel of the template is over the input pixel in question. \fBpgmmorphconv\fP 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. .PP 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. .PP The template file named by \fItemplatefile\fP 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. .PP This is similar to the continuous convolution done by \fBpnmconvol\fP, except that with \fBpnmconvol\fP the output intensity is a weighted average of nearby input pixels instead of a minimum or maximum. .PP 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. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBpgmmorphconv\fP recognizes the following command line options: .PP The options \fB-erode\fP and \fB-dilate\fP obviously produce an erosion or dilation, respectively. .PP The \fB-open\fP option causes \fBpgmmorphconv\fP to perform first an erode and then a dilate operation. The \fB-close\fP option causes a dilate first and then an erode. If you specify none of these options, it is the same as \fB-dilate\fP. .PP With \fB-gradient\fP, \fBpgmmorphconv\fP produces an image which is the difference between the eroded image and the dilated image. \fB-gradient\fP was new in Netpbm 10.70 (March 2015). .UN seealso .SH SEE ALSO .IP \(bu .BR "pgmminkowski" (1)\c \& .IP \(bu .BR "pnmconvol" (1)\c \& .IP \(bu .BR "pgm" (5)\c \& .PP For more information about morphological convolutions, see e.g. .IP \(bu .UR 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) .UE \& .IP \(bu K. Michielsen and H. De Raedt, "Integral-Geometry Morphological Image Analysis", Phys. Rep. 347, 461-538 (2001). .UN authors .SH AUTHORS Luuk van Dijk, 2001. .PP Based on work which is Copyright (C) 1989, 1991 by Jef Poskanzer. .SH DOCUMENT SOURCE This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at .IP .B http://netpbm.sourceforge.net/doc/pgmmorphconv.html .PP