Image processing toolbox- bwtraceboundary function
5 次查看(过去 30 天)
显示 更早的评论
I have a figure for which i have to trace all the boundaries. I shall phrase my question into two parts 1) I want to run bwtraceboundary in the figure and automatically get information about all the boundaries. While doing this in a loop, the problem i faced was that one direction specified in the function (say north)is not sufficient to cover the entire figure and in the middle of the loop i get the following error
"??? Error using ==> bwtraceboundarymex The boundary trace failed to terminate correctly. The problem may have been caused by specifying an initial step direction that was inconsistent with the trace direction. Try specifying the trace direction explicitly."
So my question is how can i apply bwtraceboundary to get all the boundaries in the figure automatically without intervention.
2) I have applied a few other functions from bwmorph to make the figure better for bwtraceboundary, for ex- endpoints and remove. But in this process i am having some points whose boundary does not form a loop. Will this create some problem? In the case when i dont use bwmorph the figures are worse as compared to when i use them.
I hope i can get an answer mainly to my first question.
Thank you very Much, Karthik IIT Madras
0 个评论
回答(1 个)
Steve Eddins
2011-2-14
For question 1, use bwboundaries instead of bwtraceboundary. The function bwboundaries is intended to automatically trace all boundaries in a figure without intervention.
1 个评论
Meagan
2011-3-10
I would like to know if there is a way to use bwtraceboundary such that it does not matter which direction the function needs to go.
I also want to use this function to find the information about all of my boundaries, but I then take the specific boundary locations and further analyze them, so the format in which bwboundaries comes back does not work for me. Is there a way to specify in bwtraceboundary that if, for example, 'E' does not work, then try 'SE', or something to that effect? Thanks.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!