binaryerosion
Binary erosion is a fundamental operation in mathematical morphology used to shrink foreground regions in binary images. Given a binary image A, typically with foreground value 1 and background value 0, and a structuring element B, the erosion of A by B, denoted A ⊖ B, consists of all locations x where B translated to x fits entirely inside A.
In discrete form, (A ⊖ B)(x) = min{ A(x + b) : b ∈ B }. When A and B are binary,
Properties and relationships: erosion is anti-extensive, meaning A ⊖ B ⊆ A. It is monotone with respect to
Openings and closings are derived operations: opening is (A ⊖ B) ⊕ B, and closing is (A ⊕ B)