Reverse fisheye

113 views
Skip to first unread message

Rob Antonishen

unread,
Nov 13, 2009, 2:25:53 PM11/13/09
to mat...@googlegroups.com
Does anyone know the formula to map a fisheye image to a planar image?

-Rob A.

geezer

unread,
Nov 14, 2009, 7:02:46 PM11/14/09
to MathMap


On Nov 13, 1:25 pm, Rob Antonishen <rob.antonis...@gmail.com> wrote:
> Does anyone know the formula to map a fisheye image to a planar image?
>
> -Rob A.

See the topic "Defishing filters" (March 11) in this group by Edgar
Bonet.

Rob Antonishen

unread,
Nov 15, 2009, 9:29:54 PM11/15/09
to mat...@googlegroups.com
Thanks

I think I was wring in what I wanted... not a fisheye, but the image
from a reflective hemishphere, like a christmas ornament. I thought
it would be like a 180deg fisheye but it doesn;t seem so.

-Rob A>

photo...@gmail.com

unread,
Nov 16, 2009, 2:29:04 PM11/16/09
to MathMap
not sure how much this will help

Anyway in mm 1 sphere script is included in MM/map/sphere

but is possible that the Animated Sphere script included here
http://photocomix-resources.deviantart.com/art/MathMap-custom-script-2-1-83507321
does a kind of mapping more close of what you need (is a quite
different mapping you may check the difference setting the number of
frames of the animated version to 1)

Basically i believe that will be more easy get the a 180 reflection
from the animated version because is exactly what rendered in that
case

I am aware that i am not explaining very well, and anyway i am not
able to offer you the reverse function, but i used very often both
sphere script
and i believe that the animated sphere code,( even if more complex )
may be closer to what you need to revert.

And yes, fish eyes distort , while you want map (or better reverse a
mapping )

Edgar Bonet

unread,
Nov 16, 2009, 3:47:56 PM11/16/09
to mat...@googlegroups.com
Hello!

> I think I was wring in what I wanted... not a fisheye, but the image
> from a reflective hemishphere, like a christmas ornament. I thought
> it would be like a 180deg fisheye but it doesn;t seem so.

