lpsmooth(1)

NAME
lpsmooth - smooth an image preserving thin lines (v1.2)

SYNOPSIS
lpsmooth [-options] in_file | - out_file | -

DESCRIPTION
lpsmooth reads a portable graymap(5) or a portable pixmap(5) as input, smooth the image slightly preserving thin lines, and produces a portable graymap/pixmap as output. If -p 3 (default), lpsmooth smooths the image along thin lines, whose thickness is 1 pixel, ensuring that no line is blurred in the direction orthogonal to the line locally. A 3x3 mask is put on every pixel in the image. lpsmooth finds the pixels whose color (or graylevel) is 1st through (N-1)th similar to that of the central pixel, where N is given by the option "-p N." The color of the central pixel is turned into the average color of the N pixels including the central pixel. Color difference is measured by the Euclidean distance in the RGB color space. If the string "-" is passed instead of in_file, lpsmooth reads the image from standard input. If the string "-" is passed instead of out_file, lpsmooth writes the image to standard output.

OPTIONS

-n N
    Specifies how many times (N) the smoothing operation is applied to the image. The default value is N=1.

-w N
    The weight factor for the central pixel in each 3x3 mask. The default value is N=1. If -p N and -w 0, the processing is identical to the k-nearest neighbor smoothing with k=N-1. See references for the details of the method.

-p N
    Specifies the number of the using pixels including the central pixel. The default value is N=3, i.e., 2 pixels nearest in color (graylevel) affect the new color of the central pixel. If the input image is noisy, -p 4 or -p 5 will be helpful. If -p 9 and -w 1, the processing is identical to calculating the moving average with a 3x3 mask. If -p 1, lpsmooth does nothing except consuming some memory and enormous CPU power.

-verbose
    Show processing information.

NOTES
Even if -p 3, line segments may get shorter by at most 2 pixels, because the two pixels on the edges of a line segment are blurred slightly.

For the color image processing, the color similarity is measured by the Euclidian distance in RGB color space.

SEE ALSO
pgm(5), ppm(5)

REFERENCES
L.S. Davis and A. Rosenfeld, "Noise Cleaning by Iterated Local Averaging," IEEE Trans. SMC, vol.SMC-8, No.9, pp.705-710, 1978.

AUTHOR
Copyright (C) 2000-2002 Hideaki Goto E-Mail: hgot@rd.isc.tohoku.ac.jp, hgot@aso.ecei.tohoku.ac.jp