summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/pgmkernel.1
blob: 0605268c09bb3489cc55714f6251e18e14af6135 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\
.\" 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 "Pgmkernel User Manual" 0 "19 December 2013" "netpbm documentation"
.UR #index
Table Contents
.UE
\&

.SH NAME

pgmkernel - generate a convolution kernel

.UN synopsis
.SH SYNOPSIS
.PP
\fBpgmkernel\fP
[\fB-weight=\fP\fInumber\fP]
[\fB-maxval=\fP] {\fIsize\fP | \fIwidth\fP \fIheight\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
\fBpgmkernel\fP generates a convolution kernel that you can use
with \fBpnmconvol\fP.  The kernel is one where the weight of each location
is inversely proportional to its distance from the center of the kernel.
.PP
\fBpgmkernel\fP generates a PGM image of width and height \fIsize\fP
if you specify one argument, or width \fIwidth\fP and height \fIheight\fP
if you specify two arguments.
.PP
\fBpgmkernel\fP computes the convolution function K as follows.

.RS
K(i,j) = 1 / ( 1 + w * sqrt(i^2 + j^2)) 
.RE

where \fIw\fP is a coefficient specified via the \fB-weight\fP
option.  \fIi\fP and \fIj\fP are measured in pixels.  K is zero
everywhere beyond the specified kernel width and height.
.PP
The sample values in the PGM output have this value scaled and biased using
the protocol \fBpnmconvol\fP specifies for representing the real numbers K
in PGM.


.UN options
.SH OPTIONS


.TP
\fB-weight=\fP\fInumber\fP
The distance from the center is weighted by this; a higher number means
the value falls off more quickly as you go away from the center.
.sp
This must be a positive real number.
.sp
The default is 6.0.

.TP
\fB-maxval=\fP\fImaxval\fP
The maxval for the PGM kernel.
.sp
Default is 255.
.sp
This option was new in Netpbm 10.65 (December 2013).  Before that, the
maxval is always 255.
    



.UN limitations
.SH LIMITATIONS
.PP
The computation time is proportional to \fIwidth\fP*\fIheight\fP.
This increases rapidly with the increase of the kernel size.  A better
approach could be using a FFT in these cases.

.UN history
.SH HISTORY
.PP
Before Netpbm 10.65 (December 2013), the output was always in
Plain (text) PGM format.  (Now, like standard Netpbm programs, the default
is raw PGM and you can get Plain PGM with a \fB-plain\fP option).
.PP
Before Netpbm 10.65 (December 2013), this manual said negative values
for \fB-weight\fP were valid (as long as they were greater than -1.0).  But
the program never worked with negative numbers and it isn't clear that the
result would be useful, so \fB-weight\fP is now required to be nonnegative
and the program fails gracefully if you specify a negative value.

.UN seealso
.SH SEE ALSO
.BR "pnmconvol" (1)\c
\&,
.BR "pnmsmooth" (1)\c
\&
.BR "pamgauss" (1)\c
\&
.BR "pgm" (5)\c
\&


.UN author
.SH AUTHOR

Alberto Accomazzi (\fIalberto@cfa.harvard.edu\fP).
.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/pgmkernel.html
.PP