Extract and sort size of matrix where in the cell

조회 수: 1 (최근 30일)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2021년 12월 5일
댓글: Amir Azadeh Ranjbar 2021년 12월 5일
clc;clear;close all
im= [0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 1 1 0 0
0 0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0];
cc=bwconncomp(im);
for i=1:cc.NumObjects
CC{i}=cc.PixelIdxList{i}
end
Size=zeros(1,cc.NumObjects);
for j=1:cc.NumObjects
Size(:,i)=size(cell2mat(CC(j)))
end
  댓글 수: 3
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2021년 12월 5일
Hi
I want sort Connected Components by theire Size
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2021년 12월 5일
Find areas that theire size are larger than a specified threshold (threshold for size)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by