
    1-PhY                         d dl Zd dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ  e            Zej                            d            d Zd	 Zd
 Zd Zd Z e            d             Zd ZdS )    N)assert_array_equal)moon)CENSURE)run_in_parallel)testing)rescalec                  
   t           j                            dd          } t           j                            dd          }t                                          |           t                                          |            dS )z>Censure feature detector should work on 2D image of any shape.i,     N)nprandomrandr   detect)
rect_imagesquare_images     b/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/feature/tests/test_censure.py"test_censure_on_rectangular_imagesr      sb    S))J9>>#s++LII\"""IIZ         c                      t          j        t                    5  t                                          t          j        d                     ddd           dS # 1 swxY w Y   dS )z?Censure keypoints can be extracted from gray-scale images only.)   r      N)r   raises
ValueErrorr   r   r   zeros r   r   4test_keypoints_censure_color_image_unsupported_errorr      s    	
	#	# 0 0		+..///0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0s   4AA"Ac                      t          j        t                    5  t          d           ddd           dS # 1 swxY w Y   dS )zJMode argument in keypoints_censure can be either DoB, Octagon or
    STAR.dummymodeNr   r   r   r   r   r   r   *test_keypoints_censure_mode_validity_errorr!      s     

	#	#  W                 s   8<<c                      t          j        t                    5  t          dd           ddd           dS # 1 swxY w Y   dS )z~Difference between the the max_scale and min_scale parameters in
    keypoints_censure should be greater than or equal to two.      )	min_scale	max_scaleNr    r   r   r   (test_keypoints_censure_scale_range_errorr'   #   s     

	#	# * *!q))))* * * * * * * * * * * * * * * * * *s   9= =c                  4   t                      } |                     t                     t          j        ddgddgddgddgd	d
gddgddgddgddgg	          }t          j        g d          }t          || j                   t          || j                   dS )znVerify the actual Censure keypoints and their corresponding scale with
    the expected values for DoB filter.   i  $   .   w   i^        i     ie     i  t   i     i  i  )	r      r3   r$   r$   r   r$   r$   r$   N)r   r   imgr   arrayr   	keypointsscalesdetectorexpected_keypointsexpected_scaless      r   %test_keypoints_censure_moon_image_dobr<   *   s     yyHOOCIH#J#J#J#J#J#J#J
	
  h:::;;O)8+=>>>88888r   c                  B   t          d          } |                     t          t          ddd                     t	          j        ddgd	d
gddgddgddgg          }t	          j        g d          }t          || j                   t          || j                   dS )zrVerify the actual Censure keypoints and their corresponding scale with
    the expected values for Octagon filter.octagonr         ?Fconstantanti_aliasingr            Y      W   j   ;   o   C   )r   r$      r$   r3   N	r   r   r   r4   r   r5   r   r6   r7   r8   s      r   )test_keypoints_censure_moon_image_octagonrO   B   s    
 I&&&HOOGCULLLMMMB8b"XBx#rSRTI"VWWh//O)8+=>>>88888r   c            
      N   t          d          } |                     t          t          ddd                     t	          j        ddgd	d
gddgddgddgddgddgg          }t	          j        g d          }t          || j                   t          || j                   dS )zoVerify the actual Censure keypoints and their corresponding scale with
    the expected values for STAR filter.starr   r?   Fr@   rA   rC   rD   rE   rF      V   k   rJ   m   @   rK   rL   q   F   )r   r$   r3   r$   rM   r   r$   NrN   r8   s      r   &test_keypoints_censure_moon_image_starrY   R   s     F###HOOGCULLLMMM
bB8b"XRy3)c2Yb	R  h44455O)8+=>>>88888r   )numpyr   skimage._shared.testingr   skimage.datar   skimage.featurer   r   skimage._sharedr   skimage.transformr   r4   r   seedr   r   r!   r'   r<   rO   rY   r   r   r   <module>ra      s&       6 6 6 6 6 6       # # # # # # 3 3 3 3 3 3 # # # # # # % % % % % % dff 	q   ! ! !0 0 0  * * *9 9 90 9 9 99 9 9 9 9r   