Register to reply

Lens distortion and surveying

by DaveC426913
Tags: distortion, lens, surveying
Share this thread:
DaveC426913
#1
Sep1-09, 11:34 PM
DaveC426913's Avatar
P: 15,319
Photography/optical lens distortion/surveying. Please move to appropriate forum.

I wish to survey an area of a friend's backyard using overhead photos.

I can get photos from about 25 feet up a TV antenna with a digital SLR that has a 14-42mm lens. The area to be surveyed is 70'x20' and is about 10' from the tower. That makes for a lot of foreshortening.

(see diagram).

I've done lots of pano / stitch shots before of landscapes and such, but in those cases the correcting for angular disortion wasn't a priority. It was enough that they stitched together seamlessly.

In this case, I want to eliminate all angular distortion (using PhotoShop). i.e. a 2'x2' square at the edge of the final image needs to BE a square (not foreshortened into a diamond) and it needs to be the same SIZE as the same square in the centre of the image.

I thought I could simply take enough pics and stitch them together, compensating for distortion between pics but (and here is the crux of my problem) I am finding that there is distortion within each pic (I'll call it "intra-pic distortion"). i.e. two squares in the same pic will not be congruent. No matter how much I distort any given pic, I cannot eliminate ditortion at two points simultaneously (if I make one is square, the other will be a diamond and vice versa).

How can I fix this?

I learned in college that a 50mm lens is nearest human vision. Can I set the lens to 42mm and hopefully eliminate this ... intra-pic distortion?

Thoughts?
Attached Thumbnails
PF20090901_antennaphoto.gif  
Phys.Org News Partner Science news on Phys.org
What lit up the universe?
Sheepdogs use just two simple rules to round up large herds of sheep
Animals first flex their muscles
Molydood
#2
Sep3-09, 06:47 AM
P: 117
I don't think you need to align the lens to human vision, I think you need to make it as telefoto as possible to minimize distortion (a wide angle lens distorts an image, that's why fashion photogs use telefoto lenses as it stops the models ending up with big noses, which apparantely they dont like)
I would say the combination of stitching more frames of smaller pieces together, and also using a less distorty lens, will help your intra-pic distortion issue.
Andre
#3
Sep3-09, 07:05 AM
PF Gold
Andre's Avatar
P: 5,458
Quote Quote by DaveC426913 View Post
I learned in college that a 50mm lens is nearest human vision. Can I set the lens to 42mm and hopefully eliminate this ... intra-pic distortion?

Thoughts?
First of all, it's not a distortion, it's reality, the result of an oblique projection. The human brain processes this back to the square angles it knows it consists of. To do the same with a picture is a architect nightmare, it requires either a special tilt-shift distorting lens like this or special image processing software that can stretch and tilt images.

I assume that "50mm lens nearest human vision" is about standard lens focal distance, which is -by definition- equal to the largest diameter of the sensor. For the standard original SLR this would be the square root of 24^2 + 36^2 = 43.3 mm.

Most modern DSLR have smaller sensors so the standard lens focal distance would adapt accordingly. Crop factors are

2 for Olympus: Standard focal distance 22 mm
1.6 for Canon: Standard focal distance 27 mm
1.5 for most others including Nikon and Sony: Standard focal distance 29 mm

negitron
#4
Sep3-09, 08:53 AM
Sci Advisor
negitron's Avatar
P: 842
Lens distortion and surveying

Quote Quote by DaveC426913 View Post
I learned in college that a 50mm lens is nearest human vision.
This is only true for 35-mm cameras and then only as a rough guide. For other camera formats, the lens focal length most closely approximating human vision is dependent upon the size of the exposure area. As a rule of thumb, a "normal" lens is one whose focal length is approximately equal to the diagonal length of the exposure area. For 35-mm film, this is about 43 mm; the closest standard lens is 50 mm.
DaveC426913
#5
Sep8-09, 11:23 AM
DaveC426913's Avatar
P: 15,319
Quote Quote by Andre View Post
First of all, it's not a distortion, it's reality, the result of an oblique projection.
I think you misunderstand. I am not simply talking about oblique angles. A wide-angle lens will have a higher degree of distortion (pincushion effect) near the corners than near the centre.

