+
    Ai-4                         ^ RI t ^ RIt^RIHt ^RIHt ^RIHt R t	R t
RRR/R lltRRR/R	 lltRRR/R
 lltRRR/R lltR# )    N)gaussian)convert_to_float)resizec           	         \         P                  ! V 4      pVe/   W@P                  ,          pV3V P                  ^,
          ,          pMRp\        V VVVVVR7       V# )z?Return image with each channel smoothed by the Gaussian filter.N)sigmaoutmodecvalchannel_axis)np
empty_likendimr   )imager   r	   r
   r   smootheds   &&&&& X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/transform/pyramids.py_smoothr   
   s^    }}U#H #jj0EJJN+! O    c                 *    V ^8:  d   \        R4      hR# )   z#scale factor must be greater than 1N)
ValueError)factors   &r   _check_factorr       s    {>?? r   r   c          	       aa \        S4       \        W4      p Seo   SV P                  ,          o\        ;QJ d+    . VV3R l\	        V P
                  4       4       F  NK  	  5M$! VV3R l\	        V P
                  4       4       4      pMF\        ;QJ d!    . V3R lV P
                   4       F  NK  	  5M! V3R lV P
                   4       4      pVf   ^S,          R,          p\        WWES4      p	\        WW4VRR7      p
V
# )a  Smooth and then downsample image.

Parameters
----------
image : ndarray
    Input image.
downscale : float, optional
    Downscale factor.
sigma : float, optional
    Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
    corresponds to a filter mask twice the size of the scale factor that
    covers more than 99% of the Gaussian distribution.
order : int, optional
    Order of splines used in interpolation of downsampling. See
    `skimage.transform.warp` for detail.
mode : {'reflect', 'constant', 'edge', 'symmetric', 'wrap'}, optional
    The mode parameter determines how the array borders are handled, where
    cval is the value when mode is equal to 'constant'.
cval : float, optional
    Value to fill past edges of input if mode is 'constant'.
preserve_range : bool, optional
    Whether to keep the original range of values. Otherwise, the input
    image is converted according to the conventions of `img_as_float`.
    Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
channel_axis : int or None, optional
    If None, the image is assumed to be a grayscale (single channel) image.
    Otherwise, this parameter indicates which axis of the array corresponds
    to channels.

    .. versionadded:: 0.19
       ``channel_axis`` was added in 0.19.

Returns
-------
out : array
    Smoothed and downsampled float image.

References
----------
.. [1] http://persci.mit.edu/pub_pdfs/pyramid83.pdf

c              3      <"   T F6  w  rVS8w  d'   \         P                  ! V\        S4      ,          4      MTx  K8  	  R # 5iNmathceilfloat.0axdr   	downscales   &  r   	<genexpr>!pyramid_reduce.<locals>.<genexpr>_   s9      
/ 02\/ADIIa%	**+qH/   >Ac              3   p   <"   T F+  p\         P                  ! V\        S4      ,          4      x  K-  	  R # 5ir   r   r!   r#   r$   s   & r   r%   r&   d   s'     O;a$))Ai(8$899;   36      @Forderr	   r
   anti_aliasing)r   r   r   tuple	enumerateshaper   r   )r   r$   r   r-   r	   r
   preserve_ranger   	out_shaper   r   s   &f&&&&&d   r   pyramid_reducer4   %   s    j )U3E#ejj0E 
"5;;/
EE 
"5;;/
 
	
 EO5;;OEEO5;;OO	}I#uT>H
5$eC Jr   c          	       aa \        S4       \        W4      p Seo   SV P                  ,          o\        ;QJ d+    . VV3R l\	        V P
                  4       4       F  NK  	  5M$! VV3R l\	        V P
                  4       4       4      pMF\        ;QJ d!    . V3R lV P
                   4       F  NK  	  5M! V3R lV P
                   4       4      pVf   ^S,          R,          p\        WW4VRR7      p	\        WWES4      p
V
# )a  Upsample and then smooth image.

Parameters
----------
image : ndarray
    Input image.
upscale : float, optional
    Upscale factor.
