필터 지우기
필터 지우기

how to count the number of pixels of each region in an image ( searching for big regions) ?

조회 수: 1 (최근 30일)
I want to count the number of pixels in each region of an image. The image contains more than one region and i want to ignore the big regions, so i want to search for big regions. Does any one know how to do this
  댓글 수: 2
Matt Kindig
Matt Kindig 2013년 4월 1일
편집: Matt Kindig 2013년 4월 1일
How are the "regions" defined in your image? Can these regions be identified from using bwlabel() or similar? Linking to your image would also help.

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

채택된 답변

Image Analyst
Image Analyst 2013년 4월 1일
Use regionprops(). Assuming you already have a binary image of your regions, get all the areas like this:
% Measure all blob areas.
blobMeasurements = regionprops(binaryImage, 'Area');
allAreas = [blobMeasurements.Area]
% Sort in ascending order
[sortedAreas, sortIndexes] = sort(allAreas, 'ascend');
% Take the first 10 smallest:
smallAreas = sortedAreas(1:10);
  댓글 수: 2
Shahd Ewawi
Shahd Ewawi 2013년 4월 1일
편집: Shahd Ewawi 2013년 4월 1일
i cant use regionprops() . because currently i work on matlab as simulation and i want to convert the code to php so i cant use this function
Image Analyst
Image Analyst 2013년 4월 1일
Then you'll have to write your own connected components labeling routine. Why are you even using MATLAB at all then? Why not just do everything in php right from the start, since you can't use any built-in MATLAB functions?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by