フィルターのクリア

how to trace ordered external counter of an object

1 回表示 (過去 30 日間)
Silvia Caruso
Silvia Caruso 2015 年 5 月 30 日
コメント済み: Image Analyst 2015 年 5 月 30 日
Hello,I need to order point on boundary.I have a logical image so I use bwtraceboundary, but the results is a Bb matrix empty.Can someone help me to understand the reason?I wrote this code:
[filename,pathname]=uigetfile('*.jpg');
im=imread([pathname filename]);
figure,imshow(im,[])
T=graythresh(im);
It=im2bw(im,T);
figure, imshow(It,[])
Bb=bwtraceboundary(It,[12 33],'E',8,Inf,'clockwise')
where r=12 e c=33 is the first pixel of the boundary that I want to order. I attach also the image. Thank you

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 30 日
It = ~im2bw(im,T);
Remember, black is "no object" for the purpose of boundary tracing.
  3 件のコメント
Silvia Caruso
Silvia Caruso 2015 年 5 月 30 日
sorry, I was making a mistake! you are right..thank you!
Silvia Caruso
Silvia Caruso 2015 年 5 月 30 日
Are you able to answer to my question below?

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2015 年 5 月 30 日
To get ordered points, use the much simpler bwboundaries(). You only would need to use bwtraceboundaries() if you, for some reason, wanted to start at one special, known pixel location. I have never ever needed to do that in all my image processing with MATLAB, or even before (that I can remember). The starting point just doesn't make any difference to me. It can start wherever it wants to as far as I'm concerned. That relieves me of having to find a starting point, which is not easy, or at the very least, a step that does not need to be done with bwboundaries(). Are you sure you need to start at one specific point? If so, why?
  5 件のコメント
Silvia Caruso
Silvia Caruso 2015 年 5 月 30 日
編集済み: Silvia Caruso 2015 年 5 月 30 日
Yes, I need to apply the edge splitting technique to the boundary of a letter, like here: http://dip.sun.ac.za/~hanno/tw444/lesings/lesing_19.pdf
Image Analyst
Image Analyst 2015 年 5 月 30 日
OK, good luck. What a funny coincidence -- that is the same paper Walter mentioned in the link I gave you in my last comment. I have not done that before so I don't have any code for it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeExplore and Edit Images with Image Viewer App についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by