+
    Ain1                         ^ RI t^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
t
^RIHt ^RIHt ^RIHt R t]3R	 ltR
 t]P*                  ! 4       RRRR/R l4       tR# )    N)sparse)spsolve)laplace)utils)label)_build_matrix_innerc                     \         P                  ! W,
          ^ 4      p\         P                  ! W,           ^,           V4      pW43# )r   )npmaximumminimum)nd_idxradiusnd_shape	bounds_lo	bounds_his   &&&  Y/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/restoration/inpaint.py_get_neighborhoodr      s4    

6?A.I

6?Q.9I    c                     \         P                  ! WR 7      p^W1&   \        \        V4      4      p\         P                  ! V4      pW4,          p\         P                  ! V^ R7      pW4V3# )dtypeaxis)r
   zerosr   wherestack)shapecenterr   
neigh_coefcoef_idx	coef_valss   &&&   r   _get_neigh_coefr"      sZ    %-JJ,-J xx
#H$Ixxq)H**r   c                 
   VP                   R,          pVP                   ^ ,          ^,          p\        P                  ! VP                   \        R7      p^ V\	        Ww) 4      3VP
                  ,          &   W,          p	V( V,          p
\        P                  ! V	4      p\        P                  ! V	4      p\        P                  ! V
4      p\        P                  ! W34      p\        P                  ! V
4      p\        \        W4       UUu. uF  w  pp\        P                  ! VV34      NK   	  upp4      pV^ 8g  p\        P                  ! VV\        P                  RR7      pVV,          P                  4       p\        P                  ! V4      p\        P                  ! V4      pV\        P                  ! VV8H  4      ,
          p\        P                   ! V\        P"                  R7      p\        P$                  ! VV3VP&                  R7      p\        P                   ! V\        P"                  R7      p\        P                   ! V\        P"                  R7      p\        P                   ! VVP&                  R7      p/ pVP)                  R4      p\        P*                  ! VP)                  RV34      4      p ^ p!^ p"Rp#\        P,                  ! V^R7      p\/        V4       EFO  w  p#p$\1        V$WqP                   4      w  p%p&\        V&V%,
          4      p'\        V$V%,
          4      p(VP3                  V'V(3R4      w  p)p*V)f&   \5        V'V(VP&                  R7      w  p+p)p*V)V*3VV'V(3&   V)V%R\        P6                  3,          ,           p)\        P8                  ! V)VP                   4      p,^ p-\        V*V,4       F_  w  p.p/VV/,          '       d   V#VV"&   V/VV"&   V.VV"&   V"^,          p"K/  VV!R3;;,          V.V V/R3,          ,          ,          uu&   V-^,          p-Ka  	  V-'       g   EKA  V#VV!&   V!^,          p!EKR  	  V#^,           p0T!p1T"p2\;        V0V1V2VVVVV VVVVV4      p3VRV3 pVRV31R3,          pVVP<                  3p4\>        P@                  ! VVV33V4R7      p5V5RV3,          p5\        P$                  ! VV3VP&                  R7      p6VV6VR3&   \C        V5V6RR	R
7      p7V7P
                  ^8X  d   V7R\        P6                  3,          p7V7VV&   V# u uppi )a  Solve a (sparse) linear system corresponding to biharmonic inpainting.

This function creates a linear system of the form:

``A @ u = b``

where ``A`` is a sparse matrix, ``b`` is a vector enforcing smoothness and
boundary constraints and ``u`` is the vector of inpainted values to be
(uniquely) determined by solving the linear system.

``A`` is a sparse matrix of shape (n_mask, n_mask) where ``n_mask``
corresponds to the number of non-zero values in ``mask`` (i.e. the number
of pixels to be inpainted). Each row in A will have a number of non-zero
values equal to the number of non-zero values in the biharmonic kernel,
``neigh_coef_full``. In practice, biharmonic kernels with reduced extent
are used at the image borders. This matrix, ``A`` is the same for all
image channels (since the same inpainting mask is currently used for all
channels).

``u`` is a dense matrix of shape ``(n_mask, n_channels)`` and represents
the vector of unknown values for each channel.

``b`` is a dense matrix of shape ``(n_mask, n_channels)`` and represents
the desired output of convolving the solution with the biharmonic kernel.
At mask locations where there is no overlap with known values, ``b`` will
have a value of 0. This enforces the biharmonic smoothness constraint in
the interior of inpainting regions. For regions near the boundary that
overlap with known values, the entries in ``b`` enforce boundary conditions
designed to avoid discontinuity with the known values.
r   constant)outputmoder   N:NNN)r   FMMD_ATA)use_umfpack
permc_spec)NN)"r   r
   onesboolslicendimr   flatnonzeroconcatenatetuplezipndiconvolveuint8sumcount_nonzeroemptyintpr   r   reshapeascontiguousarrayr   	enumerater   getr"   newaxisravel_multi_indexr   sizer   	csr_arrayr   )8imagemaskoutneigh_coef_fullr!   raveled_offsets
