o
    ci	                     @   sp   d dl Zd dlZd dlZdd Zdd Zdd Zdd	 Zej	
d
g ddd Zej	
dddgdd ZdS )    Nc                  C   s   t j } t jj| dd}t jjt jj| ddddd}t jjt jj| ddddd}d|  kr6dk s9J  J ||  k rD|k sGJ  J dS )z7Test that the blur metric increases with more blurring.channel_axis   )sigmar      r   N)skidata	astronautmeasureblur_effectfiltersgaussianimageB0B1B2 r   p/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/skimage/measure/tests/test_blur_effect.pytest_blur_effect   s   
 r   c                  C   sz   t j } t jj| ddd}t jj| dd}t jj| ddd}d|  kr*dk s-J  J ||  kr8|ks;J  J dS )	z\Test that the blur metric decreases with increasing size of the
    re-blurring filter.
       r   )h_sizer   r      r   r   N)r   r	   r
   r   r   r   r   r   r   test_blur_effect_h_size   s   
 r   c                  C   s   t j } t jj| dd}t jt j| }t jj| ddd}t jjt j| dd}d|  kr7dk s:J  J ||ks@J tj	|| 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   colorrgb2graynptestingassert_array_equal)r   r   r   B0_arrB1_arrr   r   r   test_blur_effect_channel_axis!   s   
r#   c                  C   s   t j dddddddf } t j| }t jt jj| dd}t jt jj| dd}d|  kr:dk s=J  J ||  k rH|k sKJ  J dS )z.Test that the blur metric works on a 3D image.Nr   )r   r   r   )r   r	   cells3dr   r   r   r   )image_3dr   r   r   r   r   r   test_blur_effect_3d/   s   " r&   factor)r   r   g      @c                 C   s.   t d|  }tjj|dd}|dksJ dS )z=Test that the blur metric is 1 for completely uniform images.)
   r(   r   r   r   r   N)r   onesr   r   r   )r'   r   Br   r   r   test_blur_effect_uniform_input9   s   r+   shape)r(      )r         c                 C   s:   t dd| d }t || }tj|}|dksJ dS )zKTest that the blur metric is 1 for an image that is uniform along one axis.r   r   r   N)r   linspacebroadcast_tor   r   r   )r,   rowr   r*   r   r   r   $test_blur_single_axis_constant_imageA   s   r3   )numpyr   pytestskimager   r   r   r#   r&   markparametrizer+   r3   r   r   r   r   <module>   s    

