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

Re: cubicQTVR projection

Expand Messages
  • Rik Littlefield
    ... Yes, these are simple central projections. To *generate* the cubic image file from spherical coordinates, the sphere is centrally projected onto six
    Message 1 of 13 , Dec 30, 2006
    • 0 Attachment
      --- In PanoToolsNG@yahoogroups.com, "Hannes Hensel" <h.hensel@...>
      wrote:
      >
      > --- In PanoToolsNG@yahoogroups.com, rogerhoward@ wrote:
      > > First, think of it as a cube. What part of Cubic QuicktimeVR
      > > implies a sphere?
      >
      > Ok, so lets ask me for the projection of the cube faces
      > on the viewer area. This is a 2D view of a virtual 3D scene,
      > and I want to know the projectiontype and the formulas
      > (to find x and y for given point with lon and lat) for it.
      > Can it be, that it is a simple central projection
      > (as used as perspective view in maya etc.)?

      Yes, these are simple central projections.

      To *generate* the cubic image file from spherical coordinates, the
      sphere is centrally projected onto six planes, one for each of the
      cube faces. In its exact form, this transformation involves lots of
      trig for every pixel, to turn sines and cosines of lat/lon into pixel
      coordinates. Sometimes computational shortcuts are taken, using
      planar triangle approximations instead of doing the trig
      independently for every pixel.

      To *show* the cubic image file, each visible cube face is projected
      to the viewing screen. This transformation involves no trig at all
      on a pixel-by-pixel basis. It just projects an oblique plane (one of
      the cube faces) onto the viewing plane (the display screen). This
      can be implemented as a matrix multiply in homogeneous coordinates,
      followed by perspective division.

      I forget the exact formulas. You can find the general forms in any
      good computer graphics text, but working out the details is always
      fiddly.

      Can I ask, why are you looking for these formulas?

      --Rik
    • Hannes Hensel
      ... Hey Rik, thanks so far. That goes into the right direction. I m only trying to get a bit deaper in that graphic stuff, to understand what is done there.
      Message 2 of 13 , Dec 30, 2006
      • 0 Attachment
        > Can I ask, why are you looking for these formulas?
        >
        > --Rik

        Hey Rik, thanks so far. That goes into the right direction. I'm only
        trying to get a bit deaper in that graphic stuff, to understand what is
        done there. And I wonder, if there is a shortcut, to do those 2 steps
        in one (sph > cube and cube > viewer = sph > viewer). Than it should be
        a sphere with the vCamera (central point) as center and the viewing
        plane inbetween (inner surface of the sphere BEHIND the viewing plane),
        right? How is the zoom realized then? Is it only done by bringing the
        viewing plane more to the camera (zoom out) or more to the sphere (zoom
        in)?
      • Rik Littlefield
        ... Hannes, Yes, zooming is equivalent to changing the distance between projection plane and center of projection. All of these operations can be combined into
        Message 3 of 13 , Dec 30, 2006
        • 0 Attachment
          --- In PanoToolsNG@yahoogroups.com, "Hannes Hensel" <h.hensel@...>
          wrote:
          > How is the zoom realized then? Is it only done
          > by bringing the viewing plane more to the camera
          > (zoom out) or more to the sphere (zoom in)?

          Hannes,

          Yes, zooming is equivalent to changing the distance between
          projection plane and center of projection.

          All of these operations can be combined into one step, for some
          definition of "step". They are usually kept separated to simplify
          thinking/coding and to move the cost of computations to where they
          can be afforded.

          A little more discussion...

          In my previous reply, I followed your lead and wrote in terms of
          lat/lon --> cubic image coordinates --> viewscreen coordinates.

          But in fact, the transformations are usually run in the opposite
          direction. For each viewscreen pixel, one computes the corresponding
          cubic image coordinates. From cubic image coordinates, one computes
          the corresponding lat/lon. From lat/lon, one computes the
          corresponding coordinates within a "perfected" camera image (after
          correction for lens distortion). From those, one computes
          coordinates within the camera image -- the one that was fed to
          Panorama Tools as a source image.

          Pixel value interpolation typically occurs at several places in the
          pipeline, once for every actual image that is constructed. Suppose,
          for example, that you run Panorama Tools to stitch multiple camera
          images into a single equirectangular image, then run PanoCUBE to
          generate a cubic file, then view with QuickTime or ptviewer. In this
          case there will be at least three separate interpolations of pixel
          value: one to go from camera images to equirectangular image, a
          second to go from equirectangular image to cubic image, and a third
          to go from cubic image to screen image.

          In theory, all of this manipulation could be combined into a single
          step, generating a screen image directly from camera images with only
          a single interpolation of pixel values.

          However, that would put the entire cost of the calculation into the
          viewing loop. At present, that's not feasible because it would be
          too slow. Instead, the expensive calculations are done once, to go
          from camera images to cubic image file, so that only very simple
          calculations are needed for interactive panning/zooming. The viewing
          calculations can be done quickly even in software, and are simple
          enough to be done in hardware for even better performance.

          It is interesting to notice that if you start with camera images from
          a perfect rectilinear lens, then in theory the entire viewing
          pipeline can be done without any spherical trig at all! All this
          lat/lon stuff is just a convenient way to think about the
          calculation. Ultimately, what's being accomplished is only to
          project each planar camera image onto the planar viewscreen. That
          process requires only matrix multiply and perspective division, using
          homogeneous coordinates. I'm not aware of any software that actually
          takes this approach, however.

          --Rik
        • Hannes Hensel
          ... Yes, that s true, but there is the problem of blendig, then. If the images were perfect, that should be no problem. But if they did not fit 100% or have
          Message 4 of 13 , Dec 31, 2006
          • 0 Attachment
            --- In PanoToolsNG@yahoogroups.com, "Rik Littlefield"
            <rj.littlefield@...> wrote:

            > It is interesting to notice that if you start with camera images from
            > a perfect rectilinear lens, then in theory the entire viewing
            > pipeline can be done without any spherical trig at all!

            Yes, that's true, but there is the problem of blendig, then. If the
            images were perfect, that should be no problem. But if they did not fit
            100% or have some exposure differences, one would notice that in the
            viewer. Maybe it would be a good approach, to correct and blend the
            images, but to leave their ratio and size. Still it would need some
            more calculations, like z-buffering, but that shouldn't be a problem.
            The question here is: is there an advantage in having the (almost)
            original images available in the viewer or its context? I can already
            hear "Protect my images! Copyright!" - which is an important thing...
          • Hans Nyberg
            ... The fact is there is a guy who stitches panoramas this way. Well not quite but what he does is actually combining 6 images from a fisheye in a 3D software
            Message 5 of 13 , Dec 31, 2006
            • 0 Attachment
              --- In PanoToolsNG@yahoogroups.com, "Rik Littlefield" <rj.littlefield@...> wrote:

              > It is interesting to notice that if you start with camera images from
              > a perfect rectilinear lens, then in theory the entire viewing
              > pipeline can be done without any spherical trig at all! All this
              > lat/lon stuff is just a convenient way to think about the
              > calculation. Ultimately, what's being accomplished is only to
              > project each planar camera image onto the planar viewscreen. That
              > process requires only matrix multiply and perspective division, using
              > homogeneous coordinates. I'm not aware of any software that actually
              > takes this approach, however.

              The fact is there is a guy who stitches panoramas this way.
              Well not quite but what he does is actually combining 6 images from a fisheye in a 3D
              software (CINEMA 4D). They are converted to rectilinear and cropped to 90x90 degree + a
              seam area.
              He also use a 15mm fisheye the same way but they have to be combined for each
              cubeface.

              His Name is Toshio Fuji
              http://www.11moon.com/

              You would know him if you were on the Quicktime list.

              But be prepared if you contact him. He is a very special guy.
              He also designs his own panorig and this is what he did to demonstate that his rig was the
              best.
              http://www.11moon.com/QuickTimeVR/temp/crush_test_s.mov


              Hans
              www.panoramas.dk
            • georgesur2003
              I use standalone versions of SPi-V and DevalVR to view equirectangular versions of 360x180 panos. I don t know whether or not they build on the fly cubic
              Message 6 of 13 , Jan 1, 2007
              • 0 Attachment
                I use standalone versions of SPi-V and DevalVR to view equirectangular
                versions of 360x180 panos.

                I don't know whether or not they build "on the fly" cubic faces...

                BTW, the displayed rectilinear image is good and moves are very smooth.
                This is very helpful for previews before end of stitcher use, but this
                is out of topic!
              • Erik Krause
                Hallo, Hannes ... Search for Euler Angles if you want to know the math behind it... -- Erik Krause Resources, not only for panorama creation:
                Message 7 of 13 , Jan 1, 2007
                • 0 Attachment
                  Hallo, Hannes
                  on Sat, 30 Dec 2006 09:00:12 -0000 Rik wrote:

                  > I forget the exact formulas. You can find the general forms in any
                  > good computer graphics text, but working out the details is always
                  > fiddly.

                  Search for "Euler Angles" if you want to know the math behind it...

                  --
                  Erik Krause
                  Resources, not only for panorama creation:
                  http://www.erik-krause.de/
                • John Riley
                  My memory of Euler Angles had grown fuzzy with time (hey, I haven t really worried about them since my mechanics classes in physics grad school 20+ years
                  Message 8 of 13 , Jan 1, 2007
                  • 0 Attachment
                    My memory of Euler Angles had grown fuzzy with time (hey, I haven't
                    really worried about them since my mechanics classes in physics grad
                    school 20+ years ago), so I googled them to remind myself. I got a
                    kick out of the blue-boxed warning at the beginning of the article on
                    Wikpedia. You know, the same one where they say that the article may
                    need to be cleaned up or doesn't provide proper references. This one
                    said: "This article or section may be confusing or unclear for some
                    readers." I had to laugh 8-) I know I can imaging an unsuspecting
                    reader wondering what the heck THAT is!

                    John


                    John Riley
                    johnriley@...
                    jriley@...




                    On Jan 1, 2007, at 12:06 PM, Erik Krause wrote:
                    >
                    >
                    > Search for "Euler Angles" if you want to know the math behind it...
                    >
                    > --
                    > Erik Krause
                    > Resources, not only for panorama creation:
                    > http://www.erik-krause.de/
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.