
    1-Ph                     L   d dl Z d dlZd dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlmZ d Ze j                            dg d          d	             Ze j                            dg d          d
             Zd Ze j                            dg d          d             Zd ZdS )    N)assert_array_equal)data)BRIEFcorner_peakscorner_harris)testingc                  
   t          j        d          } t          j        ddgddgg          }t          j        t
                    5  t                                          | |           ddd           dS # 1 swxY w Y   dS )z=Brief descriptors can be evaluated on gray-scale images only.)   r
                  N)npzerosasarrayr   raises
ValueErrorr   extract)img	keypointss     `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/feature/tests/test_brief.py"test_color_image_unsupported_errorr      s    
(;

C
QFRH-..I	
	#	# ( (Y'''( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (s   #A88A<?A<dtype)float32float64uint8intc                    t          j                                        |           }t          t	          |          ddd          }t          dd          }|                    ||dd                    t          j        g d	g d
g d	g dg d
g dg d	g dgt                    }t          |j        |           dS )zDVerify the computed BRIEF descriptors with expected for normal mode.r   r   皙?min_distancethreshold_absthreshold_rel      )descriptor_sizesigmaN)   r)   r)   r   r)   r)   r   r)   )r   r)   r)   r   r)   r)   r   r   )r   r   r   r)   r   r   r)   r   )r   r)   r)   r   r)   r)   r)   r   )r)   r   r)   r   r   r)   r)   r   r   r   coinsastyper   r   r   r   r   arrayboolr   descriptorsr   r   r   	extractorexpecteds        r   test_normal_moder4      s     *,,

e
$
$Cc!3  I aq111Ic9RaR=)))x$$$$$$$$$$$$$$$$$$$$$$$$		
   H y,h77777    c                    t          j                                        |           }t          t	          |          ddd          }t          dddd	          }t          dddd	           |                    ||d
d                    t          j        g dg dg dg dg dg dg dg dgt                    }t          |j        |           d
S )zEVerify the computed BRIEF descriptors with expected for uniform mode.r   r   r    r!   r%   r&   uniformr)   )r'   r(   moderngN)r   r)   r   r)   r   r)   r)   r   )r   r)   r   r   r   r)   r   r)   )r   r)   r   r   r   r)   r)   r)   )r)   r   r)   r   r)   r   r)   r)   )r   r   r)   r   r   r)   r   r)   )r   r)   r   r)   r   r)   r   r)   )r)   r   r)   r)   r)   r   r   r)   r*   r+   r1   s        r   test_uniform_moder:   2   s    *,,

e
$
$Cc!3  I aqyaHHHI	!19!<<<<c9RaR=)))x$$$$$$$$$$$$$$$$$$$$$$$$		
   H y,h77777r5   c                      t          j        t                    5  t          d           d d d            d S # 1 swxY w Y   d S )Nfoobar)r8   )r   r   r   r    r5   r   test_unsupported_moder>   Q   s    	
	#	#  8                 s   8<<c                    t          j        d|           }t          j        ddgddgddgddgg          }t          dd          }|                    ||           |j        j        d	         d
k    sJ t          |j        d           d S )Nd   rA   r*   r)   r
   2   P   )   
patch_sizer9   r   r   )FTTT)	r   r   r.   r   r   r0   shaper   mask)r   r   r   r2   s       r   test_borderrI   V   s    
(:U
+
+
+C1a&2r(RHr2h?@@I+++Ic9%%% &q)Q....y~'@AAAAAr5   c                     t          j        dt                    } t          j        ddgddgddgddgg          }t           j                                        }t          d|          }t          j        |j	                                                  }|                                 |
                    | |           t          j        |j	                                                  }||k    sJ d S )	Nr@   r*   r)   r
   rB   rC   rD   rE   )r   r   r   r.   randomdefault_rngr   copydeepcopyr9   r   )r   r   r9   r2   xzs         r   test_independent_rngrQ   b   s    
(:S
)
)
)C1a&2r(RHr2h?@@I
)


!
!C---Iim$$++--AJJLLLc9%%%im$$++--A666666r5   )pytestrM   numpyr   skimage._shared.testingr   skimager   skimage.featurer   r   r   skimage._sharedr   r   markparametrizer4   r:   r>   rI   rQ   r=   r5   r   <module>rZ      sS         6 6 6 6 6 6       > > > > > > > > > > # # # # # #( ( ( "H"H"HII8 8 JI8: "H"H"HII8 8 JI8<  
 "H"H"HIIB B JIB    r5   