
    1-Phl                         d dl Z d dlZd dlmZ d dlmZ ddlm	Z	 ddl
mZmZ ddlmZ ddlmZ dd	lmZ dd
lmZ d Zd ZdddZdddZd Z	 	 	 	 	 dddddZ	 	 	 	 	 	 dddddZ	 	 	 	 	 	 d dddZdS )!    N)spatial   )gaussian)_supported_float_typecheck_nD)integral_image)img_as_float   )_hessian_matrix_det)peak_local_maxc                    | dz  |dz  z   |dz  z
  d| z  |z  z  }t          j        |dd          }t          j        |          }| dz  |dz  z   |dz  z
  d| z  |z  z  }t          j        |dd          }t          j        |          }|  |z   |z   }| |z
  |z   }| |z   |z
  }	| |z   |z   } |dz  |z  |dz  |z  z   dt          j        t          ||z  |	z  | z                      z  z
  }
|
t          j        t          ||          dz  z  z  S )a  
    Compute fraction of surface overlap between two disks of radii
    ``r1`` and ``r2``, with centers separated by a distance ``d``.

    Parameters
    ----------
    d : float
        Distance between centers.
    r1 : float
        Radius of the first disk.
    r2 : float
        Radius of the second disk.

    Returns
    -------
    fraction: float
        Fraction of area of the overlap between the two disks.
    r   r
         ?)npclipmathacossqrtabspimin)dr1r2ratio1acos1ratio2acos2abcareas              T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/feature/blob.py_compute_disk_overlapr$      s-   ( dRUlRU"q1urz2FWVR##FIfEdRUlRU"q1urz2FWVR##FIfE	
R"A	BA	BA	BAq55=2q55=(33q1uqy1};M;M1N1N+NND47c"bkkQ./00    c                     t           j        d| z  z  ||z   | z
  dz  z  | dz  d| z  ||z   z  z   d|dz  |dz  z   z  z
  d|z  |z  z   z  }|dt           j        z  t          ||          dz  z  z  S )a*  
    Compute volume overlap fraction between two spheres of radii
    ``r1`` and ``r2``, with centers separated by a distance ``d``.

    Parameters
    ----------
    d : float
        Distance between centers.
    r1 : float
        Radius of the first sphere.
    r2 : float
        Radius of the second sphere.

    Returns
    -------
    fraction: float
        Fraction of volume of the overlap between the two spheres.

    Notes
    -----
    See for example http://mathworld.wolfram.com/Sphere-SphereIntersection.html
    for more details.
       r         gUUUUUU?)r   r   r   )r   r   r   vols       r#   _compute_sphere_overlapr+   7   s    2 	6	7Q;1
	 a4!a%27##a2q52q5=&99AFRKG	I  'DG#c"bkkQ&6677r%   	sigma_dimc                f   t          |           |z
  }|dk    rdS t          j        |          }| d         |d         cxk    rdk    rn ndS | d         |d         k    r| | d         }d}|d         | d         z  }n|| d         }d}| d         |d         z  }| d|         ||z  z  }|d|         ||z  z  }	t          j        t          j        |	|z
  dz                      }
|
||z   k    rdS |
t          ||z
            k    rdS |dk    rt          |
||          S t          |
||          S )	a  Finds the overlapping area fraction between two blobs.

    Returns a float representing fraction of overlapped area. Note that 0.0
    is *always* returned for dimension greater than 3.

    Parameters
    ----------
    blob1 : sequence of arrays
        A sequence of ``(row, col, sigma)`` or ``(pln, row, col, sigma)``,
        where ``row, col`` (or ``(pln, row, col)``) are coordinates
        of blob and ``sigma`` is the standard deviation of the Gaussian kernel
        which detected the blob.
    blob2 : sequence of arrays
        A sequence of ``(row, col, sigma)`` or ``(pln, row, col, sigma)``,
        where ``row, col`` (or ``(pln, row, col)``) are coordinates
        of blob and ``sigma`` is the standard deviation of the Gaussian kernel
        which detected the blob.
    sigma_dim : int, optional
        The dimensionality of the sigma value. Can be 1 or the same as the
        dimensionality of the blob space (2 or 3).

    Returns
    -------
    f : float
        Fraction of overlapped area (or volume in 3D).
    r(   g        r   r   Nr
   r         ?)lenr   r   r   sumr   r$   r+   )blob1blob2r-   ndim	root_ndim	max_sigmar   r   pos1pos2r   s              r#   _blob_overlapr9   X   sp   6 u::	!Daxxs	$I RyE"I"""""""""s	rU2Y		9*++&	2Yr"9*++&	2Yr"$<9y01D$<9y01D
