Warp Transformation

Moderator: jsachs

Post Reply
Marpel
Posts: 693
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Warp Transformation

Post by Marpel »

I have an image, taken inside a forest, of a sunrise shining from between some trees. Because of the limited space where I was positioned and the height of the sun, the lens is pointing up a bit, resulting in some fairly obvious "key-stoning" of the trees.

I attempted to correct this distortion by using the Warp Transform and, although mostly successful, I notice the revised image still shows distortion, albeit of a different nature. The trees now "barrel out" where the tops and bottoms are the same distance from the image edges, but the middle portions are closer to the same edges, making it look like the trees are all slightly curved.

To correct the keystone effect, I merely moved the two upper grid points in towards each other. However, there does not seem to be anyway to place new points halfway along the edges to be able to control the middle of the image and prevent the barrelling I described.

Not familiar enough with this transform to know if I should be doing the operation differently or if I need to add another transform to deal with the second effect.

Any advice would be appreciated.

Marv
Bob Walker
Posts: 78
Joined: April 25th, 2009, 9:08 am
What is the make/model of your primary camera?: Canon R5
Location: Los Alamos, New Mexico
Contact:

Re: Warp Transformation

Post by Bob Walker »

Marv,

It sounds like you need to correct both for the perspective (warp) and for lens distortion. There's no way (I know of) to add points to the warp transform midway from the corners, or any other place.

Do the best you can with warp, and then try the lens distortion transform under the Geometry menu.

If that doesn't help, maybe post a sample somewhere for us to play with.

Thanks,
BobW
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transformation

Post by jsachs »

The first step is to correct the barrel distortion - using the Lens Distortion transformation, place the 5 control points so as to lie on what should be a straight line in the result image (e.g. one of the tree trunks) and then click the Compute button which will compute the optimal transformation for correcting the distortion.

Once straight lines are straight, use Warp to correct for keystoning. Any perspective transformation always maps straight lines into straight lines so unless the lines are straight in the original they won't be straight in the result.
Jonathan Sachs
Digital Light & Color
Bob Walker
Posts: 78
Joined: April 25th, 2009, 9:08 am
What is the make/model of your primary camera?: Canon R5
Location: Los Alamos, New Mexico
Contact:

Re: Warp Transformation

Post by Bob Walker »

Thanks Jonathan, I realized when I couldn't sleep last night that I had the transformations in the wrong order. I assume also that the lens distortion correction should be done before the image is cropped, yes?

Thanks,
BobW
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transformation

Post by jsachs »

Yes, lens distortion assumes the distortion is symmetric about the center of the image so if you crop the image on one side more than the other it will not work.
Jonathan Sachs
Digital Light & Color
Marpel
Posts: 693
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Warp Transformation

Post by Marpel »

Sorry for the delay in responding to the advice provided.

I was not completely aware of the degree of distortion my lens had until I ran the lens distortion transform, to correct it. Once done, the warp transform brought everything into alignment. A little bit of judicious sharpening is in order, but the image is much better.

Thanks to Bob and Jonathan for their assistance.

On a different topic, which may be of interest to some - I recently picked up CS6 and Perfect Resize (I had used its predecessor, Genuine Fractals quite a bit) and needed to enlarge an image (about 300% in both directions). I used that operation as a chance to compare those two and PWP. I used the default sharpening in each program and used Lanczos 8 x 8 in PWP and Automatic in CS6. Upon close inspection, the PWP version was visually cleaner and sharper.

Marv
Post Reply