Key Facts
- Category
- Design
- Input Types
- file, number, select
- Output Type
- file
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The Image Morphological Closing tool performs a sequence of dilation followed by erosion to clean up binary images. This process effectively fills small holes, gaps, and noise within shapes while connecting nearby objects, making it an essential utility for image preprocessing and computer vision tasks.
When to Use
- •When you need to remove small black noise or holes from white objects in a binary image.
- •When you want to bridge small gaps between fragmented parts of an object to create a solid shape.
- •When preparing images for contour detection or segmentation where object continuity is required.
How It Works
- •Upload your binary image file (JPEG, PNG, WEBP, etc.) to the tool.
- •Adjust the number of iterations to control the intensity of the hole-filling effect.
- •Select the kernel size (Standard 3x3 or Large 5x5) to define the scope of the morphological operation.
- •Process the image to download the cleaned, closed version.
Use Cases
Examples
1. Restoring Fragmented Text
Data Entry Specialist- Background
- A batch of scanned receipts contains text with broken characters due to low-quality printing.
- Problem
- The OCR software fails to recognize characters because of small gaps and holes within the letters.
- How to Use
- Upload the scanned image and apply the closing operation with 1 iteration and the standard 3x3 kernel.
- Example Config
-
iterations: 1, kernelType: 'default' - Outcome
- The small gaps in the characters are filled, resulting in solid, legible text that the OCR software can process accurately.
2. Cleaning Binary Segmentation Masks
Computer Vision Researcher- Background
- A machine learning model generated a segmentation mask for an object, but the mask contains internal noise and small holes.
- Problem
- The mask is not a solid shape, which interferes with downstream object measurement tasks.
- How to Use
- Upload the binary mask and use the large 5x5 kernel with 2 iterations to ensure all internal holes are filled.
- Example Config
-
iterations: 2, kernelType: 'large' - Outcome
- The mask becomes a solid, continuous shape with all internal noise removed, ready for precise area calculation.
Try with Samples
image, png, jpgRelated Hubs
FAQ
What is morphological closing?
It is a mathematical morphology operation that performs dilation followed by erosion, which helps to close small gaps and fill holes in foreground objects.
What type of images work best?
Binary images (black and white) provide the most predictable results, as the operation is designed to distinguish between foreground and background pixels.
How do iterations affect the output?
Increasing the number of iterations makes the closing effect stronger, filling larger holes and connecting more distant objects.
What is the difference between kernel sizes?
The Standard 3x3 kernel provides subtle closing, while the Large 5x5 kernel covers a wider area, making it more effective for filling larger gaps.
Will this tool change my image resolution?
No, the tool modifies the pixel values based on morphological rules but maintains the original dimensions of your input image.