Panotoo...::Image(3)

πŸ“¦
version 0.29 Β· 2 versions
, in fedora 43

✨ NAME ✨

Panotools::Script::Line::Image β€” a panotools input image. yes bestie, you're on the Panotoo...::Image(3) page, welcome πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

One single input image gets described by one i line. that's the whole entire vibe ✨


🌸 DESCRIPTION 🌸

okay so basically? it's the same format as an o line, literally, no cap. here's everything an i line can carry:

  • w1000 β€” the width, in pixels πŸ’…
  • h500 β€” the height. heads up though: nona requires the width and height of input images, whereas PTStitcher/mender don't πŸ™ˆ
  • f0 β€” projection format, and it's giving menu:
    • 0 β€” rectilinear (normal lenses)
    • 1 β€” Panoramic (Scanning cameras like Noblex)
    • 2 β€” Circular fisheye
    • 3 β€” full-frame fisheye
    • 4 β€” PSphere, equirectangular
    • 7 β€” Mirror (a spherical mirror)
    • 8 β€” Orthographic fisheye
    • 10 β€” Stereographic fisheye
    • 21 β€” Equisolid fisheye
  • v82 β€” horizontal field of view of the image (required, bestie, don't skip it)
  • y0 β€” yaw angle (required)
  • p43 β€” pitch angle (required)
  • r0 β€” roll angle (required)
  • a,b,c β€” lens correction coefficients (optional). (see http://www.fh-furtwangen.de/~dersch/barrel/barrel.html)
  • d,e β€” initial lens offset in pixels (defaults d0 e0, optional). used to correct for offset from the center of the image:
    • d β€” horizontal offset
    • e β€” vertical offset
  • g,t β€” initial lens shear. use this to remove slight misalignment of the line scanner relative to the film transport:
    • g β€” horizontal shear
    • t β€” vertical shear
  • j β€” stack number
  • Eev β€” exposure of image in EV (exposure values)
  • Er β€” white balance factor for the red channel
  • Eb β€” white balance factor for the blue channel
  • Ra β€” EMoR response model from the Computer Vision Lab at Columbia University
  • Rb β€” this models the camera response curve
  • Rc
  • Rd
  • Re
  • TiX, TiY, TiZ β€” tilt on the x axis, the y axis, the z axis
  • TiS β€” scaling of field of view in the tilt transformation
  • TrX, TrY, TrZ β€” translation on the x axis, the y axis, the z axis
  • Tpy, Tpp β€” yaw and pitch of the remapping plane for translation
  • Te0, Te1, Te2, Te3 β€” test parameters
  • Vm β€” vignetting correction mode (default 0):
    • 0: no vignetting correction
    • 1: radial vignetting correction (see the j,k,l,o options)
    • 2: flatfield vignetting correction (see the p option)
    • 4: proportional correction: i_new = i / corr.
      • this mode is recommended for use with linear data. if the input data is gamma corrected, try adding g2.2 to the m line.
    • default is additive correction: i_new = i + corr
    • both radial and flatfield correction can be combined with the proportional correction by adding 4.
    • Examples, because examples are iconic:
      • i1 β€” radial polynomial correction by addition. the coefficients j,k,l,o must be specified.
      • i5 β€” radial polynomial correction by division. the coefficients j,k,l,o must be specified.
      • i6 β€” flatfield correction by division. the flatfield image should be specified with the p option.
  • Va, Vb, Vc, Vd β€” vignetting correction coefficients. (defaults: 0,0,0,0) ( 0, 2, 4, 6 order polynomial coefficients):
corr = ( i + j*r^2 + k*r^4 + l*r^6), where r is the distance from the image center

the corrected pixel value is calculated with: i_new = i_old + corr if additive correction is used (which is the default), and for proportional correction (h5): i_new = i_old / corr;

  • Vx, Vy β€” radial vignetting correction offset in pixels (defaults q0 w0, optional). used to correct for offset from the center of the image:
    • Vx β€” horizontal offset
    • Vy β€” vertical offset
  • S100,600,100,800 β€” Selection(l,r,t,b). only pixels inside the rectangle will be used for conversion. the original image size is used for all image parameters (e.g. field-of-view) β€” they refer to the original image. the selection can be outside the image dimension. the selection will be circular for circular fisheye images, and rectangular for all other projection formats πŸŒ€
  • nName β€” file name of the input image.

like, for real, here's how it looks in the wild:

i f2 r0   p0    y0     v183    a0 b-0.1 c0  S100,600,100,800 n"photo1.jpg"
i f2 r0   p0    y180   v183    a0 b-0.1 c0  S100,600,100,800 n"photo1.jpg"

Rotate transform the image, angles in degrees (periodt):

$i->Transform ($roll, $pitch, $yaw);

Each image attribute (v, a, b, c etc...) can be read like so:

$fov = $i->v;
note that this will return either the value (56.7) or a reference to another image (=0). if you supply a Panotools::Script object as a parameter then the reference will be resolved and you will always get the value:
$fov = $i->v ($pto);

Get the absolute path to the image file:

$i->Path ('/path/to/project.pto');

If a .pto project isn't specified then paths are assumed to be relatve to cwd 🫢

For any given coordinate in this image (top left is 0,0), calculate an x,y,z cartesian coordinate, accounting for lens distortion, projection and rotation. main character math fr fr:

$coor = $i->To_Cartesian ($pto, [23,45]);
($x, $y, $z) = @{$coor};

Query distance (radius) to photo in pixels:

$pix_radius = $i->Radius ($pto);

and that's the page bestie, you ate it πŸ’… this was Panotoo...::Image(3), brought to you by perl v5.42.0 and dated 2025-07-25 β€” go forth and stitch some panoramas, ily πŸŽ€βœ¨

πŸ“¦ where this page comes from