U
    ?h#                     @   s   d dl Zd dlmZ d dlmZmZmZ d dlm	Z	m
Z
 d dlmZ ee ZedkZdd Zd	d
 ZejfdddddZdd Zdd Zdd Zdd Zdd Zdd ZdS )    N)assert_array_equal)colordata
morphology)binary	isotropic)img_as_boolg?c                  C   sP   t td dd df d} tttd dd df td}t| | d S )Nd         	r   isotropic_erosionbw_imgr   r   binary_erosionr   diskr   isotropic_res
binary_res r   Y/var/www/html/venv/lib/python3.8/site-packages/skimage/morphology/tests/test_isotropic.pytest_non_square_image   s     r   c                  C   s0   t td} ttttd}t| | d S Nr   r   r   r   r   r   test_isotropic_erosion   s    r   T)strict_radiusspacingc                C   sp   t |  | d }t ||\}}|d k	rB||d 9 }||d 9 }|sN| d7 } t j|d |d  | d k|dS )N   r   g      ?   dtype)npZarangeZmeshgridarray)radiusr   r   r   LXYr   r   r   _disk_with_spacing   s    r%   c                  C   s6   t jtddd} ttttddd}t| | d S )N   )r   r   )r   )r   isotropic_dilationr   r   r   binary_dilationr%   r   r   r   r   r   test_isotropic_erosion_spacing(   s    r)   c                  C   s0   t td} ttttd}t| | d S r   )	r   r'   r   r   r   r(   r   r   r   r   r   r   r   test_isotropic_dilation.   s     r*   c                  C   s0   t td} ttttd}t| | d S r   )	r   Zisotropic_closingr   r   r   Zbinary_closingr   r   r   r   r   r   r   test_isotropic_closing6   s    r+   c                  C   s0   t td} ttttd}t| | d S r   )	r   Zisotropic_openingr   r   r   Zbinary_openingr   r   r   r   r   r   r   test_isotropic_opening<   s    r,   c                  C   sR   t jdtd} d| ddddf< t| d}tt| t	d}t
|| d S )N)   r-   r   Tr      	   )r   Zzerosboolr   r   r   r   r   r   r   r   )imgr   r   r   r   r   test_footprint_overflowB   s
    r2   c                  C   sf   t jt jfD ]T} d}td}t|}| }| |||d t||ksPtt	|| || qd S )Nr   )
   r3   )out)
r   r   r'   r   ZonesZ
zeros_likecopyanyAssertionErrorr   )funcr!   r1   r4   Z	out_savedr   r   r   test_out_argumentJ   s    

r9   )numpyr   Znumpy.testingr   Zskimager   r   r   Zskimage.morphologyr   r   Zskimage.utilr   Zrgb2grayZ	astronautr1   r   r   r   Zuint8r%   r)   r*   r+   r,   r2   r9   r   r   r   r   <module>   s   