On Wed 01-Jul-2009 at 11:56 -0700, Aron H wrote:
>
>Given a pixel in the final panorama image, find what sub-pixel it maps
>to
>in a given input image:
>-Given 0,0 in the image center, and FOV, find a yaw/pitch for the
>pixel, and make a direction vector.
>-Rotate that vector by the image's yaw-pitch-roll angles, so it is now
>in camera coordinates
>-Convert the hfov to a vfov using the aspect ration, as described
>here:
http://wiki.panotools.org/Field_of_View
>-Use the condition that r=1 at the h/2 radius, find the depth of the
>image plane, zf
> tan(vfov/2) = r/zf
> zf = r / tan(vfov/2)
>- If our direction vector is (vx, vy, vz), mulitply it by zf/vz, to
>get (ix, iy), a point on the image plane. Points behind the camera or
>too far away can be thrown out.
>- Calculate r = sqrt(ix^2 + iy^2), and distort by multplying (ix, iy)
>* (a r^3 + b r^2 + c r + d) = (dx, dy)
>- multiply (dx, dy) * h/2 to get a number in pixels
>- Interpolate a color from the surrounding pixels in the source image.
Correct, though your assumption is for landscape format images, it
is slightly simpler for portrait.
>Is that actually correct? Can someone point me to where this is done
>in the source code?
math.c in libpano13.
--
Bruno
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQTo post to this group, send email to
hugin-ptx@...
To unsubscribe from this group, send email to
hugin-ptx-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/hugin-ptx-~----------~----~----~----~------~----~------~--~---