How to Remove Blobs from Image using morphological operations

5 views (last 30 days)
I am doing a project for doing a project for digits recognition using morphological image processing. Here I need to remove Blobs of digits like 9 or 6. I got a link of matlab as http://www.mathworks.in/matlabcentral/fileexchange/20114-removing-blobs-from-a-binary-image But the method bwremove not found error occurs. Can any one help me PLZ. I did as
I=imread('I.tif')
I=imcomplement(I)
I2=imfill(I,'holes');
I3=I2-I
I5=I2-I3
I6=imcomplement(I3)
In I5 I tried to get stem by subtracting the blob from filled image. Since I3 is inside of Blobs It gives the origin image. If I could increase size of I3 keeping the dimension same i.e. like adding pixels repeatedly on boundary of I3 until I get it large enough to outer boundary of the Blobs it would be OK. Any proper logic for this PLZ

Answers (3)

Image Analyst
Image Analyst on 15 Nov 2013
It's hard to visualize. Can you attach your image so we can try your code? What criteria are you applying to the blobs to determine if a blob represents a number 6 or number 9? The Euler number? That's what I'd use assuming that the blobs have the holes completely surrounded (no breaks in the circle around them). You can get the Euler number from regionprops().

Kalyanbrat
Kalyanbrat on 18 Nov 2013
Thank You for your answer. Here is my image. I need to remove the round blob so that I can get only the stem. From the position of the stem I can determine that it is 9. Since 6 and 9 both contains blob, mere knowing that a blob presents we can not say it is 9 or 6. we need stem position. So first I want to remove blob. I do not know How Euler number is use to determine a Blob. I am a novice to mat lab.
  1 Comment
Image Analyst
Image Analyst on 24 Apr 2023
You can tell the difference between a 6 and a 9 just from the centroid. If the centroid of the blob is in the upper half of the bounding box, it's a 9. Otherwise it's a 6 because the centroid is in the lower half of the bounding box.

Sign in to comment.


Kalyanbrat
Kalyanbrat on 18 Nov 2013

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!