Periodic Line

class periodic_line2d

Create a line with points points equally spaced from the origin in a given direction V of length \(l = 2n+1\).

\[ L_{n,V} = \{ -n.V, -(n-1).V, ..., -V, (0,0), V, ..., (n-1).V, n.V \} \]

V defines the period of the line.

Public Functions

periodic_line2d(mln::point2d V, int k) noexcept

Create a line of period V and number of pixels \(L = 2k+1\).

Parameters:
  • V – The period.

  • k – Half-number of pixels in the line. \precondition k >= 0

rng_t offsets() const noexcept

Return a range of SE offsets.

inline int size() const noexcept

Return the number of pixels in the line.

inline int repetition() const noexcept

Return the number of repetitions k.

inline mln::point2d period() const noexcept

Return the period.

int radial_extent() const noexcept

Return the extent radius.

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)

bool is_horizontal() const noexcept

Return true if the line is a pure horizontal (dy=0 and dx=1)

bool is_vertical() const noexcept

Return true if the line is a pure vertical (dx=0 and dy=1)

Performance

The speed of a dilation (or erosion) by a periodic line does not depend on its length.