
    hh                     >   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                  j!                  dg d      d	        Ze j                  j!                  dg d      d
        Zd Ze j                  j!                  dg d      d        Zd Zy)    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               j                  | |       ddd       y# 1 sw Y   yxY w)z=Brief descriptors can be evaluated on gray-scale images only.)   r
                  N)npzerosasarrayr   raises
ValueErrorr   extract)img	keypointss     ^/var/www/html/dev/engine/venv/lib/python3.12/site-packages/skimage/feature/tests/test_brief.py"test_color_image_unsupported_errorr      s\    
((;
C

QFRH-.I	
	# (Y'( ( (s   
A..A7dtype)float32float64uint8intc                 P   t        j                         j                  |       }t        t	        |      ddd      }t        dd      }|j                  ||dd        t        j                  g d	g d
g d	g dg d
g dg d	g dgt              }t        |j                  |       y)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1Ic9Ra=)xx$$$$$$$$		
 H y,,h7    c                 r   t        j                         j                  |       }t        t	        |      ddd      }t        dddd	      }t        dddd	       |j                  ||d
d        t        j                  g dg dg dg dg dg dg dg dgt              }t        |j                  |       y
)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HI	!19!<c9Ra=)xx$$$$$$$$		
 H y,,h7r5   c                  x    t        j                  t              5  t        d       d d d        y # 1 sw Y   y xY w)Nfoobar)r8   )r   r   r   r    r5   r   test_unsupported_moder>   Q   s+    	
	# 8  s   09c                    t        j                  d|       }t        j                  ddgddgddgddgg      }t        dd      }|j	                  ||       |j
                  j                  d	   d
k(  sJ t        |j                  d       y )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~~'@Ar5   c                     t        j                  dt              } t        j                  ddgddgddgddgg      }t         j                  j                         }t        d|      }t        j                  |j                        j	                         }|j	                          |j                  | |       t        j                  |j                        j	                         }||k(  sJ y )	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imm$++-AJJLc9%imm$++-A6M6r5   )pytestrM   numpyr   skimage._shared.testingr   skimager   skimage.featurer   r   r   skimage._sharedr   r   markparametrizer4   r:   r>   rI   rQ   r=   r5   r   <module>rZ      s       6  > > #( "HI8 J8: "HI8 J8<
 "HIB JBr5   