1Pamrubber User Manual(0) Pamrubber User Manual(0)
2
3
4
6 pamrubber - a rubber-sheeting utility that stretches an image based on
7 control points
8
9
11 pamrubber {-tri | -quad} [-linear] [-frame] [-randomseed=N] cp1x cp1y
12 [cp2x cp2y [cp3x cp3y [cp4x cp4y]]] cp1x cp1y [cp2x cp2y [cp3x cp3y
13 [cp4x cp4y]]] [filename]
14
15 Minimum unique abbreviation of options is acceptable. You may use dou‐
16 ble hyphens instead of single hyphen to denote options.
17
18
20 This program is part of Netpbm(1).
21
22 The pamrubber utility converts a pam image into a new image with the
23 contents moved around. The transformation is often called "rubber
24 sheeting": you identify control points (CP) on the source image and
25 specify new positions for those points in the new image. pamrubber
26 moves all the pixels around, stretching and compressing as necessary,
27 as if the original image were on a sheet of rubber and you pulled on
28 the sheet to make the control points move to their new locations.
29
30 The new image has the same dimensions and format as the original.
31
32 The transformation can happen in two very different ways, called "quad"
33 and "tri." With the former, you must specify four control points (for
34 both source and target). These are the corners of two quadrilaterals
35 that will act as the coordinate system for both source and target
36 images. Consider them as non-orthogonal (0,0), (0,1), (1,0) and (1,1)
37 points. This transformation comes close to the one pamperspective
38 does, however that program does other corrections as well.
39
40 When you specify less than four control points, the program adds con‐
41 trol points in the following way. With three control points, pamrubber
42 chooses the fourth one such that the four points form a parallelogram.
43 With two points, pamrubber considers them the opposite corners of a
44 rectangle. When you specify only one control point, pamrubber uses a
45 rectangle from the top left corner of the image to the single control
46 point.
47
48 In "tri" mode, pamrubber conceptually cuts up the source and target
49 image into triangles. It Transforms within each corresponding pair of
50 triangles in a stretching fashion. It's like pulling on the three cor‐
51 ners of the triangle. In this mode, each pixel in the source image
52 gets mapped to a position in the target image. No pixels are lost.
53
54 When, in "tri" mode, you specify only a single control point in the
55 source and target image, pamrubber creates four triangles from this
56 point to the four corners of the image. With two points, the program
57 creates six triangles from the two endpoints of the line connecting the
58 two points, again to the four corners of the image. Three control
59 points is in a way the core of this utility in "tri" mode. Between the
60 three edges of the central triangle and the four edges of the image,
61 pamrubber constructs another seven triangles. Four control points
62 define two central connected triangles. In total this results in cut‐
63 ting the source and target image up into ten triangles.
64
65 In this case clearly a picture says more than a thousand words. There
66 is a graphical illustration of these various modes at
67 www.schaik.com/netpbm/rubber ⟨http://www.schaik.com/netpbm/rubber⟩ .
68 An example of how to use this type of rubber sheeting in cartography is
69 in the article
70 Visualizing the Landscape of Old-Time Tokyo
71 ⟨http://www.isprs.org/proceedings/XXXVI/5-W1/papers/21.pdf⟩ .
72
73
74
76 The parameters are control points (cp) in pairs of x and y. The source
77 and target image must have the same number of control points. The min‐
78 imum number of values specified here is 4 for a single control point in
79 the source and target image. The maximum is 16 for four control points
80 in each image.
81
82 filename is the name of the input file. If you don't specify this, pam‐
83 rubber reads the image from Standard Input.
84
85
86
88 In addition to the options common to all programs based on libnetpbm
89 (most notably -quiet, see
90 Common Options ⟨index.html#commonoptions⟩ ), pamrubber recognizes the
91 following command line options:
92
93
94
95
96 -tri | -quad
97
98 This selects the type of rubber sheeting done. You must specify
99 exactly one of these options.
100
101
102
103 -linear
104
105 This determines whether pamrubber uses nearest neighbor interpo‐
106 lation or bilinear interpolation of four source pixels.
107
108
109
110
111 -frame
112
113 This option causes pamrubber to overlay the target image with
114 the edges of the quadrilaterals, respectively the triangles used
115 for the rubber sheeting. To get the same overlay for the source
116 image, use a pamrubber transformation with identical control
117 points for source and target.
118
119
120
121 -randomseed=N
122
123 pamrubber randomizes some of its output. So that you can pro‐
124 duce repeatable results, you can choose the seed of the random
125 number generator with this option. If you use the same input
126 image and the same random number generator seed, you should
127 always get the exact same output. By default, pamrubber uses
128 the time of day as the seed, so you get slightly different out‐
129 put when you run the program twice on the same input.
130
131 Before Netpbm 10.61 (December 2012), this was called -randseed,
132 and that still works.
133
134
135
136
137
138
140 pam(1) and pamperspective(1)
141
142
144 pamrubber was new in Netpbm 10.54 (March 2011).
145
146
147
149 Willem van Schaik wrote this program in February 2011 and contributed
150 it to Netpbm.
151
153 This manual page was generated by the Netpbm tool 'makeman' from HTML
154 source. The master documentation is at
155
156 http://netpbm.sourceforge.net/doc/pamrubber.html
157
158netpbm documentation February 2011 Pamrubber User Manual(0)