§
    (Áôgx  ã                   ó&   — d dl mZ d dlmZ dd„ZdS )é    )Úunique)Úentropyé   c                 óL   — t          | d¬¦  «        \  }}t          ||¬¦  «        S )až  Calculate the Shannon entropy of an image.

    The Shannon entropy is defined as S = -sum(pk * log(pk)),
    where pk are frequency/probability of pixels of value k.

    Parameters
    ----------
    image : (M, N) ndarray
        Grayscale input image.
    base : float, optional
        The logarithmic base to use.

    Returns
    -------
    entropy : float

    Notes
    -----
    The returned value is measured in bits or shannon (Sh) for base=2, natural
    unit (nat) for base=np.e and hartley (Hart) for base=10.

    References
    ----------
    .. [1] `https://en.wikipedia.org/wiki/Entropy_(information_theory) <https://en.wikipedia.org/wiki/Entropy_(information_theory)>`_
    .. [2] https://en.wiktionary.org/wiki/Shannon_entropy

    Examples
    --------
    >>> from skimage import data
    >>> from skimage.measure import shannon_entropy
    >>> shannon_entropy(data.camera())
    7.231695011055706
    T)Úreturn_counts)Úbase)r   Úscipy_entropy)Úimager   Ú_Úcountss       ú`/var/www/html/bac/bac_backend/python/env/lib/python3.11/site-packages/skimage/measure/entropy.pyÚshannon_entropyr      s.   € õF �u¨DÐ1Ñ1Ô1�I€A€vÝ˜ dÐ+Ñ+Ô+Ð+ó    N)r   )Únumpyr   Úscipy.statsr   r	   r   © r   r   ú<module>r      sG   ðØ Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0ð$,ð $,ð $,ð $,ð $,ð $,r   