+
    Ai                     ,    ^ RI t^RIHt RRR/R lltR# )    N)labeloutc               R  a \         ;QJ d)    V3R lV P                   4       F  '       g   K   RM	  RM! V3R lV P                   4       4      '       d   Vf   \        R4      hVf   V P                  4       pVed   RVP                   RVP                   2pVP                  VP                  8w  d	   \        V3hVP                  \
        8w  d   \        R4      hV( pM\        P                  ! V\
        R	7      pS^,           p\        V4      p\        V) R4      p	VP                   U
u. uF  p
\        R4      NK  	  pp
\        VP                  4       F4  pWV&   RV\        V4      &   WV&   RV\        V4      &   \        R4      W&   K6  	  \        V^ RR
7      w  r\        P                  ! W,          4      p\        P                  ! V^,           4      p\        P                   ! W4      pVV P#                  R4      ,          P#                  V P                  4      pW$V&   V# u up
i )a  Clear objects connected to the label image border.

Parameters
----------
labels : (M[, N[, ..., P]]) array of int or bool
    Imaging data labels.
buffer_size : int, optional
    The width of the border examined.  By default, only objects
    that touch the outside of the image are removed.
bgval : float or int, optional
    Cleared objects are set to this value.
mask : ndarray of bool, same shape as `image`, optional.
    Image data mask. Objects in labels image overlapping with
    False pixels of mask will be removed. If defined, the
    argument buffer_size will be ignored.
out : ndarray
    Array of the same shape as `labels`, into which the
    output is placed. By default, a new array is created.

Returns
-------
out : (M[, N[, ..., P]]) array
    Imaging data labels with cleared borders

Examples
--------
>>> import numpy as np
>>> from skimage.segmentation import clear_border
>>> labels = np.array([[0, 0, 0, 0, 0, 0, 0, 1, 0],
...                    [1, 1, 0, 0, 1, 0, 0, 1, 0],
...                    [1, 1, 0, 1, 0, 1, 0, 0, 0],
...                    [0, 0, 0, 1, 1, 1, 1, 0, 0],
...                    [0, 1, 1, 1, 1, 1, 1, 1, 0],
...                    [0, 0, 0, 0, 0, 0, 0, 0, 0]])
>>> clear_border(labels)
array([[0, 0, 0, 0, 0, 0, 0, 0, 0],
       [0, 0, 0, 0, 1, 0, 0, 0, 0],
       [0, 0, 0, 1, 0, 1, 0, 0, 0],
       [0, 0, 0, 1, 1, 1, 1, 0, 0],
       [0, 1, 1, 1, 1, 1, 1, 1, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0]])
>>> mask = np.array([[0, 0, 1, 1, 1, 1, 1, 1, 1],
...                  [0, 0, 1, 1, 1, 1, 1, 1, 1],
...                  [1, 1, 1, 1, 1, 1, 1, 1, 1],
...                  [1, 1, 1, 1, 1, 1, 1, 1, 1],
...                  [1, 1, 1, 1, 1, 1, 1, 1, 1],
...                  [1, 1, 1, 1, 1, 1, 1, 1, 1]]).astype(bool)
>>> clear_border(labels, mask=mask)
array([[0, 0, 0, 0, 0, 0, 0, 1, 0],
       [0, 0, 0, 0, 1, 0, 0, 1, 0],
       [0, 0, 0, 1, 0, 1, 0, 0, 0],
       [0, 0, 0, 1, 1, 1, 1, 0, 0],
       [0, 1, 1, 1, 1, 1, 1, 1, 0],
       [0, 0, 0, 0, 0, 0, 0, 0, 0]])

c              3   .   <"   T F
  pSV8  x  K  	  R # 5i)N ).0sbuffer_sizes   & `/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/segmentation/_clear_border.py	<genexpr>clear_border.<locals>.<genexpr>?   s     
2\;!\s   TFNz/buffer size may not be greater than labels sizez3labels and mask should have the same shape but are z and zmask should be of type bool.)dtype)
background
return_num)anyshape
ValueErrorcopyr   bool	TypeErrornp
zeros_likeslicerangendimtupler   uniquearangeisinreshape)labelsr
   bgvalmaskr   err_msgbordersextslstartslend_slicesdnumberborders_indicesindices
label_masks   &f&&$            r   clear_borderr1      s   r s
2V\\
2sss
2V\\
222t|JKK
{kkm99+U4::,0 	 99

"w'':::;;% --40Ao*sdD!'*yy1y!%+y1sxxA1I%)GE&M"1I%)GE&M"dFI ! 31>NF ii0Oii
#G2JfnnR()11&,,?D IJ/ 2s   +H$)r   r   N)numpyr   measurer   r1   r       r   <module>r5      s     g4 gr4   