o
    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   b/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/morphology/tests/test_isotropic.pytest_non_square_image   s
   r   c                  C   0   t td} ttttd}t| | d S Nr   r   r   r   r   r   test_isotropic_erosion      r   T)strict_radiusspacingc                C   sp   t |  | d }t ||\}}|d ur!||d 9 }||d 9 }|s'| d7 } t j|d |d  | d k|dS )N   r   g      ?   dtype)nparange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   r   r   )	r   r+   r   r   r   r,   r   r   r   r   r   r   r   test_isotropic_dilation.   s   
r.   c                  C   r   r   )	r   isotropic_closingr   r   r   binary_closingr   r   r   r   r   r   r   test_isotropic_closing6   r   r1   c                  C   r   r   )	r   isotropic_openingr   r   r   binary_openingr   r   r   r   r   r   r   test_isotropic_opening<   r   r4   c                  C   sR   t jdtd} d| ddddf< t| d}tt| t	d}t
|| d S )N)   r5   r   Tr      	   )r!   zerosboolr   r   r   r   r   r   r   r   )imgr   r   r   r   r   test_footprint_overflowB   s
   r;   c                  C   sf   t jt jfD ]*} d}td}t|}| }| |||d t||ks(J t|| || qd S )Nr   )
   r<   )out)	r   r   r+   r!   ones
zeros_likecopyanyr   )funcr%   r:   r=   	out_savedr   r   r   test_out_argumentJ   s   

rD   )numpyr!   numpy.testingr   skimager   r   r   skimage.morphologyr   r   skimage.utilr   rgb2gray	astronautr:   r   r   r   uint8r)   r-   r.   r1   r4   r;   rD   r   r   r   r   <module>   s     