o
    h                     @   s   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d	 Zd
d Zdd Zdd Zdd Ze dd Zdd ZdS )    N)assert_array_equal)moon)CENSURE)run_in_parallel)testing)rescalec                  C   s8   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_image r   ]/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/feature/tests/test_censure.py"test_censure_on_rectangular_images   s   r   c                   C   sB   t t t td W d   dS 1 sw   Y  dS )z?Censure keypoints can be extracted from gray-scale images only.)   r      N)r   raises
ValueErrorr   r   r	   zerosr   r   r   r   4test_keypoints_censure_color_image_unsupported_error   s   "r   c                   C   s:   t t tdd W d   dS 1 s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   r   *test_keypoints_censure_mode_validity_error   s   "r   c                   C   s<   t t tddd W d   dS 1 s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   r   (test_keypoints_censure_scale_range_error#   s   "r!   c                  C   sz   t  } | t t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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      r,   r   r   r   r   r   r   N)r   r   imgr	   arrayr   	keypointsscalesdetectorexpected_keypointsexpected_scalesr   r   r   %test_keypoints_censure_moon_image_dob*   s   

	r5   c                  C   sr   t dd} | ttdddd tddgd	d
gddgddgddgg}t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   r,   N	r   r   r   r-   r	   r.   r   r/   r0   r1   r   r   r   )test_keypoints_censure_moon_image_octagon>   s   


rG   c               
   C   s~   t dd} | ttdddd tddgd	d
gddgddgddgddgddgg}t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   r7   Fr8   r9   r;   r<   r=   r>      V   k   rB   m   @   rC   rD   q   F   )r   r   r,   r   rE   r   r   NrF   r1   r   r   r   &test_keypoints_censure_moon_image_starT   s    


rP   )numpyr	   skimage._shared.testingr   skimage.datar   skimage.featurer   r   skimage._sharedr   skimage.transformr   r-   r
   seedr   r   r   r!   r5   rG   rP   r   r   r   r   <module>   s"    
