+
    Ai<                     p    ^ RI t^ RIt^ RIHt ]! RRRR7      R 4       t]! RRRR7      R 4       tR
R	 ltR# )    N)njitzf8[:, :](f8[:, :], f8)T)cachenogilc                 z   V P                   w  r#\        P                  ! W"34      p\        V4       F  p\        V4       Ft  p\        P                  ! \        P
                  ! V4      ) \        P                  ! \        P                  ! W,          W,          ,
          4      4      ,          4      WEV3&   Kv  	  K  	  V# )N)shapenpzerosrangeexpsqrtsumsquare)XvnmKijs   &&     `/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymatting/laplacian/lbdm_laplacian.pycalculate_kernel_matrixr      s}    77DA
!A1XqAffbggaj[266"))AD14K2H+IIJAdG   H    z1Tuple((f8[:], i4[:], i4[:]))(f8[:, :, :], f8, i4)c           	         V P                   R ,          w  r4W4,          p^V,          ^,           ^,          p\        P                  ! V4      P                  W44      p\        P                  ! WV^,          34      p\        P                  ! WV^,          3\        P
                  R7      p	\        P                  ! WV^,          3\        P
                  R7      p
\        W#V,
          4       EF  p\        W$V,
          4       EF  pWV,          ,           p\        P                  ! V^34      p^ p\        W,
          W,           ^,           4       FT  p\        W,
          W,           ^,           4       F.  p\        ^4       F  pV VVV3,          WV3&   K  	  V^,          pK0  	  KV  	  W{V,
          W,           ^,           1W,
          W,           ^,           13,          P                  4       p\        P                  ! WP                  4      p\        P                  P                  VV\        P                  ! V4      ,          ,           V4      p\        P                  ! VP                   ^ ,          4      V,
          pVP                  VP                  4      p\        V4       F'  pVWVRV13&   VWW,          W,          V,           13&   K)  	  VP                  4       W&   EK  	  EK  	  VP                  4       V	P                  4       V
P                  4       3# )N   N)dtypeN)r   r   arangereshaper	   int32r
   onesflattendotTlinalgsolveeyeravel)imageepsilonrhwr   areaindicesvaluesi_indsj_indsyxr   r   ky2x2cwindow_indicesr   ftmp2tmp3s   &&&                     r   _lbdm_laplacianr<      s5   ;;r?DA	AEAI!Diil""1(GXXq!)n%FXXq!)nBHH5FXXq!)nBHH5F
 1!e_qa%AE	Au&AAAE1519-quqy1B"1X"'B	"2Q$ &FA 2 . %UQUQY%6	8I%IJRRTN
 q##A		GbffTl$: :A>A66!''!*%)D88DFF#D4[%3!'T'z"8F!(QX_445 ! 

FI7 ! < <<>6<<>6<<>99r   c                    V P                   R,          w  r4W4,          p\        WV4      w  rgp\        P                  P	                  WgV33WU3R7      p	V	# )a  
Calculate a Laplacian matrix based on :cite:`zheng2009learning`.

Parameters
----------
image: numpy.ndarray
   Image with shape :math:`h\times w \times 3`
epsilon: float
   Regularization strength, defaults to :math:`10^{-7}`. Strong
   regularization improves convergence but results in smoother alpha mattes.
radius: int
   Radius of local window size, defaults to :math:`1`, i.e. only adjacent
   pixels are considered. The size of the local window is given as
   :math:`(2 r + 1)^2`, where :math:`r` denotes the radius. A larger radius
   might lead to violated color line constraints, but also favors further
   propagation of information within the image.

Returns
-------
L: scipy.sparse.csr_matrix
    Matting Laplacian
r   )r   )r   r<   scipysparse
csr_matrix)
r(   r)   radiusr+   r,   r   r/   r0   r1   Ls
   &&&       r   lbdm_laplacianrC   @   sS    . ;;r?DA	A,UVDFF&)9 :1&IAHr   )gHz>   )	numpyr   scipy.sparser>   numbar   r   r<   rC    r   r   <module>rI      sO      d$7 8 9TR-: S-:`r   