+
    Ai`                     r    R t ^ RIt^ RIHt ^RIHt ^RIH	t	 R t
R tR	R lt^^
^]P                  3R ltR# )
z(Common tools to optical flow algorithms.N)ndimage)pyramid_reduce)_convertc                z    VP                  4       p\        V 4       F  w  r4W#R3;;,          V,          uu&   K  	  V# )a  Compute warp point coordinates.

Parameters
----------
grid : iterable
    The sparse grid to be warped (obtained using
    ``np.meshgrid(..., sparse=True)).``)
flow : ndarray
    The warping motion field.

Returns
-------
out : ndarray
    The warp point coordinates.

.)copy	enumerate)gridflowoutidxgs   &&   f/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/registration/_optical_flow_utils.py_get_warp_pointsr   
   s4    " ))+CD/H "J    c           	     V   \        WP                  R,          4       UUu. uF  w  r#W#,          NK  	  ppp\        P                  ! W@P                  R7      pV F  pVR\        P
                  3,          pK  	  V\        P                  ! V ^.V,           ^ RRR7      ,          pV# u uppi )am  Rescale the values of the vector field (u, v) to the desired shape.

The values of the output vector field are scaled to the new
resolution.

Parameters
----------
flow : ndarray
    The motion field to be processed.
shape : iterable
    Couple of integers representing the output shape.

Returns
-------
rflow : ndarray
    The resized and rescaled motion field.

   NNdtype.nearestF)ordermode	prefilter)zipshapenparrayr   newaxisndizoom)r	   r   noscalescale_factor_rflows   &&      r   _resize_flowr&   !   s    (  #5**R.9:9tqQUU9E:88E4L#CO4  388qcEke E L ;s   B%c                    V .p\        V P                  4      p^pWb8  dT   WQV,          8  dG   \        VR,          VRR7      pVP                  V4       \        VP                  4      pV^,          pKY  VRRR1,          # )az  Construct image pyramid.

Parameters
----------
I : ndarray
    The image to be preprocessed (Grayscale or RGB).
downscale : float
    The pyramid downscale factor.
nlevel : int
    The maximum number of pyramid levels.
min_size : int
    The minimum size for any dimension of the pyramid levels.

Returns
-------
pyramid : list[ndarray]
    The coarse to fine images pyramid.

N)channel_axis)minr   r   append)I	downscalenlevelmin_sizepyramidsizecountJs   &&&&    r   _get_pyramidr4   B   sn    * cGqww<DE>8'; ;72;	Eq177|
4R4=r   c                t   V P                   VP                   8w  d   \        R4      h\        P                  ! V4      P                  R9  d   \        R4      h\        \        \        \        W4      W4V4      \        \        W4      W4V4      4      4      p\        P                  ! V^ ,          ^ ,          P                  3V^ ,          ^ ,          P                   ,           VR7      pV! V^ ,          ^ ,          V^ ,          ^,          V4      pVR,           F!  w  rV! W\        WP                   4      4      pK#  	  V# )a%  Generic coarse to fine solver.

Parameters
----------
I0 : ndarray
    The first grayscale image of the sequence.
I1 : ndarray
    The second grayscale image of the sequence.
solver : callable
    The solver applied at each pyramid level.
downscale : float
    The pyramid downscale factor.
nlevel : int
    The maximum number of pyramid levels.
min_size : int
    The minimum size for any dimension of the pyramid levels.
dtype : dtype
    Output data type.

Returns
-------
flow : ndarray
    The estimated optical flow components for each axis.

z'Input images should have the same shapeefdgz8Only floating point data type are valid for optical flowr   r   )r   
ValueErrorr   r   charlistr   r4   r   zerosndimr&   )I0I1solverr-   r.   r/   r   r0   r	   J0J1s   &&&&&&&    r   _coarse_to_finerA   d   s    : 
xx288BCC	xx6)VWW",iJ",iJ	
G 88WQZ]'')GAJqM,?,??uMD'!*Q-A5D"++bl4:;  Kr   )g       @
      )__doc__numpyr   scipyr   r   	transformr   
util.dtyper   r   r&   r4   float32rA    r   r   <module>rK      s9    .    & !.BF  Rrzz2r   