Binary Morphology in Image Processing

Interactive courseware module that introduces the fundamental morphological operations used in image processing.

117 descargas

Actualizado 27 Jan 2023

De GitHub

Ver licencia en GitHub

Binary Morphology in Image Processing

View Binary Morphology in Image Processing on File Exchange or Open in MATLAB Online

Curriculum Module
Created with R2020a. Compatible with R2020a and later releases.


This package contains a live script and supporting files to illustrate and apply the fundamentals of morphological operations used for processing binary images. The materials are designed to be flexible and can be easily modified to accommodate a variety of teaching and learning methods. The package includes definitions and a brief background, interactive illustrations of concepts, guided tasks, reflection questions, application examples, and practice problems for the concepts explored in this module.

Learning Goals

  • Define and apply the primary morphological operations—erosion and dilation.
  • Explain the use of relational and logical operators in the context of binary image processing.
  • Define and apply compound morphological operations like opening and closing.
  • Explain the effect of using structuring elements of different shapes and sizes for each morphological operation.
  • Identify and apply the appropriate morphological operations and structuring elements to achieve a given processing outcome.
  • Use simple shapes to filter objects in an image.

This module contains several illustrative animations. For the best experience, run it one section at a time to begin. The instructions will guide you through each section while also allowing for free exploration of ideas. To stop running the script or a section midway (for example, when an animation is in progress), use the Stop button in the Run section of the Live Editor tab in the MATLAB® toolstrip.

Suggested Prework

MATLAB Onramp – a free two-hour introductory tutorial to learn the essentials of MATLAB.


binaryMorphologyBasics.mlx Open in MATLAB Online This is an interactive guided lesson that introduces the fundamentals of morphological image processing. Students identify and apply basic operators to process binary images to perform tasks such as extracting object boundaries and filtering objects by shapes. It is the main script for this module.

This is a supplementary script containing solutions to the three guided practice problems contained in binaryMorphologyBasics.mlx.

This folder contains several binary images used for illustration and practice in binaryMorphologyBasics.mlx. The main script adds this folder to your search path and provides controls to switch between the images when applicable. Ensure that this folder is in the same folder as the main script. Alternatively, ensure that all the required images are in the MATLAB search path.


MATLAB, Image Processing Toolbox™


The license for this module is available in the LICENSE.TXT file in this GitHub repository.

Educator Resources

Have any questions or feedback? Contact the MathWorks online teaching team.

Copyright 2021 The MathWorks, Inc.

Citar como

Emma Smith Zbarsky (2023). Binary Morphology in Image Processing (, GitHub. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2020a
Compatible con cualquier versión desde R2020a
Compatibilidad con las plataformas
Windows macOS Linux
Comunidades de usuarios

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión

See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


Para consultar o notificar algún problema sobre este complemento de GitHub, visite el repositorio de GitHub.
Para consultar o notificar algún problema sobre este complemento de GitHub, visite el repositorio de GitHub.