1Pgmkernel User Manual(0) Pgmkernel User Manual(0)
2
3
4
5Table Contents ⟨#index⟩
6
7
9 pgmkernel - generate a convolution kernel
10
11
13 pgmkernel [-weight=number] [-maxval=] {size | width height}
14
15 Minimum unique abbreviation of option is acceptable. You may use dou‐
16 ble hyphens instead of single hyphen to denote options. You may use
17 white space in place of the equals sign to separate an option name from
18 its value.
19
20
21
23 This program is part of Netpbm(1).
24
25 pgmkernel generates a convolution kernel that you can use with pnmcon‐
26 vol. The kernel is one where the weight of each location is inversely
27 proportional to its distance from the center of the kernel.
28
29 pgmkernel generates a PGM image of width and height size if you specify
30 one argument, or width width and height height if you specify two argu‐
31 ments.
32
33 pgmkernel computes the convolution function K as follows.
34
35 K(i,j) = 1 / ( 1 + w * sqrt(i^2 + j^2))
36
37 where w is a coefficient specified via the -weight option. i and j are
38 measured in pixels. K is zero everywhere beyond the specified kernel
39 width and height.
40
41 The sample values in the PGM output have this value scaled and biased
42 using the protocol pnmconvol specifies for representing the real num‐
43 bers K in PGM.
44
45
46
48 -weight=number
49 The distance from the center is weighted by this; a higher num‐
50 ber means the value falls off more quickly as you go away from
51 the center.
52
53 This must be a positive real number.
54
55 The default is 6.0.
56
57
58 -maxval=maxval
59 The maxval for the PGM kernel.
60
61 Default is 255.
62
63 This option was new in Netpbm 10.65 (December 2013). Before
64 that, the maxval is always 255.
65
66
67
68
69
71 The computation time is proportional to width*height. This increases
72 rapidly with the increase of the kernel size. A better approach could
73 be using a FFT in these cases.
74
75
77 Before Netpbm 10.65 (December 2013), the output was always in Plain
78 (text) PGM format. (Now, like standard Netpbm programs, the default is
79 raw PGM and you can get Plain PGM with a -plain option).
80
81 Before Netpbm 10.65 (December 2013), this manual said negative values
82 for -weight were valid (as long as they were greater than -1.0). But
83 the program never worked with negative numbers and it isn't clear that
84 the result would be useful, so -weight is now required to be nonnega‐
85 tive and the program fails gracefully if you specify a negative value.
86
87
89 pnmconvol(1), pnmsmooth(1) pamgauss(1) pgm(1)
90
91
92
94 Alberto Accomazzi (alberto@cfa.harvard.edu).
95
97 This manual page was generated by the Netpbm tool 'makeman' from HTML
98 source. The master documentation is at
99
100 http://netpbm.sourceforge.net/doc/pgmkernel.html
101
102netpbm documentation 19 December 2013 Pgmkernel User Manual(0)