Difference between revisions of "Unusual remappings"

From PanoTools.org Wiki
Jump to navigation Jump to search
m (changed thumbs to 250px)
m (→‎Little planet: corrected link)
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Unusual remappings ==
+
The possibilities of panotools go far beyond mere panorama stitching. Due to its flexibility and modular design there are some remappings possible that (may be) were not intended originally. It is possible to perform these (and other unusual) remappings using the [[Panorama Tools Plugins]]. There is a Photoshop action by Flemming V. Larsen which uses the plugins: [http://www.fvlmedia.dk/temp/remappano.htm].
The possibilities of panotools go far beyond mere panorama stitching. Due to it's flexibility and modular design there are some remappings possible that (may be) where not intended originally. It should be possible to perform these remappings using the [[Panorama Tools Plugins]] but I prefer to use one of the [[GUI front-ends]], since they allow for a more convenient control. I've used [[PTGui]] here but it should be possible with [[hugin]], [[PTAssembler]] or [[PTMac]] in a similar way.
 
  
=== Little planet ===
+
I prefer to use one of the [[GUI front-ends]], since they allow for a more convenient control. I've used [[PTGui]] here but it should be possible with [[hugin]], [[PTAssembler]] or [[PTMac]] in a similar way.
This is a remapping already used by Helmut Dersch as a thumbnail for his virtual Marburg tour on [http://www.path.unimelb.edu.au/~dersch/] (scroll down on the page). It remaps an [[equirectangular]] full spherical panorama to a virtual 360� fishey image. Unfortunately neither PTGui nor hugin support this remapping directly, hence we have to modify the [[PTStitcher]] script.
 
  
 +
== Little planet ==
 +
[[Image:little planet.jpg|thumb|250px|Fisheye little planet remapping result © Erik Krause]]
 +
[[Image:little planet2.jpg|thumb|250px|Stereographic little planet remapping result © Erik Krause]]
 +
This is a remapping already used by Helmut Dersch as a thumbnail for his virtual Marburg tour on [http://www.panotools.org/dersch/Marburg/Marburg.html], where he remapped an [[equirectangular]] full spherical panorama to a 360 degree fisheye image with the [[nadir]] in the center and the [[zenith]] at the circle border. This is the same projection as used in the first example.
  
[[Image:little_planet.jpg|thumb|250px|Little planet remapping result © Erik Krause]]
+
Nowadays most [[GUI front-ends]] feature [[Stereographic Projection|stereographic]] and [[fisheye]] output projection directly. Stereographic is far better for Little Planets since the outer regions are less compressed and hence keep their natural proportions. The stereographic example here has a smaller [[Field of View]] (250°) although the apparent size of the planet is approximately the same like the fisheye one.
==== Steps ====
+
 
* Open PTGui, choose '''Advanced mode''' and load your equirect image on '''Source Images''' tab page.
+
Some [[Panorama Viewers]] like f.e. KRPano or DevalVR also feature stereographic projection or even "Little Planet" directly.
* On '''Lens Settings''' tab page choose '''Equirectangular''' from the '''Lens type''' list, set '''Hor. Field of View''' to 360 degrees and click '''Restore defaults''' in the '''Advanced''' frame in order to set all lens correction parameters to 0.0.
+
 
* On '''Panorama Settings''' tab page choose '''Projection: Equirectangular''' and set '''Field of View''' to 180 x 180 degrees. This is for convenience only. The values will be changed later.
+
=== Tweaks ===
* On '''Image parameters''' tab page click the '''Pitch''' field for your image and set it to 90 in order to view straight down.
+
If you don't like the rotation of the result image you use '''Numerical transform''' from the PTGui panorama editor (Ctrl+E). Enter a step value for '''Roll''' (f.e. -10) and press '''Apply''' button repeatedly until you like the rotation.  
* On '''Create Panorama''' tab page set the width and file format you want for your output image. One single image is created hence any single image format is good. Don't forget the image name. Choose '''Stitch using: Panorama Tools (PTStitcher)''' from the '''Advanced''' frame and check '''Show script'''.
+
 
* Click '''Create panorama'''. The script will be shown.
+
You can change "Little planet" to "Tunnel view" (same projection with the [[zenith]] in the center and the [[nadir]] on the outer side) if you put -90 in the '''Pitch''' field on '''Image tab''' in order to view straight up.
* In the line beginning with the letter p change '''f2''' to '''f3''' and '''v180''' to '''v360'''. Click Ok.
+
 
 +
=== Older GUI Versions ===
 +
 
 +
If you want to use older GUI versions which don't feature stereographic or fisheye output please see the [http://wiki.panotools.org/Unusual_remappings&oldid=12959 archived version of this article].
  
The resulting image is supposed to be a "Full Frame Fisheye", hence you need to crop it to a circular frame in your image editor.
+
{{clr}}
  
[[Image:little_planet_tweaks.jpg|thumb|250px|Pano editor tweaks in PTGui]]
+
== Orientation plate (arc) ==
==== Tweaks ====
+
[[Image:orientation-plate.jpg|thumb|250px|Arc formed panorama © Erik Krause]]
If you don't like the rotation of the result image you use '''Numerical transform''' from the PTGui panorama editor (Ctrl+E). Enter a step value for '''Roll''' (f.e. -10) and press '''Apply''' button repeatedly until you like the roation. The display in pano editor will be in equirect, not in "little planet" of course. {{clr}}
 
  
 +
On some places with wide panoramic vistas you can find orientation plates. Arc formed prints of the panorama. Panotools can make this remapping from a cylindrical panorama to an arc formed one, too. No need to edit scripts here but a pocket calculator might be of some use and you should know the approximate horizontal [[Field of View]] (here abbreviated as '''hFoV''') of your panorama. This works even for 360 degree panoramas.
  
[[Image:orientation-plate.jpg|thumb|250px|Arc formed panorama © Erik Krause]]
+
=== Steps ===
 
[[Image:pano-editor-settings.jpg|thumb|250px|Pano editor and pano settings in PTGui]]
 
[[Image:pano-editor-settings.jpg|thumb|250px|Pano editor and pano settings in PTGui]]
[[Image:pano-editor-settings-360.jpg|thumb|250px|Pano editor and lens settings for 360� in PTGui]]
+
[[Image:pano-editor-settings-360.jpg|thumb|250px|Pano editor and lens settings for 360 degree in PTGui]]
[[Image:orientation-plate-360.jpg|thumb|250px|Arc formed 360� panorama © Erik Krause]]
+
[[Image:orientation-plate-360.jpg|thumb|250px|Arc formed 360 degree panorama © Erik Krause]]
=== Orientation plate (arc) ===
 
On some places with wide panoramic vistas you can find orientation plates. Arc formed prints of the panorama. Panotools can make this remapping from a cylindrical panorama to an arc formed one, too. No need to edit scripts here but a pocked calculator might be of some use and you should know the approximate horizontal [[Field of View]] (here abbreviated as '''hfov''') of your panorama. This works even for 360� panoramas.
 
  
==== Steps ====
+
* Open PTGui, choose '''Advanced mode''' and load your cylindrical image on '''Source Images''' tab page. Note down the pixel sizes. In our example these are 4254x400 pixels.
<ul>
+
* On '''Lens Settings''' tab page choose '''Cylindrical''' from the '''Lens type''' list, set '''Hor. Field of View''' to the field of view of your panorama (120 degrees in our example). Click '''Restore defaults''' in the '''Advanced''' frame in order to set all lens correction parameters to 0.0. Get your calculator. Use the following formula (provided by Rik Littlefield - many thanks):
<li>Open PTGui, choose '''Advanced mode''' and load your cylindrical image on '''Source Images''' tab page. Note down the pixel sizes. In our example these are 4254x400 pixels.</li>
+
<math>r=\frac{imageWidthInPixels*360}{hFoV*2*pi}</math>
<li> On '''Lens Settings''' tab page choose '''Cylindrical''' from the '''Lens type''' list, set '''Hor. Field of View''' to the field of view of your panorama (120 degrees in our example). Click '''Restore defaults''' in the '''Advanced''' frame in order to set all lens correction parameters to 0.0. Get your calculator. Use the following formula (provided by Rik Littlefield - many thanks):<pre>r = (image_width_in_pixels*360)/(hfov*2*pi)</pre> In the example case this is<pre>r = (4254*360)/(120*2*3.14) = 2031</pre>Enter the result as a negative value in the '''vert.(e)''' Image shift field (-2031 in the example case).</li>
+
In the example case this is
<li> On '''Panorama Settings''' tab page choose '''Projection: Rectilinear''' and set '''Field of View''' to 120 x 120 degrees. This will probably be changed later.</li>
+
<math>r=\frac{4254*360}{120*2*3.14}=2031</math>
<li> On '''Image parameters''' tab page click the '''Pitch''' field for your image and set it to 90 in order to view straight down.</li>
+
Enter the result as a negative value in the '''vert.(e)''' Image shift field (-2031 in the example case).
<li> On '''Create Panorama''' tab page set the width and file format you want for your output image. One single image is created hence any single image format is good. Don't forget the image name. Choose '''Stitch using: Panorama Tools (PTStitcher)''' from the '''Advanced''' frame and uncheck '''Use fast transform'''.</li>
+
* On '''Panorama Settings''' tab page choose '''Projection: Rectilinear''' and set '''Field of View''' to 120 x 120 degrees. This will probably be changed later.
<li> Open panorama editor (Ctrl+E) and adjust panorama width and height using the sliders such that it contains the whole arc. Ocassionaly PTGui fails to display the arc correctly in pano editor. In this case you need to calculate the appropriate values. See below for details.</li>
+
* On '''Image parameters''' tab page click the '''Pitch''' field for your image and set it to 90 in order to view straight down.
<li> On '''Create Panorama''' tab page check the output size and click '''Create panorama'''.
+
* On '''Create Panorama''' tab page set the width and file format you want for your output image. One single image is created hence any single image format is good. Don't forget the image name. Choose '''Stitch using: Panorama Tools (PTStitcher)''' from the '''Advanced''' frame and uncheck '''Use fast transform'''.
</ul>
+
* Open panorama editor (Ctrl+E) and adjust panorama width and height using the sliders such that it contains the whole arc. Occasionally PTGui fails to display the arc correctly in pano editor. In this case you need to calculate the appropriate values. See below for details.
 +
* On '''Create Panorama''' tab page check the output size and click '''Create panorama'''.
  
 
You might want to crop the result image in your image editor in order to get rid of the black space.
 
You might want to crop the result image in your image editor in order to get rid of the black space.
  
==== Tweaks ====
+
=== Tweaks ===
Since the source panorama is arched, the pixels have to be compressed at the inner side and stretched at the outer side. There is a line in the middle where there is no stretching or compression. In most cases it is desireable that this line is the horizon which is assumed to be half way between upper and lower edge of the panorama. If you want this line to be somewhere else simply use a different image shift (e) value. For example -2231 will shift 200 pixels further down (nearer to the center of the result image) than -2031 and create a smaller and narrower arc.
+
Since the source panorama is arched, the pixels have to be compressed at the inner side and stretched at the outer side. There is a line in the middle where there is no stretching or compression. In most cases it is desirable that this line is the horizon which is assumed to be half way between upper and lower edge of the panorama. If you want this line to be somewhere else simply use a different image shift (e) value. For example -2231 will shift 200 pixels further down (nearer to the center of the result image) than -2031 and create a smaller and narrower arc.
  
The above calculation <pre>r = (image_width_in_pixels*360)/(hfov*2*pi)</pre> actually calculates the virtual radius (half of the diameter of the cylinder it is projected on) of the cylindrical source image in pixels. We will need this value '''r''' for the following calculation.  
+
The above calculation
 +
<math>r=\frac{imageWidthInPixels*360}{hFoV*2*pi}</math>
 +
actually calculates the virtual radius (half of the diameter of the cylinder it is projected on) of the cylindrical source image in pixels. We will need this value '''r''' for the following calculation.  
  
Result images might get very large large since they have to be symmetrical to the center point of the arcs circle, which requires a lot of black space especially if the source panorama HFoV is low. Occasionaly PTGui pano editor doesn't show the correct result image (although PTStitcher will create the arc correctly) making it impossible to adjust the panorama size manually.  
+
Result images might get very large large since they have to be symmetrical to the center point of the arcs circle, which requires a lot of black space especially if the source panorama HFoV is low. Occasionally PTGui pano editor doesn't show the correct result image (although PTStitcher will create the arc correctly) making it impossible to adjust the panorama size manually.  
  
 
In both cases it might be interesting to create the minimum possible size that covers the whole arc. Since '''Fit Panorama''' (in PTGui pano editor) fails in this case we need to calculate the values ourselves.
 
In both cases it might be interesting to create the minimum possible size that covers the whole arc. Since '''Fit Panorama''' (in PTGui pano editor) fails in this case we need to calculate the values ourselves.
  
The minimal vertical FoV value that will cover the whole arc can be calculated by <pre>rvFoV = 2*arctan(r/(e-(image_height/2)))</pre> where '''e''' is the positive Image shift you entered in the '''vert.(e)''' Image shift field as a negative value and '''r''' is the radius from two paragraphs above. In our example: <pre>rvFoV = 2*arctan(2031/(2031-(400/2))) = 95.93 degrees</pre>  
+
The minimal vertical FoV value that will cover the whole arc can be calculated by  
 +
<math>rvFoV=2*arctan\left(\frac{r}{e-\left(\frac{ImageHeight}{2}\right)}\right)</math>
 +
where '''e''' is the positive Image shift you entered in the '''vert.(e)''' Image shift field as a negative value and '''r''' is the radius from two paragraphs above. In our example:
 +
<math>rvFoV=2*arctan\left({\frac{2031}{2031-\frac{400}{2}}}\right)=95.93^\circ</math>
 
'''rvFoV''' (for result vertical Field of View).
 
'''rvFoV''' (for result vertical Field of View).
  
If your source FoV is lower than 180� like in our example the resulting horizontal Field of View ('''rhFoV''') can be lower than the vertical FoV (rvFoV). This can be calculated by <pre>rhFoV = 2*arctan(sin(source_hfov/2) * tan(rvFoV/2))</pre> In our example <pre> 2*arctan(sin(120/2)*tan(96/2)) = 87.77 degrees</pre>
+
If your source FoV is lower than 180 degree like in our example the resulting horizontal Field of View ('''rhFoV''') can be lower than the vertical FoV (rvFoV). This can be calculated by
 
+
<math>rhFoV=2*arctan\left(sin\left(\frac{hFoV_{source}}{2}\right)*tan\left(\frac{rvFoV}{2}\right)\right)</math>
It is advisable to choose sligtly larger values for both horizontal and vertical result FoV in order not to loose any pixels.  
+
In our example
 +
<math>2*arctan\left(sin\left(\frac{120}{2}\right)*tan\left(\frac{96}{2}\right)\right)=87.77^\circ</math>
 +
It is advisable to choose slightly larger values for both horizontal and vertical result FoV in order not to loose any pixels.  
  
<small>--[[User:Erik Krause|Erik Krause]] 16:09, 13 Dec 2005 (EST)</small>
 
  
[[Category:Tutorial]][[Category:Tutorial:Specialised]]
+
[[Category:Tutorial:Specialised]]

Revision as of 17:38, 4 April 2017

The possibilities of panotools go far beyond mere panorama stitching. Due to its flexibility and modular design there are some remappings possible that (may be) were not intended originally. It is possible to perform these (and other unusual) remappings using the Panorama Tools Plugins. There is a Photoshop action by Flemming V. Larsen which uses the plugins: [1].

I prefer to use one of the GUI front-ends, since they allow for a more convenient control. I've used PTGui here but it should be possible with hugin, PTAssembler or PTMac in a similar way.

Little planet

Fisheye little planet remapping result © Erik Krause
Stereographic little planet remapping result © Erik Krause

This is a remapping already used by Helmut Dersch as a thumbnail for his virtual Marburg tour on [2], where he remapped an equirectangular full spherical panorama to a 360 degree fisheye image with the nadir in the center and the zenith at the circle border. This is the same projection as used in the first example.

Nowadays most GUI front-ends feature stereographic and fisheye output projection directly. Stereographic is far better for Little Planets since the outer regions are less compressed and hence keep their natural proportions. The stereographic example here has a smaller Field of View (250°) although the apparent size of the planet is approximately the same like the fisheye one.

Some Panorama Viewers like f.e. KRPano or DevalVR also feature stereographic projection or even "Little Planet" directly.

Tweaks

If you don't like the rotation of the result image you use Numerical transform from the PTGui panorama editor (Ctrl+E). Enter a step value for Roll (f.e. -10) and press Apply button repeatedly until you like the rotation.

You can change "Little planet" to "Tunnel view" (same projection with the zenith in the center and the nadir on the outer side) if you put -90 in the Pitch field on Image tab in order to view straight up.

Older GUI Versions

If you want to use older GUI versions which don't feature stereographic or fisheye output please see the archived version of this article.


Orientation plate (arc)

Arc formed panorama © Erik Krause

On some places with wide panoramic vistas you can find orientation plates. Arc formed prints of the panorama. Panotools can make this remapping from a cylindrical panorama to an arc formed one, too. No need to edit scripts here but a pocket calculator might be of some use and you should know the approximate horizontal Field of View (here abbreviated as hFoV) of your panorama. This works even for 360 degree panoramas.

Steps

Pano editor and pano settings in PTGui
Pano editor and lens settings for 360 degree in PTGui
Arc formed 360 degree panorama © Erik Krause
  • Open PTGui, choose Advanced mode and load your cylindrical image on Source Images tab page. Note down the pixel sizes. In our example these are 4254x400 pixels.
  • On Lens Settings tab page choose Cylindrical from the Lens type list, set Hor. Field of View to the field of view of your panorama (120 degrees in our example). Click Restore defaults in the Advanced frame in order to set all lens correction parameters to 0.0. Get your calculator. Use the following formula (provided by Rik Littlefield - many thanks):

In the example case this is


Enter the result as a negative value in the vert.(e) Image shift field (-2031 in the example case).

  • On Panorama Settings tab page choose Projection: Rectilinear and set Field of View to 120 x 120 degrees. This will probably be changed later.
  • On Image parameters tab page click the Pitch field for your image and set it to 90 in order to view straight down.
  • On Create Panorama tab page set the width and file format you want for your output image. One single image is created hence any single image format is good. Don't forget the image name. Choose Stitch using: Panorama Tools (PTStitcher) from the Advanced frame and uncheck Use fast transform.
  • Open panorama editor (Ctrl+E) and adjust panorama width and height using the sliders such that it contains the whole arc. Occasionally PTGui fails to display the arc correctly in pano editor. In this case you need to calculate the appropriate values. See below for details.
  • On Create Panorama tab page check the output size and click Create panorama.

You might want to crop the result image in your image editor in order to get rid of the black space.

Tweaks

Since the source panorama is arched, the pixels have to be compressed at the inner side and stretched at the outer side. There is a line in the middle where there is no stretching or compression. In most cases it is desirable that this line is the horizon which is assumed to be half way between upper and lower edge of the panorama. If you want this line to be somewhere else simply use a different image shift (e) value. For example -2231 will shift 200 pixels further down (nearer to the center of the result image) than -2031 and create a smaller and narrower arc.

The above calculation


actually calculates the virtual radius (half of the diameter of the cylinder it is projected on) of the cylindrical source image in pixels. We will need this value r for the following calculation.

Result images might get very large large since they have to be symmetrical to the center point of the arcs circle, which requires a lot of black space especially if the source panorama HFoV is low. Occasionally PTGui pano editor doesn't show the correct result image (although PTStitcher will create the arc correctly) making it impossible to adjust the panorama size manually.

In both cases it might be interesting to create the minimum possible size that covers the whole arc. Since Fit Panorama (in PTGui pano editor) fails in this case we need to calculate the values ourselves.

The minimal vertical FoV value that will cover the whole arc can be calculated by


where e is the positive Image shift you entered in the vert.(e) Image shift field as a negative value and r is the radius from two paragraphs above. In our example:


rvFoV (for result vertical Field of View).

If your source FoV is lower than 180 degree like in our example the resulting horizontal Field of View (rhFoV) can be lower than the vertical FoV (rvFoV). This can be calculated by


In our example


It is advisable to choose slightly larger values for both horizontal and vertical result FoV in order not to loose any pixels.