o
    h                     @   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   Z/var/www/html/scripts/venv/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testingassert_equalr   )	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   )nrowsncols))r   r   )r      r   )r   r   r'   )r   r'   r'   )r&   r   )r(   r   )r)   r   r   r   )sizeT)only_matchesr)keypoints_color)matches_colorvertical)	alignment)

matplotlibr#   subplotsr   randomrandrandintcolumn_stackr   r   )pltfigaxshapes
keypoints1
keypoints2idxs1idxs2matchesshape1shape2img1img2r   r   r   test_plot_matches.   s2   

rD   )numpyr   r	   "skimage._shared._dependency_checksr   skimage.feature.utilr   r   r   r   r   r   r   r   r!   markskipifrD   r   r   r   r   <module>   s    