
    0-Ph	                         d dl Zd dlZd dlZd Zd Zd Zd Zej	        
                    dg d          d             Zej	        
                    d	d
dg          d             ZdS )    Nc                     t           j                                        } t           j                            | d          }t           j                            t           j                            | dd          d          }t           j                            t           j                            | dd          d          }d|cxk    rdk     sn J ||cxk     r|k     sn 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B2s       f/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/measure/tests/test_blur_effect.pytest_blur_effectr      s    H  E		 	 R	 	8	8B		 	 U!"==B 
! 
 
B 
	 	 U!"==B 
! 
 
B ;;;;Q;;;;;;<<<<R<<<<<<<<    c                  P   t           j                                        } t           j                            | dd          }t           j                            | d          }t           j                            | dd          }d|cxk    rdk     sn J ||cxk    r|k    sn 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   s       r   test_blur_effect_h_sizer      s     H  E		 	 qr	 	B	BB		 	 R	 	8	8B		 	 r	 	C	CB;;;;Q;;;;;;<<<<R<<<<<<<<r   c                  .   t           j                                        } t           j                            | d          }t           j                            t           j                            |                     }t           j                            | dd          }t           j                            t           j                            |           d          }d|cxk    rdk     sn 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_arrs        r   test_blur_effect_channel_axisr'   !   s     H  E		 	 R	 	8	8B		 	 !3!3E!:!:	;	;B[$$U$NNF[$$SY%7%7%>%>D$QQF;;;;Q;;;;;;8888J!!&&11111r   c                     t           j                                        dddddddf         } t           j                            |           }t           j                            t           j                            | d                    }t           j                            t           j                            | d                    }d|cxk    rdk     sn J ||cxk     r|k     sn 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   s       r   test_blur_effect_3dr+   /   s    x!!!!!Q111*-H		 	 	*	*B		 	 !5!5ha!5!H!H	I	IB		 	 !5!5ha!5!H!H	I	IB;;;;Q;;;;;;<<<<R<<<<<<<<r   factor)r   r   g      @c                     t          j        d          | z  }t          j                            |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   Bs      r   test_blur_effect_uniform_inputr1   9   sC     GK  6)EB77A666666r   shape)r.      )r	         c                     t          j        dd| d                   }t          j        ||           }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   )r2   rowr   r0   s       r   $test_blur_single_axis_constant_imager:   A   sR     +aE"I
&
&COC''E&&A666666r   )numpyr"   pytestskimager
   r   r   r'   r+   markparametrizer1   r:    r   r   <module>rA      s              	 	 	2 2 2   ;;;//  0/ 8Y"788  98  r   