Saturday, December 20, 2008

how about that

This paper is for educational porposes only, I am only illistrating how somthing works, please support these guys- they have saved me hours in the digital lab. And every hour saved there can be spent doing other things.

(PS. educational papers dont need to have proper spelling and stuff)
I have read about the fish-eye hemi photoshop plugin by the people at image trends. They are the genuis's that created ICE, the amazing dust and scratch removal software. If you scan negitaves, then you have probly used their software.

I love going wide, so a fisheye was the way to go. Anyways, I bought a nikon 10.5mm and it distorts pretty great.















But sometimes the curvature of field is... cliche. So using software like nikon capture, or photoshops lens correction you can create a rectilinier transformation. Which looks somthing like this.















The grey/ yellow area is where the transformation creates an area that needs to be cropped away. I read somewhere that this is about a 33 percent loss. This leaves alot to be desired. So I try my to avoid using it.

Then my savior. Instead of rectilinier transformation they use celendrical transformation. I tried it on a few photographs that i took of my sisters kids' 2nd birthday and I was very happy with the result.













Just as promised on their web page. I'm mere moments from purchasing the software at its 30$ usd price tag. But my cards running low from that polorizing filter i bought (oh, and christmas presents) so I wonder if I can do somthing similar myself. I screw around with the Transform> Warp tool for a few hours trying to eyeball a defishing transformation... and then watch a doctor who marathon.

He is brilliant. And after watching the show i feel smarter too. And behold through the benifit of placabos i try Image trends plugin on a grid created of 1"x1" bars. Suddenly square no more they appear cylendricaly warped, WOW!

With this map created by the plugin i answered two questions I had. Did it analize the image for lines it needed to keep straight, or did it generize fisheyes and then apply the same defish every time.?

Well it difished a very square grid, so it didnt analize the image, and that left the generized fisheye approch. sidenote: This worries me a little. My nikon 10.5mm distorts differently than say a russian peleng 8mm, or a sigma 8mm. So that means this isn't optimised for my lens! Infact, there would have to be room for improvment for each lens, including my own. the awsome just got better!

For those unformilure to photoshop their is a very easy scripting tool where it records what you do then can parrot it back to you at a single click. I placed an unadulted grid above the one warped by image trends software then went at it. I did two different Transform>Warp transformation upon my new grid to get this.














The red lines are the grid i warped, and the faint black lines are the plugins' warp. I obviously am not as perfect as the plugin, but for 20 mins of warping and as a proof of concept, i said good enough.

I stopped recording my clicks and transformation and now i have a script that will repeate my actions.
  1. Select the entire canvas
  2. Transform>Warp (major warpage)
  3. Transform>Warp (minor warpage - not neccisarry if my first warp had been better)
Then I open the same image that had be de-fished by Image Trends software and I get...















Side by side. Left is my warp script, the right is the plugin by Image trends.

Feel free to try and pick them appart, they are different, but with out a perfect one next to my verision, I argue you wouldn't be able to tell.

Conclusion
I still am going to buy the software. My spelling is still bad. But I have that warm 'i figured somthing out' feeling. And no, I don't intend to release the script. I have educated (hopefully) and there is more than enough here to figure out how to do it yourself.

8 comments:

  1. In your version the door is warped. In the Image Trends version the door is straight. Good job even if there are minor discrepancies. :)

    ReplyDelete
  2. Can't spell, can't maintain coherent sentence structure and train of thought, and on top of it all you're withholding the script.

    You suck and fail at utterly everything.

    ReplyDelete
  3. Not releasing the script is a bit weird. What is the point in finding out that a piece of software isn't worth it's salt, susequently buying it and finally refuse people the alternative ?

    Are you afraid of claims that you reverse engineered the thing ? I do not see a lot of tech that belongs to company in question here.

    Just post the script, what could go wrong ?

    ReplyDelete
  4. Nice work!

    How about taking a picture of an actuall grid, like drawn on a wall or something? You know.. for refference. You could tinker about with the warp settings until the photographed grid was perfectly straight, and voilá, you'd know the exact values needed to defishify pictures taken with your camera and lens!

    Right..? =P

    ReplyDelete
  5. I'm not a photography person at all so forgive me if I'm missing something, but why even mess with distorted pics like that? even the commercial "defishing" software makes an image that makes me nauseous just looking at it. it's like looking into a hall of funny mirrors while tripping.

    ReplyDelete
  6. @Sirus20x6
    Lens like this are used to get wide angle views of a space. The distortion is one of the side effects of trying to cram up to 180 degree field of view into a APS or 35mm style sensor. Being able to remove the distortion would allow you to create a panoramic photo out of a single wide angle shot, instead of stitching it together from different shots.

    It's got me thinking about how this could be done. With a photo of a known grid, and a fixed lens, it shouldn't be that hard to bend each small square back into a square shape. Wouldn't be perfect, but it would be a start. Smaller grids would make it more accurate, as would finding the non-linear distortion the lens causes and moving the pixels individually.

    ReplyDelete
  7. You're an embarrassment to the English language...I know it and it's not even my own native language.

    ReplyDelete