t)**++A27{{s 	CRLLsqyy$QB/// 'q"b111r%   c                :   | dd| df                                          }d|z  t          j        | j        d         |z
            z  }t	          j        | ddd| f                   }t          j        t          |	                    |                              }t          |          dk    r| S |D ]H\  }}| |         | |         }
}	t          |	|
|          |k    r|	d         |
d         k    rd|
d<   Cd|	d<   It          j        d | D                       S )aX  Eliminated blobs with area overlap.

    Parameters
    ----------
    blobs_array : ndarray
        A 2d array with each row representing 3 (or 4) values,
        ``(row, col, sigma)`` or ``(pln, row, col, sigma)`` in 3D,
        where ``(row, col)`` (``(pln, row, col)``) are coordinates of the blob
        and ``sigma`` is the standard deviation of the Gaussian kernel which
        detected the blob.
        This array must not have a dimension of size 0.
    overlap : float
        A value between 0 and 1. If the fraction of area overlapping for 2
        blobs is greater than `overlap` the smaller blob is eliminated.
    sigma_dim : int, optional
        The number of columns in ``blobs_array`` corresponding to sigmas rather
        than positions.

    Returns
    -------
    A : ndarray
        `array` with overlapping blobs removed.
    Nr   r
   r   r,   r   c                 *    g | ]}|d          dk    |S )r   r    ).0r    s     r#   
<listcomp>z _prune_blobs.<locals>.<listcomp>   s!    9991quqyyQyyyr%   )maxr   r   shaper   cKDTreer   arraylistquery_pairsr0   r9   stack)blobs_arrayoverlapr-   sigmadistancetreepairsijr2   r3   s              r#   _prune_blobsrN      s0   0 I:;;'++--E5y49[%6q%9I%EFFFH?;qqq+I:+~677DHT$**8445566E
5zzQ 	" 	"DAq&q>;q>5EUEY???'II 9uRy(( !E"II !E"I899999:::r%   c                 l   t          |t                    rPt          |          | k    rt          d          |D ]&}t          |t                    st          d          '|dz   S t          |t                    r	|f| z  dz   S |du rt          d          |du rd| dz   z  S t          d| d	          )
zaFormat an ``exclude_border`` argument as a tuple of ints for calling
    ``peak_local_max``.
    zP`exclude_border` should have the same length as the dimensionality of the image.zBexclude border, when expressed as a tuple, must only contain ints.)r   Tzexclude_border cannot be TrueFr
   zUnsupported value (z) for exclude_border)
isinstancetupler0   
ValueErrorint)img_ndimexclude_borderexcludes      r#   _format_exclude_borderrW      s    .%(( U~(**/   & 	 	Ggs++  $  
 $$	NC	(	( U 8+d22	4		8999	5	 	 x!|$$S~SSSTTTr%   2   皙?r   F)threshold_relrU   c                   t          |           } t          | j                  }|                     |d          } t	          j        |          ot	          j                  }	t	          j        |          rt	          j        | j        ||          }t	          j                  rt	          j        | j        |          t	          j        |          t	          j        ||          }dk    rt          d          t          t	          j        t	          j        |z            t	          j                  z  dz                       }
