Slashdot Mirror


Correcting Lens Aberrations in Digital Photography?

Kavau asks: "I've recently entered the world of digital photography, and bought a pocket-sized digital. While the resolution and the color accuracy are very nice, I was utterly disappointed by the (lack of) quality of the zoom lens: It has a clearly visible barrel distortion, especially in wide angle, so that straight lines appear curved in the picture. This is especially annoying in architectural shots or cityscapes. While grumbling about this shortcoming, I suddenly realized that I am dealing with digital imaging here: In principle it should be no problem to measure the distortion, and then to correct it with a digital mapping. Other lens faults such as vignetting could also be corrected. Now, since I don't want to reinvent the wheel, here is my question to Slashdot: Do you know of any open-source tools that deal with issues such as (1) applying general analytic transformations to a picture, (2) specifically correcting for barrel distortion, or (3) determining the amount of distortion from test pictures? Also, since people probably had this idea before, does anyone have experience with this issue that he/she wants to share, or some resources to point out?"

67 comments

  1. Tutorial by L.+VeGas · · Score: 3, Funny

    1. Grip each eyeball firmly between your middle fingers and thumbs.

    2. With your forefingers at 9:00 (left) and 3:00 (right), press firmly against each eye. Distortion should now be minimized.

    3. Should blindness occur, trim fingernails and repeat with alternate eyeballs.

    1. Re:Tutorial by SouthSideNick · · Score: 1

      Why do you bother?

    2. Re:Tutorial by Anonymous Coward · · Score: 0

      Because he's the funniest guy on Slashdot.

  2. Seems to me... by Lendrick · · Score: 4, Informative

    ...that your best bet would be to take a picture of a piece of graph paper, and then figure out exactly how to stretch it so that the lines are straight again. That said, I'm not entirely certain if there are any programs out there that would do this, but I think it'd be reasonably easy to write an OpenGL program that allows you to apply arbitrary distortions to an image, and then saves those distortions to apply to other images.

    1. Re:Seems to me... by Mprx · · Score: 3, Informative

      I don't think the OpenGL API allows easy arbitrary distortions. Maybe have a look at the source for the various distortion plugins for the GIMP.

    2. Re:Seems to me... by Lendrick · · Score: 2, Informative

      I don't think the OpenGL API allows easy arbitrary distortions.

      Sure it does.

      The way to do it is use the original as a texture, and then draw a grid of square polygons, each with a corresponding of that texture. Allow the user to distort those squares (while leaving the texture the same) and you can distort the image. To really make this look good, you'll need to use fairly fine-grained squares, but you're not concerned with frame-rate here.

    3. Re:Seems to me... by addaon · · Score: 1

      Do one square per pixel of source image, colored squares (no texture)... and use the raw data (RGB), with the pixel grid in place. That is, don't use the combined RGB values; each pixel should be some saturation of one of red, green, or blue. Antialiasing and filtering, then, should give you the optimal (combined RGB) image, either before or after distorting.

      --

      I've had this sig for three days.
    4. Re:Seems to me... by samoverton · · Score: 1

      Firstly, forget about graph paper. It is already common practise in photography to examine the properties of a camera's lens and viewfinder using standard test images such as this (don't use this actual image though, it is a photograph itself, not actually the source image).

      I think the poster already has an idea how to solve the problem, he mentions digital mappings, but the point is that he doesn't want to go to the effort of coding if it has been done before.

    5. Re:Seems to me... by nomel · · Score: 3, Insightful
      Firstly, forget about graph paper.


      Huh? Graph paper would do a MUCH better job at finding the lenses flaws, and make it fairly simple to correct them...that picture you have would barely do any good at all...just on the parts where there was detail. Even then, that would be insanely hard to implement in software compared to a grid. It might be better at finding focus or something...but thats not the point. The graph paper would show you exactly how the lense was deformed at practically every point on the lense (depending on density of the lines of course). All you would have to do to fix it would be straighten out the lines. I don't really see how that picture you posted could be used to find lense distortion...it just doesn't have enough detail. What is it specifically for?
    6. Re:Seems to me... by SeanAhern · · Score: 1

      No, not that image. That's an image used to determine the fidelity of a digital camera. Higher megapixels (or higher-fidelity chips like the Foveon) will resolve higher-detail features.

      A grid, such as that generated by taking a picture of graph paper, is exactly what you need to correct for barrel distortions and the like.

  3. AMD logo? by kworthington · · Score: 3, Interesting

    I'm just curious why there's an AMD logo for this edition of ask /.

    1. Re:AMD logo? by GotSanity · · Score: 1

      I am wondering the same thing? Is it an error with the slashdot posting system or is it an error by the writer. We may never know.

    2. Re:AMD logo? by kavau · · Score: 1
      Is it an error with the slashdot posting system or is it an error by the writer.

      IIRC I posted the story with "Graphics" as the topic. However, "AMD" is the first topic in the list so I strongly suspect an oversight by the editor (not to be blasphemous or anything...)

    3. Re:AMD logo? by GotSanity · · Score: 1

      I can see that, when I saw the AMD logo it perked my interest. I was hoping AMD was breaking into the graphics market.

  4. PanoTools by ugglan · · Score: 5, Informative

    Check out PanoTools at http://www.path.unimelb.edu.au/~dersch/

    It has a steep learning curve, but seems to be worth the effort. I've only played around with it some myself but I've seen lots of (seemingly) professional photographers on the web that use it.

    Exellent tutorials: Big Ben's Panorama Tutorials

    1. Re:PanoTools by bill_mcgonigle · · Score: 1

      Last I heard, IPIX was trying to bully Dersch off the 'Net - he's back up now? Anybody have info?

      Anyway, he has a page on Correcting Barrel Distortion.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  5. google says... by tchuladdiass · · Score: 4, Informative

    Search string: photo barrel distortion
    4'th link down:
    www.philohome.com/barrelpers/barrelpers.htm

    It mentions to use the "panorama tools" package, which is open source. However, from what I remember, someone sued the author for patent infringement or something, so he no longer has it on his web site www.fh-furtwangen.de/~dersch/, but I found it on www.path.unimelb.edu.au/~dersch/

  6. Photoshop options by cgenman · · Score: 2, Informative

    I know, I know, not freeware. Yet everyone seems to have a copy.

    a creative pro article about correcting barrel distortion, and one at Fred Miranda.

    1. Re:Photoshop options by cgenman · · Score: 1

      Ok, I can completely understand an "overrated" rating, but "offtopic?"

  7. Nothing new here by themo0c0w · · Score: 5, Interesting

    This has been a problem in traditional photography for some time. Distortion for wide angle shots always occurs for any wide angle shot -- try a 28mm lense sometime and see for yourself.

    Special lenses do exist to correct for this. However, the are very expensive. Generally, only architecture photographers and other professionals have them.

    You'll probably want a better lens anyway for doing any sort of quality photography. Oh, and as for fixing it with a filter, good luck. Its not as easy as just applying a transform as the person with the graph paper suggests. The warping depends on distance from the lens.

    --
    ph34r teh p0w3r 0f th3 c0w
    1. Re:Nothing new here by Elwood+P+Dowd · · Score: 1

      The warping depends on distance from the lens.

      If some physicist can explain that one to me, I'll eat my shorts. (Note, we're not talking about blurring, we're talking about warping.)

      --

      There are no trails. There are no trees out here.
    2. Re:Nothing new here by hamjudo · · Score: 2, Informative
      The warping depends on distance from the lens.

      That's not quite right, so leave your shorts where they belong.

      The warping changes as you change focus or zoom. How much it changes depends on the quality of the lens.

      If you zoom in, you may need to recalibrate your dewarping transform.

      Cheap cameras that don't autofocus or zoom have an advantage here.

    3. Re:Nothing new here by kavau · · Score: 1
      Distortion for wide angle shots always occurs for any wide angle shot

      True. However, my film SLR has no noticeable distortion at 35mm. With my pocket digital, the issue is clearly the inferior lens, and not the fundamental limitations you're mentioning.

      You'll probably want a better lens anyway for doing any sort of quality photography.

      I'm well aware that it's impossible to get high-quality pictures from an ultra-compact camera. I chose this particular camera, however, because it's easy to carry around in a shirt pocket. When an unexpected opportunity for a good shot arises, it will be there, while my film SLR will be lying at home.

      What I'm looking for is therefore a compromise: Acceptable image quality with a small form factor. And I think an ultra-compact digital combined with some software-based distortion removal might just do the job. Well, thanks for all the suggestions so far!

      For the curious: The camera I'm talking about is a Pentax Optio S.

    4. Re:Nothing new here by nomel · · Score: 1

      Like the other guy said, you change focus and zoom...and since lense shape is static...you moving lenses away or to the detector/film. So I gues it does directly have to do with distance.

    5. Re:Nothing new here by Anonymous Coward · · Score: 0

      This has been a problem in traditional photography for some time. Distortion for wide angle shots always occurs for any wide angle shot -- try a 28mm lense sometime and see for yourself.

      Not true, distortion is not mandatory, you just need to spend a lot of money to get little or no distortion. Get Canon L ("luxury") or Leitz pro lenses and you'll see what quality glass can do.

      Now, the perspective of a 28 mm lens is quite different from a 50 mm lens, which is why some photographers use them to get a desired effect. Many landscape shots are wide-angle.

      The angle of view for a 50 mm lens is roughly that of your eye.

      Portrait photos are often shot with small telephoto lenses (like 200 mm) to de-emphasize the nose and make people look more attractive.

      Of course, 28 mm isn't that wide. 20 mm or less, that's wide!

  8. Hmmmm, I wonder by shaka999 · · Score: 2, Insightful

    Not the most computationally efficient method but I wonder if you could do this with povray.

    Use the picture as an image map on a sphere or cylinder. Keep adjusting the frame and object size until the lines look straight. Make sure the object is self illuminating and you don't use external light sources...

    Hmmmm, seems like it might work....

    --
    One should not theorize before one has data. -Sherlock Holmes-
    1. Re:Hmmmm, I wonder by shaka999 · · Score: 1

      Ok, I thought about this some more and the sphere or cylinder would have the opposite effect. But, I think the idea of using a 3d renderer is still sound.

      Basically build a custom lens in the program and view the image through that lens. The lens would straighten the lines....

      Err I think it could..

      --
      One should not theorize before one has data. -Sherlock Holmes-
    2. Re:Hmmmm, I wonder by TheRoachMan · · Score: 1

      Doing it with the sphere or cylinder would work, if you could stick the texture to the inside of the object, on the opposite side (on the back inside part, instead of the front outside part). I don't have any experience with applying textures to 3d objects and stuff, so this is purely from a logical point of view.

    3. Re:Hmmmm, I wonder by cybermace5 · · Score: 1

      In POV-Ray you can create any polynomial surface, not just cylinders and spheres.

      Even if you were limited to a sphere, you could just subtract it from a box.

      --
      ...
  9. DLT by MountainLogic · · Score: 5, Informative
    The method for fully correcting for lens aberations is the Direct Linear Transform. It involves placing targets at known locations in the object field, recording their location in the film plane, then solve for this real ugly transform matix. You can then take a pixel in film space, run it through the solved matrix and get that pixels location in meat space (well really just that pixel's vector for a 2d camera system). You can also do this with two fixed cameras to solve for 3d location. I've had no trouble resolving targets down to 1/4 pixel accuracy. The only referance I have off of the top of my head is:

    Woodle, Alan S., Scott Elliott: The Vector system for dynamic gait analysis. Clinics in podiatric medicine and surgery. 10(3)485-500, 1993.

    There are referances to the math in that paper. Good key words to google might be DLT & photogrametry (sp?)

    1. Re:DLT by cdrudge · · Score: 1

      That sounds like a great book to read if you suffer from insomnia.

  10. VIPS & NIP by Yarn · · Score: 4, Informative

    VIPS is a wonderful image processing library with all sorts of "evil stuff", NIP is a GTK interface to the library which gives you a kind of spreadsheet for images. I'm telling the author about this slashdot item so he can come and pimp it here himself, but in the mean time take a look.

    I have personally used it for analysis of medical images, it's nice and versatile, although the built in scripting language is a bit sick (imo).

    --
    -Yarn - Rio Karma: Excellent
    1. Re:VIPS & NIP by kavau · · Score: 1

      VIPS looks very interesting, but I couldn't find any tools for applying distortions to a picture, except for rather trivial ones such as scaling and rotating. Am I missing something? Are the convolution tools more powerful than I think they are?

    2. Re:VIPS & NIP by Yarn · · Score: 1

      It has rubbersheet distortion, I'd imagine that would do the job just fine.

      --
      -Yarn - Rio Karma: Excellent
    3. Re:VIPS & NIP by jcupitt65 · · Score: 2, Informative

      Hi, I'm the VIPS maintainer. Thanks for the plug Yarn :)

      It has a rubbersheet tool. You make a target image (a black and white chessboard works well), print the target out, take a picture of it (you'll need to pick a particular zoom setting to calibrate), and feed the original (undistored) image and the (distorted) photo into the transformation estimator.

      The estimator uses gradient analysis to iteratively discover a 0/1/2nd order transform from the distorted image back to the original. It won't work so well at the image edges (you'll need to crop the corrected image down a bit), but mostly it works pretty well. I use it on 10,000 by 10,000 pixel images without problems. For pincushion/barell distortions it should get you a fixed image to less than a pixel error.

      Downside: VIPS is GPL and the transform stuff was done by a friend of mine as part of his PhD. He doesn't want to GPL it, so the transform stuff is distributed as a binary plugin. The windows and suse binaries on the website include it.

    4. Re:VIPS & NIP by Captain+Pedantic · · Score: 1

      VIPS & NIP are wonderful. Thank you!

      Unfortunately, I can't this rubbersheet plugin anywhere, neither in the rpms from the site, nor the source package I have compiled up. Both nip 7.8.8. I can find the rubbersheet batch stuff, but nothing that looks like a binary plugin. Am I doing something stupid, or is it really not there?

      Also, is there a page where all the nifty scripts/plugins that people have made can be found? If there isn't, do you think there should be? ;)

      --

      None are more hopelessly enslaved than those who falsely believe they are free. Johann Wolfgang von Goethe.
    5. Re:VIPS & NIP by Anonymous Coward · · Score: 0

      Both vips are 7.8.8, and both nips are 7.8.7 rather.

    6. Re:VIPS & NIP by jcupitt65 · · Score: 1

      Oh dear, they should be. I'll check.

    7. Re:VIPS & NIP by jcupitt65 · · Score: 1

      Thanks for your kind words (blush).

      The RPMs should have the rubbersheet stuff inside already (complied into the library).

      I've added an extra download for the binary for just the plugin, in case you build from source. Check out the vips-7.8 download page again.

      There are some extras in the "extras" bit at the top of the website. nip has only been launched properly for 6 months, so there's no public repository yet.

    8. Re:VIPS & NIP by Captain+Pedantic · · Score: 1

      That works a treat. Thank you very much!

      --

      None are more hopelessly enslaved than those who falsely believe they are free. Johann Wolfgang von Goethe.
  11. photoshop plugin by foniksonik · · Score: 4, Informative


    http://www.humansoftware.com/pages1200/PhotoFixlen s/HSphotofixlens11.html

    Photoshop plugin for exactly this issue. Dont' know how well it works but it may be just waht you're looking for... Mac and Windows.

    --
    A fool throws a stone into a well and a thousand sages can not remove it.
  12. Try Intel's Open Source Computer Vision Library by hamjudo · · Score: 3, Informative
    Intel's Open CV.

    It worked for me a couple years ago with cheap USB cameras. I haven't used it recently, so I want to know if there are better choices now. I've got a new robot platform with a lot more CPU power and USB bandwidth, so I'm going to try working on the vision thing again.

    Back then, I started with the instructions at Program Your Computer to See. Note how the URLs inside the article are mostly out of date.

  13. Objective reality of 3-d space by Hell+O'World · · Score: 4, Informative
    Those curved lines you are experiencing are not an artifact of your lens. They are the inevitable result of living in a 3-D world. They occur because you are mapping straight 3-D lines onto a curved picture plane.


    You may be familiar with the concept of a picture plane that is used in perspective drawings. The idea is that a transparent sheet is placed between the object and the eye, and rays are mapped onto the surface. That works fine for narrow fields of vision, but it falls apart as the lens gets wider.

    Imagine an extreme case: You are standing in a train station. To your left the tracks disappear to a point on the horizon, straight ahead of you the train sits, and to your right the tracks disappear off to another point. If this image is cut up into small enought chunks, you won't notice the abberations of traditional perspective. You have a one point perspective of the train, and a two point perspective on each side. But try to stitch the images into a whole, which is similar to what you are trying to do with a wide angle lens, and all those straight lines are going to have to bend somewhere!
    A more accurate picture plane, one that could actually capture a real image without any distortion, would be a sphere, with the eye at the center. Straight lines now map to great circles on the sphere, and whole images, just like the ones your eye sees, can be presented in their entirety.


    But then you can't exactly paste them into your photo album. So you are back to the question of, how do you map a sphere onto a plane?


    Or maybe you could get some funny looking virtual reality googles.

    1. Re:Objective reality of 3-d space by kavau · · Score: 1
      Those curved lines you are experiencing are not an artifact of your lens. They are the inevitable result of living in a 3-D world. They occur because you are mapping straight 3-D lines onto a curved picture plane.

      Your statement is certainly true for ultra-wide angle lenses (below 24mm focal length, 35mm equivalent). A moderate wide-angle lens (24-35mm, 35mm equivalent) of good quality should not show any significant distortions, according to this article. I am actually more interested in the range above 35mm, so maybe the term "wide angle" is not entirely correct...

  14. Re:Bottom line... by kavau · · Score: 1
    No wonder. What do you expect? Get a better camera!

    The advantage of a pocket-sized camera is that it fits in a shirt pocket. Nuff said.

  15. Ugly patent story by morcheeba · · Score: 1

    You're right about the patent thing. Ipix aparently has a patent that they are using on Quicktime QTVR and panotools. more info warning - these links seem a bit old; I wonder what the progress has been. These are pretty simple algorithms (not trivial to implement, though) and are exactly the type of patents I hate... argh...

  16. Re:Bottom line... by Anonymous Coward · · Score: 0

    The advantage of a pocket-sized camera is that it fits in a shirt pocket. Nuff said.

    Key thing is, buy cameras according to the optical reputation of the brand, not the electronics/digital reputation. 99% of the time things will work out better that way.

  17. dude, you're a genius by DrSkwid · · Score: 1

    How would we have worked it out without you!

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  18. OK - buy a bigger shirt ! by DrSkwid · · Score: 1

    & if it's big enough you might need a pocket map !

    Don't forget a pocket torch in case you fall inside it!

    You could see how deep it is by timing your fall with the in-built pocket watch!

    I'm so funny !

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  19. Re:Bottom line... by kavau · · Score: 2, Informative
    Key thing is, buy cameras according to the optical reputation of the brand, not the electronics/digital reputation. 99% of the time things will work out better that way.

    Not always true. Reputable companies sometimes throw cheap stuff at you, too. The camera in question here is a Pentax Optio S, and Pentax certainly has a good reputation in optics (maybe not as good as Nikon, but certainly good enough). The problem with the Optio S is its "revolutionary sliding lens design", which makes the camera as thin as a deck of cards. However, as in world politics, revolutions often introduce a whole new set of problems...

  20. A Tangent... by Anonymous Coward · · Score: 0

    What if digital camera makers were to incorporate software like you mention into their cameras. For one, they could use much cheaper lenses and correct the image as it's being saved. They could also give the photographer the option of choosing between a number of predefined virtual lenses to use when shooting the photograph.

  21. Correcting Lens Distortion by The+Rabid+Walnut · · Score: 1

    http://www.frc.ri.cmu.edu/~hpm/project.archive/rob ot.papers/2000/ARPA.MARS.reports.00/Report.0001.ht ml

    This describes a piece of software called FLATFISH that can correct the type of distortion you're seeing.

    I'll warn you, it can be a bit tempermental until you get used to working with it, and it's not meant for the faint of heart. But I've personally used it for camera calibration on a robot using a webcam for vision, and I can say that it does work pretty well. It will very likely give you the technical, correct solution, assuming that your lens is radially symmetric. Sadly, unless you spent a lot of money on your camera lens, it's probably not symmetric. But it'll still do a decent job.

  22. Camera Calibration Code - Link by StormForge · · Score: 1

    Best stuff is here: http://www-2.cs.cmu.edu/afs/cs.cmu.edu/user/rgw/ww w/TsaiCode.html

  23. Using Panorama Tools to correct lens distortions by BrunoPostle · · Score: 2, Informative

    I have a couple of examples, both involve correcting perspective at the same time:

    A single photo, corrected

    Two photos stitched, corrected and perspective adjusted

    There is a project to build an easy-to-use front-end for panorama tools: Hugin, it has a Mailing-list, anyone welcome.

    If you just want to batch process individual photos without having to learn Panorama Tools, try this perl-script, it implements everything required to correct barrel distortion (though you have to calibrate your camera first).

  24. A plan, for the do-it-yourselfer... by Anonymous Coward · · Score: 0

    Get a copy of octave (because I assume you aren't going to drop cash on Matlab)

    Find a way to get the images from camera format into octave (its not exactly 1-2-3, but there's .m files to be found via google).

    Use techniques from above post's links and the powerful matrix manipulation features of octave to do the dirty work.

    View the results....

    If you get a procedure that works eventually, you can script the whole thing.

    The most annoying part is you might have to open up the picture in Gimp and "hand paint" the depth information into another channel to give clues to the DLT algorithm. Either that or take two shots of each picture (stereo).

  25. thoughts by Anonymous Coward · · Score: 0

    #1: you care about this stuff with a pocket-sized digital? if you want good pictures you need to get a good NON-ZOOM lens, like you can get for an SLR. Only use zoom lenses if you are taking pictures someplace where you can't walk closer/further from the subject (edge of a cliff?).

    If you are stuck with a cheapo zoom lens, find the zoom setting with the best picture (straightest lines, least distortion) and ONLY use that setting (unless you're at the cliff).

    Personally I use macro lenses for everything, macro lenses are just fine for regular work, they are usually higher quality, and they focus in a flat plane instead of equidistant points. Drawbacks, they are heavier, slower f stop, slower to focus, and more expensive. But I do a lot of copy work and can't justify paying for another 50mm lense when I already have a perfectly good 50mm macro, etc.

    #2: barrel distortion (curved lines): even the best lens will have this, you can't avoid it. There are several photoshop plugins available to fix it, including the one from Human Software mentioned above which you use by basically marking some points that should be straight, and it does the rest. It also has a database of lenses. Again you will have better predictable results if you avoid zoom lenses.

    #3: perspective distortion ("keystoning"): if you have this (lines are straight but not parallel), you can use "perspective crop" in photoshop. Learn about it. The Gimp has a similar feature I've used.

    #4: other distortion: don't bother trying to fix other distortion like misfocus or abberation. information has been lost in your image. Just get a better lens.

    I'd like to see some open source tools for this purpose. I've thought about writing a GPL PS plugin to measure and correct barrel distortion and keystoning but adobe's license terms don't allow GPL (or any similar license, I couldn't believe it), and the SDK wasn't available for zero-cost last I checked so I gave up on it. Would be nice though.

    The math is straightforward but the trick is to interpolate/resample appropriately so that your pictures don't become all jaggy. That takes some cleverness or you chew up lots of CPU time doing it the direct way.

  26. Pixelzap and other tools.. by Myself · · Score: 1

    Have you checked Tabaware? The author of Pixelzap and others, offers a ton of info on post-processing digital images to do neat tricks, including perspective correction for panorama assembly, etc.

  27. Digital Pornography by dotpl · · Score: 1

    I know digital pornography inflicts a lot of eye strain, but I never thought that there are specific correcting lens that deal with this sort or eyes strain... oh wait..

  28. Pentax optics by Andy+Dodd · · Score: 1

    FYI, Pentax is/was a pioneer in multicoated optics. (For superior anti-reflection properties.)

    I believe that no other manufacturere can approach Pentax's MC technology w/o having to pay Pentax royalties.

    Nikon may be ahead of Pentax in other optical areas, but Pentax is the leader in coatings, or at least used to be.

    But I agree, even the reputable companies can often give you cheap crap.

    --
    retrorocket.o not found, launch anyway?
  29. Re:Bottom line... by metamatic · · Score: 1

    Reputable companies sometimes throw cheap stuff at you, too.


    Take Nikon, for example. All their sub-$1000 digital cameras have crappy f/2.8 zoom lenses. Even Sony offer better glass than that.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  30. Dave Dyer wrote a tool specifically for this by voodoo1man · · Score: 1

    Dave Dyer wrote a photoshop plugin called LensDoc for this purpose for Andromeda Software. I haven't personally used it, but the sample results look pretty nice, and the guy definitely knows what he's doing. Check out some of his other stuff as well.

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  31. Not Quite...(Plus some experiential data) by bacchus612 · · Score: 1

    Almost...spherical distortion is a long standing problem, and it DOES depend on the subject's distance from the lens (this is why spherical abberation is generally fixed in microscope lenses). If you take a close up picture (of a face for example) with a lens with bad distortion at close distances (like a wide angle lens), objects that are just a little closer to the lens than others in the frame (like the tip of the person's nose) will seem a great deal closer as a result of the distortion (creating a pinnochio effect) The distance from the lens, the depth-of-field and the focal length all play a role in the distortion.

    My GF had this problem measuring the length of feather barbules in her biology thesis - we could find no (Free) software that easily corrected for spherical distortion, and did not have the means to try the more expensive image analysis software. But simply taking a picture of graph paper and correcting for the distortion you see will _NOT_ work as the depth of field and distance from the lens change - therefore it would be somewhat useless to correct for graph paper at ~1/2 m from the lens, and then take pictures of buldings ~500 m away. That said, the effect should be diminished at greater distances, so you really should not have a problem with architectural pictures. If you really want everything to be accurate, you will either have to get a SLR digital camera (with interchangable lenses) and spend some cash on a nice lens (note that most auto-zoom lenses are not that high quality - this is why a lot of pro photagraphers carry like 10 lenses or several different cameras all the time); or you could try to write it yourself...but I don't think you'll find the time/price tradeoff of either option worth the improvement for your particular application.

  32. What your looking for is Extended Depth Imaging. by Amousha · · Score: 1

    Extended Depth Imaging is definately whats called for here. Basically, you stick a filter on the front of the lens that is comprised of mostly transparent grid lines. Then you right software that searches for the grid lines in the image, and maps the source image using the distorted grid lines *contained* within each picture. High-end systems generally have a piece of hardware stuck on the camera that
    does it for you prior to dumping to the storage unit. This technique is used extensively in robotics to "extend the plane of depth" e.g. if you are using a stereoscopic matching algorithm to reconstruct 3D structures from stereopictures, you can SIGNIFICANTLY improve the 3d reconstruction by sticking aforementioned filter on the front of a lense, and digitally preprocessing to remove distortions introduced by lens aberrations. It shouldn't be too difficult to code up a stupid simple algorithm to sample a picture according to detect said distorted grid in each picture, and then remap the distorted picture into a corrected image.

    BTW - if you are serious about digital photography, another technique thats been pioneered recently is using a range finder (associated with the CCD) to store the z depths of each pixel in the image; the benefit being that if you are attempting to do any collage work, you can mask out area of the image based on depth (ergo saying: "Please provide me with all pixels 6 feet or less away from the camera position")... I'm currently researching techniques (- film deposition) for correcting for chromatic lens aberrations, so if anyone knows a good way, let me know :P