Ë
    ÿ[;j×  ã                   óV   — d dl ZddlmZ d„ Z ej
                  d¬«      ddœd„«       Zy)	é    Né   )Úutilsc                 óž  — | j                   j                  dk(  rh| j                  d«      }t        j                  |«      }t        j                  |j                  d«      «      }t        j
                  |«      d   }||   }nTt        j                  | j                  d«      dd¬«      \  }}}t        j                  |j                  d«      d¬«      \  }}t        j                  |«      | j                  z  }t        j                  |«      |j                  z  }t        j                  |||«      }	|	|   j                  | j                  «      S )z™
    Return modified source array so that the cumulative density function of
    its values matches the cumulative density function of the template.
    Úuéÿÿÿÿr   T)Úreturn_inverseÚreturn_counts)r	   )ÚdtypeÚkindÚreshapeÚnpÚbincountÚnonzeroÚuniqueÚcumsumÚsizeÚinterpÚshape)
ÚsourceÚtemplateÚ
src_lookupÚ
src_countsÚtmpl_countsÚtmpl_valuesÚ
src_valuesÚsrc_quantilesÚtmpl_quantilesÚinterp_a_valuess
             úlG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\skimage/exposure/histogram_matching.pyÚ_match_cumulative_cdfr       s  € ð
 ‡|�|×Ñ˜CÒØ—^‘^ BÓ'ˆ
Ü—[‘[ Ó,ˆ
Ü—k‘k (×"2Ñ"2°2Ó"6Ó7ˆô —j‘j Ó-¨aÑ0ˆØ! +Ñ.‰ä-/¯Y©YØ�N‰N˜2Ó¨tÀ4ô.
Ñ*ˆ
�J 
ô $&§9¡9¨X×-=Ñ-=¸bÓ-AÐQUÔ#VÑ ˆ�[ô —I‘I˜jÓ)¨F¯K©KÑ7€MÜ—Y‘Y˜{Ó+¨h¯m©mÑ;€Nä—i‘i ¨~¸{ÓK€OØ˜:Ñ&×.Ñ.¨v¯|©|Ó<Ð<ó    )r   é   )Úchannel_arg_positions)Úchannel_axisc                ó   — | j                   |j                   k7  rt        d«      ‚|��| j                  d   |j                  d   k7  rt        d«      ‚t        j                  | j                  | j
                  ¬«      }t        | j                  d   «      D ]  }t        | d|f   |d|f   «      }||d|f<   Œ! nt        | |«      }|j
                  j                  dk(  r2t        j                  | j
                  «      }|j                  |d¬«      }|S )	aw  Adjust an image so that its cumulative histogram matches that of another.

    The adjustment is applied separately for each channel.

    Parameters
    ----------
    image : ndarray
        Input image. Can be gray-scale or in color.
    reference : ndarray
        Image to match histogram of. Must have the same number of channels as
        image.
    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.

    Returns
    -------
    matched : ndarray
        Transformed input image.

    Raises
    ------
    ValueError
        Thrown when the number of channels in the input image and the reference
        differ.

    References
    ----------
    .. [1] http://paulbourke.net/miscellaneous/equalisation/

    z:Image and reference must have the same number of channels.r   zENumber of channels in the input image and reference image must match!)r
   .ÚfF)Úcopy)ÚndimÚ
ValueErrorr   r   Úemptyr
   Úranger    r   r   Ú_supported_float_typeÚastype)ÚimageÚ	referencer$   ÚmatchedÚchannelÚmatched_channelÚ	out_dtypes          r   Úmatch_histogramsr4   !   s  € ðD ‡z�z�Y—^‘^Ò#ÜØKó
ð 	
ð ÐØ�;‰;�r‰?˜iŸo™o¨bÑ1Ò1Üð.óð ô
 —(‘(˜5Ÿ;™;¨e¯k©kÔ:ˆÜ˜UŸ[™[¨™_Ö-ˆGÜ3Ø�c˜7�lÑ# Y¨s°G¨|Ñ%<óˆOð %4ˆG�C˜�LÒ!ñ	 .ô (¨¨yÓ9ˆà‡}�}×Ñ˜SÒ ä×/Ñ/°·±Ó<ˆ	Ø—.‘. °�.Ó7ˆØ€Nr!   )Únumpyr   Ú_sharedr   r    Úchannel_as_last_axisr4   © r!   r   Ú<module>r9      s4   ðÛ å ò=ð6 €×Ñ°&Ô9Ø7;ó ;ó :ñ;r!   