a
    
d                     @   sd   d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 dd Zdd	 Zd
d Zdd ZdS )    )assert_array_equal)rgb2gray)	astronautcells3d)gaussian)blur_effectc                  C   sv   t  } t| dd}tt| ddddd}tt| ddddd}d|  krRdk sXn J ||  k rl|k srn J dS )z7Test that the blur metric increases with more blurring.channel_axis   )sigmar
      r   N)r   r   r   imageB0B1B2 r   o/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/skimage/measure/tests/test_blur_effect.pytest_blur_effect	   s    r   c                  C   sf   t  } t| ddd}t| dd}t| ddd}d|  krBdk sHn J ||  kr\|ksbn J dS )	z\Test that the blur metric decreases with increasing size of the
    re-blurring filter.
       r   )Zh_sizer
   r	      r   r   N)r   r   r   r   r   r   test_blur_effect_h_size   s    r   c                  C   sp   t  } t| dd}tt| }t| ddd}tt| dd}d|  krPdk sVn J ||ksbJ t|| dS )zWTest that passing an RGB image is equivalent to passing its grayscale
    version.
    r   r	   N)r
   reduce_func)r   r   r   )r   r   r   r   )r   r   r   ZB0_arrZB1_arrr   r   r   test_blur_effect_channel_axis!   s    r   c                  C   s~   t  dddddddf } t| }tt| dd}tt| dd}d|  krZdk s`n J ||  k rt|k szn J dS )z.Test that the blur metric works on a 3D image.Nr   )r   r   r   )r   r   r   )Zimage_3dr   r   r   r   r   r   test_blur_effect_3d/   s    r   N)Znumpy.testingr   Zskimage.colorr   Zskimage.datar   r   Zskimage.filtersr   Zskimage.measurer   r   r   r   r   r   r   r   r   <module>   s   