How to apply distance transform on labelled matrix

1 回表示 (過去 30 日間)
Rizwan Khan
Rizwan Khan 2020 年 7 月 17 日
コメント済み: Rizwan Khan 2020 年 7 月 21 日
I have got a labelled matrix and want to apply distance tranform on the diffent different labels in the matrix. How can it be done in matlab?
Thanks
  4 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 21 日
is this https://ieeexplore.ieee.org/document/885672
Rizwan Khan
Rizwan Khan 2020 年 7 月 21 日

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

回答 (1 件)

Anmol Dhiman
Anmol Dhiman 2020 年 7 月 20 日
Hi Rizwan,
I am assuming the matrix as binary. You can refer to Distance Transform of a Binary Image.
Regrds,
Anmol Dhiman
  3 件のコメント
Image Analyst
Image Analyst 2020 年 7 月 20 日
That's why it doesn't make sense. Why on earth would you even want to try to do a distance transform on a labeled image? What would even be the formula for distance in that case? And what would he do with the result? I think this is a case of a user thinking he wants something, but he really doesn't want that, he just doesn't know it yet.
Rizwan Khan
Rizwan Khan 2020 年 7 月 21 日
Dear Image Analyst,
This is the flowchart which i need to implement in matalb.
CC = bwconncomp(B,8);
L = labelmatrix(CC);
num = max(L(:));
D = zeros(size(B));
for iter = 1:Inf % loop for new regions
for j= 1:num
[r,c] = find(L==j);
for k = 1:size(r,1)
D = my_dist(B(r(k,1),c(k,1)));
end
L = watershed(D);
num1(j) = max(L(:));
end
num = sum(num1);
if abs(num(iter+1)-num(iter)) == 0
break
end
end

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by