# What Is the MATLAB imreconstruct() Useful For?

Could some one tell reasons to use the MATLAB imreconstruct function when processing images? I already have studied the topic and what the function actually does to the image. However, I cannot figure what we would use it for. What output should we expect from calling doing this function?

• Anything missing in my answer? Please let me know. – Royi Mar 2 '20 at 10:26

## 2 Answers

It could be useful in the field of OCR as a pre processing step.

Think about badly scanned data.
You'd like to convert it into binary image.
So the first step would be applying some kind of thresholding.
Since no thresholding is perfect, There will be some "Holes" / "Gaps" within the text.

Closing those "Holes" / "Gaps" can be done using morphological operations.

Some applications are scanned text document (OCR as mentioned previously), fluorescently stained cell nuclei, or galaxies in a far-infrared telescope image. It can be used for extract marked objects, find bright regions surrounded by dark pixels, detect or remove objects touching the image border, detect or fill in object holes, filter out spurious high or low points, and perform many other operations.