From 4e1337c38b24ebad6e840055bba85d55c9e717ae Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 18 May 2017 18:31:03 +0000 Subject: miscellaneous update git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@2976 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- pamgauss.html | 101 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 28 deletions(-) (limited to 'pamgauss.html') diff --git a/pamgauss.html b/pamgauss.html index f3bd38e2..48725823 100644 --- a/pamgauss.html +++ b/pamgauss.html @@ -2,13 +2,13 @@ Pamgauss User Manual

pamgauss

-Updated: 8 May 2004 +Updated: 18 May 2017
Table Of Contents

NAME

-pamgauss - create a two dimensional gaussian function as a PAM image +pamgauss - create a two-dimensional Gaussian function as a PAM image

SYNOPSIS

@@ -18,6 +18,8 @@ pamgauss - create a two dimensional gaussian function as a PAM image -sigma=number [-maxval=number] [-tupletype=string] +[-maximize] +[-oversample=number

Minimum unique abbreviation of option is acceptable. You may use double @@ -28,8 +30,8 @@ space in place of the equals sign to separate an option name from its value.

EXAMPLES

-     pamgauss 3 3 -sigma=.5 -tupletype=GRAYSCALE | pamtopnm >gauss.pgm
-     pnmconvol -nooffset gauss.pgm myimage.ppm >blurred.ppm
+     pamgauss 7 7 -sigma=.5 -maximize -tupletype=GRAYSCALE | pamtopnm >gauss.pgm
+     pnmconvol -nooffset -normalize gauss.pgm myimage.ppm >blurred.ppm
 

DESCRIPTION

@@ -37,27 +39,20 @@ space in place of the equals sign to separate an option name from its value.

This program is part of Netpbm.

pamgauss generates a one-plane PAM image whose samples are a -gaussian function of their distance from the center of the image. I.e. +Gaussian function of their distance from the center of the image. I.e. the sample value is highest in the center and goes down, in a bell curve shape, as you move away from the center. -

The values are scaled so that the volume under the surface of the -two-dimensional Gaussian function is the maxval of the image. -

You can use this image as a convolution kernel with pnmconvol to blur an image. (This technique is known as Gaussian blurring). width and height are the dimensions of the image that -pamgauss generates. Mathematically speaking, they are the domain -of the two dimensional gaussian function. - -

The sum of all the samples is equal to the image's maxval (within -rounding error). This is true even if you clip the Gaussian function -by making the image too small. If you want to be sure you get a whole -Gaussian function, make sure that you choose a sigma and image -dimensions so that if you made it any larger, the sample values at the -edges would be zero. +pamgauss generates. Mathematically speaking, they are the domain of +the two-dimensional Gaussian function. If you want to be sure you get a whole +Gaussian function, make sure that you choose a standard deviation and image +dimensions so that if you made it any larger, the sample values at the edges +would be zero.

The output image is PAM. To make it usable with pnmconvol, specify -tupletype=GRAYSCALE so pnmconvol can use it as @@ -65,23 +60,62 @@ if it were PGM. You must use the -nooffset option on pnmconvol because zero means zero in the PAM that pamgauss generates. +

Without -maximize, the sum of all the samples is equal to the +image's maxval (within rounding error). This is true even if you clip the +Gaussian function by making the image too small. This is what is normally +required of a convolution kernel. + +

pamgauss oversamples and averages to represent the continuous +Gaussian function in discrete samples in the PAM output. Consider an image 11 +samples wide and an oversampling factor of 10. The samples can be thought of +as contiguous squares one unit wide. The center of the image is thus the +center of the 6th sample from the left. The 3rd sample from the left covers a +range of distances from 3 to 4 units from the center of the image. Because +the oversampling factor is 10, pamgauss computes the value of the +Gaussian function at 10 points evenly spaced between 3 and 4 units from the +center of the image and assigns the 3rd sample from the left the mean of those +10 values. + +

OPTIONS

-sigma=number -
This is the sigma parameter of the Gaussian function (if it were a -Gaussian probability function, this would be its standard deviation). -The higher the number, the more spread out the function is. Normally, -you want to make this number low enough that the function reaches zero -value before the edge of your image. +
This is the standard deviation of the Gaussian function. The higher the +number, the more spread out the function is. Normally, you want to make this +number low enough that the function reaches zero value before the edge of your +image. -

number is in units of pixels. +

number is in units of samples.

This option is required. There is no default. +

-maximize +
Causes pamgauss to use the whole dynamic range available in +the output PAM image by choosing an amplitude for the Gaussian function that +causes the maximum value in the image to be the maxval of the image. +

+If you select this, you probably want to normalize the output (scale the +samples down so the volume under the surface of the two-dimensional Gaussian +function is the maxval) before you use it, for example with +pnmconvol's -normalize option. The reason this is different +from just not using -maximize is that this subsequent normalization can +be done with much more precision than can be represented in a PAM image. +

+Without this option, pamgauss uses an amplitude that makes the volume +under the surface of the two-dimensional Gaussian function the maxval of the +image. This means all the samples in the image are normally considerably less +than the maxval. + +

This option was new in Netpbm 10.79 (June 2017). +

-maxval=number -
This is the maxval for the output image. It defaults to 255. +
This is the maxval for the output image. 65535 is almost always the best +value to use. But there may be some programs (not part of Netpbm) that can't +handle a maxval greater than 255. + +

The default is 255.

-tupletype=string
@@ -89,10 +123,22 @@ This is the value of the "tuple_type" attribute of the created PAM image. It can be any string up to 255 characters. If you don't specify this, pamgauss generates a PAM with unspecified tuple type. +
-oversample=number +
+

This sets the oversampling factor. pamgauss samples the +Gaussian function this many times, bother horizontally and vertically, to +get the value of each sample in the output. + +

An oversampling factor of 1 means no oversampling, which means each +sample is based only on the value of the Gaussian function at the center of +the sample. + +

The default is 5 divided by the standard deviation, rounded up to a whole +number. +

-  -

SEE ALSO

+

SEE ALSO

pnmconvol, pamtopnm, @@ -100,8 +146,7 @@ It can be any string up to 255 characters. If you don't specify this, pamseq, pam -  -

HISTORY

+

HISTORY

pamgauss was new in Netpbm 10.23 (July 2004). -- cgit 1.4.1