how to count the number of pixels of each region in an image ( searching for big regions) ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Matt Kindig
am 1 Apr. 2013
Bearbeitet: Matt Kindig
am 1 Apr. 2013
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.
Akzeptierte Antwort
Image Analyst
am 1 Apr. 2013
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 Kommentare
Image Analyst
am 1 Apr. 2013
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?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!