U
    ?h                     @   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 t||  k rl|k srn tdS )z7Test that the blur metric increases with more blurring.channel_axis   )sigmar
      r   N)r   r   r   AssertionErrorimageB0B1B2 r   X/var/www/html/venv/lib/python3.8/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 t||  kr\|ksbn t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   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 t||ksbt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   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 t||  k rt|k szn tdS )z.Test that the blur metric works on a 3D image.Nr   )r   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   