mosaic mode maths - an equation, please!

29 views
Skip to first unread message

kfj

unread,
Dec 7, 2010, 10:59:24 AM12/7/10
to hugin and other free panoramic software
Hi all!

I'm trying to help in a parallel thread

http://groups.google.com/group/hugin-ptx/browse_thread/thread/873b58166bd2ff33/74891be947b6e4b6#74891be947b6e4b6

There is a guy who needs to know how varying the Z parameter
translates into a scaling factor. I thought this was straightforward,
but found it is not: I thought the Z parameter translates into a
linear distance along the optical axis measured from the center of the
panosphere, since the X and Y parameters translate into linear shifts
parallel to the image plane. This would be easy. But I can set Z
beyond 1.0, even up to 100 and further, and the image 'comes closer'
but I never quite get there. So it must be some asymptotic nonlinear
function, and I can't be bothered poking around in the code to find
the formula. Maybe someone can just tell me what it is or point me to
the appropriate place?

with regards
Kay

kfj

unread,
Dec 10, 2010, 5:36:49 AM12/10/10
to hugin and other free panoramic software

Hi all!

Maybe my request was overlooked, so I take the liberty to push it up
to the top of the list again before I try again under a different and
maybe more tempting heading ;-)
I did try to look into the code, and gave up after half an hour - I
just couldn't find where the calculation is done.

with regards
Kay

On 7 Dez., 16:59, kfj <_...@yahoo.com> wrote:
>...

T. Modes

unread,
Dec 10, 2010, 5:59:22 PM12/10/10
to hugin and other free panoramic software
No equation, but a description can be found in the wiki:
http://wiki.panotools.org/Stiching_a_photo-mosaic

kfj

unread,
Dec 11, 2010, 5:38:49 AM12/11/10
to hugin and other free panoramic software


On 10 Dez., 23:59, "T. Modes" <Thomas.Mo...@gmx.de> wrote:
> No equation, but a description can be found in the wiki:

http://wiki.panotools.org/Stiching_a_photo-mosaic

Thank you very much! I was confused, because I thought the Z axis was
going the other way. Now it all became clear: you can have Z values
down to -1, which is when you actually touch the projection plane.
With Z values <= -1 you can't see anything, since the virtual camera
position is on or behind the plane. With rising Z values you move away
fron the projection plane - if an image with the same hfov is then
projected onto the plane, it becomes ever bigger with rising Z values.
So it's linear after all, just my understanding was nonlinear ;-)

So I suppose the following holds true (with rectilinear projection,
all other parameters at default values):

Let d be the distance of the virtual camera from the image plane: d =
Z + 1 , Z > -1

If an image is projected with different Z values, the output sizes
will differ by a scaling factor proportional to the respective d
values

e.g. if an image is processed once with Z = -0.25 and once with +0.5,
the resulting second projection will be twice as large (in width and
height; surface will be four times as large) as the first, since

d1 = -0.25 + 1 = 0.75
d2 = 0.5 + 1 = 1.5
d2 = 2 * d1

with regards
Kay
Reply all
Reply to author
Forward
0 new messages