RSS/Atom feed Twitter
Site is read-only, email is disabled

"Squaring up" an Image - Perspective Transform Changes Sizes

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

"Squaring up" an Image - Perspective Transform Changes Sizes Steve Strobel 22 Jan 20:43
  "Squaring up" an Image - Perspective Transform Changes Sizes Marc) (A.) (Lehmann 22 Jan 22:18
   "Squaring up" an Image - Perspective Transform Changes Sizes Gene Heskett 22 Jan 22:52
   "Squaring up" an Image - Perspective Transform Changes Sizes Steve Strobel 23 Jan 01:56
Steve Strobel
2004-01-22 20:43:18 UTC (over 20 years ago)

"Squaring up" an Image - Perspective Transform Changes Sizes

I am trying to "square up" an image. It is a scanned map which shows section lines representing a one mile square. Because of the map projection, the section lines on the map aren't quite square (opposite sides aren't even quite parallel). I am trying to "square up" the image so I can overlay it with some survey data. Using the shearing and rotation transform tools, I can get it close, but I haven't found a good way to correct for opposite sides not being parallel.

I tried using the perspective transform to adjust the corners of the image so the section lines would be horizontal and vertical. At first, that appeared to work, but it has an unintended side-effect. When I adjust a corner vertically, it also affects the horizontal placement of objects in the image (see for a screen shot using the transform tool - note that everything got "squished" to the left). I understand that is correct for a perspective transform, but it isn't what I need for the map.

Is there another transform or tool in the Gimp that will allow me to "stretch" the corners of an image? Specifically, I am looking for a tool that will let me move one of the corners vertically, adjusting the objects on the map vertically to compensate, while leaving their horizontal locations alone. Thanks for any advice.

Steve

P.S. This may be a similar problem to the one faced by those that are "stitching" small image "tiles" together to create larger panoramic images. I am not familiar with how that is done. Thanks again. ---
Steve Strobel WWW: http://www.link-comm.com Link Communications, Inc. Phone: (406) 245-5002 ext 102 MailTo:steve@link-comm.com Fax: (406) 245-4889

Marc) (A.) (Lehmann
2004-01-22 22:18:43 UTC (over 20 years ago)

"Squaring up" an Image - Perspective Transform Changes Sizes

On Thu, Jan 22, 2004 at 12:43:18PM -0700, Steve Strobel wrote:

I tried using the perspective transform to adjust the corners of the image so the section lines would be horizontal and vertical.

That's actually correctly doing what the perspective transform is doing (try to imagine a plane with rectangles on it, in an angle towards you).

From what you are writing, I'd say he shearing transform is *exactly* what you need, so what kind of problems are you facing when using a shear transform?

Gene Heskett
2004-01-22 22:52:15 UTC (over 20 years ago)

"Squaring up" an Image - Perspective Transform Changes Sizes

On Thursday 22 January 2004 16:18, pcg@goof.com ( Marc) (A.) (Lehmann ) wrote:

On Thu, Jan 22, 2004 at 12:43:18PM -0700, Steve Strobel

wrote:

I tried using the perspective transform to adjust the corners of the image so the section lines would be horizontal and vertical.

That's actually correctly doing what the perspective transform is doing (try to imagine a plane with rectangles on it, in an angle towards you).

From what you are writing, I'd say he shearing transform is *exactly* what you need, so what kind of problems are you facing when using a shear transform?

You may also be trying to undo the spherical component of the mapping. USGS maps, and most maps in general are on a spherical plane usually, sometimes on a modification of the mercator projection. This may be something that the gimp coders could add, a 'de-sphericalizer'. Make the user put in the 1/xxxxxx ratio as shown on the map and use that to calculate what to do.

Steve Strobel
2004-01-23 01:56:03 UTC (over 20 years ago)

"Squaring up" an Image - Perspective Transform Changes Sizes

Thanks for the quick reply. The shearing transform works great for what it does, but it can't help when the opposite sides aren't parallel; it always moves them together. Imagine drawing a "square" with straight lines but with none of the corners quite 90 degrees. Rotate it until the top is level, then use the shear transform to make the right edge vertical. Now you have one corner (the lower-left) that isn't quite correct. What I need is a way to "drag" that lower-left corner into place.

Now consider the case where that lower-left corner is in the correct horizontal position but too low. As I move it down into place, everything else in the image needs to move up too (less so as you get closer to the right and top edges). But nothing should need to move to the right or left; those positions should be OK. When I move the lower left corner upward with the perspective tool, however, it not only changes the vertical positions, but "squishes" everything to the left horizontally as well (see ).

I believe that what I need is a 2-D linear transform something like shearing or scaling that changes the amount of correction linearly as it moves from one edge of the image to the other, rather than a 3-D transform like the perspective tool. In other words, I am not looking at a square map from an angle (in which case the perspective tool would be perfect), but trying to change a map made with one projection to another projection.

I don't think that the way the perspective transform works can possibly be the right way to change between the map projections. Consider this: take each section of the map, run them through the transform tool to make them square, then put them back together. If the perspective tool takes the stuff in the center of each section and squishes it to the left, your scale would ramp in sawtooth fashion (one tooth per section) as you crossed the newly assembled map.

Steve

At 10:18 PM 1/22/2004 +0100, you wrote:

On Thu, Jan 22, 2004 at 12:43:18PM -0700, Steve Strobel wrote:

I tried using the perspective transform to adjust the corners of the image so the section lines would be horizontal and vertical.

That's actually correctly doing what the perspective transform is doing (try to imagine a plane with rectangles on it, in an angle towards you).

From what you are writing, I'd say he shearing transform is *exactly* what you need, so what kind of problems are you facing when using a shear transform?