pgmmorphconv performs morphological convolutions on a PGM image: dilation and erosion.
pgmmorphconv performs a "topological" convolution, which is similar to the continuous convolution done by pnmconvol, except that the resulting picture is not a weighted product of its neighbors as defined by a convolution mask, but the minimum or maximum of its neighbors.
This convolution changes the three Minkowski integrals in a predefined way, an can be used to filter an image to enhance certain features, to ease their automatic recognition.
The -open option first performs the erode and then the dilate operation. The -close option does a dilate first and then an erode.
Based on work which is Copyright (C) 1989, 1991 by Jef Poskanzer.