Is it possible to thicken lines of a binary image without thickening the ends?
14 次查看(过去 30 天)
显示 更早的评论
I m trying to thicken white lines on a binary image using the function
bwmorph(myImage, 'thicken')
however when the ends expand they are closing a space that I don't want closed. Is there a way to say identify the ends and exclude the ends from being thickened? I tried the dilate function also but this did the same.
So if I can use the skeleton option for bwmorph, I can identify end points, but when applying thicken can you do so ignoring identified end points?
0 个评论
回答(1 个)
Image Analyst
2015-9-3
Identify the endpoints, then find a line from the endpoints back a few pixels. Then find the equation of the line perpendicular to that - hint: slope will be -1/slope. Then create a mask where it's true inside the line area and false outside the line area. Then dilate the line with imdilate and AND with the mask to "chop off" the pixels beyond the end of the line.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!