
    9i                         S SK rS SKJr  SSKJr  SSKJr   S SK J	r	  S/r\R                  " \R                  " S5      5      rSS\R                   4S	 jrg! \
 a	    S SKJ	r	   NFf = f)
    N   )rgb2gray)img_as_float)	AxisErrorblur_effect      c           
         Ub#   [         R                  " XS5      n [        U 5      n U R                  n[        U 5      n U R                  n/ nSSK	J
n  [        U Vs/ s H  n[        SUS-
  5      PM     sn5      n	[        U5       H  n
[        R                  " XU
S9n[         R                   " U" X
S95      n[         R                   " U" XS95      n[         R"                  " [$        U5      n[         R"                  " [$        U5      n[         R"                  " SX-
  5      n[         R&                  " X   5      n[         R&                  " X   5      nUR)                  [         R                   " UU-
  5      U-  5        M     Uc  U$ U" U5      $ ! [         a    [        S5        e [         a    [        S5        e f = fs  snf )	a  Compute a metric that indicates the strength of blur in an image
(0 for no blur, 1 for maximal blur).

Parameters
----------
image : ndarray
    RGB or grayscale nD image. The input image is converted to grayscale
    before computing the blur metric.
h_size : int, optional
    Size of the re-blurring filter.
channel_axis : int or None, optional
    If None, the image is assumed to be grayscale (single-channel).
    Otherwise, this parameter indicates which axis of the array
    corresponds to color channels.
reduce_func : callable, optional
    Function used to calculate the aggregation of blur metrics along all
    axes. If set to None, the entire list is returned, where the i-th
    element is the blur metric along the i-th axis.

Returns
-------
blur : float (0 to 1) or list of floats
    Blur metric: by default, the maximum of blur metrics along all axes.

Notes
-----
`h_size` must keep the same value in order to compare results between
images. Most of the time, the default size (11) is enough. This means that
the metric can clearly discriminate blur up to an average 11x11 filter; if
blur is higher, the metric still gives good results but its values tend
towards an asymptote.

References
----------
.. [1] Frederique Crete, Thierry Dolmiere, Patricia Ladret, and Marina
   Nicolas "The blur effect: perception and estimation with a new
   no-reference perceptual blur metric" Proc. SPIE 6492, Human Vision and
   Electronic Imaging XII, 64920I (2007)
   https://hal.archives-ouvertes.fr/hal-00232709
   :DOI:`10.1117/12.702790`
z6channel_axis must be one of the image array dimensionszchannel_axis must be an integerr   )sobelr   )axisr   )npmoveaxisr   print	TypeErrorr   ndimr   shapefiltersr   tupleslicerangendiuniform_filter1dabsmaximum_EPSILONsumappend)imageh_sizechannel_axisreduce_funcn_axesr   Br   sslicesaxfilt_imim_sharpim_blurTM1M2s                    \/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/measure/_blur_effect.pyr   r      sv   V 	KKR8E ZZFEKKE
AU3UE!QUOU34FFm&&u2>66%/0&&w01 ::h1**Xw/JJq(,-VVH$%VVAI	R2%&  #17Q7;  	JK 	34	 4s   F F<,F9)numpyr   scipy.ndimagendimager   colorr   utilr   r   ImportErrornumpy.exceptions__all__spacingfloat64r   maxr        r.   <module>r<      sa       
+
 / ::bjjm$ !t L8  +*+s   A A%$A%