| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pgmkernel User Manual" 1 "19 December 2013" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pgmkernel - generate a convolution kernel |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
.PP |
| 14 |
\fBpgmkernel\fP |
| 15 |
[\fB-weight=\fP\fInumber\fP] |
| 16 |
[\fB-maxval=\fP] {\fIsize\fP | \fIwidth\fP \fIheight\fP} |
| 17 |
.PP |
| 18 |
Minimum unique abbreviation of option is acceptable. You may use double |
| 19 |
hyphens instead of single hyphen to denote options. You may use white |
| 20 |
space in place of the equals sign to separate an option name from its value. |
| 21 |
|
| 22 |
|
| 23 |
.UN description |
| 24 |
.SH DESCRIPTION |
| 25 |
.PP |
| 26 |
This program is part of |
| 27 |
.BR "Netpbm" (1)\c |
| 28 |
\&. |
| 29 |
.PP |
| 30 |
\fBpgmkernel\fP generates a convolution kernel that you can use |
| 31 |
with \fBpnmconvol\fP. The kernel is one where the weight of each location |
| 32 |
is inversely proportional to its distance from the center of the kernel. |
| 33 |
.PP |
| 34 |
\fBpgmkernel\fP generates a PGM image of width and height \fIsize\fP |
| 35 |
if you specify one argument, or width \fIwidth\fP and height \fIheight\fP |
| 36 |
if you specify two arguments. |
| 37 |
.PP |
| 38 |
\fBpgmkernel\fP computes the convolution function K as follows. |
| 39 |
|
| 40 |
.RS |
| 41 |
K(i,j) = 1 / ( 1 + w * sqrt(i^2 + j^2)) |
| 42 |
.RE |
| 43 |
|
| 44 |
where \fIw\fP is a coefficient specified via the \fB-weight\fP |
| 45 |
option. \fIi\fP and \fIj\fP are measured in pixels. K is zero |
| 46 |
everywhere beyond the specified kernel width and height. |
| 47 |
.PP |
| 48 |
The sample values in the PGM output have this value scaled and biased using |
| 49 |
the protocol \fBpnmconvol\fP specifies for representing the real numbers K |
| 50 |
in PGM. |
| 51 |
|
| 52 |
|
| 53 |
.UN options |
| 54 |
.SH OPTIONS |
| 55 |
.PP |
| 56 |
In addition to the options common to all programs based on libnetpbm |
| 57 |
(most notably \fB-quiet\fP, see |
| 58 |
.UR index.html#commonoptions |
| 59 |
Common Options |
| 60 |
.UE |
| 61 |
\&), \fBpgmkernel\fP recognizes the following |
| 62 |
command line options: |
| 63 |
|
| 64 |
|
| 65 |
.TP |
| 66 |
\fB-weight=\fP\fInumber\fP |
| 67 |
The distance from the center is weighted by this; a higher number means |
| 68 |
the value falls off more quickly as you go away from the center. |
| 69 |
.sp |
| 70 |
This must be a positive real number. |
| 71 |
.sp |
| 72 |
The default is 6.0. |
| 73 |
|
| 74 |
.TP |
| 75 |
\fB-maxval=\fP\fImaxval\fP |
| 76 |
The maxval for the PGM kernel. |
| 77 |
.sp |
| 78 |
Default is 255. |
| 79 |
.sp |
| 80 |
This option was new in Netpbm 10.65 (December 2013). Before that, the |
| 81 |
maxval is always 255. |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
.UN limitations |
| 87 |
.SH LIMITATIONS |
| 88 |
.PP |
| 89 |
The computation time is proportional to \fIwidth\fP*\fIheight\fP. |
| 90 |
This increases rapidly with the increase of the kernel size. A better |
| 91 |
approach could be using a FFT in these cases. |
| 92 |
|
| 93 |
.UN history |
| 94 |
.SH HISTORY |
| 95 |
.PP |
| 96 |
Before Netpbm 10.65 (December 2013), the output was always in |
| 97 |
Plain (text) PGM format. (Now, like standard Netpbm programs, the default |
| 98 |
is raw PGM and you can get Plain PGM with a \fB-plain\fP option). |
| 99 |
.PP |
| 100 |
Before Netpbm 10.65 (December 2013), this manual said negative values |
| 101 |
for \fB-weight\fP were valid (as long as they were greater than -1.0). But |
| 102 |
the program never worked with negative numbers and it isn't clear that the |
| 103 |
result would be useful, so \fB-weight\fP is now required to be nonnegative |
| 104 |
and the program fails gracefully if you specify a negative value. |
| 105 |
|
| 106 |
.UN seealso |
| 107 |
.SH SEE ALSO |
| 108 |
.BR "pnmconvol" (1)\c |
| 109 |
\&, |
| 110 |
.BR "pnmsmooth" (1)\c |
| 111 |
\& |
| 112 |
.BR "pamgauss" (1)\c |
| 113 |
\& |
| 114 |
.BR "pgm" (1)\c |
| 115 |
\& |
| 116 |
|
| 117 |
|
| 118 |
.UN author |
| 119 |
.SH AUTHOR |
| 120 |
|
| 121 |
Alberto Accomazzi (\[email protected]\fP). |
| 122 |
.SH DOCUMENT SOURCE |
| 123 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 124 |
source. The master documentation is at |
| 125 |
.IP |
| 126 |
.B http://netpbm.sourceforge.net/doc/pgmkernel.html |
| 127 |
.PP |