How to count area under given surface ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MMSAAH
am 30 Apr. 2020
Kommentiert: Ameer Hamza
am 4 Mai 2020
Hello,
I want to count areas limited by green lines.
So, for my image the result is three areas.
Can anyone help me please.
1 Kommentar
Akzeptierte Antwort
Ameer Hamza
am 30 Apr. 2020
Bearbeitet: Ameer Hamza
am 30 Apr. 2020
Try this. It gives the area of three regions in number of pixels
im = im2double(imread('area.jpeg'));
im(:,end-5:end,:) = 0; % remove the white line at right and bottom of image
im(end-5:end,:,:) = 0;
mask = (im(:,:,1)>0.75) & (im(:,:,2)>0.75) & (im(:,:,3)>0.75);
regions = bwconncomp(mask);
areas = cellfun(@(x) numel(x), regions.PixelIdxList);
required_areas = maxk(areas, 3);
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!