PDA

View Full Version : Fixing Curved Panoramic Shots


HKMonkey
24th of May 2004 (Mon), 06:59
I tried fixing this shot with the Panorama Tools plugin for PS, but as it was designed for wide-angle lenses and not panoramic shots, it didn't come out that great. Any idea how I can straighten this out better? It is the inn my wife and I stayed at in Kamitsue, Japan. (It's a great inn, I highly recommend it!)

Here's before Panorama Tools:
http://img71.photobucket.com/albums/v217/HKMonkey/Photography/Inn.jpg

And after:
http://img71.photobucket.com/albums/v217/HKMonkey/Photography/Inn2.jpg

Thanks for any help you can supply!

dn7elson
24th of May 2004 (Mon), 20:37
Almost all of the panorama applications indicate that the segments comprising the panorama should not be zoomed or a wide angle, i.e., a normal (50mm lens equivilent).

About the only thing that you can do is do a severe crop to trim the borders. Each curved segment joins the next and creates a longer curve. When you start to warp the output, like in your second image, the proportions start to get distorted.

john_houghton
25th of May 2004 (Tue), 01:08
Almost all of the panorama applications indicate that the segments comprising the panorama should not be zoomed or a wide angle, i.e., a normal (50mm lens equivilent).
None of the above applies to Panorama Tools, which can cope with virtually any lens and any amount of camera tilt. The panorama should have been stitched with Panorama Tools in the first place, then you would not have had the problem. With such a wide angle of view, you must expect some distortion in a printed output. A cylindrical projection is normally used, in which verticals are preserved (if done properly), but all horizontals except for the horizon will become curved. However, faced with your output image one way correcting it is to input it to Panorama Tools, specifying the lens type as "Panoramic" - i.e. a cylindrical format as used in cameras for those long school photographs. Then the image can be re-oriented and stitched back out again. Without knowing the angle of view of the panorama, it involves some guesswork, but this is the result I got. Some cloning was necessary in the top corners (which would not be necessary if the images are stitched with Pano Tools):

http://homepage.ntlworld.com/j.houghton/inn2.jpg

Panorama Tools is free but needs a gui program to improve the user interface. I prefer to use PTGui myself, but there are PTAssembler, PTMac and Hugin also to choose from. Of these, Hugin is the only freeware program, but is in development and a bit fragile.

John

dn7elson
25th of May 2004 (Tue), 05:01
None of the above applies to Panorama Tools, which can cope with virtually any lens and any amount of camera tilt.

Nice. I was not aware of Panorama Tools. I'll have to check it out.

HKMonkey
25th of May 2004 (Tue), 13:22
I downloaded PTGui and used it to stitch together the original photos, but my resulting file is not that different than the one I had before. I must be missing something important. :? Here's the output file I get:
http://img71.photobucket.com/albums/v217/HKMonkey/Photography/PanoToolsInn.jpg
If you have the time, I'd love to hear the steps you took to correct my photo. I can't seem to get rid of that curvature of the bottom. I tried just loading the original panorama into PTGui, but it said I needed to input more than one image. I think it thought I was going to create a panorama, but I wanted to fix a panorama as you had suggested. Thanks for the great info. I just realized I have been working on this problem too long. It's 3:30am. No sympathy from the wife when I'm dead tired tomorrow!

john_houghton
25th of May 2004 (Tue), 16:23
Sorry, but your image is not displaying for me. Getting the output panorama correctly aligned is largely a question of determining the camera's angle of pitch. When the images are assigned the angles of pitch that match the camera's, the horizon will be positioned halfway up the output image area. (The centre point of the output area is where yaw=pitch=0). There are various techniques available to straighten the horizon, e.g. by placing special t2 control points on the actual horizon, when visible, and/or by using t1 control points to mark vertical features. The optimizer uses these control points to move the images to a position where the horizon becomes flat and the verticals become vertical (the two things go together).

An easy way to get a reasonable, if not quite so accurate, correction is to use the panorama editor window. After running the optimizer to align the images with each other, you can simply push the images as a group upwards or downwards as appropriate. You will see the curvature of the image change as you move the image up and down. You can drag with the right button to rotate the image. You may find that there is excessive stretching of the image at the top, in which case you can try switching the output projection to equirectangular instead of cylindrical (which is what I did).

You will find that when you stitch images with a tilted camera, the resulting panorama will have blank space at the top or bottom. This is normal, and is the result of getting the horizon positioned at the centre. You will naturally crop this blank space away. Should you want to input the stitched panorama image back into Pano Tools, (as I did), you first need to replace the part of the image that was cropped away so that the image is as originally output. This entailed some guesswork on my part. If you do this, the image can be manipulated exactly as described above. You can certainly input a single image to PTGui (possibly the wizard for newbies was being used when you got your error message?).

Anyway, this is not the place for a full scale tutorial. You will find some that I have written on my site at http://homepage.ntlworld.com/j.houghton. There's one that describes the use of the t1 and t2 control points for straightening horizons, and a new one that explains how the optimizer works. It's all good stuff, but don't be put off if you don't learn it all in an evening! It takes a little time to become proficient with Pano Tools.

John

PS. After posting this response, I can now see your image. All that is wrong is the pitch setting of your images. Try using the panorama editor window as described above, or maybe assign the pitch of the central image to, say, 10 degrees. Fix it in position and optimize y,p,r of all the other images. See the effect and try other values until you like the result.

HKMonkey
25th of May 2004 (Tue), 20:05
Yahoo! :D thanks for the information. I went to your site with the tutorial and followed your instructions and got this output:
http://img71.photobucket.com/albums/v217/HKMonkey/Photography/FixedInn.jpg
Thanks so much for your help. Now I can fix the other panoramas I have. Thanks again!

john_houghton
26th of May 2004 (Wed), 00:08
That's a very good result. You seem to have picked up the basics of Pano Tools fairly easily. Some people have far more trouble.

John

HKMonkey
26th of May 2004 (Wed), 06:56
Thanks. I am comfortable in learning new programs, as I have a Computer Information Systems degree from my University. But actually, it is because your step-by-step tutorial on your website was so good. :wink: Thanks again for your help!