Ë
    ÿ[;jõ  ã                   ó,   — d dl mZ ddlmZ dd„Zdd„Zy)é    )Úndimageé   )Úlabel_cythonNc           	      ó"  — ddl m} |dk(  r|  } |€| j                  }d|cxk  r| j                  k  s+n t        d| j                  › d| j                  › d|› d�«      ‚ |d|| j                  «      }t	        j
                  | |¬	«      }|r|S |d
   S )z‚Faster implementation of clabel for boolean input.

    See context: https://github.com/scikit-image/scikit-image/issues/4833
    é   )Ú_resolve_neighborhoodr   NzConnectivity for zD image should be in [1, ..., z]. Got Ú.)Ú	structurer   )Úmorphology._utilr   ÚndimÚ
ValueErrorr   Úlabel)ÚimageÚ
backgroundÚ
return_numÚconnectivityr   Ú	footprintÚresults          ú_G:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\skimage/measure/_label.pyÚ_label_boolr      sŸ   € õ
 9à�Q‚Ø�ˆàÐØ—z‘zˆà�Ô* §
¡
Ô*ÜØ §
¡
˜|ð ,Ø#Ÿj™j˜\¨°°¸aðAó
ð 	
ñ
 & d¨L¸%¿*¹*ÓE€IÜ�]‰]˜5¨IÔ6€FáØˆà�a‰yÐó    c                 ób   — | j                   t        k(  rt        | |||¬«      S t        | |||«      S )a—
  Label connected regions of an integer array.

    Two pixels are connected when they are neighbors and have the same value.
    In 2D, they can be neighbors either in a 1- or 2-connected sense.
    The value refers to the maximum number of orthogonal hops to consider a
    pixel/voxel a neighbor::

      1-connectivity     2-connectivity     diagonal connection close-up

           [ ]           [ ]  [ ]  [ ]             [ ]
            |               \  |  /                 |  <- hop 2
      [ ]--[x]--[ ]      [ ]--[x]--[ ]        [x]--[ ]
            |               /  |  \             hop 1
           [ ]           [ ]  [ ]  [ ]

    Parameters
    ----------
    label_image : ndarray of dtype int
        Image to label.
    background : int, optional
        Consider all pixels with this value as background pixels, and label
        them as 0. By default, 0-valued pixels are considered as background
        pixels.
    return_num : bool, optional
        Whether to return the number of assigned labels.
    connectivity : int, optional
        Maximum number of orthogonal hops to consider a pixel/voxel
        as a neighbor.
        Accepted values are ranging from  1 to input.ndim. If ``None``, a full
        connectivity of ``input.ndim`` is used.

    Returns
    -------
    labels : ndarray of dtype int
        Labeled array, where all connected regions are assigned the
        same integer value.
    num : int, optional
        Number of labels, which equals the maximum label index and is only
        returned if return_num is `True`.

    See Also
    --------
    skimage.measure.regionprops
    skimage.measure.regionprops_table

    References
    ----------
    .. [1] Christophe Fiorio and Jens Gustedt, "Two linear time Union-Find
           strategies for image processing", Theoretical Computer Science
           154 (1996), pp. 165-181.
    .. [2] Kensheng Wu, Ekow Otoo and Arie Shoshani, "Optimizing connected
           component labeling algorithms", Paper LBNL-56864, 2005,
           Lawrence Berkeley National Laboratory (University of California),
           http://repositories.cdlib.org/lbnl/LBNL-56864

    Examples
    --------
    >>> import numpy as np
    >>> x = np.eye(3).astype(int)
    >>> print(x)
    [[1 0 0]
     [0 1 0]
     [0 0 1]]
    >>> print(label(x, connectivity=1))
    [[1 0 0]
     [0 2 0]
     [0 0 3]]
    >>> print(label(x, connectivity=2))
    [[1 0 0]
     [0 1 0]
     [0 0 1]]
    >>> print(label(x, background=-1))
    [[1 2 2]
     [2 1 2]
     [2 2 1]]
    >>> x = np.array([[1, 0, 0],
    ...               [1, 1, 5],
    ...               [0, 0, 0]])
    >>> print(label(x))
    [[1 0 0]
     [1 1 2]
     [0 0 0]]
    )r   r   r   )ÚdtypeÚboolr   Úclabel)Úlabel_imager   r   r   s       r   r   r   !   s?   € ðh ×ÑœDÒ ÜØØ!Ø!Ø%ô	
ð 	
ô �k :¨z¸<ÓHÐHr   )NFN)Úscipyr   Ú_ccompr   r   r   r   © r   r   Ú<module>r       s   ðÝ Ý *óô8\Ir   