t	          j        fdt          |
dz             D                       }t	          j        | j        |
fz   |          }t#          | |d         d	
          }t%          |dd                   D ]#\  }}t#          | |d	
          }||z
  |d|f<   |}$ddz
  z  }||z  }t'          | j        |          }t)          ||||t	          j        d| j        dz   z                      }|j        dk    r't	          j        d| j        |	rdn| j        z   f          S |                    |          }||dddf                  }|	r|ddddf         }t	          j        |ddddf         |g          }|j        d         }t1          |||          S )u  Finds blobs in the given grayscale image.

    Blobs are found using the Difference of Gaussian (DoG) method [1]_, [2]_.
    For each blob found, the method returns its coordinates and the standard
    deviation of the Gaussian kernel that detected the blob.

    Parameters
    ----------
    image : ndarray
        Input grayscale image, blobs are assumed to be light on dark
        background (white on black).
    min_sigma : scalar or sequence of scalars, optional
        The minimum standard deviation for Gaussian kernel. Keep this low to
        detect smaller blobs. The standard deviations of the Gaussian filter
        are given for each axis as a sequence, or as a single number, in
        which case it is equal for all axes.
    max_sigma : scalar or sequence of scalars, optional
        The maximum standard deviation for Gaussian kernel. Keep this high to
        detect larger blobs. The standard deviations of the Gaussian filter
        are given for each axis as a sequence, or as a single number, in
        which case it is equal for all axes.
    sigma_ratio : float, optional
        The ratio between the standard deviation of Gaussian Kernels used for
        computing the Difference of Gaussians
    threshold : float or None, optional
        The absolute lower bound for scale space maxima. Local maxima smaller
        than `threshold` are ignored. Reduce this to detect blobs with lower
        intensities. If `threshold_rel` is also specified, whichever threshold
        is larger will be used. If None, `threshold_rel` is used instead.
    overlap : float, optional
        A value between 0 and 1. If the area of two blobs overlaps by a
        fraction greater than `threshold`, the smaller blob is eliminated.
    threshold_rel : float or None, optional
        Minimum intensity of peaks, calculated as
        ``max(dog_space) * threshold_rel``, where ``dog_space`` refers to the
        stack of Difference-of-Gaussian (DoG) images computed internally. This
        should have a value between 0 and 1. If None, `threshold` is used
        instead.
    exclude_border : tuple of ints, int, or False, optional
        If tuple of ints, the length of the tuple must match the input array's
        dimensionality.  Each element of the tuple will exclude peaks from
        within `exclude_border`-pixels of the border of the image along that
        dimension.
        If nonzero int, `exclude_border` excludes peaks from within
        `exclude_border`-pixels of the border of the image.
        If zero or False, peaks are identified regardless of their
        distance from the border.

    Returns
    -------
    A : (n, image.ndim + sigma) ndarray
        A 2d array with each row representing 2 coordinate values for a 2D
        image, or 3 coordinate values for a 3D image, plus the sigma(s) used.
        When a single sigma is passed, outputs are:
        ``(r, c, sigma)`` or ``(p, r, c, sigma)`` where ``(r, c)`` or
        ``(p, r, c)`` are coordinates of the blob and ``sigma`` is the standard
        deviation of the Gaussian kernel which detected the blob. When an
        anisotropic gaussian is used (sigmas per dimension), the detected sigma
        is returned for each dimension.

    See also
    --------
    skimage.filters.difference_of_gaussians

    References
    ----------
    .. [1] https://en.wikipedia.org/wiki/Blob_detection#The_difference_of_Gaussians_approach
    .. [2] Lowe, D. G. "Distinctive Image Features from Scale-Invariant
        Keypoints." International Journal of Computer Vision 60, 91–110 (2004).
        https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf
        :DOI:`10.1023/B:VISI.0000029664.99615.94`

    Examples
    --------
    >>> from skimage import data, feature
    >>> coins = data.coins()
    >>> feature.blob_dog(coins, threshold=.05, min_sigma=10, max_sigma=40)
    array([[128., 155.,  10.],
           [198., 155.,  10.],
           [124., 338.,  10.],
           [127., 102.,  10.],
           [193., 281.,  10.],
           [126., 208.,  10.],
           [267., 115.,  10.],
           [197., 102.,  10.],
           [198., 215.,  10.],
           [123., 279.,  10.],
           [126.,  46.,  10.],
           [259., 247.,  10.],
           [196.,  43.,  10.],
           [ 54., 276.,  10.],
           [267., 358.,  10.],
           [ 58., 100.,  10.],
           [259., 305.,  10.],
           [185., 347.,  16.],
           [261., 174.,  16.],
           [ 46., 336.,  16.],
           [ 54., 217.,  10.],
           [ 55., 157.,  10.],
           [ 57.,  41.,  10.],
           [260.,  47.,  16.]])

    Notes
    -----
    The radius of each blob is approximately :math:`\sqrt{2}\sigma` for
    a 2-D image and :math:`\sqrt{3}\sigma` for a 3-D image.
    Fcopydtyper/   zsigma_ratio must be > 1.0r
   c                      g | ]
}|z  z  S r<   r<   )r=   rL   	min_sigmasigma_ratios     r#   r>   zblob_dog.<locals>.<listcomp>l  s"    NNNA9Q7NNNr%   r   reflect)rH   modeN.r(   threshold_absrZ   rU   	footprintr   r,   )r	   r   r_   astyper   isscalarfullr4   asarrayrR   rS   meanlogrB   rangeemptyr@   r   	enumeraterW   r   onessizehstackrN   )imagera   r6   rb   	thresholdrG   rZ   rU   float_dtypescalar_sigmak
sigma_listdog_image_cubegaussian_previousrL   sgaussian_currentsflocal_maximalmsigmas_of_peaksr-   s    ` `                  r#   blob_dogr      s   l E'44KLL5L11E ;y))Dbk).D.DL 
{9 FGEJ	EEE		{9 FGEJ	EEE	 
9K888I
9K888Ic4555 	BGBF9y011BF;4G4GG!KLLMMA NNNNNq1uNNNOOJ
 XekQD0DDDN jm)LLL*QRR.)) - -1#ECCC!25E!EsAv, 
