o
    &?e                     @   sv   d dl Zd dlZd dlmZ d dlmZmZmZm	Z	m
Z
 dd Zdd Zdd	 Zd
d Zejje dddd ZdS )    N)has_mpl)FeatureDetectorDescriptorExtractor_prepare_grayscale_input_2D_mask_border_keypointsplot_matchesc                   C   s<   t t t d  W d    d S 1 sw   Y  d S N)pytestraisesNotImplementedErrorr   detect r   r   `/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/skimage/feature/tests/test_util.pytest_feature_detector
   s   "r   c                   C   s>   t t t d d  W d    d S 1 sw   Y  d S r   )r	   r
   r   r   extractr   r   r   r   test_descriptor_extractor   s   "r   c                   C   s   t t ttd W d    n1 sw   Y  t t ttd W d    n1 s3w   Y  t t ttd W d    n1 sOw   Y  ttd ttd ttd d S )N)   r   r   )r      )r   r   r   )r   r   )r   r   r   )r   r   r   )r	   r
   
ValueErrorr   npzerosr   r   r   r   test_prepare_grayscale_input_2D   s   r   c                  C   s   t ddgddgddgddgddgg} t jtd| dg d t jtd| dg d t jtd	| dg d
 t jtd| dg d t jtd| dg d d S )Nr   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   arraytestingZassert_equalr   )Z	keypointsr   r   r   test_mask_border_keypoints    s    (r   zMatplotlib not installed)reasonc               
   C   s  ddl m}  | jddd\}}d}dtjdd }dtjdd }tjjddd}tjjddd}t||f}|D ]C\}	}
t|	}t|
}t	|||||| t	||||||d	d
 t	||||||dd t	||||||dd t	||||||dd q<d S )Nr   )pyplotr   )ZnrowsZncols))r   r   )r      r   )r   r   r#   )r   r#   r#   )r"   r   )r$   r   )r%   r   r   r   )sizeT)Zonly_matchesr)Zkeypoints_color)Zmatches_colorvertical)Z	alignment)
Z
matplotlibr!   Zsubplotsr   randomZrandrandintZcolumn_stackr   r   )ZpltZfigaxZshapesZ
keypoints1Z
keypoints2Zidxs1Zidxs2matchesZshape1Zshape2Zimg1Zimg2r   r   r   test_plot_matches.   s2   

r-   )numpyr   r	   Z"skimage._shared._dependency_checksr   Zskimage.feature.utilr   r   r   r   r   r   r   r   r   markZskipifr-   r   r   r   r   <module>   s    