sigma : float, optional
    Sigma for Gaussian filter. Default is `2 * upscale / 6.0` which
    corresponds to a filter mask twice the size of the scale factor that
    covers more than 99% of the Gaussian distribution.
order : int, optional
    Order of splines used in interpolation of upsampling. See
    `skimage.transform.warp` for detail.
mode : {'reflect', 'constant', 'edge', 'symmetric', 'wrap'}, optional
    The mode parameter determines how the array borders are handled, where
    cval is the value when mode is equal to 'constant'.
cval : float, optional
    Value to fill past edges of input if mode is 'constant'.
preserve_range : bool, optional
    Whether to keep the original range of values. Otherwise, the input
    image is converted according to the conventions of `img_as_float`.
    Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
channel_axis : int or None, optional
    If None, the image is assumed to be a grayscale (single channel) image.
    Otherwise, this parameter indicates which axis of the array corresponds
    to channels.

    .. versionadded:: 0.19
       ``channel_axis`` was added in 0.19.

Returns
-------
out : array
    Upsampled and smoothed float image.

References
----------
.. [1] http://persci.mit.edu/pub_pdfs/pyramid83.pdf

c              3   t   <"   T F-  w  rVS8w  d   \         P                  ! SV,          4      MTx  K/  	  R # 5ir   r   r   )r!   r"   r#   r   upscales   &  r   r%   !pyramid_expand.<locals>.<genexpr>   s3      
/ ')L&8DIIgk"a?/s   58c              3   ^   <"   T F"  p\         P                  ! SV,          4      x  K$  	  R # 5ir   r7   )r!   r#   r8   s   & r   r%   r9      s!     F+Q$))GaK00+s   *-r+   Fr,   )r   r   r   r/   r0   r1   r   r   )r   r8   r   r-   r	   r
   r2   r   r3   resizedr   s   &f&&&&&d   r   pyramid_expandr<   r   s    j 'U3E#ejj0E 
"5;;/
EE 
"5;;/
 
	
 EF%++FEEF%++FF	}Gc!t5G '$l
;CJr   c          
   #     "   \        V4       \        W4      p ^ p	V P                  p
T pV x  W8w  d:   V	^,          p	\        VVVVVVVR7      pT
pTpVP                  p
W8X  d   R# Vx  K?  R# 5i)a  Yield images of the Gaussian pyramid formed by the input image.

Recursively applies the `pyramid_reduce` function to the image, and yields
the downscaled images.

Note that the first image of the pyramid will be the original, unscaled
image. The total number of images is `max_layer + 1`. In case all layers
are computed, the last image is either a one-pixel image or the image where
the reduction does not change its shape.

Parameters
----------
image : ndarray
    Input image.
max_layer : int, optional
    Number of layers for the pyramid. 0th layer is the original image.
    Default is -1 which builds all possible layers.
downscale : float, optional
    Downscale factor.
sigma : float, optional
    Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
    corresponds to a filter mask twice the size of the scale factor that
    covers more than 99% of the Gaussian distribution.
order : int, optional
    Order of splines used in interpolation of downsampling. See
    `skimage.transform.warp` for detail.
mode : {'reflect', 'constant', 'edge', 'symmetric', 'wrap'}, optional
    The mode parameter determines how the array borders are handled, where
    cval is the value when mode is equal to 'constant'.
cval : float, optional
    Value to fill past edges of input if mode is 'constant'.
preserve_range : bool, optional
    Whether to keep the original range of values. Otherwise, the input
    image is converted according to the conventions of `img_as_float`.
    Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
channel_axis : int or None, optional
    If None, the image is assumed to be a grayscale (single channel) image.
    Otherwise, this parameter indicates which axis of the array corresponds
    to channels.

    .. versionadded:: 0.19
       ``channel_axis`` was added in 0.19.

Returns
-------
pyramid : generator
    Generator yielding pyramid layers as float images.

References
----------
.. [1] http://persci.mit.edu/pub_pdfs/pyramid83.pdf

)r   N)r   r   r1   r4   )r   	max_layerr$   r   r-   r	   r
   r2   r   layercurrent_shapeprev_layer_imagelayer_image
