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
83 filename is the name of the input file. If you don't specify this, pam‐
84 rubber reads the image from Standard Input.
85
86
87
89 -tri | -quad
90
91 This selects the type of rubber sheeting done. You must specify
92 exactly one of these options.
93
94
95
96 -linear
97
98 This determines whether pamrubber uses nearest neighbor interpo‐
99 lation or bilinear interpolation of four source pixels.
100
101
102
103
104 -frame
105
106 This option causes pamrubber to overlay the target image with
107 the edges of the quadrilaterals, respectively the triangles used
108 for the rubber sheeting. To get the same overlay for the source
109 image, use a pamrubber transformation with identical control
110 points for source and target.
111
112
113
114 -randomseed=N
115
116 pamrubber randomizes some of its output. So that you can pro‐
117 duce repeatable results, you can choose the seed of the random
118 number generator with this option. If you use the same input
119 image and the same random number generator seed, you should
120 always get the exact same output. By default, pamrubber uses
121 the time of day as the seed, so you get slightly different out‐
122 put when you run the program twice on the same input.
123
124 Before Netpbm 10.61 (December 2012), this was called -randseed,
125 and that still works.
126
127
128
129
130
131
132
134 pam(1) and pamperspective(1)
135
136
137
139 pamrubber was new in Netpbm 10.54 (March 2011).
140
141
142
144 Willem van Schaik wrote this program in February 2011 and contributed
145 it to Netpbm.
146
148 This manual page was generated by the Netpbm tool 'makeman' from HTML
149 source. The master documentation is at
150
151 http://netpbm.sourceforge.net/doc/pamrubber.html
152
153netpbm documentation February 2011 PamRubber User Manual(0)