Development of an Interactive Application for Teaching Image Segmentation Techniques through Research-Based Learning
Description
Image segmentation is a fundamental process in digital image analysis that divides an image into meaningful regions, allowing the identification of distinct structures or objects. It plays a crucial role in high-level applications such as medical imaging, object recognition, and industrial inspection, where accurate segmentation enables automated analysis and decision-making. For instance, in the medical field, segmentation techniques are used to identify organs or lesions in CT and MRI scans, assisting in precise diagnoses. In computer vision, segmentation supports object detection tasks, such as pedestrian recognition in autonomous driving systems or pattern identification in surveillance systems. In industrial environments, segmentation helps identify and classify components on production lines, improving quality control and automation.
This project has led to the development of an interactive educational MATLAB application designed to support research-based learning in the field of image processing. The tool provides an intuitive and highly visual environment where students can load images, apply different segmentation methods, and visualize the results in real time. The application integrates a variety of techniques — including Otsu’s thresholding, k-means clustering, the Hough transform, Watershed segmentation, and active contours — along with preprocessing and postprocessing operations. Users can adjust parameters, experiment with different configurations, and save segmented images for further analysis and comparison.
The tool is intended to help students explore, experiment, and reason about which segmentation methods perform best depending on the characteristics of each image. Through this hands-on approach, they develop critical thinking and analytical skills, reinforcing theoretical concepts studied in class.
The application has been successfully implemented in three courses at the Universidad Politécnica de Madrid (UPM) and is designed to be modular and adaptable to different student profiles. This modular structure allows students with different levels of experience to engage at an appropriate depth — from exploring basic concepts to experimenting with advanced algorithmic parameters.
Image Segmentation app

The Figure shows a screenshot of the Image Segmentation app, whose content and main functionalities are described below.
- Panel 1 (in red in the Figure): o Original image: It shows the original image, in grayscale, to be segmented.
- Segmented image: It shows the result of the segmentation, representing each class with a different color.
- Panel 2 (in green in the figure): o It shows significant data of the image to be segmented, as well as some relevant data related to the results of the applied segmentation method. In the example shown in the Figure, the histogram of the original image and the threshold used to segment it are represented.
- Panel 3 (in blue in the Figure):
- Num. classes: Allows the selection of the number of classes to be obtained when segmenting the image.
- Time: Shows the time (in milliseconds) required to segment the image. These times are approximate and do not consider the time required to display images or update the application data.
- Method panel: It is a panel that allows the selection of the segmentation method to be applied. Depending on the chosen method, the content of the panel changes. It includes the following methods:
- Manual segmentation
- Otsu’s segmentation
- k-means segmentation
- Local thresholding
- Watershed-based segmentation
- Active contours-based segmentation
- Hough-based segmentation
- Tool bar (at the top of the interface):
- Load: It allows the selection of the image to work with (PNG format).
- Save: It saves the results obtained (the original image, the segmented image and the configuration parameters corresponding to the segmentation method used).
- All this data is saved in a folder that is automatically generated within a results folder in the same path where the application is located and whose name will include the current date and time.
Drawing functionalities
Some of the described segmentation methods (watersheds and active contours) include options to draw contours on the original image. This is done using the Matlab tool “drawassisted” (see Matlab help for details), which should be used as follows:
- Click the right mouse button on the point of the image where it is desired to start drawing the contour.
- Keep the button pressed while drawing the desired contour.
- Release the button near the starting point (before closing the contour).
- Click the right mouse button on the starting point to close the contour.
Note: The line defining the contour must be prevented from crossing itself.
Note: Before drawing can start, the cursor should appear as a cross when hovering over the image.¡
Video Tutorials
- Manual segmentation
- Otsu’s segmentation
- k-means segmentation
- Local thresholding
- Watershed-based segmentation
- Active contours-based segmentation
- Hough-based segmentation
Download
Acknowledgment
The authors would like to acknowledge the financial support of the Universidad Politécnica de Madrid through the Educational Innovation Project with code IE25.0905.
Contact
For further information about this work, please contact Carlos Cuevas at: This email address is being protected from spambots. You need JavaScript enabled to view it..