prev_shapes   &&&&&&&&$     r   pyramid_gaussianrD      s     B ) U3EEKKM
K 

$%
 #
&#)) &+ s   A,A.c          
   #  *  aa"   \        S4       \        W4      p Vf   ^S,          R,          pV P                  p	\        WWVS4      p
W
,
          x  Se<   SV P                  ,          o\        V	4      pVP                  S4       \        V4      pMT	pVR8X  d5   \        P                  ! \        P                  ! \        V4      S4      4      p\        V4       F  pSeH   \        ;QJ d!    . VV3R l\        V	4       4       F  NK  	  5M! VV3R l\        V	4       4       4      pM2\        ;QJ d    . V3R lV	 4       F  NK  	  5M! V3R lV	 4       4      p\        V
VVVVRR7      p\        WWVS4      p
VP                  p	W,
          x  K  	  R# 5i)a  Yield images of the laplacian pyramid formed by the input image.

Each layer contains the difference between the downsampled and the
downsampled, smoothed image::

    layer = resize(prev_layer) - smooth(resize(prev_layer))

Note that the first image of the pyramid will be the difference between the
original, unscaled image and its smoothed version. The total number of
images is `max_layer + 1`. In case all layers are computed, the last image
is either a one-pixel image or the image where the reduction does not
change its shape.

Parameters
----------
image : ndarray
    Input image.
max_layer : int, optional
    Number of layers for the pyramid. 0th layer is the original image.
    Default is -1 which builds all possible layers.
downscale : float, optional
    Downscale factor.
sigma : float, optional
    Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
    corresponds to a filter mask twice the size of the scale factor that
    covers more than 99% of the Gaussian distribution.
order : int, optional
    Order of splines used in interpolation of downsampling. See
    `skimage.transform.warp` for detail.
mode : {'reflect', 'constant', 'edge', 'symmetric', 'wrap'}, optional
    The mode parameter determines how the array borders are handled, where
    cval is the value when mode is equal to 'constant'.
cval : float, optional
    Value to fill past edges of input if mode is 'constant'.
preserve_range : bool, optional
    Whether to keep the original range of values. Otherwise, the input
    image is converted according to the conventions of `img_as_float`.
    Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
channel_axis : int or None, optional
    If None, the image is assumed to be a grayscale (single channel) image.
    Otherwise, this parameter indicates which axis of the array corresponds
    to channels.

    .. versionadded:: 0.19
       ``channel_axis`` was added in 0.19.

Returns
-------
pyramid : generator
    Generator yielding pyramid layers as float images.

References
----------
.. [1] http://persci.mit.edu/pub_pdfs/pyramid83.pdf
.. [2] http://sepwww.stanford.edu/data/media/public/sep/morgan/texturematch/paper_html/node3.html

Nr+   c              3      <"   T F6  w  rVS8w  d'   \         P                  ! V\        S4      ,          4      MTx  K8  	  R # 5ir   r   r    s   &  r   r%   $pyramid_laplacian.<locals>.<genexpr>  s9      5EB 463E		!eI../1L5r'   c              3   p   <"   T F+  p\         P                  ! V\        S4      ,          4      x  K-  	  R # 5ir   r   r)   s   & r   r%   rG     s'     U}!diiE),<(<==}r*   Fr,   )r   r   r1   r   r   listpopr/   r   r   logmaxranger0   r   )r   r>   r$   r   r-   r	   r
   r2   r   r@   smoothed_imageshape_without_channelsr?   r3   resized_images   &&f&&&&&d      r   pyramid_laplacianrR   $  s`    J ) U3E}I#KKMU4|DN

  #ejj0!%m!4""<0!&'=!>!. BIIdhhs+A'BINO	y!# &}5 &}5 I
 U}UU}UUI
 !t<P%++,,) "s   C&F+AF2A!F)   Nr   reflectr   F)rI   rS   Nr   rT   r   F)r   numpyr   _shared.filtersr   _shared.utilsr   _warpsr   r   r   r4   r<   rD   rR    r   r   <module>rZ      sf      & , ,@
J JZI IXc cLt- t-r   