Loading ...
Sorry, an error occurred while loading the content.

Can't do perspective correction

Expand Messages
  • Leonard Evens
    I am using hugin 0.7.0 under Fedora Linux 9. I used it a while back with moderate success and I ve come back to it now, but I am having problems. I want to
    Message 1 of 3 , Apr 29, 2009
    • 0 Attachment
      I am using hugin 0.7.0 under Fedora Linux 9.

      I used it a while back with moderate success and I've come back to it
      now, but I am having problems.

      I want to correct horizontal perspective on an image. I followed the
      instructions in the hugin tutorial at
      hugin.sourceforge.net/tutorials/architectural/en.shtml
      But it doesn't work and nothing I try works. I picked three horizontal
      lines at the top middle and bottom of the building. I get curved lines
      in the preview even though I've chosen rectilinear. I've tried all the
      possible options. Often I get black screen and nothing I do raises an
      image. I downloaded the test image and the tutorial method did work
      with it.

      I've attached the image file. Actually I know quite a lot about it
      The picture was taken with a 4 x 5 view camera with a 75 mm lens with
      minimum distortion. I used a panoramic head and swung to the left 15
      degrees (yaw -15). I used a rise which translates into a vertical
      displacement of about 229 pixels. Is there some way to incorporate
      that information to produce the result I want?

      This image is one half of a two image panaorama with the other half
      turned 15 degrees to the right. I did manage to use hugin to merge
      these after some effort, but the resulting image still needed some
      horizontal perpective correction. I managed to improve things by
      appropriate choice of centering in the preview, but I still ended up
      having to use perspective correction in gimp to get it right. I was
      wondering if I could do better by doing the perspective correction first
      on each of the two images and then merge the resulting images, but I
      haven't been able to get that to work even for one of the images.

      Any suggestions would be appreciated. Also, explanations of what hugin
      thinks it is might be enlightening.
      --
      Leonard Evens <len@...>
      Mathematics Department, Northwestern University


      [Non-text portions of this message have been removed]
    • John Houghton
      Leonard, You need to take account of the lens shift by including the lens parameter vertical shift (e) in your custom optimization parameters. Assign two
      Message 2 of 3 , Apr 30, 2009
      • 0 Attachment
        Leonard, You need to take account of the lens shift by including the lens parameter vertical shift (e) in your custom optimization parameters. Assign two pairs of horizontal line (t2) control points on each of your selected horizontal features. Also assign some vertical line (t1) control points on some verticals. Optimize y,p,r on all images together with the lens parameters b and e. (You can initialize e to your estimated value). If things go awry and you get a blank output area, temporarily change the output projection to equirectangular with 360x180 fov. That will show you the entire spherical stitching surface and your image should be visible somewhere provided the lens fov has not been optimized to 0 degrees.

        BTW, this forum does not support attachments.

        John
      • Carl von Einem
        Hi Leonard, ... Time to switch to the latest (pre-) release: in your case
        Message 3 of 3 , Apr 30, 2009
        • 0 Attachment
          Hi Leonard,

          Leonard Evens wrote:
          > I am using hugin 0.7.0 under Fedora Linux 9.

          Time to switch to the latest (pre-) release:
          <http://panospace.wordpress.com/downloads/>
          in your case <http://wiki.panotools.org/Hugin_Compiling_Fedora>

          > I want to correct horizontal perspective on an image. I followed the
          > instructions in the hugin tutorial at
          > hugin.sourceforge.net/tutorials/architectural/en.shtml
          > But it doesn't work and nothing I try works. I picked three horizontal
          > lines at the top middle and bottom of the building. I get curved lines
          > in the preview even though I've chosen rectilinear. I've tried all the
          > possible options.

          Rectilinear output should work. The tutorial defines three vertical
          lines (shown as a blue, green and red pair). Poles for road signs can
          often be used for those, also the edge of a building from the roof to
          the ground level.

          You seem to have used several horizontal lines. Only set those on the
          actual horizon! They are useful e.g. to level a wavy horizon when you
          shoot a panorama from a beach.

          > I've attached the image file.

          You should upload that to your webspace (or something like flickr.com)
          and post the URL here.

          > Actually I know quite a lot about it
          > The picture was taken with a 4 x 5 view camera with a 75 mm lens with
          > minimum distortion. I used a panoramic head and swung to the left 15
          > degrees (yaw -15). I used a rise which translates into a vertical
          > displacement of about 229 pixels. Is there some way to incorporate
          > that information to produce the result I want?

          4" x 5" (about 100 x 125 mm) with a 75 mm lens lead to a fov of roughly
          67 degrees (short side) and 79 degrees (long side).

          You should carefully optimize for shift (distance of image center from
          the optical axis, 'e' = vertical and 'd' = horizontal) and shear (often
          introduced by scanners, 't' = vertical and 'g' = horizontal, values in
          pixels). Don't optimize all of them at once...

          > This image is one half of a two image panaorama with the other half
          > turned 15 degrees to the right. I did manage to use hugin to merge
          > these after some effort, but the resulting image still needed some
          > horizontal perpective correction.

          Hugin can correct correct all of that in the same project. Just add your
          vertical lines and optimize not only yaw, pitch , roll and fov, but also
          d/e and g/t as described above.

          Hope that helps,
          Carl
        Your message has been successfully submitted and would be delivered to recipients shortly.