o
    :ήc!                     @   s   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d Ze jdg d	d
d Ze jdg d	dd Zdd Ze jdg d	dd ZdS )    N)assert_array_equal)data)BRIEFcorner_peakscorner_harris)testingc                  C   s^   t d} t ddgddgg}tt t | | W d   dS 1 s(w   Y  dS )z=Brief descriptors can be evaluated on gray-scale images only.)   r                  N)npzerosasarrayr   raises
ValueErrorr   extract)img	keypoints r   G/tmp/pip-target-vg8gfxp4/lib/python/skimage/feature/tests/test_brief.py"test_color_image_unsupported_error
   s
   
"r   dtype)float32float64uint8intc              
   C   s   t  | }tt|dddd}t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	d}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expectedr   r   r   test_normal_mode   s$   

	r2   c              
   C   s   t  | }t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	d}t
|j| d	S )zEVerify the computed BRIEF descriptors with expected for uniform mode.r   r   r   r   r#   r$   uniform)r%   r&   modeN)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)   r/   r   r   r   test_uniform_mode*   s$   

	r5   c                   C   s:   t t tdd W d    d S 1 sw   Y  d S )Nfoobar)r4   )r   r   r   r   r   r   r   r   test_unsupported_modeB   s   "r7   c                 C   sj   t jd| d}t 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   r8   r(   r'   r   2   P   )   )
patch_sizer   r	   )FTTT)	r   r   r,   r   r   r.   shaper   mask)r   r   r   r0   r   r   r   test_borderG   s   "
r?   )pytestnumpyr   skimage._shared.testingr   skimager   skimage.featurer   r   r   skimage._sharedr   r   markparametrizer2   r5   r7   r?   r   r   r   r   <module>   s    

