Software Lens Fixes (barrel distortion, etc.)

I read with some interest this article on lens distortions from dpreview. I had no idea the Canon S90 was doing so much software lens correction!
http://www.dpreview.com/articles/distortion/


That's the image out of the Canon S90, natively.

It back me back 15 years to my college dorm room, when I had the original black & white Quickcam. For this old camera (~1994) Connectix had chosen a lens which allowed more light and sharpness for less money, but at a cost of terrific barrel distortion.

Back then, I posted some ancient code to do a bilinear warp of the form r = r + ar^3 + br^5, a polynomial approximation that seems to be able to fix most lens distortion. This code caches the warp map, and applies it to video in realtime. I'm sure it barely compiles anymore, because the hardware is really ancient:



Today you'd probably want to use a much better interpolation than bilinear, but this one was realtime for video back in 1996, which seemed pretty cool at the time.

Really all lenses should have these kinds of computations done automatically in the processing pipeline. It would give a benefit to weight, sharpness, and cost. And the software isn't that hard to write, either.

The dpreview article mentions that optical corrections for barreling tend to introduce a mustache distortion (which even the most expensive lenses aren't able to fix perfectly).

It seems to me like lenses should have some of these distortion measurements built-in, and the data could come through the processing pipeline directly.

My impression is that DxO and Photoshop CS5 are keeping external databases of this information, which is nice for the moment. It doesn't necessarily make sense to talk to a network service just to process a RAW file. But I guess it makes it possible to do this sort of correction right away rather than waiting 10 years for metadata standards to adapt.

5 comments:

  1. Anonymous2:12 PM

    I think your s90 was just made obsolete by the iphone4. (I used to have a s90 btw)

    ReplyDelete
  2. The s90 is really good in low-light. I can't imagine the little iPhone lens will actually compare! but it definitely is a camera that's always with you.

    ReplyDelete
  3. Anonymous3:56 PM

    For me the s90's image quality was simply too low. I loved the size and portability, but it was still this extra device to carry around... and it just didn't seem worth it given the iQ. So we ended up selling it and getting a Panasonic GF1. In fact I think all cameras here on out should have wifi built in.

    Iq wise the old iphone had the most god awful image quality out there, but because of the 3g/wifi/big lcd/alwayswithyouness it still ends up being the camera we use the most. The crazy 300+ dpi screen, hd video, 3g/wifi of the iphone4 really makes you question the need for compact cameras.

    ReplyDelete
  4. yeah we use it with an eye.fi card...
    I do think 5mpix cell phones will be good, but there's still probably a factor of 4 for low-light sensitivity, and that matters sometimes.

    ReplyDelete
  5. Anonymous5:04 PM

    I've been "eye-ing" the eye-fi card because my least favorite thing to do in the world is downloading stuff from a sd/cf card. It seemed kind of complicated from the reviews I saw. Seems like a too-good-to-be-true thing.

    ReplyDelete