Use erode to wear away the edges of an image. Erosion spreads light objects in an image further apart.
• erode(M, Melem, r_origin, c_origin, b)—Performs binary erosion on matrix M at threshold b using structuring element Melem with origin at row r_origin and column c_origin.
The function has a binary output: foreground is always set to 255, while background is always set to 0.
Arguments
• M is an image matrix.
• Melem is a vector or matrix.
• b is a real number.
• r_origin, c_origin are integers, where sign indicates direction.