Blobs.color#

property Blobs.color: Any#

Blob color

Returns:

blob color

Return type:

int

Blob color in a binary image. This is inferred from the level in the blob hierarchy. The background blob is black (0), the first-level child blobs are white (1), etc.

Example:

>>> from machinevisiontoolbox import Image
>>> im = Image.Read('multiblobs.png')
>>> blobs = im.blobs()
>>> blobs[2].color
0
>>> blobs.color
array([0, 1, 0, 0, 1, 0, 1, 1, 0, 1])
Seealso:

level parent children