
    9ii                         S SK r S SKrS SKrS SKJr  S SKJrJr  S SK	J
r
  S SKJr  SrS r " S S	5      r " S
 S\R                   5      rg)    N)assert_equal)raiseswarns)expected_warnings)extrema-q=c                     [         R                  " U [         R                  S9n [         R                  " U[         R                  S9nX-
  S-  R                  5       n[        R
                  " U5      $ )Ndtype   )npasarrayfloat64summathsqrt)abts      e/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/morphology/tests/test_extrema.pydiffr      sL    


1BJJ'A


1BJJ'A
%AA99Q<    c                   P    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rSrg)TestExtrema   c                 r   [         R                  " / SQ/ SQ/ SQ/[         R                  S9n[        R                  " US5      n[         R                  " / SQ/ SQ/ SQ/[         R                  S9n[        X#5      nU[        :  d   e[        R                  " US5      n[         R                  " / S	Q/ S
Q/ SQ/[         R                  S9n[        XS5      nU[        :  d   e[         R                  " SS/SS//[         R                  S9n[        R                  " US5      n[         R                  " SS/SS//[         R                  S9n[        X#5      nU[        :  d   e[        R                  " US5      n[         R                  " SS/SS//[         R                  S9n[        XS5      nU[        :  d   eg)z*Adding/subtracting a constant and clipping)         r   )d            )   
         r
   r$   )      	   r*   )h      r)   r)   )      r      )      r&   r&   )`            )r      r   r   i  i  i ir&   ii  N)	r   arrayuint8r   _add_constant_clipr   eps_subtract_constant_clipint16)selfdataimg_constant_addedexpectederrorimg_constant_subtracteds         r   test_saturated_arithmetic%TestExtrema.test_saturated_arithmetic   sw    xx3]C288
 %77a@883]C288
 '2s{{")"A"A$"J882LA
 ,7s{{ xx%&&)9:"((K$77a@88eU^ff-=>bhhO'2s{{")"A"A$"J88eU^ff-=>bhhO,7s{{r   c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9n[         R                  " / S
Q/ S
Q/ SQ/ SQ/ S
Q/ S
Q/ S
Q/ SQ/ SQ/ S
Q/
[         R                  S	9n[         R                  [         R                  [         R                  [         R
                  4 HB  nUR                  U5      n[        R                  " US5      n[        X$5      nU[        :  a  MB   e   g)zh-maxima for various data types
r%         r.   r.      r.   r.   rH   rG   
rG   rH   rI      rK   rK   rK   rK   rI   rH   
rH   rI   (   rM      rN   rN   <   rO   rI   
r.   rK   rM   rM      rQ   rQ   rO   rO   rK   
r.   rK   rN   rQ   rQ   rQ   rQ   rQ   rN   rK   
rI   rK   rN   rQ   rQ      rQ   rQ   rN   rK   
r.   rK   P   rV   rQ   rQ   rQ   r    r    rK   
rH   rI   rV   rV   rN   rN   rN   r    r    rI   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   rM   N)r   r7   r8   uint64int8int64astyper   h_maximar   r:   r=   r>   expected_resultr   outrA   s         r   test_h_maximaTestExtrema.test_h_maxima6   s     xx8888888::8 ((
  ((.......... ((
 hh		277BHH=E;;u%D""4,C.E3;; >r   c                 R   [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9nS
U-
  n[         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9n[         R                  [         R                  [         R                  [         R
                  4 H^  nUR                  U5      n[        R                  " US5      n[        X$5      nU[        :  d   eUR                  UR                  :X  a  M^   e   g)zh-minima for various data typesrF   rJ   rL   rP   rR   rS   rU   rW   r
   r    rX   rY   rZ   rM   N)r   r7   r8   r[   r\   r]   r^   r   h_minimar   r:   r   r`   s         r   test_h_minimaTestExtrema.test_h_minima_   s     xx8888888::8 ((
 Tz((.......... ((
 hh		277BHH=E;;u%D""4,C.E3;;99 5 5555 >r   c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9nS
U-
  n[        R                  " US5      n[         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R
                  S	9n[        XC5      nU[        :  d   e[        R                  " US5      n[        XC5      nU[        :  d   eg)zspecific tests for float type
皙?)\(?p=
ף?Q?rn   333333?rn   rn   rm   rl   
rl   rm   ro   {Gz?rq   rq   rq   rq   ro   rm   
rm   ro   皙?rs   
ףp=
?rt   rt   333333?ru   ro   
rn   rq   rs   rs   RQ?rw   rw   ru   ru   rq   
rn   rq   rt   rw   rw   rw   rw   rw   rt   rq   
ro   gK?rt   rw   g&1?皙?rw   rw   rt   rq   
rn   rq   皙?r|   rw   rw   rw         ?r}   rq   
rm   ro   r|   r|   rt   rt   rt   r}   r}   ro   r
   r}   g~jth?rX   rZ   )
r   r   r   r   r&   r   r   r   r   r   N)	r   r7   float32r   r_   r8   r   r:   rf   )r=   r>   inverted_datarb   ra   rA   s         r   test_extrema_floatTestExtrema.test_extrema_float   s    xxLLLLLNLJJL **
 d
tU+((.......... ((
  _*s{{}e4_*s{{r   c                    Sn[         R                  SU2SU24   u  p#SSX!S-  -
  S-  X1S-  -
  S-  -   -  -
  nSUSS2SS24'   SUSS2S	S
24'   SUS	S
2SS24'   SUS	S
2S	S
24'   UR                  [         R                  5      n[         R                  " U5      nSXTS:  '   S H0  n[
        R                  " XF5      n[        XW5      nU[        :  a  M0   e   g)z,specific tests for h-maxima float image typer%   r   rT   rz   r   rM   r$   rO   r/   r*   rV   r    r}   gfffff3@r   gư>gMbP?g{Gz?rk   rk   N)	r   mgridr^   r   
zeros_liker   r_   r   r:   	r=   wxyr>   ra   hrb   rA   s	            r   test_h_maxima_float_image%TestExtrema.test_h_maxima_float_image   s    xx!QqS!CAAI!+qq5yQ.>>??QqS!A#XQqS!A#XQqS!A#XQqS!A#X{{2::&---),&?A""4+C.E3;; @r   c                 r   [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[         R                  " SSS5      nSnU HL  nUS	-  S:w  a  S
/nO/ n[	        U5         [
        R                  " X5      nSSS5        WS   S:X  d  MG  US	-  nMN     US:X  d   eg! , (       d  f       N+= f)z-specific tests for h-maxima float h parameter)r   r   r   r   r   )r   r'   r'   r'   r   )r   r'   r$   r'   r   r
   r}          @r    r   r&   (possible precision loss converting imageNr   r   )r   r7   r8   linspacer   r   r_   )r=   r>   h_valsfailuresr   msgsmaximas          r   test_h_maxima_float_h!TestExtrema.test_h_maxima_float_h   s    xx ((	
 S#s+A1uzBC"4( ))$2 ) d|q A  1}} )(   ,B((
B6	c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[        R                  " US5      n[         R
                  " U5      S:X  d   e[         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[        R                  " US5      n[         R
                  " U5      S:X  d   eg)	z.test that h-maxima works correctly for large h)r%   r%   r%   r%   r%   )r%   rH   rH   rH   r%   )r%   rH   r.   rH   r%   r
   r   r         @N)r   r7   r8   r   r_   r   r   r=   r>   r   s      r   test_h_maxima_large_h!TestExtrema.test_h_maxima_large_h       xx$$$$$ ((	
 !!$*vvf~"""xx$$$$$ **	
 !!$,vvf~"""r   c                    Sn[         R                  SU2SU24   u  p#SSX!S-  -
  S-  X1S-  -
  S-  -   -  -   nSUSS2SS24'   SUSS2S	S
24'   SUS	S
2SS24'   SUS	S
2S	S
24'   UR                  [         R                  5      n[         R                  " U5      nSXTS:  '   S H0  n[
        R                  " XF5      n[        XW5      nU[        :  a  M0   e   g)z,specific tests for h-minima float image typer%   r      rz   r      r$      r/   r*   x   r    r}   g33333f@r   N)	r   r   r^   r   r   r   rf   r   r:   r   s	            r   test_h_minima_float_image%TestExtrema.test_h_minima_float_image  s    xx!QqS!SQQY1,E	a/??@@QqS!A#XQqS!A#XQqS!A#XQqS!A#X{{2::&---*-'?A""4+C.E3;; @r   c                 r   [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[         R                  " SSS5      nSnU HL  nUS	-  S:w  a  S
/nO/ n[	        U5         [
        R                  " X5      nSSS5        WS   S:X  d  MG  US	-  nMN     US:X  d   eg! , (       d  f       N+= f)z-specific tests for h-minima float h parameter)r$   r$   r$   r$   r$   )r$   r&   r&   r&   r$   )r$   r&   r   r&   r$   r
   r}   r   r    r   r&   r   Nr   )r   r7   r8   r   r   r   rf   )r=   r>   r   r   r   r   minimas          r   test_h_minima_float_h!TestExtrema.test_h_minima_float_h  s    xx ((	
 S#s+A1uzBC"4( ))$2 ) d|q A  1}} )(r   c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[        R                  " US5      n[         R
                  " U5      S:X  d   e[         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/[         R                  S9n[        R                  " US5      n[         R
                  " U5      S:X  d   eg)	z.test that h-minima works correctly for large h)r.   r.   r.   r.   r.   )r.   rG   rG   rG   r.   )r.   rG   r%   rG   r.   r
   r   r   r   N)r   r7   r8   r   rf   r   r   r   s      r   test_h_minima_large_h!TestExtrema.test_h_minima_large_h3  r   r    N)__name__
__module____qualname____firstlineno__rC   rc   rg   r   r   r   r   r   r   r   __static_attributes__r   r   r   r   r      s7    >'R(6T)V&<#<&:#r   r   c            
       ,   \ rS rSrSr\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  /
r\R"                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/\R                  S	9r\R"                  " / S
Q/ S
Q/ SQ/ SQ/ SQ/ SQ/\S	9r\R"                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/\S	9rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S!r#g")#TestLocalMaximaiR  z1Some tests for local_minima are included as well.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   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   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   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   c                 b   [         R                  " [        R                  " / /5      SS9nUR                  S:X  d   eUR
                  [        :X  d   eUR                  S:X  d   e[         R                  " [        R                  " / 5      SS9n[        U[        5      (       d   e[        U5      S:X  d   eUS   R                  S:X  d   eUS   R
                  [        R                  :X  d   e[         R                  " [        R                  " / /5      SS9n[        U[        5      (       d   e[        U5      S:X  d   eUS   R                  S:X  d   eUS   R
                  [        R                  :X  d   eUS   R                  S:X  d   eUS   R
                  [        R                  :X  d   eg)	zTest result with empty image.F)indicesr   )r&   r   Tr&   r   N)r   local_maximar   r7   sizer   boolshape
isinstancetuplelenintp)r=   results     r   
test_emptyTestLocalMaxima.test_empty  sd   %%bhhtneD{{a||t###||v%%%%%bhhrlDA&%((((6{aay~~"""ay"'')))%%bhhtndC&%((((6{aay~~"""ay"'')))ay~~"""ay"'')))r   c                     U R                    H]  n[        R                  " U R                  R	                  U5      5      nUR
                  [        :X  d   e[        X R                  5        M_     g)zATest results with default configuration for all supported dtypes.N)	supported_dtypesr   r   imager^   r   r   r   expected_default)r=   r   r   s      r   test_dtypesTestLocalMaxima.test_dtypes  sQ    **E))$***;*;E*BCF<<4'''!6!67 +r   c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9n[         R                  " / S
Q/ S
Q/ SQ/ SQ/ S
Q/ SQ/ S
Q/ SQ/ SQ/ S
Q/
[        S	9nU R                   HK  nUR                  U5      n[        R                  " U5      nUR                  [        :X  d   e[        XR5        MM     g)zg
Test results with default configuration and data copied from old unit
tests for all supported dtypes.
rF   rJ   rL   rP   rR   rS   rU   rW   r
   rX   rZ   )
r   r   r   r   r   r&   r   r   r   r   N)
r   r7   r8   r   r   r^   r   r   r   r   )r=   r>   r@   r   r   r   s         r   test_dtypes_oldTestLocalMaxima.test_dtypes_old  s    
 xx8888888::8 ((
 88.......... 
 **EKK&E))%0F<<4'''*	 +r   c                    [         R                  " U R                  SS9nUR                  [        :X  d   e[        XR                  5        [         R                  " U R                  SS9nUR                  [        :X  d   e[        X R                  5        [         R                  " U R                  SS9nUR                  [        :X  d   e[        X0R                  5        g)z&Test results if footprint is a scalar.r&   )connectivityr   r'   N)r   r   r   r   r   r   expected_crossr   )r=   result_conn1result_conn2result_conn3s       r   test_connectivity!TestLocalMaxima.test_connectivity  s     ++DJJQG!!T)))\#6#67 ++DJJQG!!T)))\#8#89 ++DJJQG!!T)))\#8#89r   c           	      V   [         R                  " / SQ/ SQ/ SQ/[        S9n[        R                  " U R
                  US9nUR                  [        :X  d   e[        X R                  5        S[         R                  " S[         R                  S9[         R                  " S[         R                  S9[         R                  " S[        S94 HM  n[        R                  " U R
                  US9nUR                  [        :X  d   e[        X@R                  5        MO     [         R                  " / SQ/ SQ/ SQ/[        S9n[         R                  " / SQ/ S	Q/ S
Q/ SQ/ SQ/ SQ/[        S9n[        R                  " U R
                  US9nUR                  [        :X  d   e[        Xv5        g)z#Test results if footprint is given.)r   r&   r   )r&   r&   r&   r
   	footprint)TTTr   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   r   r&   r   r   r   )r   r   r&   r   r&   r   r   r   r&   r&   r   r   r   r   r   N)r   r7   r   r   r   r   r   r   r   onesr   r8   r   )r=   footprint_crossresult_footprint_crossr   result_footprint_squarefootprint_xexpected_footprint_xresult_footprint_xs           r   test_footprintTestLocalMaxima.test_footprint  sV   ((Iy)#DDQ!(!5!5JJ/"
 &++t333+-@-@A GGF"**-GGF"((+GGF$'	
I '.&:&:

i'# +00D88802G2GH
 hh	9i@M!xx====== 
 
 %11$**T!''4///'>r   c                 0   [         R                  " U R                  5      n[        R                  " U R
                  SSS9n[        X!5        [         R                  " U R                  5      n[        R                  " U R
                  SSS9n[        XC5        g)z,Test output if indices of peaks are desired.r&   T)r   r   r   N)r   nonzeror   r   r   r   r   r   )r=   expected_conn1r   expected_conn2r   s        r   test_indicesTestLocalMaxima.test_indices  sp     D$7$78++DJJQPTU\2 D$9$9:++DJJQPTU\2r   c           	      r   [         R                  " U R                  SSS9nUR                  [        :X  d   e[        XR                  5        [        R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/[        S	9n[         R                  " U R                  SS
S9nUR                  [        :X  d   e[        X25        g)z*Test maxima detection at the image border.r&   T)r   allow_borders)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
   FN)	r   r   r   r   r   r   r   r   r7   )r=   result_with_boderexpected_without_borderresult_without_borders       r   test_allow_borders"TestLocalMaxima.test_allow_borders  s     $00JJQd
 !&&$...&(;(;<"$((====== 
#
 !( 4 4JJQe!
 !&&$...*Dr   c                    [         R                  " / SQ5      n[         R                  " / SQ[        S9n[        R                  " U5      nUR
                  [        :X  d   e[        X25        [         R                  " S[         R                  S9n[         R                  " S[        S9nSUSSS2SS24'   SUS	'   SUSSS2SS24'   SUS	'   SUS
S2SS4'   SUS
S2SS4'   SUSS
S2S
S24'   SUS'   SUSS
S2S
S24'   USS2S
S2S
S24==   S-  ss'   SUSS
S2S
S24'   SUSS
S2S
S24'   SUSS2SS2SS24'   SUS'   SUS'   [        R                  " U5      nUR
                  [        :X  d   e[        Xe5        g)z%Test one- and three-dimensional case.)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&   r6   r6   r   r/   2   r6   r)   )r/   r/   r/   N)	r   r7   r   r   r   r   r   zerosr8   )r=   x_1dexpected_1d	result_1dx_3dexpected_3d	result_3ds          r   test_ndTestLocalMaxima.test_nd)  s    xx9:hh@M((.	$&&&Y, xx	2hhy5Q!QqS[WQ!QqS[ GQqS!QY!"AaCAIQ!QqS[WQ!QqS[QqS!A#qs]r!#$AqsAaCK #$AqsAaCK !QqS!A#qs]W G((.	$&&&Y,r   c                    [         R                  " SS[         R                  S9n[         R                  " S[         R                  S9nU R                   H  nUR                  U5      n[        R                  " U5      nUR                  [        :X  d   e[        XB5        [        R                  " U5      nUR                  [        :X  d   e[        XB5        M     g)z!Test behaviour for 'flat' images.)r/   r6   *   r
   N)r   fullr8   r   r   r^   r   r   r   r   r   local_minima)r=   const_imager@   r   r   s        r   test_constantTestLocalMaxima.test_constantL  s    ggfb988F"((3**E%,,U3K))+6F<<4'''*))+6F<<4'''* +r   c                    [         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[         R                  S	9nS
U-
  n[         R                  " / SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/ SQ/
[        S	9n[        R
                  " U5      nUR                  [        :X  d   e[        XC5        [        R                  " U5      nUR                  [        :X  d   e[        XC5        g)zSpecific tests for float type.rj   rp   rr   rv   rx   ry   r{   r~   r
   r}   rX   rZ   )
r   r&   r   r   r&   r   r   r   r   r   N)	r   r7   r   r   r   r   r   r   r   )r=   r   inverted_imagera   r   s        r   r   "TestLocalMaxima.test_extrema_float[  s     LLLLLNLJJL **
 u((.......... 
" %%e,||t###V- %%n5||t###V-r   c                     [         R                  " / SQ/ SQ/ SQ/ SQ/5      n[        R                  " U5      n[         R                  " / SQ/ SQ/ SQ/ SQ/5      n[	        X#5        g )N)Ԕdn2;׭;r	  r  )r	  R;r
  r	  )FFFF)FTTF)r   r7   r   r   r   )r=   r   r   ra   s       r   test_extrema_small_float(TestLocalMaxima.test_extrema_small_float  s\    PPPP	
 %%e,((,**,	
 	V-r   c           	         [        [        SS9   [        R                  " U R                  [
        R                  " S[        S9S9  SSS5        [        [        SS9   [        R                  " U R                  [
        R                  " S[        S9S9  SSS5        [        [        SS9   [        R                  " U R                  [
        R                  " S	[        S9S9  SSS5        [        [        SS9   [        R                  " U R                  [
        R                  " S
[        S9S9  SSS5        [        [        SS9   [        R                  " [
        R                  " S[
        R                  S95        SSS5        g! , (       d  f       GNE= f! , (       d  f       GN
= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g= f)z5Test if input validation triggers correct exceptions.znumber of dimensionsmatch)r'   r'   r'   r
   r   N)r'   zdimension size)r   r'   )r   r   zfloat16 which is not supportedr&   )r   
ValueErrorr   r   r   r   r   r   	TypeErroremptyfloat16)r=   s    r   test_exceptionsTestLocalMaxima.test_exceptions  s     J&<=  rwwyPT7UV >J&<=  rwwt47PQ > J&67  rwwvT7RS 8J&67  rwwvT7RS 8 I%EF  !2::!>? GF >=== 8777 GFs;   7F7F)7F(67F98G

F
F%(
F69
G

Gc                    Sn[         R                  " SS/5      n[        R                  " USS9  [	        [
        US9   [        R                  " USS9nSSS5        [        WSS/5        UR                  [        :X  d   e[         R                  " SS	/S	S	//5      n[        R                  " USSS
9  [	        [
        US9   [        R                  " USSS
9nSSS5        [        U[         R                  " S[         R                  S95        US   R                  [         R                  :X  d   eUS   R                  [         R                  :X  d   eg! , (       d  f       GN= f! , (       d  f       N= f)a  Test output for arrays with dimension smaller 3.

If any dimension of an array is smaller than 3 and `allow_borders` is
false a footprint, which has at least 3 elements in each
dimension, can't be applied. This is an implementation detail so
`local_maxima` should still return valid output (see gh-3261).

If `allow_borders` is true the array is padded internally and there is
no problem.
z0maxima can't exist .* any dimension smaller 3 .*r   r&   T)r   r  FNr   )r   r   )r   r   r
   )r   r7   r   r   r   UserWarningr   r   r   r   r   )r=   warning_msgr   r   s       r   test_small_array TestLocalMaxima.test_small_array  s    IHHaVQd3;k2))!5AF 3VaV$||t###HHq!fq!f%&QdDA;k2))!5$OF 3VRXXfBGG<=ay"'')))ay"''))) 32 32s   E E%
E"%
E3r   N)$r   r   r   r   __doc__r   r8   uint16uint32r[   r\   r<   int32r]   r   r   r   r7   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r  r   r   r   r   r   r   R  s%   ; 	
		
		
		









 HH999999	
 hh
E xx999999	
 
 XX999999	
 
N**8'+R:"%?N
3E6!-F++.Z..@"*r   r   )r   unittestnumpyr   numpy.testingr   pytestr   r   skimage._shared.testingr   skimage.morphologyr   r:   r   r   TestCaser   r   r   r   <module>r&     sG       &   5 & y# y#x	w*h'' w*r   