kAo	BbN+EJGGN!#%'$%*q.122  L AxEJ|*K!!LMNNN 
		[	)	)B !aaae!45O 2)!!!QqS&1 
Bqqq#2#vJ0	1	1B%a(IGy9999r%   
   皙?c                \   t          |           } t          | j                  }	|                     |	d          } t	          j        |          rt	          j        |          rdnd}
t	          j        |          rt	          j        | j        ||	          }t	          j        |          rt	          j        | j        ||	          }t	          j        ||	          }t	          j        ||	          }|r?t	          j	        |          }t	          j	        |          }t	          j
        |||          }nt	          j        |||          }t	          j        | j        t          |          fz   |	          }t          |          D ]8\  }}t!          j        | |           t	          j        |          dz  z  |d|f<   9t'          | j        |          }t)          ||||t	          j        d| j        dz   z            	          }|j        d
k    r't	          j        d
| j        |
rdn| j        z   f          S |                    |	          }||dddf                  }|
r|ddd
df         }t	          j        |ddddf         |g          }|j        d         }t1          |||          S )a  Finds blobs in the given grayscale image.

    Blobs are found using the Laplacian of Gaussian (LoG) method [1]_.
    For each blob found, the method returns its coordinates and the standard
    deviation of the Gaussian kernel that detected the blob.

    Parameters
    ----------
    image : ndarray
        Input grayscale image, blobs are assumed to be light on dark
        background (white on black).
    min_sigma : scalar or sequence of scalars, optional
        the minimum standard deviation for Gaussian kernel. Keep this low to
        detect smaller blobs. The standard deviations of the Gaussian filter
        are given for each axis as a sequence, or as a single number, in
        which case it is equal for all axes.
    max_sigma : scalar or sequence of scalars, optional
        The maximum standard deviation for Gaussian kernel. Keep this high to
        detect larger blobs. The standard deviations of the Gaussian filter
        are given for each axis as a sequence, or as a single number, in
        which case it is equal for all axes.
    num_sigma : int, optional
        The number of intermediate values of standard deviations to consider
        between `min_sigma` and `max_sigma`.
    threshold : float or None, optional
        The absolute lower bound for scale space maxima. Local maxima smaller
        than `threshold` are ignored. Reduce this to detect blobs with lower
        intensities. If `threshold_rel` is also specified, whichever threshold
        is larger will be used. If None, `threshold_rel` is used instead.
    overlap : float, optional
        A value between 0 and 1. If the area of two blobs overlaps by a
        fraction greater than `threshold`, the smaller blob is eliminated.
    log_scale : bool, optional
        If set intermediate values of standard deviations are interpolated
        using a logarithmic scale to the base `10`. If not, linear
        interpolation is used.
    threshold_rel : float or None, optional
        Minimum intensity of peaks, calculated as
        ``max(log_space) * threshold_rel``, where ``log_space`` refers to the
        stack of Laplacian-of-Gaussian (LoG) images computed internally. This
        should have a value between 0 and 1. If None, `threshold` is used
        instead.
    exclude_border : tuple of ints, int, or False, optional
        If tuple of ints, the length of the tuple must match the input array's
        dimensionality.  Each element of the tuple will exclude peaks from
        within `exclude_border`-pixels of the border of the image along that
        dimension.
        If nonzero int, `exclude_border` excludes peaks from within
        `exclude_border`-pixels of the border of the image.
        If zero or False, peaks are identified regardless of their
        distance from the border.

    Returns
    -------
    A : (n, image.ndim + sigma) ndarray
        A 2d array with each row representing 2 coordinate values for a 2D
        image, or 3 coordinate values for a 3D image, plus the sigma(s) used.
        When a single sigma is passed, outputs are:
        ``(r, c, sigma)`` or ``(p, r, c, sigma)`` where ``(r, c)`` or
        ``(p, r, c)`` are coordinates of the blob and ``sigma`` is the standard
        deviation of the Gaussian kernel which detected the blob. When an
        anisotropic gaussian is used (sigmas per dimension), the detected sigma
        is returned for each dimension.

    References
    ----------
    .. [1] https://en.wikipedia.org/wiki/Blob_detection#The_Laplacian_of_Gaussian

    Examples
    --------
    >>> from skimage import data, feature, exposure
    >>> img = data.coins()
    >>> img = exposure.equalize_hist(img)  # improves detection
    >>> feature.blob_log(img, threshold = .3)
    array([[124.        , 336.        ,  11.88888889],
           [198.        , 155.        ,  11.88888889],
           [194.        , 213.        ,  17.33333333],
           [121.        , 272.        ,  17.33333333],
           [263.        , 244.        ,  17.33333333],
           [194.        , 276.        ,  17.33333333],
           [266.        , 115.        ,  11.88888889],
           [128.        , 154.        ,  11.88888889],
           [260.        , 174.        ,  17.33333333],
           [198.        , 103.        ,  11.88888889],
           [126.        , 208.        ,  11.88888889],
           [127.        , 102.        ,  11.88888889],
           [263.        , 302.        ,  17.33333333],
           [197.        ,  44.        ,  11.88888889],
           [185.        , 344.        ,  17.33333333],
           [126.        ,  46.        ,  11.88888889],
           [113.        , 323.        ,   1.        ]])

    Notes
    -----
    The radius of each blob is approximately :math:`\sqrt{2}\sigma` for
    a 2-D image and :math:`\sqrt{3}\sigma` for a 3-D image.
    Fr\   Tr^   r   .re   r
   rf   r   Nr   r,   )r	   r   r_   ri   r   rj   rk   r4   rl   log10logspacelinspacerp   r@   r0   rq   ndigaussian_laplacerm   rW   r   rr   rs   rt   rN   )ru   ra   r6   	num_sigmarv   rG   	log_scalerZ   rU   rw   rx   startstoprz   
