
    9i	                         S SK rS SKrS SKrS rS rS rS r\R                  R                  S/ SQ5      S 5       r\R                  R                  S	S
S/5      S 5       rg)    Nc                     [         R                  R                  5       n [         R                  R	                  U SS9n[         R                  R	                  [         R
                  R                  U SSS9SS9n[         R                  R	                  [         R
                  R                  U SSS9SS9nSUs=::  a  S:  d   e   eXs=:  a  U:  d   e   eg)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/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/measure/tests/test_blur_effect.pytest_blur_effectr      s    HH E		 	 R	 	8B		 	 U!"=B 
! 
B 
	 	 U!"=B 
! 
B ;Q;;;<R<<<    c                  >   [         R                  R                  5       n [         R                  R	                  U SSS9n[         R                  R	                  U SS9n[         R                  R	                  U SSS9nSUs=::  a  S:  d   e   eXs=:  a  U:  d   e   eg)	zTTest 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     HH E		 	 qr	 	BB		 	 R	 	8B		 	 r	 	CB;Q;;;<R<<<r   c                     [         R                  R                  5       n [         R                  R	                  U SS9n[         R                  R	                  [         R
                  R                  U 5      5      n[         R                  R	                  U SSS9n[         R                  R	                  [         R
                  R                  U 5      SS9nSUs=::  a  S:  d   e   eX:X  d   e[        R                  R                  X45        g)zOTest 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     HH E		 	 R	 	8B		 	 !3!3E!:	;B[[$$U$NF[[$$SYY%7%7%>D$QF;Q;;;8O8JJ!!&1r   c                     [         R                  R                  5       SS2SSS2SS24   n [         R                  R	                  U 5      n[         R                  R	                  [         R
                  R                  U SS95      n[         R                  R	                  [         R
                  R                  U SS95      nSUs=::  a  S:  d   e   eXs=:  a  U:  d   e   eg)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    xx!!Q1*-H		 	 	*B		 	 !5!5ha!5!H	IB		 	 !5!5ha!5!H	IB;Q;;;<R<<<r   factor)r   r   g      @c                     [         R                  " S5      U -  n[        R                  R	                  USS9nUS:X  d   eg)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   s;     GGK 6)EB7A6M6r   shape)r.      )r	         c                     [         R                  " SSU S   5      n[         R                  " X5      n[        R                  R                  U5      nUS:X  d   eg)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   sG     ++aE"I
&COOC'E&A6M6r   )numpyr"   pytestskimager
   r   r   r'   r+   markparametrizer1   r:    r   r   <module>rA      sq      	2 ;/ 0 8Y"78 9r   