How to fill the region of interest by white color
Show older comments
Hi All,
I have this Black and white mask

I want to fill the region of interest to be like this

approximatlly by white color to use it for segmentation later,please any could help by a Matlab code to do this job,thanks in advance.
Accepted Answer
More Answers (2)
Walter Roberson
on 31 Dec 2013
0 votes
Your gaps are fairly big and are going to cause you problems, I suspect.
9 Comments
hamed abdulaziz
on 31 Dec 2013
Edited: hamed abdulaziz
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
Edited: hamed abdulaziz
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
Edited: Walter Roberson
on 31 Dec 2013
Image Analyst
on 31 Dec 2013
Link doesn't work. Please fix it. Did you adjust the threshold to the best value as you were following the demo? I also have an app for that in my File Exchange.
hamed abdulaziz
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
Walter Roberson
on 31 Dec 2013
Consider using Alpha Shapes. The effect can be like putting an elastic band around the object, effectively closing the curve.
Image Analyst
on 1 Jan 2014
Alpha shapes might be good. Sometimes the boundary can go inside the points so you have to be aware of how you do it to make sure it gives you a boundary you are happy with. Concave hull doesn't go inside points (I don't think) though it can jump gaps. I don't have experience with alpha shapes (though I'd like to) but I do have experience with concave hulls.
Image Analyst
on 31 Dec 2013
0 votes
How did you get that bad mask in the first place? I think it might be better to improve it from the start than to try to fix up a bad one. If you need to use that one I'd just close with a bigger disk, or use imline to burn a line into the images manually, or use edge linking methods, or use the concave hull (restricted convex hull, demo attached).
10 Comments
hamed abdulaziz
on 31 Dec 2013
Edited: Image Analyst
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
hamed abdulaziz
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
hamed abdulaziz
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
Image Analyst
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
Sometimes I have to leave the house to do things like buy food.
Walter Roberson
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
hamed, it is New Years Eve in North America. We have celebration preparations to make. And house-work to do. And other people to answer here. And several other forums on various topics that we are dealing with as well.
Also with the effect of the wind, the temperature outside my house is -40C at the moment (-48C last night) so I am on edge about whether my furnace will break or not.
Image Analyst
on 31 Dec 2013
Moved: DGM
on 13 Feb 2023
So, did you try the concave hull demo I gave you?
Image Analyst
on 31 Dec 2013
Why do you have to use ant? What is the original image? What is the bottom image in your original question? It looks masked - how did you do that if your edges are broken? What's the original unmasked image look like, so I can see if edge detection is best or if you can get by with simple thresholding? Did you try anything I suggested? I'm not inclined to offer more until I get my questions answered.
Walter Roberson
on 1 Jan 2014
Which "ant algorithm" ? Ant Colony Optimization?
Image Analyst
on 1 Jan 2014
Not sure, but that's what I assumed. It's the only ant algorithm I've ever heard of.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




