Mask 2D

class mask2d : public mln::se_facade<mask2d>

Creates a 2D structuring element based on a mask. Every non-zero value will add the 2D-point in the set. The SE is assumed to be anchored at the center of the mask, thus the mask must have odd dimensions.

mln::se::mask2d mask = {{0, 0, 1, 0, 0},
                                      {1, 1, 1, 1, 1}
                                      {0, 0, 1, 0, 0}};

Public Functions

mask2d(std::initializer_list<std::initializer_list<int>> values)

Initializer from a 2D array of values.

Parameters:

values – List of 0-1 to define the mask

Throws:

std::runtime_error – if the sizes of the list are not odd.

inline int radial_extent() const

Returns the radial extent of the mask.

mln::box2d compute_input_region(mln::box2d roi) const noexcept

Return the input region (the outer region needed for the roi computation)

Post:

this->compute_input_region(roi).includes(roi)

mln::box2d compute_output_region(mln::box2d roi) const noexcept

Return the output region (the valid inner region)

Pre:

roi.includes(this->se.compute_output_region(roi)