machinevisiontoolbox.Image.blobs

Image.blobs(**kwargs)

Find and describe blobs in image

Returns:

blobs in the image

Return type:

Blobs

Find all blobs in the image and return an object that contains geometric information about them. The object behaves like a list so it can be indexed and sliced.

Example:

>>> from machinevisiontoolbox import Image
>>> im = Image.Read('shark2.png')
>>> blobs = im.blobs()
>>> type(blobs)
<class 'machinevisiontoolbox.ImageBlobs.Blobs'>
>>> len(blobs)
2
>>> print(blobs)
┌───┬────────┬──────────────┬──────────┬───────┬───────┬────────┬────────┬────────┐
│id │ parent │     centroid │     area │ touch │ perim │ circul │ orient │ aspect │
├───┼────────┼──────────────┼──────────┼───────┼───────┼────────┼────────┼────────┤
│ 0 │     -1 │ 371.2, 355.2 │ 7.59e+03 │ False │ 556.6 │  0.343 │ -11.7° │  0.584 │
│ 1 │     -1 │ 171.2, 155.2 │ 7.59e+03 │ False │ 556.6 │  0.343 │ -11.7° │  0.584 │
└───┴────────┴──────────────┴──────────┴───────┴───────┴────────┴────────┴────────┘

References:
  • Robotics, Vision & Control for Python, Section 12.1.2.1, P. Corke, Springer 2023.