need function 'bwlabel' but without image toolbox.Is there any option?

4 ビュー (過去 30 日間)
Amy
Amy 2015 年 5 月 23 日
編集済み: Adam Danz 2020 年 1 月 3 日
I don't have license for image toolbox.Is there any way to do this function? Maybe source code ? I don't know. Thank u for helping :D Wish u a nice day

回答 (2 件)

Adam Danz
Adam Danz 2020 年 1 月 3 日
編集済み: Adam Danz 2020 年 1 月 3 日
I recently had to solve this problem without Image Processing Toolbox but this solution will only work for vector inputs.
% vector of grouped 1s, separated by 0s
v = mod(1:100,10) > 0;
% Solve without Image Processing Toolbox
vcs = cumsum(diff([0,v]) == 1); % if v is a column vector: [0;v]
L = zeros(size(v));
L(v) = vcs(v);
% Solve using Image Processing Toolbox
L2 = bwlabel(v);
% Compare outputs
isequal(L,L2) % = TRUE, they match

Walter Roberson
Walter Roberson 2015 年 5 月 23 日
References
[1] Haralick, Robert M., and Linda G. Shapiro, Computer and Robot Vision, Volume I, Addison-Wesley, 1992, pp. 28-48.
So you can look for that book and read the algorithm there and program it.
Or you could purchase a license for the Image Processing Toolbox.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by