Blobs

Include <mln/labeling/blobs.hpp>

template<std::integral Label, Image I>
image_ch_value_t<I, Label> blobs(I input, Neighborhood nbh, int &nlabel)

Labelize the connected components of binary image.

Template Parameters:

Label

The integral numeric type (std::is_integral_v<Label> is true) for the labels, filling the following requirements:

  • Label is signed: sizeof(Label) <= sizeof(int)

  • Label is unsigned: sizeof(Label) < sizeof(int)

Parameters:
  • input – Input image

  • nbh – Neighborhood

  • nlabel – The number of labels in the image

Returns:

An image of label from [0:nlabel] (label 0 is the background label)

Exception:

std::runtime_error if the number of labels overflows

Notes

Complexity

Linear.