フィルターのクリア

How can I extract each connected object in a 3D array?

2 ビュー (過去 30 日間)
May
May 2017 年 3 月 1 日
コメント済み: Image Analyst 2017 年 3 月 2 日
I have a 3D array (attached as Y.mat) and I find the connected components using bwconncomp. I used the following coding to extract each component but X is a zero array with the same size as Y. Please, help me to solve this problem.
Thanks
May
CC = bwconncomp(Y, 26); % Y is the 3D array
L = labelmatrix(CC);
for i=1:length(CC.PixelIdxList)
X = (L==i);
imshow3D(a); % use existing function to show 3D
end

採用された回答

Image Analyst
Image Analyst 2017 年 3 月 1 日
Use ismember
oneBlobOnly = ismember(L, i);
  2 件のコメント
May
May 2017 年 3 月 2 日
Thanks Image Analyst,I tried it but the result is not change. Please kindly help me , where I made wrong. Thank you so much again.
load Y;
CC = bwconncomp(Y, 26); % Y is the 3D array
L = labelmatrix(CC);
oneBlobOnly = ismember(L,2);
map = hsv(90);
XR = oneBlobOnly; %%If I show "Y", it can show.
Ds = smooth3(XR);
hiso = patch(isosurface(Ds,5),'FaceColor','blue','EdgeColor','none');
hcap = patch(isocaps(XR,5),'FaceColor','interp','EdgeColor','none');
colormap(map)
daspect(gca,[1,1,.4])
lightangle(305,30);
fig = gcf;
fig.Renderer = 'zbuffer';
lighting phong
isonormals(Ds,hiso)
hcap.AmbientStrength = .6;
hiso.SpecularColorReflectance = 0;
hiso.SpecularExponent = 50;
ax = gca;
ax.View = [215,30];
ax.Box = 'On';
axis tight
title('One Blob');
Image Analyst
Image Analyst 2017 年 3 月 2 日
You forgot to attach Y.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by