Nevermind straight lines: even a perfectly circular beachball will appear greatly elongated along an axis through the centre of the pic. (As a former photo processor, I am too familiar with human heads stretched into ovals near the corners of wide angle pics. Look at the guys in the top right of this pic: http://www.msm.cam.ac.uk/dmg/GroupIn...Photo2008a.jpg)

That is not reality, that is lens distortion.


Quote Quote by negitron View Post
This is only true for 35-mm cameras and then only as a rough guide. For other camera formats, the lens focal length most closely approximating human vision is dependent upon the size of the exposure area. As a rule of thumb, a "normal" lens is one whose focal length is approximately equal to the diagonal length of the exposure area. For 35-mm film, this is about 43 mm; the closest standard lens is 50 mm.
I did not know this. Or more accurately, I knew only the specific case of 35mm film, not realizing there was a more general general case.

Quote Quote by Molydood View Post
I don't think you need to align the lens to human vision, I think you need to make it as telefoto as possible to minimize distortion (a wide angle lens distorts an image, that's why fashion photogs use telefoto lenses as it stops the models ending up with big noses, which apparantely they dont like)
I would say the combination of stitching more frames of smaller pieces together, and also using a less distorty lens, will help your intra-pic distortion issue.
Yes. But that is impractical.
1] It's hard enough to take a few dozen pix while dangling from an antenna. This method would require a hundred or more.
But more importantly:
2] I need to have at least three reference marks in each shot so that I can digitally return them to an orthagonal view to stitch them together. At telephoto range, I'd need to place reference marks every foot or so, instead of every five feet as I have them now. That would mean that, instead of laying 60 reference marks in my 70'x20' area, I'd need to lay 1470!
junglebeast
#6
Sep8-09, 11:59 AM
P: 462
Dave,

You are correct that this is a radial distortion...it does not exist for ideal pinhole cameras. Lower quality optics have higher amounts of radial distortion, especially with wide field of view.

Typically this is corrected for by calibrating the distortion effects using a reference image that contains known straight lines. Discovering the distortion function can then be posed as a least squares problem to convert the projected curves back into straight lines on the projective plane.

See the wiki page. They mention some Photoshop plugins

http://en.wikipedia.org/wiki/Distortion_%28optics%29
Andre
#7
Sep8-09, 12:29 PM
PF Gold
Andre's Avatar
P: 5,458
Not sure if I don't understand. Look at JB's link:

Distortion (optics)
In geometric optics and cathode ray tube (CRT) displays, distortion is a deviation from rectilinear projection, a projection in which straight lines in a scene remain straight in an image. It is a form of optical aberration.
Now if you'd put a ruler along the window sills etc you will see that these are just about straight, hence there is virtually no distortion.

The problem, I think, is the oblique perspective, vertical parallel lines merging towards the floor. Obviously the same happens with the people, heads being much closer than the feet.
f95toli
#8
Sep8-09, 01:19 PM
Sci Advisor
PF Gold
f95toli's Avatar
P: 2,249
As André has already suggested: Get a tilt-shift lens; this is what the "professionals" use in situations like these and would solve most of your problems.
Now, they are quite expensive but you should be able to rent one from e.g. a pro-photo shop.
mgb_phys
#9
Sep8-09, 01:45 PM
Sci Advisor
HW Helper
P: 8,953
There is a well known model for lens distortions (2 radial terms, 2 tangential, 1 extra for a fisheye) and x+y scale.
See 'learning openCV' chapter 11 - the free opencv library also includes example code to calculate the terms for a given camera+lens using photos of a checkerboard and coe to undistort an image ( there are probably commercial apps that do this)

http://books.google.ca/books?id=seAg...age&q=&f=false
DaveC426913
#10
Sep8-09, 07:57 PM
DaveC426913's Avatar
P: 15,319
Quote Quote by Andre View Post
The problem, I think, is the oblique perspective, vertical parallel lines merging towards the floor. Obviously the same happens with the people, heads being much closer than the feet.
No. Look at the shape of the heads of the guys on the far right. Even a small object with no foreshortening is still distorted into an ellipse in the far corners of a wide angle image.