n_channelsr   	edge_maskboundary_maskcenter_maskboundary_pts
boundary_icenter_imask_i
center_ptsbcmask_pts	structuretmp
nnz_matrixn_maskn_structnnz_rhs_vector_maxrow_idx_known
data_knownrow_idx_unknowncol_idx_unknowndata_unknown
coef_cache	mask_flatout_flat	idx_knownidx_unknown	mask_pt_nr   b_lob_hi
coef_shapecoef_centerr    coefs_index1dnvalscoefi	row_startknown_start_idxunknown_start_idxnnz_rhssp_shapematrix_unknownrhsresults8   &&&&&&                                                  r   !_inpaint_biharmonic_single_regionrv   !   s   D 2J""1%*F

$/I78IuVW%'$))34$M*t#K88M*L.J~~k*H^^Z23F+&J\9VW9VAbnnaV,9VWXH  1$I
,,tYrxxj
ICTJ d#F	*H""2"23(?"CC HH/rww?M-z:#))LJhhz9Ohhz9O88Jcii8L J R I##CKKZ0@$ABHIKI88Lq1L&|4	6&vvzzB
d 4$;'
FTM*$..*k)BLQ%!0Ksyy"Ax 6>u4EJ
K01 d1bjj=11&&x< 5'*GD!||/8,/0,,0[)q 9a<(D8AqD>,AA(
 + 5'0M)$NI? 5D AIO#!!G( "(7+MHWHaK(J !H%%	9:(N
 $AvI.N ((FJ'syy
9C&Cq ^Se	RF{{a2::&CMJc Xs   	$T

split_into_regionsFchannel_axisc          	     `  a V P                   ^8  d   \        R4      hVRJpV'       d   V P                  RR MV P                  pWQP                  8w  d   \        R4      h\        P                  P                  V 4      '       d   \        R4      h\        P                  ! V 4      p \        P                  ! V P                  4      pV P                  VRR7      p VP                  \        RR7      pV'       g   V R\        P                  3,          p \        P                  ! V RR	7      p^o^S,          ^,           3VP                   ,          pS3VP                   ,          p	\!        WVP                  R
7      w  rpVP"                  R,          pVS,
          pW( ,          pVP%                  ^ R7      VP'                  ^ R7      3pV'       Ed   \(        P*                  ! VP                   ^4      p\(        P,                  ! VVR7      p\/        V4      pVV,          p\(        P0                  ! V4      p\3        V^4       EF'  w  pp\4        ;QJ d+    . V3R l\7        VVP                  4       4       F  NK  	  5M$! V3R l\7        VVP                  4       4       4      pVV,          V8H  pV\9        R4      3,          pVV,          P                  4       p\        P:                  ! VR,          P"                   Uu. uF  pVV,          NK  	  up4      p\        P<                  ! VVR\        P                  3,          ,          ^ R7      p\?        V V,          VVV
VV4       VVV&   EK*  	  M\        P:                  ! VR,          P"                   Uu. uF  pVV,          NK  	  up4      p\        P<                  ! VVR\        P                  3,          ,          ^ R7      p\?        WWzVV4       \        P@                  ! VV^ ,          V^,          VR7       V'       g
   VR,          pV# u upi u upi )aY  Inpaint masked points in image with biharmonic equations.

Parameters
----------
image : (M[, N[, ..., P]][, C]) ndarray
    Input image.
mask : (M[, N[, ..., P]]) ndarray
    Array of pixels to be inpainted. Have to be the same shape as one
    of the 'image' channels. Unknown pixels have to be represented with 1,
    known pixels - with 0.
split_into_regions : bool, optional
    If True, inpainting is performed on a region-by-region basis. This is
    likely to be slower, but will have reduced memory requirements.
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 : (M[, N[, ..., P]][, C]) ndarray
    Input image with masked pixels inpainted.

References
----------
.. [1]  S.B.Damelin and N.S.Hoang. "On Surface Completion and Image
        Inpainting by Biharmonic Functions: Numerical Aspects",
        International Journal of Mathematics and Mathematical Sciences,
        Vol. 2018, Article ID 3950312
        :DOI:`10.1155/2018/3950312`
.. [2]  C. K. Chui and H. N. Mhaskar, MRA Contextual-Recovery Extension of
        Smooth Functions on Manifolds, Appl. and Comp. Harmonic Anal.,
        28 (2010), 104-113,
        :DOI:`10.1016/j.acha.2009.04.004`

Examples
--------
>>> img = np.tile(np.square(np.linspace(0, 1, 5)), (5, 1))
>>> mask = np.zeros_like(img)
>>> mask[2, 2:] = 1
>>> mask[1, 3:] = 1
>>> mask[0, 4:] = 1
>>> out = inpaint_biharmonic(img, mask)
z!Input array has to be at least 1DNz&Input arrays have to be the same shapezMasked arrays are not supportedF)copy.C)orderr   r   )rS   c              3      <"   T FI  w  r\        \        VP                  S,
          ^ 4      \        VP                  S,           V4      4      x  KK  	  R# 5i)r   N)r-   maxstartminstop).0slr@   r   s   &  r   	<genexpr>%inpaint_biharmonic.<locals>.<genexpr>*  sD       AHB c"((V+Q/RWWv5Et1LMM As   AA)a_mina_maxrD   r*   ).r   )!r.   
ValueErrorr   r
   maisMaskedArray	TypeErrorskimageimg_as_floatr   _supported_float_typer   astyper,   r>   rz   r"   stridesr   r~   r3   generate_binary_structurebinary_dilationr   find_objectsr<   r1   r2   r-   arrayr6   rv   clip)rB   rC   rw   rx   multichannelimg_baseshapefloat_dtyperD   rf   rg   rE   r    r!   channel_stride_bytesoffsetsknown_pointslimitskernelmask_dilatedmask_labeledbbox_slices
idx_regionbb_sliceroi_slmask_regionotmpsostridesrF   r   s   &&$$                         @r   inpaint_biharmonicr      s}   d zzA~<==t+L(4EKK$%++M

"ABB	uu5!!9::  'E --ekk:KLL5L1E;;t%;(Dc2::o&
''%s
#C Ff*q."TYY.J)dii'K+:syy,(Oy
 ;;r? G <LA&(8(8a(8(@AF..tyy!<**46B\*&&|4$-k1$= JU  #Hl.@.@ AUU  #Hl.@.@ A F
 'v.*<KuT{n$Fv;##%D xx48L4H4HI4Hq***4HIH !ffWxRZZ/H%HqQO-f CK9 %>> 88F@S@ST@S1Q"666@STU&&8CO+D!D1M)y/	

 GGCvayq	s;&kJ; J  Us   8P&
P+)numpyr
   scipyr   scipy.sparse.linalgr   scipy.ndimagendimager3   r   r   _sharedr   measurer   _inpaintr   r   floatr"   rv   channel_as_last_axisr    r   r   <module>r      se      '  !    )  */ +aH N% Nd N Nr   