PINTERP(1)                                                          PINTERP(1)



NNAAMMEE
       pinterp - interpolate/extrapolate view from pictures

SSYYNNOOPPSSIISS
       ppiinntteerrpp  [  view options ][ --tt tthhrreesshhoolldd ][ --zz zzoouutt ][ --ff _t_y_p_e ][ --BB ][
       --aa||qq ][ --ee eexxppoossuurree ][ --nn ] ppiiccttffiillee zzssppeecc ....

DDEESSCCRRIIPPTTIIOONN
       _P_i_n_t_e_r_p interpolates or extrapolates a new view from one or more  RADI-
       ANCE  pictures  and sends the result to the standard output.  The input
       picture files must contain correct view specifications,  as  maintained
       by  _r_p_i_c_t_(_1_)_, _r_v_u_(_1_)_, _p_f_i_l_t_(_1_) and _p_i_n_t_e_r_p_.  Specifically, _p_i_n_t_e_r_p will
       not work on pictures processed by _p_c_o_m_p_o_s_(_1_) or _p_c_o_m_b_(_1_)_.   Each  input
       file must be accompanied by a z specification, which gives the distance
       to each pixel in the image.  If  _z_s_p_e_c  is  an  existing  file,  it  is
       assumed  to contain a short floating point number for each pixel, writ-
       ten in scanline order.  This file is usually generated by the _-_z option
       of _r_p_i_c_t_(_1_)_.  If _z_s_p_e_c is a positive number rather than a file, it will
       be used as a constant value for the corresponding image.  This  may  be
       useful  for  certain transformations on "flat" images or when the view-
       point remains constant.

       The _-_n option specifies that input and output z distances are along the
       view  direction, rather than absolute distances to intersection points.
       This option is usually appropriate with a constant z specification, and
       should not be used with _r_p_i_c_t_(_1_) z files.

       The  _-_z  option writes out interpolated z values to the specified file.
       Normally, this information is thrown away.

       _P_i_n_t_e_r_p rearranges the pixels from the input pictures to produce a rea-
       sonable  estimate  of  the desired view.  Pixels that map within the _-_t
       threshold of each other (.02 times the z distance by default) are  con-
       sidered  coincident.   With  the  _-_a option, image points that coincide
       will be averaged together, giving a smooth result.  The _-_q option turns
       averaging  off,  which  means  that  the first mapped pixel for a given
       point will be used.  This makes the program run faster  and  take  less
       memory,  but  at the expense of image quality.  By default, two or more
       pictures are averaged together, and a single picture  is  treated  with
       the  faster  algorithm.  This may be undesirable when a quick result is
       desired from multiple input pictures in the first  case,  or  a  single
       picture is being reduced in size (anti-aliased) in the second case.

       Portions  which  were  hidden  or missing in the input pictures must be
       "filled in" somehow, and a number of methods are  provided  by  the  _-_f
       option.   The  default  value  for this option is _-_f_a_, which results in
       both foreground and background filling.  The foreground fill  algorithm
       spreads each input pixel to cover all output pixels within a parallelo-
       gram corresponding to that pixel's projection in the new view.  Without
       it,  each  input  pixel  contributes  to at most one output pixel.  The
       background algorithm fills in those areas in  the  final  picture  that
       have  not  been filled with foreground pixels.  It does this by looking
       at the boundary surrounding each blank area and  picking  the  farthest
       pixels  to  each  side,  assuming  that this will make a suitable back-
       ground.  The _-_f_f option tells the program to use  only  the  foreground
       fill,  the _-_f_b option says use only background fill, and the _-_f_0 option
       says not to use either fill algorithm.

       Even when both fill algorithms  are  used,  there  may  still  be  some
       unfilled  pixels.   By  default,  these  pixels  are  painted black and
       assigned a z distance of zero.  The _-_f_c option can be  used  to  change
       the  color  used for unfilled pixels, and the _-_f_z option can be used to
       set the z distance (always along the view  direction).   Alternatively,
       the  _-_f_r  option  can  be used to compute these pixels using _r_t_r_a_c_e_(_1_)_.
       The argument to this option is a quoted string containing arguments for
       _r_t_r_a_c_e_.   It  must  contain  the octree used to generate the input pic-
       tures, along with any other options necessary to match the  calculation
       used  for  the  input  pictures.  The _-_f_s option can be used to place a
       limit on the distance (in pixels) over which the background fill  algo-
       rithm is used.  The default value for this option is 0, which is inter-
       preted as no limit.  A value of 1 is equivalent to  turning  background
       fill  off.   When combined with the _-_f_r option, this is roughly equiva-
       lent to the _-_p_s option of _r_p_i_c_t_(_1_)_.

       In order of increasing quality and cost, one can  use  the  _-_f_a  option
       alone,  or the _-_f_r option paired with _-_f_s or _-_f_f or _-_f_0_.  The last com-
       bination will result in the recalculation of all pixels not  adequately
       accounted  for  in the input pictures, with an associated computational
       expense.  It is rare that the _-_f_s option results in  appreciable  image
       degradation,  so it is usually the second combination that is used when
       the background fill algorithm results in objectionable artifacts.

       The _-_B option may be used to average multiple views read from the stan-
       dard  input  into a single, blurred output picture.  This is similar to
       running _p_i_n_t_e_r_p multiple times and averaging the output together with a
       program  like  _p_c_o_m_b_(_1_)_.   This  option is useful for simulating motion
       blur and depth of  field.   (See  _p_m_d_b_l_u_r_(_1_)_._)   The  input  views  are
       reported  in  the information header of the output file, along with the
       averaged view.  The picture dimensions computed  from  the  first  view
       will  be  the ones used, regardless whether or not the subsequent views
       agree.  (The reported pixel aspect ratio in the  output  is  determined
       from  these  original dimensions and the averaged view.)  Note that the
       expense of the _-_f_r option is proportional to the number of  views  com-
       puted,  and  the  _-_z  output file will be the z-buffer of the last view
       interpolated rather than an averaged distance map.

       In general, _p_i_n_t_e_r_p performs well when the output view  is  flanked  by
       two nearby input views, such as might occur in a walk-through animation
       sequence.  The algorithms start to break down when  there  is  a  large
       difference between the view desired and the view(s) provided.  Specifi-
       cally, obscured objects may appear to have  holes  in  them  and  large
       areas at the image borders may not be filled by the foreground or back-
       ground algorithms.  Also, specular reflections and highlights will  not
       be  interpolated  very well, since their view-dependent appearance will
       be incompletely compensated for by the program.  (The _-_a option  offers
       some benefit in this area.)

       The _-_e option may be used to adjust the output image exposure, with the
       same specification given as for _p_f_i_l_t_.  The actual adjustment  will  be
       rounded to the nearest integer f-stop if the _-_q option is in effect (or
       there is only a single input picture).

EEXXAAMMPPLLEE
       To interpolate two frames of a walk-through  animation,  anti-alias  to
       512x400 and increase the exposure by 2.5 f-stops:

         pinterp  -vf 27.vf -a -x 512 -y 400 -e +2.5 30.hdr 30.z 20.hdr 20.z >
         27.hdr

       To extrapolate a second eyepoint for  a  stereo  pair  and  recalculate
       background regions:

         pinterp -vf right.vf -ff -fr "-av .1 .1 .1 scene.oct" left.hdr left.z
         > right.hdr

       To convert an angular fisheye to a hemispherical fisheye:

         pinterp -vf fish.hdr -vth -ff fish.hdr 1 > hemi.hdr

AAUUTTHHOORR
       Greg Ward

SSEEEE AALLSSOO
       getinfo(1), pdfblur(1), pfilt(1), pmblur(1), pmdblur(1), rpict(1), ran-
       imate(1), rtrace(1), rvu(1)



RADIANCE                            1/24/96                         PINTERP(1)