Here's another one that has none of the vertical foreshortening that's confusing you in that first pic. Look at the shape of the heads of the guys in the top left and (more noticeably) top right corners.
http://www.qtp.ufl.edu/~kmmprogs/ima...oup-6-7-06.jpg
And here (girl, top left):
http://iopenshell.usc.edu/krylovgroup/group-feb2009.jpg
And here (girl, top left):
http://media.tri-cityherald.com/stat...og/piemain.jpg
DaveC426913
#11
Sep8-09, 08:19 PM
DaveC426913's Avatar
P: 15,319
Quote Quote by junglebeast View Post
Dave,

You are correct that this is a radial distortion...it does not exist for ideal pinhole cameras. Lower quality optics have higher amounts of radial distortion, especially with wide field of view.
This much I knew. I sold a lot of cheap 35mm cameras in the 80s - and then developed all their cheap pictures. Corner distortion was bad - and amplified by the wide angle lens.
Quote Quote by junglebeast View Post
Typically this is corrected for by calibrating the distortion effects using a reference image that contains known straight lines. Discovering the distortion function can then be posed as a least squares problem to convert the projected curves back into straight lines on the projective plane.
This is exactly why I laid reference spots throughout the entire area (a sticky note every 5 feet, vert & horiz). I'd hoped it was just a matter of distorting each pic. Unfortunately, the standard distortion in PhotoShop does not straighten distorted lines within an image.
Quote Quote by junglebeast View Post

See the wiki page. They mention some Photoshop plugins

http://en.wikipedia.org/wiki/Distortion_%28optics%29
Cool. I will check that out. Thanks!
junglebeast
#12
Sep9-09, 12:18 AM
P: 462
Quote Quote by DaveC426913 View Post
This is exactly why I laid reference spots throughout the entire area (a sticky note every 5 feet, vert & horiz). I'd hoped it was just a matter of distorting each pic. Unfortunately, the standard distortion in PhotoShop does not straighten distorted lines within an image.
As a quick hack, I've used the Pinch/Spherize distortion filters to remove the apparent presence of radial distortion in the past...although I wouldn't trust that for a consistent approach. You don't actually need to put reference markers in the image because it doesn't depend on depth, you should be able to recover the radial distortion parameters from any calibration image and then use it to remove distortion from any other image taken by the same camera. good luck, let me know if you find a good technique
DaveC426913
#13
Sep9-09, 12:39 AM
DaveC426913's Avatar
P: 15,319
Quote Quote by junglebeast View Post
As a quick hack, I've used the Pinch/Spherize distortion filters to remove the apparent presence of radial distortion in the past...although I wouldn't trust that for a consistent approach.
Yeah. Tried that. No joy. I did download a PhotoShop Lens Correction filter, which is designed to do exactly this though.

Quote Quote by junglebeast View Post
You don't actually need to put reference markers in the image because it doesn't depend on depth, you should be able to recover the radial distortion parameters from any calibration image and then use it to remove distortion from any other image taken by the same camera. good luck, let me know if you find a good technique
Huh. Yeah, when I was using the filter, I suddenly realized it should be the exact same setting for every picture, regardless of what was in the picture. (Provided they were all at the same zoom.)

Now that you mention it, I could set up a calibration card with a grid on it. I simply set the lens to the right zoom, take a pic of the grid, and pull it into PS where I apply the filter. Whatever filter setting corrects the grid back to straight lines is the setting I'll use on every picture...

Great idea.

Makes me wish I hadn't given the camera back to my brother...
DaveC426913
#14
Sep14-09, 09:12 AM
DaveC426913's Avatar
P: 15,319
Bah! It's not working no matter how I try.

I went back one more time and laid out mason's twine along the entire 70' length of the site: four strands four feet apart. Then went back and marked each strand with tape at four foot intervals, givng me a 4x4 grid of the entire area. Then I took my pics again.

Still too much distortion.

In PhotoShop, I cannot warp a single photo and get all reference points in the photo to line up to a grid. I think this has to do with the fact that the Perspective filter does its distortion in a more sophisticated way than the more simple Distort filter. I think the Perspective filter does "weighted" foreshortening, whereas Distort does not. Problem is, Perspective filtering is done purely by guesswork.


Register to reply

Related Discussions
Surveying scientists' use of computers General Physics 0
A question of surveying a plat of land Engineering, Comp Sci, & Technology Homework 5
Surveying update General Engineering 3
Surveying - Measuring the meter. Science & Math Textbooks 0