필터 지우기
필터 지우기

Expand a coordinate array to be wider

조회 수: 1 (최근 30일)
Savannah D
Savannah D 2020년 11월 13일
편집: Matt J 2020년 11월 13일
Using bwboundary and regionprops, I have created a coordinate array of segmented objects "A". I have 64 "A" objects that have been segmented and I have their boundary coordinates (PixelList from regionprops). I am trying to elimate other objects "B" that are within 10 pixels of any "A" object. "A" and "B" never overlap but their close proximity has a negative effect on my final data analysis. Is there a way to expand on the "A" coordinate array so that I can separate A and B better?

답변 (1개)

Matt J
Matt J 2020년 11월 13일
편집: Matt J 2020년 11월 13일
I'm assuming A and B are the struct output from regionprops:
Z=false(size(BW));
Aunion=Z;
for i=1:numel(A)
Aunion(A(i).PixelIdxList)=1;
end
D=bwdist(Aunion)>=10;
discard=false(1,numel(B));
for i=1:numel(B)
Bi=Z;
Bi(B.PixelIdxList)=1;
discard(i)=any(Bi(:)&D(:)); %test for intersection
end
B(discard)=[];

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by