Ë
    ½GìjÇ
  ã                   ó4   — d dl Zd dlmZmZmZ d dlmZ dd„Zy)é    N)Úvec_vec_dotÚmat_vec_dotÚvec_vec_outer)Ú	boxfilterc                 óò  ‡ ‡‡‡‡‡‡‡— ‰ j                  t        j                  «      Š d‰z  dz   }||z  }‰ j                  \  ŠŠ}t	        ‰ ‰d¬«      |z  }t	        t        ‰ ‰ «      ‰d¬«      |z  }|t        ||«      z  }t        j                  j                  |||z  t        j                  |«      z  z   «      |z  Št        ‰|«      Šd|z  t        |‰«      z   Št	        t        j                  ‰d‰z  z
  ‰d‰z  z
  f«      ‰d¬«      Šˆˆˆˆˆ ˆˆˆfd„}	|r^t	        d‰z
  ‰d¬«      }
dt	        ‰‰d¬«      z  }|t        t	        ‰‰d¬«      ‰ «      z  }|
t        ‰ |«      z  }
|	|
j                  «       fS |	S )aØ  Calculates the Laplacian for large kernel matting :cite:`he2010fast`

    Parameters
    ----------
    image: numpy.ndarray
        Image of shape :math:`h\times w \times 3`
    epsilons: float
        Regularization strength, defaults to :math:`10^{-7}`
    radius: int
        Radius of local window size, defaults to :math:`10`, 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.
    return_diagonal: bool
        Whether to also return the diagonal of the laplacian, defaults to True

    Returns
    -------
    L_matvec: function
        Function that applies the Laplacian matrix to a vector
    diag_L: numpy.ndarray
        Diagonal entries of the matting Laplacian, only returns if
        `return_diagonal` is True
    é   é   Úvalid©ÚmodeÚfullc           	      ó�  •— | j                  ‰‰«      } t        | ‰d¬«      }t        | d d …d d …t        j                  f   ‰	z  ‰d¬«      }‰| z  }|d d …d d …t        j                  f   ‰z  t	        ‰|«      z
  }|t        ‰	t        |‰d¬«      «      z  }|‰
z  t        |‰«      z
  }|t        |‰d¬«      z  }|j                  «       S )Nr
   r   r   )Úreshaper   ÚnpÚnewaxisr   r   Úflatten)ÚpÚp_sumsÚpI_sumsÚp_LÚtempÚVÚVmÚcÚhÚimageÚmVmÚradiusÚws        €€€€€€€€úeC:\Users\Stabi\Downloads\virtual-tryon(1)\venv\Lib\site-packages\pymatting/laplacian/lkm_laplacian.pyÚL_matveczlkm_laplacian.<locals>.L_matvec3   sÀ   ø€ Ø�I‰I�a˜‹Oˆä˜1˜f¨7Ô3ˆÜ˜Aša¢¤B§J¡JÐ.Ñ/°%Ñ7¸ÀgÔNˆà�!‰eˆà’ašœBŸJ™JÐ&Ñ'¨"Ñ,¬{¸1¸gÓ/FÑFˆØŒ{˜5¤)¨D°&¸vÔ"FÓGÑGˆà˜‰|œk¨'°2Ó6Ñ6ˆØŒy˜˜v¨FÔ3Ñ3ˆà�{‰{‹}Ðó    g      ð?)Úastyper   Úfloat64Úshaper   r   ÚlinalgÚinvÚeyer   r   Úonesr   )r   Úepsilonr   Úreturn_diagonalÚwindow_sizeÚwindow_areaÚdepthÚmeansÚcovsr!   Údiag_Lr   r   r   r   r   r   r   s   ` `         @@@@@@r    Úlkm_laplacianr2      sr  ÿ€ ð4 �L‰LœŸ™Ó$€Eà�f‘*˜q‘.€KØ Ñ+€KØ—+‘+�K€A€qˆ%ô �e˜V¨'Ô2°[Ñ@€Eô ”] 5¨%Ó0°&¸wÔGÈ+ÑU€DØŒM˜% Ó'Ñ'€Dô 	�	‰	�‰�d˜W {Ñ2´R·V±V¸E³]ÑBÑBÓCÀkÑQ€AÜ	�Q˜Ó	€BØ
ˆk‰/œK¨¨rÓ2Ñ
2€CÜ”"—'‘'˜1˜q 6™z™>¨1¨q°6©z©>Ð:Ó;¸VÈ&ÔQ€A÷ó ñ  ä˜3 ™9 f°6Ô:ˆØ”9˜R ¨fÔ5Ñ5ˆØ”œI a¨°fÔ=¸uÓEÑEˆØ”+˜e TÓ*Ñ*ˆà˜Ÿ™Ó)Ð)Ð)à€Or"   )gH¯¼šò×z>é
   T)	Únumpyr   Úpymatting.util.utilr   r   r   Úpymatting.util.boxfilterr   r2   © r"   r    Ú<module>r8      s   ðÛ ß GÑ GÝ .ôFr"   