Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Lens distortion and surveying

  1. Sep 1, 2009 #1


    User Avatar
    Gold Member

    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?


    Attached Files:

  2. jcsd
  3. Sep 3, 2009 #2
    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.
  4. Sep 3, 2009 #3
    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
  5. Sep 3, 2009 #4


    User Avatar
    Science Advisor

    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.
  6. Sep 8, 2009 #5


    User Avatar
    Gold Member

    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/GroupInfo/GroupPhotos/GroupPhoto2008a.jpg" [Broken])

    That is not reality, that is lens distortion.

    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.

    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!
    Last edited by a moderator: May 4, 2017
  7. Sep 8, 2009 #6

    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

  8. Sep 8, 2009 #7
    Not sure if I don't understand. Look at JB's link:

    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.
  9. Sep 8, 2009 #8


    User Avatar
    Science Advisor
    Gold Member

    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.
  10. Sep 8, 2009 #9


    User Avatar
    Science Advisor
    Homework Helper

    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)

  11. Sep 8, 2009 #10


    User Avatar
    Gold Member

    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/images/Group-6-7-06.jpg [Broken]
    And here (girl, top left):
    http://iopenshell.usc.edu/krylovgroup/group-feb2009.jpg [Broken]
    And here (girl, top left):
    Last edited by a moderator: May 4, 2017
  12. Sep 8, 2009 #11


    User Avatar
    Gold Member

    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.
    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.
    Cool. I will check that out. Thanks!
  13. Sep 9, 2009 #12
    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
  14. Sep 9, 2009 #13


    User Avatar
    Gold Member

    Yeah. Tried that. No joy. I did download a PhotoShop Lens Correction filter, which is designed to do exactly this though.

    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...
  15. Sep 14, 2009 #14


    User Avatar
    Gold Member

    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook