
    9i                     $    S SK rSSKJr   SS jrg)    N   )gaussianc                    [         R                  R                  U5      n[        U /U-  5      n[         R                  " U5      n[        [        SU-  5      U-  S5      nXR                  X(45      -  R                  [        5      n	SU[        S U	 5       5      '   [        USU -  U-  SS9n[         R                  " USSU-
  -  5      n
[         R                  " Xz:  5      $ )ap  
Generate synthetic binary image with several rounded blob-like objects.

Parameters
----------
length : int, optional
    Linear size of output image.
blob_size_fraction : float, optional
    Typical linear size of blob, as a fraction of ``length``, should be
    smaller than 1.
n_dim : int, optional
    Number of dimensions of output image.
volume_fraction : float, default 0.5
    Fraction of image pixels covered by the blobs (where the output is 1).
    Should be in [0, 1].
rng : {`numpy.random.Generator`, int}, optional
    Pseudo-random number generator.
    By default, a PCG64 generator is used (see :func:`numpy.random.default_rng`).
    If `rng` is an int, it is used to seed the generator.

Returns
-------
blobs : ndarray of bools
    Output binary image

Examples
--------
>>> from skimage import data
>>> data.binary_blobs(length=5, blob_size_fraction=0.2)  # doctest: +SKIP
array([[ True, False,  True,  True,  True],
       [ True,  True,  True, False,  True],
       [False,  True, False,  True,  True],
       [ True, False, False,  True,  True],
       [ True, False, False, False,  True]])
>>> blobs = data.binary_blobs(length=256, blob_size_fraction=0.1)
>>> # Finer structures
>>> blobs = data.binary_blobs(length=256, blob_size_fraction=0.05)
>>> # Blobs cover a smaller volume fraction of the image
>>> blobs = data.binary_blobs(length=256, volume_fraction=0.3)

g      ?   c              3   $   #    U  H  ov   M     g 7f)N ).0indicess     Z/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/data/_binary_blobs.py	<genexpr>binary_blobs.<locals>.<genexpr>8   s     -f7wfs   g      ?F)sigmapreserve_ranged   )nprandomdefault_rngtuplezerosmaxintastyper   
percentilelogical_not)lengthblob_size_fractionn_dimvolume_fractionrngrsshapemaskn_ptspoints	thresholds              r   binary_blobsr&      s    Z 
		s	#B6(U"#E88E?DC,,-6:Eyy%0088=F12D-f-	-.D6M$66uD dC1+>$?@I>>$*++    )i   g?r   g      ?N)numpyr   _shared.filtersr   r&   r   r'   r   <module>r*      s     & KO7,r'   