Corrosion and expansion are two basic operations in digital morphology and are generally used for binary images (although RGB diagrams can also be used). To put it bluntly, the effect of corrosion is to make the dark area larger, and the effect of expansion is to make the bright area larger. One of the most typical application scenarios is that after you binarize, you can try two operations when your target and background are not very clean, and sometimes the effect is surprisingly good.
MATLAB Release Compatibility
Created with
R2022b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.