image_cuberL   r}   r   r   r   r-   s                        r#   blob_logr     s   Z E'44KLL5L11E ;y11Wbk)6L6LW44RWL 
{9 FGEJ	EEE		{9 FGEJ	EEE	 
9K888I
9K888I B##x	""[i88

[IyAA
 %+Z(::+NNNJ*%% O O1!25!<<<rwqzzQN
36+EJGGN!#%'$%*q.122  L AxEJ|*K!!LMNNN 
		[	)	)B !aaae!45O 2)!!!QqS&1 
Bqqq#2#vJ0	1	1B%a(IGy9999r%      {Gz?)rZ   c          
      <   t          | d           t          |           } t          | j                  }|                     |d          } t          |           } |rAt          j        |d          t          j        |d          }
}	t          j	        |	|
|          }nt          j
        |||          }t          j        | j        t          |          fz   |          }t          |          D ]\  }}t          | |          |d|f<   t!          |||dt          j        d|j        z                      }|j        d	k    rt          j        d
          S |                    t          j                  }||dddf                  |dddf<   t+          ||          S )a  Finds blobs in the given grayscale image.

    Blobs are found using the Determinant of Hessian method [1]_. For each blob
    found, the method returns its coordinates and the standard deviation
    of the Gaussian Kernel used for the Hessian matrix whose determinant
    detected the blob. Determinant of Hessians is approximated using [2]_.

    Parameters
    ----------
    image : 2D ndarray
        Input grayscale image.Blobs can either be light on dark or vice versa.
    min_sigma : float, optional
        The minimum standard deviation for Gaussian Kernel used to compute
        Hessian matrix. Keep this low to detect smaller blobs.
    max_sigma : float, optional
        The maximum standard deviation for Gaussian Kernel used to compute
        Hessian matrix. Keep this high to detect larger blobs.
    num_sigma : int, optional
        The number of intermediate values of standard deviations to consider
        between `min_sigma` and `max_sigma`.
    threshold : float or None, optional
        The absolute lower bound for scale space maxima. Local maxima smaller
        than `threshold` are ignored. Reduce this to detect blobs with lower
        intensities. If `threshold_rel` is also specified, whichever threshold
        is larger will be used. If None, `threshold_rel` is used instead.
    overlap : float, optional
        A value between 0 and 1. If the area of two blobs overlaps by a
        fraction greater than `threshold`, the smaller blob is eliminated.
    log_scale : bool, optional
        If set intermediate values of standard deviations are interpolated
        using a logarithmic scale to the base `10`. If not, linear
        interpolation is used.
    threshold_rel : float or None, optional
        Minimum intensity of peaks, calculated as
        ``max(doh_space) * threshold_rel``, where ``doh_space`` refers to the
        stack of Determinant-of-Hessian (DoH) images computed internally. This
        should have a value between 0 and 1. If None, `threshold` is used
        instead.

    Returns
    -------
    A : (n, 3) ndarray
        A 2d array with each row representing 3 values, ``(y,x,sigma)``
        where ``(y,x)`` are coordinates of the blob and ``sigma`` is the
        standard deviation of the Gaussian kernel of the Hessian Matrix whose
        determinant detected the blob.

    References
    ----------
    .. [1] https://en.wikipedia.org/wiki/Blob_detection#The_determinant_of_the_Hessian
    .. [2] Herbert Bay, Andreas Ess, Tinne Tuytelaars, Luc Van Gool,
           "SURF: Speeded Up Robust Features"
           ftp://ftp.vision.ee.ethz.ch/publications/articles/eth_biwi_00517.pdf

    Examples
    --------
    >>> from skimage import data, feature
    >>> img = data.coins()
    >>> feature.blob_doh(img)
    array([[197.        , 153.        ,  20.33333333],
           [124.        , 336.        ,  20.33333333],
           [126.        , 153.        ,  20.33333333],
           [195.        , 100.        ,  23.55555556],
           [192.        , 212.        ,  23.55555556],
           [121.        , 271.        ,  30.        ],
           [126.        , 101.        ,  20.33333333],
           [193.        , 275.        ,  23.55555556],
           [123.        , 205.        ,  20.33333333],
           [270.        , 363.        ,  30.        ],
           [265.        , 113.        ,  23.55555556],
           [262.        , 243.        ,  23.55555556],
           [185.        , 348.        ,  30.        ],
           [156.        , 302.        ,  30.        ],
           [123.        ,  44.        ,  23.55555556],
           [260.        , 173.        ,  30.        ],
           [197.        ,  44.        ,  20.33333333]])

    Notes
    -----
    The radius of each blob is approximately `sigma`.
    Computation of Determinant of Hessians is independent of the standard
    deviation. Therefore detecting larger blobs won't take more time. In
    methods line :py:meth:`blob_dog` and :py:meth:`blob_log` the computation
    of Gaussians for larger `sigma` takes more time. The downside is that
    this method can't be used for detecting blobs of radius less than `3px`
    due to the box filters used in the approximation of Hessian Determinant.
    r   Fr\   r   )r@   r_   .re   rf   r   )r   r(   Nr   )r   r	   r   r_   ri   r   r   rn   r   r   r   rp   r@   r0   rq   r   r   rr   r4   rs   float64rN   )ru   ra   r6   r   rv   rG   r   rZ   rw   r   r   rz   r   rM   r}   r   r   s                    r#   blob_dohr   H  s   D UAE'44KLL5L11E5!!E Bhy"--tx	2/F/Ft[i88

[IyAA
s:.@ @TTTJ*%% ; ;10::
36!#'$011  L Ax			RZ	(	(B<2./Bqqq"uIG$$$r%   )r
   rX   rY   r   r   )r
   rX   r   r   r   F)r
   r   r   r   r   F)r   numpyr   scipy.ndimagendimager   scipyr   _shared.filtersr   _shared.utilsr   r   	transformr   utilr	   _hessian_det_appxr   peakr   r$   r+   r9   rN   rW   r   r   r   r<   r%   r#   <module>r      s                    & & & & & & ; ; ; ; ; ; ; ; & & & & & &       2 2 2 2 2 2            !1 !1 !1H8 8 8B ./ ;2 ;2 ;2 ;2 ;2| 56 ); ); ); ); );XU U U: |: |: |: |: |: |:B i: i: i: i: i: i:\ C% C% C% C% C% C% C% C%r%   