clear connected pixel touching a non square border
显示 更早的评论
hi, i am trying to remove the border objects from an image of an octogonal sample. plese see the image
i would like to know if there is a way to create a mask that is octogonal and then perhaps apply imclearborder.
other suggestions are very welcome.
thank, S
采纳的回答
更多回答(1 个)
Image Analyst
2012-2-17
1 个投票
Threshold to get the dark outer octagon. You might need to dilate this a layer or two. Then threshold to get the bright particles. Then AND those two together. This gets you a combined binary image that has both the dark surround and the bright inner particles. Then call imclearborder() and subtract from your original combined binary image to get a binary image of just the dark surround and the particles that touch it. Then use that to mask out (zero out, erase) the bright particles that touch the border from your original image.
Your flickr web site says "The owner has disabled downloading of their photos" so I can't get a copy unless you want me to.
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!