필터 지우기
필터 지우기

Sort pixelIdxList Array as descending order based on their number of pixels.

조회 수: 2 (최근 30일)
numPixels = cellfun(@numel,CC.PixelIdxList);
numPixels =
1015 951 719 852 760 550 503
I want to sort this value and their indexes also. how can I do this?

채택된 답변

Image Analyst
Image Analyst 2017년 6월 19일
Not sure who told you that convoluted complicated way of determining the number of pixels in the labeled objects. You can do this so much easier by doing this:
props = regionprops(CC, 'Area');
sortedAreas = sort([props.Area], 'descend'); % Areas = "numPixels"

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by