Blobs.fillfactor#

property Blobs.fillfactor: Any#

Fill factor, ratio of area to bounding box area

Returns:

fill factor

Return type:

int

Return the ratio, \(\le 1\), of the blob area to the area of the bounding box. This is a simple shape metric which is invariant to blob position and scale.

Example:

>>> from machinevisiontoolbox import Image
>>> im = Image.Read('shark2.png')
>>> blobs = im.blobs()
>>> blobs[0].fillfactor
np.float64(0.06216625716625716)
>>> blobs.fillfactor
array([0.0622, 0.3667])

Note

The bounding box is the smallest box with vertical and horizontal edges that fully encloses the blob.

Seealso:

bbox