How to fill the region of interest by white color
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (2)
Walter Roberson
il 31 Dic 2013
0 voti
Your gaps are fairly big and are going to cause you problems, I suspect.
9 Commenti
hamed abdulaziz
il 31 Dic 2013
Modificato: hamed abdulaziz
il 31 Dic 2013
hamed abdulaziz
il 31 Dic 2013
hamed abdulaziz
il 31 Dic 2013
Modificato: hamed abdulaziz
il 31 Dic 2013
hamed abdulaziz
il 31 Dic 2013
Modificato: Walter Roberson
il 31 Dic 2013
Image Analyst
il 31 Dic 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
il 31 Dic 2013
hamed abdulaziz
il 31 Dic 2013
Walter Roberson
il 31 Dic 2013
Consider using Alpha Shapes. The effect can be like putting an elastic band around the object, effectively closing the curve.
Image Analyst
il 1 Gen 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
il 31 Dic 2013
0 voti
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 Commenti
hamed abdulaziz
il 31 Dic 2013
Modificato: Image Analyst
il 31 Dic 2013
hamed abdulaziz
il 31 Dic 2013
Spostato: DGM
il 13 Feb 2023
hamed abdulaziz
il 31 Dic 2013
Spostato: DGM
il 13 Feb 2023
hamed abdulaziz
il 31 Dic 2013
Spostato: DGM
il 13 Feb 2023
Image Analyst
il 31 Dic 2013
Spostato: DGM
il 13 Feb 2023
Sometimes I have to leave the house to do things like buy food.
Walter Roberson
il 31 Dic 2013
Spostato: DGM
il 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
il 31 Dic 2013
Spostato: DGM
il 13 Feb 2023
So, did you try the concave hull demo I gave you?
Image Analyst
il 31 Dic 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
il 1 Gen 2014
Which "ant algorithm" ? Ant Colony Optimization?
Image Analyst
il 1 Gen 2014
Not sure, but that's what I assumed. It's the only ant algorithm I've ever heard of.
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





