Tracing in Matlab

11 ビュー (過去 30 日間)
Aaron
Aaron 2012 年 4 月 25 日
Just found this bit of code and I had a few questions:
I = imread('image.jpg');
BW = im2bw(I, graythresh(I));
[B,L] = bwboundaries(BW,'noholes');
imshow(label2rgb(L, @jet, [.5 .5 .5]))
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,5), 'w', 'LineWidth', 2)
end
Is it possible to not have it fill in holes with random colours?
Is it possible to animate the tracing process so that I can watch it being traced?
How would I go about rendering images so that they would fit in a specific size? (1980 x 1080 image to fit inside a 800 x 600 box).
I'll be putting all of this in a clean GUI so that it can browse and trace images straight from the GUI!
All help appreciated thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 4 月 25 日
The colors are controlled by the function being passed, @jet
  1 件のコメント
Aaron
Aaron 2012 年 4 月 25 日
How would I go about changing it? (To white for example and the tracing to be black)

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

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by