I just committed this change.
2008-12-29 dmg <d...@uvic.ca>
* panorama.h, math.c, adjust.c, queryfeature.c, filter.h,
parser.c: Added panini projection. the credit goes to Thomas
Sharpless who rediscovered it, and to Bruno Postle, who did the
original math.
I'll try to add the "architectural" in the next few days.
I'll let Bruno and Tom provide the background and math, both are
fascinating.
I have only tested it going from equirectangular to panini, but it
should work like any other. We might need some more changes to the
library before hugin can use it, though.
--dmg
There was a long thread on hugin-ptx where Tom and myself picked
apart a Panini painting of St Peter's with some strange perspective
effects. It turns out that hardly any of these great 'vedutismo'
paintings have a standard 'rectilinear' photographic perspective.
There is a very simple projection that does the same kind of thing,
vertical lines are preserved as vertical, radial lines (i.e. the
lines that radiate from the vanishing point) are preserved as
straight, and objects near the horizon have no local distortion.
Using this projection it is possible to create images with extreme
wide angles (over 200°) that look like normal perspectives, I've
uploaded a few here:
http://www.flickr.com/groups/vedutismo/
..and here is a mathmap script that will convert a normal 360°
cylindrical panorama:
filter panini (image in, float FoV: 1-360 (230.07), float pan: -180-180 (0.0))
# Vedutismo / Panini effect
# Bruno Postle December 2008
# input is any 360 cylindrical image
maxphi=atan(pi/2);
newphi=FoV*pi/360/2;
scale=tan(newphi)/tan(maxphi);
phi=atan(x*scale*pi/W);
yscale=cos(phi)*cos(phi);
in(xy:[phi/pi*W+(W*pan/360),y*scale*yscale])
end
--
Bruno
> I just committed this change.
>
> 2008-12-29 dmg <d...@uvic.ca>
>
> * panorama.h, math.c, adjust.c, queryfeature.c, filter.h,
> parser.c: Added panini projection. the credit goes to Thomas
> Sharpless who rediscovered it, and to Bruno Postle, who did the
> original math.
THANKS A LOT!
> I have only tested it going from equirectangular to panini, but it
> should work like any other. We might need some more changes to the
> library before hugin can use it, though.
I found a small bug in the library (even before the introduction of
Panini) that would enumerate one projection too many in the hugin drop
down of available projections. And Panini was missing in there, so I added
it. I don't think I have commit rights to panotools, and I'm anyway on
very limited infrastructure for another ten days. Find my patch to libpano
attached. The hugin stuff will come in a subsequent mail, with a blog
article on how to do that (I hope to entice newbie contributors to put
their hands under the hood of hugin, and maybe you will help me with
something similar for the projections in panotools?).
Yuv
Yuv
>> I have only tested it going from equirectangular to panini, but it
>> should work like any other. We might need some more changes to the
>> library before hugin can use it, though.
Yuval> I found a small bug in the library (even before the introduction of
Yuval> Panini) that would enumerate one projection too many in the hugin drop
Mmm, I just checked and I think libpano code is ok. It might be the
code in hugin. panoProjectionFormatCount returns exactly the enumber
of projections available (currently 13, including panini), numbered
from 0 to 12.
Panini is #12 in panotools.
Anybody wants to try it?
Yuval> down of available projections. And Panini was missing in there, so I added
Yuval> it. I don't think I have commit rights to panotools, and I'm anyway on
Yuval> very limited infrastructure for another ten days. Find my patch to libpano
Yuval> attached. The hugin stuff will come in a subsequent mail, with a blog
Yuval> article on how to do that (I hope to entice newbie contributors to put
Yuval> their hands under the hood of hugin, and maybe you will help me with
Yuval> something similar for the projections in panotools?).
I had done the changes last night already, and I committed them few
minutes ago. your code was good, except that it was missing the
maximum vFOV and hFOV values that libpano should return to hugin.
By the way, I have hardcoded 220 degrees as the maximum hFOV. Anything
bigger is just, well, unusable ;) vFOV is set to 180, but 90 is a more
practical one.
--dmg
--
Daniel M. German "We die. That may be the meaning of life.
But we do language. That may be
Toni Morrison -> the measure of our lives."
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .
Bruno> There was a long thread on hugin-ptx where Tom and myself picked
Bruno> apart a Panini painting of St Peter's with some strange perspective
Bruno> effects. It turns out that hardly any of these great 'vedutismo'
Bruno> paintings have a standard 'rectilinear' photographic perspective.
Bruno> There is a very simple projection that does the same kind of thing,
Bruno> vertical lines are preserved as vertical, radial lines (i.e. the
Bruno> lines that radiate from the vanishing point) are preserved as
Bruno> straight, and objects near the horizon have no local distortion.
Bruno> Using this projection it is possible to create images with extreme
Bruno> wide angles (over 200°) that look like normal perspectives, I've
Bruno> uploaded a few here:
As a clarification, we are using equirectangular as the intermediary
projection. It will be interesting to see the effect that other
cylindrical projections have on the final result.
--dmg
--
Daniel M. German "Beware of bugs in the above code;
I have only proved it
Donald Knuth -> correct, not tried it."
>> I have only tested it going from equirectangular to panini, but it
>> should work like any other. We might need some more changes to the
>> library before hugin can use it, though.
Yuval> I found a small bug in the library (even before the introduction of
Yuval> Panini) that would enumerate one projection too many in the hugin drop
Mmm, I just checked and I think libpano code is ok. It might be the
code in hugin. panoProjectionFormatCount returns exactly the enumber
of projections available (currently 13, including panini), numbered
from 0 to 12.
Panini is #12 in panotools.
Anybody wants to try it?
Yuval> down of available projections. And Panini was missing in there, so I added
Yuval> it. I don't think I have commit rights to panotools, and I'm anyway on
Yuval> very limited infrastructure for another ten days. Find my patch to libpano
Yuval> attached. The hugin stuff will come in a subsequent mail, with a blog
Yuval> article on how to do that (I hope to entice newbie contributors to put
Yuval> their hands under the hood of hugin, and maybe you will help me with
Yuval> something similar for the projections in panotools?).
I had done the changes last night already, and I committed them few
minutes ago. your code was good, except that it was missing the
maximum vFOV and hFOV values that libpano should return to hugin.
By the way, I have hardcoded 220 degrees as the maximum hFOV. Anything
bigger is just, well, unusable ;) vFOV is set to 180, but 90 is a more
practical one.
--dmg
--
Daniel M. German "We die. That may be the meaning of life.
But we do language. That may be
Toni Morrison -> the measure of our lives."
just created my first panorama using the panini projection - compared to
equirectangular - which would have been my first choice - it somehow
added more depth to the scene. (a small cemetery with winterly trees in
the background)
anyway, since there are so many projections now, maybe we should think
about ordering them? something like "keeps straight lines", "keeps
angles", "keeps areas equal" or "mixed", as the architectural
projection. or are the projections too different to be classified like that?
thx to all developers :) can't imagine working without hugin/panotools
anymore....
Benjamin
The projections form two neat series of 'cylindrical' and
'azimuthal' types, all other projections are not so easy to
categorise. I've updated the wiki page on projections, so this may
make a bit more sense there:
http://wiki.panotools.org/Projections
--
Bruno
> The projections form two neat series of 'cylindrical' and
> 'azimuthal' types, all other projections are not so easy to
> categorise. I've updated the wiki page on projections, so this may
> make a bit more sense there:
>
> http://wiki.panotools.org/Projections
Many thanks! I'v added the (approximate) field of view for each example
image. There are some, where I probably didn't get it right from
counting the squares, so please correct if you have the exact values.
--
Erik Krause
http://www.erik-krause.de
Tom> Thanks for this helpful page.
Tom> Since the Pannini projections are just compressed cylindrical ones,
Tom> why not put them in the cylindrical category?
Hi Tom,
Pannini is not a cylindrical in the pure sense. It is a hybrid. It is
an azimuthal projection of a cylindrical one.
--dmg
One might (pedantically) call that a composite,
not a hybrid :-)
BugBear
paul> Daniel M German wrote:
>>
>>
Tom> Thanks for this helpful page.
Tom> Since the Pannini projections are just compressed cylindrical ones,
Tom> why not put them in the cylindrical category?
>>
>> Hi Tom,
>>
>> Pannini is not a cylindrical in the pure sense. It is a hybrid. It is
>> an azimuthal projection of a cylindrical one.
paul> One might (pedantically) call that a composite,
paul> not a hybrid :-)
I like that term: compositional projections. Those created by the
composition of 2 or more projections.
Hybrids: those created by mixing 2 or more projections, each covering
part of the field of view.
--dmg
..except that the pannini projection is as similar to stereographic
as it is to cylindrical.
The interesting thing about organising them like this is that it
shows that hugin/panotools now has a comprehensive range of
cylindrical and azimuthal output projections. The others are a bit
random: some composite/hybrid projections, one transverse.
--
Bruno