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

Re: [PanoToolsNG] Re: optimizing a 10.5mm lens in PTgui

Expand Messages
  • Milko Amorth
    Hi Juergen, hi Matt ... I beg to differ. In order to calibrate your lens correctly and to be used as a template in the data base you need vertical and
    Message 1 of 16 , Jun 29, 2007
    • 0 Attachment
      Hi Juergen, hi Matt

      > the lines don't have to be vertical or horizontal.

      I beg to differ. In order to calibrate your lens correctly and to be used
      as a template in the data base you need vertical and horizontal features
      in one pair of images at the least. Also a 50% overlap on those are
      essential.
      The horizontal t2 and vertical t1 lines are the features which do
      undistort radial shift distortion of the lens. Anything else is an
      approximation just to make the images fit for that particular panorama.
      That is why a template from that will not produce consistent results on
      other images from the same cam/lens set.

      See http://epaperpress.com/ptlens/index.html
      for a good explanation and target calibration for lens distortion.

      Once you have a good calibration of your lens for your cam/lens set you
      can use these values in your data base for quick single shot remaps and
      for panos you can get away with as little 2 manual control points in each
      pair of images. Often, this works faster than auto align. Especially with
      moving object features.

      Each Cam/lens set is different and there are other variables like sensor
      shift and lens mount shift/play. So you need to do your own.

      Cheers, Milko

      --
      Milko Amorth
      360° Immersive Imaging
      Photographic Virtual Reality
      VRCanada.ca
      604.561.5101

      PhotoScrapbook at Flickr.com/photos/vrdundee
      Skype me @ vrdundee
      Member of IVRPA.org
      Contributor to the World Wide Panorama Project
    • matt_nolan_uaf
      Thanks Milko. I checked out PTlens and it certainly seems worth $15. But I m confused -- are the PTlens coefficients the same as used with PTgui, or is PTgui
      Message 2 of 16 , Jun 29, 2007
      • 0 Attachment
        Thanks Milko. I checked out PTlens and it certainly seems worth
        $15. But I'm confused -- are the PTlens coefficients the same as
        used with PTgui, or is PTgui already using the same algorithm, or?

        BTW, I checked out the World Wide Panorama Project in your signature,
        seems neat. I was just in Berkeley convening this meeting
        www.isde5.org. I wonder if the WWPP would be interested in an
        International Polar Year event? www.ipy.org I'm not sure what form
        that would take, especially since most folks dont have access to the
        poles. But perhaps either a winter event in general or a climate
        change event of some sort? Anyway, just some thoughts.

        Cheers,
        Matt


        --- In PanoToolsNG@yahoogroups.com, "Milko Amorth" <panotools@...>
        wrote:
        >
        > Hi Juergen, hi Matt
        >
        > > the lines don't have to be vertical or horizontal.
        >
        > I beg to differ. In order to calibrate your lens correctly and to
        be used
        > as a template in the data base you need vertical and horizontal
        features
        > in one pair of images at the least. Also a 50% overlap on those
        are
        > essential.
        > The horizontal t2 and vertical t1 lines are the features which do
        > undistort radial shift distortion of the lens. Anything else is an
        > approximation just to make the images fit for that particular
        panorama.
        > That is why a template from that will not produce consistent
        results on
        > other images from the same cam/lens set.
        >
        > See http://epaperpress.com/ptlens/index.html
        > for a good explanation and target calibration for lens distortion.
        >
        > Once you have a good calibration of your lens for your cam/lens set
        you
        > can use these values in your data base for quick single shot remaps
        and
        > for panos you can get away with as little 2 manual control points
        in each
        > pair of images. Often, this works faster than auto align.
        Especially with
        > moving object features.
        >
        > Each Cam/lens set is different and there are other variables like
        sensor
        > shift and lens mount shift/play. So you need to do your own.
        >
        > Cheers, Milko
        >
        > --
        > Milko Amorth
        > 360° Immersive Imaging
        > Photographic Virtual Reality
        > VRCanada.ca
        > 604.561.5101
        >
        > PhotoScrapbook at Flickr.com/photos/vrdundee
        > Skype me @ vrdundee
        > Member of IVRPA.org
        > Contributor to the World Wide Panorama Project
        >
      • John Houghton
        ... Also t3,t4,...tn. John
        Message 3 of 16 , Jun 29, 2007
        • 0 Attachment
          --- In PanoToolsNG@yahoogroups.com, "Milko Amorth" <panotools@...>
          wrote:
          >
          > The horizontal t2 and vertical t1 lines are the features which do
          > undistort radial shift distortion of the lens.

          Also t3,t4,...tn.

          John
        • Serge Maandag (yahoo)
          ... Not necessarily. To determine the a,b,c,d,e coefficients of your lens/sensor, you can use two scenarios. The first scenario is to take a shot with lots of
          Message 4 of 16 , Jun 30, 2007
          • 0 Attachment
            >> the lines don't have to be vertical or horizontal.
            >
            > I beg to differ. In order to calibrate your lens correctly and to be used
            > as a template in the data base you need vertical and horizontal features
            > in one pair of images at the least. Also a 50% overlap on those are
            > essential.

            Not necessarily. To determine the a,b,c,d,e coefficients of your lens/sensor, you
            can use two scenarios.

            The first scenario is to take a shot with lots of straight lines. They don't need to
            be vertical or horizontal, but placing control points for horizontal/vertical lines
            is just easier than placing control points for "straight lines" (t3 - tn). Your
            bathroom wall may do just fine. When using horzontal/vertical lines, be sure to also
            optimize for yaw/pitch/roll. Because chances are, you didn't set up the camera
            exactly straight.

            The second scenario is to shoot a full 360 x 180 degrees panorama with lots of
            overlap and lots of distinct features. Using a control point generator and weeding
            out the misfits by checking them all seems to be the easiest. The more control
            points, the marrier.

            For this second scenario you don't need horizontal/vertical line control points,
            because it does not matter whether the scene is tilted or not. As long as the
            average control point distance is low, you've got a good calibration that you can
            use on single images from then on. There is an endless amount of combinations of
            yaw/pitch/roll that fit an a,b,c,d,e combination in exactly the same way.

            a,b,c,d,e and yaw,pitch,roll are two different subjects and (optimally) they have no
            influence on each other.

            Serge.
          • Milko Amorth
            Hi Matt, ... The PTlens coefficients (a,b and c lens distortion) have been determined with the same tools, but with a specific calibration target. If you use
            Message 5 of 16 , Jun 30, 2007
            • 0 Attachment
              Hi Matt,

              > But I'm confused -- are the PTlens coefficients the same as
              > used with PTgui, or is PTgui already using the same algorithm, or?
              The PTlens coefficients (a,b and c lens distortion) have been determined
              with the same tools, but with a specific calibration target.
              If you use the lens data base of ptlens in ptgui you dont have to optimize
              for them in PTgui anymore. You just have to do your FoV, d and e for your
              calibration set. In theory, if you keep your lens locked in one spot on
              your cam and you dont change your crop lines, you never have to optimize
              for those params again.......just yaw, pitch and roll of the images. That
              is an ultimate goal and not easy to achieve.....any lens mount shift will
              have to be reoptimized for d and e. If you nail this down for your set it
              is really fun to do lets say 3 or 4 shots around and only two pairs of cps
              each pair manually and see it come together faster then with any auto
              mode. Old school thinking:-))


              > www.isde5.org. I wonder if the WWPP would be interested in an
              > International Polar Year event? www.ipy.org I'm not sure what form
              > that would take, especially since most folks dont have access to the
              > poles. But perhaps either a winter event in general or a climate
              > change event of some sort? Anyway, just some thoughts.

              Join us and propose this to the members. The themes are all suggested and
              ultimately chosen by a small panel.
              If the theme is doable and has apeal for most members then it could be a
              winner....it can happen.
              The more restrictive the themes are, the less partisipation will occur,
              naturally.



              --
              Milko Amorth
              360° Immersive Imaging
              Photographic Virtual Reality
              VRCanada.ca
              604.561.5101

              PhotoScrapbook at Flickr.com/photos/vrdundee
              Skype me @ vrdundee
              Member of IVRPA.org
              Contributor to the World Wide Panorama Project
            • Milko Amorth
              Hi John, ... Yes, and as you point out in your optimizer tutorial you must only place these points on lines that should remain straight in the selected output
              Message 6 of 16 , Jun 30, 2007
              • 0 Attachment
                Hi John,

                > Also t3,t4,...tn.
                Yes, and as you point out in your optimizer tutorial you must only place
                these points on lines that should remain straight in the selected output
                projection. Another good read.
                http://www.homepage.ntworld.com/j.houghton/optitude.htm
                Thanks.

                Cheers, Milko



                --
                Milko Amorth
                360° Immersive Imaging
                Photographic Virtual Reality
                VRCanada.ca
                604.561.5101

                PhotoScrapbook at Flickr.com/photos/vrdundee
                Skype me @ vrdundee
                Member of IVRPA.org
                Contributor to the World Wide Panorama Project
              • Milko Amorth
                Hi Serge, ... Sure, good enough for the pano fit in eq/cyl projection. Try these values for a pano twice the resolution or try a calibration grid target with
                Message 7 of 16 , Jun 30, 2007
                • 0 Attachment
                  Hi Serge,

                  > For this second scenario you don't need horizontal/vertical line control
                  > points,
                  > because it does not matter whether the scene is tilted or not. As long
                  > as the
                  > average control point distance is low, you've got a good calibration
                  > that you can
                  > use on single images from then on.
                  Sure, good enough for the pano fit in eq/cyl projection. Try these values
                  for a pano twice the resolution or try a calibration grid target with
                  rectlinear projection and you will see it is just an approximation.


                  I just did a test run with 2 calibration grid images using the auto align
                  of ptgui beta and ptgui optimizer.
                  The optimizer does not care if the images are side by side or in line.
                  It placed 28 cps nicely spread on the outside of the grid with a minimum
                  of 0,0000031 and a maximum of 0,00185 source pixel distance. It produced
                  a=0,012160; b=-0,012329; c=0,014578 and tagged this is too good to be true.
                  Perfect overlap and match of both images, but still showing some barrel
                  distortion and perspective shifts.

                  After that, i just applied the calibrated values for this lens from the
                  data base, which are different (a=0,01309 b=-0,03639 c=0).
                  and no distortion what so ever, but still the perspective shift. Only
                  after setting t1 and t2 I got it perspectively correct. After reoptimizing
                  with the previous values and the new t1 and t2 I got quite close but not
                  perfect. Applying the data base lens coefficients again......voila. Nice
                  grid. A good lens calibration takes time and away the guessing
                  game.....and it needs true lines. Luckily you only have to do it once for
                  your set.


                  Cheers, Milko



                  --
                  Milko Amorth
                  360° Immersive Imaging
                  Photographic Virtual Reality
                  VRCanada.ca
                  604.561.5101

                  PhotoScrapbook at Flickr.com/photos/vrdundee
                  Skype me @ vrdundee
                  Member of IVRPA.org
                  Contributor to the World Wide Panorama Project
                • Serge Maandag (yahoo)
                  ... Milko, I think we re trying to say the same. I was going for images with lots of detail and thus tons of control points. That s the dirt ugly way. You re
                  Message 8 of 16 , Jul 2, 2007
                  • 0 Attachment
                    > I just did a test run with 2 calibration grid images using the auto align
                    > of ptgui beta and ptgui optimizer.
                    > The optimizer does not care if the images are side by side or in line.
                    > It placed 28 cps nicely spread on the outside of the grid with a minimum
                    > of 0,0000031 and a maximum of 0,00185 source pixel distance. It produced
                    > a=0,012160; b=-0,012329; c=0,014578 and tagged this is too good to be true.
                    > Perfect overlap and match of both images, but still showing some barrel
                    > distortion and perspective shifts.

                    Milko,

                    I think we're trying to say the same. I was going for images with lots of detail and
                    thus tons of control points. That's the dirt ugly way. You're going for the clean
                    optimize grid way. That saves you a lot of control points and is intuitive.

                    My only point was that you don't necessarily have to work with t1/t2 points to
                    determine lens error parameters. But that's mere theory. Using t1/t2 points does
                    make it easier and more transparent though. As long as you don't forget to optimize
                    y,p,r too :)

                    Doing a 360 is the best way to determine the lens FoV though..

                    Serge.
                  • matt_nolan_uaf
                    Serge and Milko, Thanks for your input. A few follow up questions. - Milko, what sort of target did you use for calibration? A sheet of graph paper, or
                    Message 9 of 16 , Jul 2, 2007
                    • 0 Attachment
                      Serge and Milko,

                      Thanks for your input. A few follow up questions.

                      - Milko, what sort of target did you use for calibration? A sheet of
                      graph paper, or something more sophisticated?

                      - If I understand correctly, the t1 and t2 lines are used more to
                      correct shift than to calibrate the lens? I tried using these only,
                      and got strange results, but I didnt fool with it very much.

                      - What exactly is the 'optimizer' doing? Is it changing control
                      points to match better, or just using what exists and coming up with
                      the best lens parameters? Is there a way to 'force' some control
                      points to have higher priority in optimization?

                      - Is the field of view for the 10.5 mm lens changing? I didnt think
                      so, so shouldn't I force PTgui to use the correct values to help it
                      optimize shifts? Does anyone know the correct value? Or does this
                      vary slightly with each lens? What are others getting?

                      BTW, I was able to 'successfully' use PTgui on single images at a
                      wedding over the weekend. I saved the lens parameters found by a 360
                      panorama, and then applied it to single frames. I tried calibrating
                      using just pairs, but as I said the results were wierd, and the
                      panorama did well enough for my eyes in this application. In the
                      future I'd like to calibrate for real. It's really wild how much
                      shifting can be done in PTgui. You can see a few pics here
                      http://www.uaf.edu/water/faculty/nolan/temp/belfair/belfair.htm

                      Cheers,
                      Matt



                      --- In PanoToolsNG@yahoogroups.com, "Serge Maandag (yahoo)"
                      <yahoo@...> wrote:
                      >
                      > > I just did a test run with 2 calibration grid images using the
                      auto align
                      > > of ptgui beta and ptgui optimizer.
                      > > The optimizer does not care if the images are side by side or in
                      line.
                      > > It placed 28 cps nicely spread on the outside of the grid with a
                      minimum
                      > > of 0,0000031 and a maximum of 0,00185 source pixel distance. It
                      produced
                      > > a=0,012160; b=-0,012329; c=0,014578 and tagged this is too good
                      to be true.
                      > > Perfect overlap and match of both images, but still showing some
                      barrel
                      > > distortion and perspective shifts.
                      >
                      > Milko,
                      >
                      > I think we're trying to say the same. I was going for images with
                      lots of detail and
                      > thus tons of control points. That's the dirt ugly way. You're going
                      for the clean
                      > optimize grid way. That saves you a lot of control points and is
                      intuitive.
                      >
                      > My only point was that you don't necessarily have to work with
                      t1/t2 points to
                      > determine lens error parameters. But that's mere theory. Using
                      t1/t2 points does
                      > make it easier and more transparent though. As long as you don't
                      forget to optimize
                      > y,p,r too :)
                      >
                      > Doing a 360 is the best way to determine the lens FoV though..
                      >
                      > Serge.
                      >
                    • Serge Maandag (yahoo)
                      ... Don t know about Milko, but I used the tiled wall in my bathroom :) ... No. The t1 and t2 parameters are mainly to tell the optimizer: This point should be
                      Message 10 of 16 , Jul 2, 2007
                      • 0 Attachment
                        > - Milko, what sort of target did you use for calibration? A sheet of
                        > graph paper, or something more sophisticated?

                        Don't know about Milko, but I used the tiled wall in my bathroom :)

                        > - If I understand correctly, the t1 and t2 lines are used more to
                        > correct shift than to calibrate the lens? I tried using these only,
                        > and got strange results, but I didnt fool with it very much.

                        No. The t1 and t2 parameters are mainly to tell the optimizer: This point should be
                        straight above or straigth next to the other point. Normally you use them on
                        horizons or on doorframes. But when you're calibrating your lens it means you are
                        searching for parameters that make straight lines in the real world seem straight in
                        your photo. Since t1 and t2 control points are all about straight lines, they come
                        in handy to do the actual calibration.


                        > - What exactly is the 'optimizer' doing? Is it changing control
                        > points to match better, or just using what exists and coming up with
                        > the best lens parameters? Is there a way to 'force' some control
                        > points to have higher priority in optimization?

                        First of all, the optimizer does what you're telling it too. You will have to tell
                        it what parameters can be played with to reach the ultimate goal: control points in
                        multiple images that, on the 3d globe, exactly fall in the same place. You can
                        compare it to the "goal seek" function in Microsoft Excel.

                        Before you press "optimize", you will have set an input (format and position) and an
                        output (format and position). The optimizer will determine how good the control
                        points will match if the input image is warped to the output format and position. If
                        it's not a perfect match, it will repeatedly change parameters like yaw and roll to
                        see if the result gets better. It will stop when it has found the parameters that
                        give the best match.

                        > - Is the field of view for the 10.5 mm lens changing? I didnt think
                        > so, so shouldn't I force PTgui to use the correct values to help it
                        > optimize shifts? Does anyone know the correct value? Or does this
                        > vary slightly with each lens? What are others getting?

                        Not much, that's for sure. There's probably some variation when you focus
                        differently. Whether the aperture setting has any influence, I don't know. I always
                        optimize the field of view along in my 360 panoramas anyway. There will be some
                        variation between 2 lenses for sure, but for single images that's not going to hurt
                        you.

                        > I tried calibrating using just pairs, but as I said the results
                        > were wierd,

                        they shouldn't be. Perhaps you forgot to optimize a variable or you did not place
                        your control points optimally. If you place the image and the .pts online, we can
                        have a look..

                        Serge.
                      • Milko Amorth
                        Hi Matt, hi Serge, ... Tiles are great if you can trust your tiler ;-) I do use my tiled shower to do a precise script for close-ups under 10 feet. In general
                        Message 11 of 16 , Jul 5, 2007
                        • 0 Attachment
                          Hi Matt, hi Serge,

                          > Don't know about Milko, but I used the tiled wall in my bathroom

                          Tiles are great if you can trust your tiler ;-) I do use my tiled shower
                          to do a precise script for close-ups under 10 feet.
                          In general you need a true grid to fill your view finder and be at least
                          10 feet away or more. Highrise buildings make the best target when you
                          have one opposite and can shoot with the horizon in the center. Laser
                          levels can help as well. For normal lenses I have a grid map pano on the
                          wall made of chart paper.

                          Like Serge said, the optimizer will do what you tell it to do. Remember,
                          it does not look at the picture but the coordinates you set (Xpixel and
                          Ypixel).

                          Happy stitching,
                          Cheers, Milko


                          --
                          Milko Amorth
                          360° Immersive Imaging
                          Photographic Virtual Reality
                          VRCanada.ca
                          604.561.5101

                          PhotoScrapbook at Flickr.com/photos/vrdundee
                          Skype me @ vrdundee
                          Member of IVRPA.org
                          Contributor to the World Wide Panorama Project
                        Your message has been successfully submitted and would be delivered to recipients shortly.