If you take a picture of a reflective sphere from a far distance (a
distance significantly longer than the sphere's diameter), then you
get was is called an equisolid angle projection. As far as I know, this
is the most common fisheye projection. Or at least it's the projection
that my fisheye (Nikon 10.5 DX) claims to provide. IIRC, the Sigmas
give the same projection. Well, with one difference: the typical
fisheye will give you only 180 deg. while the reflective sphere will
get you 360 deg (actually 360 deg minus the tiny angle hidden by the
sphere itself).

If I understand correctly, you want to transform some image into
the equisolid angle projection in order to simulate the reflection
from a sphere. Are you aware that you need for this a full 360x180 deg
panorama? If you do have such panorama available, please tell us what
is the projection of this input image. Then we will be able to give you
the formulas to map your image into a sphere's reflection.

Regards,

Edgar.

photo...@gmail.com

unread,
Nov 17, 2009, 1:27:47 PM11/17/09
to MathMap

> If I understand correctly, you want to transform some image into
> the equisolid angle projection in order to simulate the reflection
> from a sphere. Are you aware that you need for this a full 360x180 deg
> panorama? If you do have such panorama available, please tell us what
> is the projection of this input image. Then we will be able to give you
> the formulas to map your image into a sphere's reflection.
>
> Regards,
>
> Edgar.

if i understand well is the reverse:
the input is 1 photo of a real reflex on a sphere,limited to its
visible part (so as 1 reflex of a semi spheric mirror )
the output should be ..well a normal view of what reflected

As to get a normal image from what reflected on a spheric mirror
photographed from only 1 point of view with only 1 shoot

That seems close to the inverse of the function to map on a semisphere
(but i fear much more complex...will be so simple only if the point of
view/ position of camera was perpendicular to the sphere
as a photographer shooting to his reflex on a spheric mirror exactly
in front of him with the sphere center at same height of the camera

Except that here the point of view of the photographer respect to the
spheric mirror is not know ,
(but only may be guessed from the rest of the image if not cropped )
and even the kind of lens used (and so the distortion that may
create ) may be not know with precision
( but only guessed, as example noticing typical distortion of
wideangle in the input image )

Rob Antonishen

unread,
Nov 17, 2009, 2:36:29 PM11/17/09
to mat...@googlegroups.com
> As to get a normal image from what reflected on a spheric mirror
> photographed from only 1 point of view with only 1 shoot
>
> That seems close to the inverse of the function to map on a semisphere
> (but i fear much more complex...will be so simple only if the point of
> view/ position of camera was perpendicular to the sphere
> as a photographer shooting to his reflex on a spheric mirror exactly
> in front of him with the sphere center at same height of the camera
>
> Except that here the point of view of the photographer respect to the
> spheric mirror is not know ,
> (but only may be guessed from the rest of the image if not cropped )
> and even the kind of lens used (and so the distortion that may
> create ) may be not know with precision
> ( but only guessed, as example noticing typical distortion of
> wideangle in the input image )
>
>

I am not sure about that. Looking at the 2d case, regardless as where
the camera is pointing there will be a point tangential to the focal
point.

The only factor that is needed is the ratio of the distance to the
sphere to the diameter of the sphere, to determine what amount of the
sphere is visible (at an infinate distance with an infinite zoom the
limit is 180deg, but the smaller the distance:diameter ratio the less
of the sphere is visible. As mentioned before, the reflection will
cover 360 degrees less the parts of the image occluded by the sphere
(i.e the reflection will not include any of the scene "behind" the
sphere.

But the thing I have come to realize is that it can't be
"undistorted" to a planar image, only another panoramic projection
(with a small area blocked out.)

Here is a good description I found:
http://wiki.panotools.org/ChristmasBallPanoTutor

The important thing (which I didn't realize) is:

"While this looks like a Fisheye Projection image, it certainly is
not. First of all the FoV is close to 360 degrees, which is very
uncommon for a fisheye image. Secondly, with a fisheye the number of
degrees covered in the image with each millimeter you move away from
the center is the same. That is a difficult sentence, so I'll give an
example: Say you draw a circle with a diameter of 1 cm from the center
of the image and that cicle covers 10 degrees FoV. Then a circle with
a diameter of 2 cm will have a FoV of 2 x 10 = 20 degrees. And so on.

With this reflection, this is not the case. In the center part of the
image the rule more or less holds, but as you get nearer to the edge
of the ball, more and more degrees are crammed into a mm. Therefore
you can not simply defish this image, but you'll have to convert it
from "convex mirror" or "mirror ball" to Equirectangular Projection.
To convert it you can use the Panorama Tools Plugins or the flexify
plugin from Flaming Pear. "

I also found this great reference (with diagrams) that describes the process:

http://www.pointzero.nl/dump/mirrorball_theory/

-Rob A>

Edgar Bonet

unread,
Nov 17, 2009, 3:43:55 PM11/17/09
to mat...@googlegroups.com
Hi!

Rob Antonishen wrote:
> But the thing I have come to realize is that it can't be
> "undistorted" to a planar image, only another panoramic projection
> (with a small area blocked out.)

It can, as long as you don't expect to get the whole panorama but only
a fraction small enough to make a reasonable field of view for a
rectilinear (regular perspective) projection. You should not try to
get more than 90 deg. HFOV unless you like the kind of weird
perspectives you can get out of ultra-ultra-wide lenses. 90 deg. is
the HFOV of a 18 mm equiv. lens.

Quoting wiki.panotools.org:
> While this looks like a Fisheye Projection image, it certainly is
> not. [...] with a fisheye the number of
> degrees covered in the image with each millimeter you move away from
> the center is the same.

This is simply not true. Whoever wrote that is assuming that all
fisheyes provide the so called equidistant projection. Although there
may be some fisheyes out there that do provide this projection, I've
found that in most cases the projection type is not specified. And when
it is specified, I have only seen equisolid angle projections on
contemporary fisheyes.

The equisolid angle projection is the limit of the mirror ball when
the distance from camera to mirror is very large compared to the mirror
diameter.

Regards,

Edgar.
Reply all
Reply to author
Forward
0 new messages