Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: D M German <dmg@uv...>  20100328 19:51:39

Hi everybody, Some people have recently mentioned that it would be useful to implement new input projections in libpano/hugin to support a wider variety of fisheye lenses (i.e. samyang stereographic lenses, and potentially fine tune projections to fisheye lenses). I spent some time this weekend looking at the code in libpano trying to understand how this could be done. In a nutshell, this is the process used to map a photo (we do it backwards): // Building the conversion stack // // 1 Convert from panorama projection to equirectangular // 2 Rotate horizontally // 3 Convert to spherical from equirectangular // 4 Apply perspective correction (pitch and roll) in spherical coordinates // 5 Convert to image format (rectilinear, pano, equirectangular) // 6 Scale output image // 7 Do radial correction // 8 Do tilt // 9 Do vertical shift // 10 Do horizontal shift // 11 Do shear Spherical coordinates are equidistant ones (think equidistant fisheye). It is in spherical coordinates that the optimization step happens. To support a new input projection we need a function that maps from spherical coordinates to the output projection (and its inverse). The current candidates to be added as input projections are: equisolid, stereographic, mirror, and orthographic There was some work towards supporting them, but it was incomplete (it does not work in current version of panotools). I have gotten this far (work not committed yet): These two are implemented: * Orthographic: Not tested. seems to work. * Stereographic: Not tested, seems to work. This one is buggy: * equisolid NOT WORKING: equisolid_sphere_tp, and sphere_tp_equisolid are implemented but they don't work. The composition of the forward and the inverse is not returning the original points. * Mirror: NOT IMPLEMENTED. In theory, we could implement a projection that fits the lens (see http://michel.thoby.free.fr/Blur_Panorama/Nikkor105mm_or_Sigma8mm/Sigma_or_Nikkor/Comparison_Short_Version_Eng.html) Given that there are not that many fisheye lenses, we could have mappings that approximate the lens as close as possible. But I am stumped. My geometry sucks. My main problem is that I don't understand how the equirectangular coordinates are converted into equidistant ones, and viceversa. Basically, I need to learn how the equidistant projection equations (see http://mathworld.wolfram.com/AzimuthalEquidistantProjection.html) are derived. If anybody can point me to a resource, or explain it here, I'll appreciate it. Other things that need to be done: In libpano: * Implement mirror transformation. There is already a mirror_erect. We need its inverse. * Determine what is wrong with equisolid. * Test orthographic and stereographic input projections. In Hugin: * Expose the projections in the user interface: IMAGE_FORMAT_EQUIRECTANGULAR = 4, IMAGE_FORMAT_MIRROR = 7, IMAGE_FORMAT_FISHEYE_ORTHOGRAPHIC = 8, IMAGE_FORMAT_FISHEYE_STEREOGRAPHIC = 10, IMAGE_FORMAT_FISHEYE_EQUISOLID = 21, I am sure that there will be some issues with respect to Fullframe vs circular fisheyes for these projections. But we can deal with them as the need arises. dmg   Daniel M. German http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with . 