Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Applies vertical perspective correction to an angular panoramic image. |
last modified: November 29, 2023
USAGE: pano2rect [-v vtop,vbot] [-p pfov] [-f format] [-i iyc] [-o oyc] [-h height] [-vp vpmethod] [-b bgcolor] infile outfile
-v .... vtop,vbot ....... vertical viewing angles corresponding to the PURPOSE: To apply vertical perspective correction to an angular panoramic image DESCRIPTION: PANO2RECT applies vertical perspective correction to an angular panoramic image. The output formats are either tilt or leve. These describe only the vertical format for the output image. The horizontal format will not be changed. For tilt format, the output will be a tilted view with the look direction towards the mid row of the input panoramic image. For level format, the perspective will be looking horizontally. ARGUMENTS: -v vtop,vbot ... VTOP,VBOT are the vertical viewing angles at the top and bottom of the input panorama image. The default is 90,0 which corresponds to a 90 degree vertical range of view, i.e. zenith to horizon. -p pfov ... PFOV is the vertical output perspective image field of view in degrees. Values are floats in the range 0<pfov<180. The default is to use the vertical viewing range of the fisheye image, which is vrange = (vrad-vcen) = ifov/2 (half of the field of view across the circular diameter). The amount of input image in the output perspective image will depend upon the pfov parameter. Note that in comparison, a value of 27 degrees corresponds to a vertical field of view from a 35 mm camera (film size 36mm x 24mm) with a 50mm focal length lens, i.e. a "normal" view. -f format ... FORMAT is the output image perspective format. The choices are: tilt (T) and level (L). The default is tilt. If tilt (T) is chosen, then the output image will have perspective correction applied in the vertical direction and the image will be centered by default about the mid-angle of the panorama image, i.e., vertical center of the panorama. In other words a tilted vertical perspective will be produced. If level (L) is chosen, then the output image will also have perspective correction applied in the vertical direction. But the view will be one that is not tilted, but looking horizontally. The horizon line will default to the bottom of the output image (assuming that the top row of the panorama image is looking above the horizon). -i iyc ... IYC is the pixel coordinates in the input panorama image that will be the center of the perspective correction. The default is the center row of the panorama image. Values are non-negative floats. -o oyc ... OYC is the pixel coordinates in the output perspective image that will be the center of the perspective correction. The default is the center row of the perspective image for format=tilt and the bottom row of the perspective image for format=level (assuming that the top row of the panorama image is looking above the horizon). Values are non-negative floats. -h height ... HEIGHT is the desired height of the perspective image. The default is the same as the input. Values larger than the input may be useful in showing more of the image when a level perspective is used. Values other than the default will not change the scale of the perspective image in the vertical dimension. They will only allow more (or less) data to be viewed. -vp vpmethod ... VPMETHOD is the virtual-pixel method. Any valid IM virtual-pixel setting is allowed. The default is black. -b bgcolor ... BGCOLOR is the background color to use with vpmethod=background. Any valid IM color may be used. The default is black. NOTE: This script uses -fx and therefore will be rather slow. CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
Panoramic Image From Hyperwide Fisheye Image |
||
Original Fisheye With Direction For Center Of Panorama |
||
Panorama Image Generated From Fisheye |
||
Tilt Perspective Correction: |
Panoramic Image From Hyperwide Fisheye Image |
||
Original Fisheye Image With Direction For Center Of Panorama |
||
Panorama Image Generated From Fisheye |
||
Tilt Perspective Correction: |
||
Level Perspective Correction: |
||
Level Perspective Correction With Extra Height: |
What the script does is as follows:
This is equivalent to the following IM commands for the case of a
|