Greetings, how to extract each object and calculate their area based on example picture shown below.

3 Ansichten (letzte 30 Tage)
  2 Kommentare
alice shaarveina
alice shaarveina am 15 Mär. 2018
I need to extract each of the object then calculate the area. last time i tried the coding given in other post but sadly i don't get output only error. Hope anyone can help me solve this.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 14 Mär. 2018
k=imread('cell.bmp');
BW1=im2bw(k);
BW2=imcomplement(BW1);
% Apply condition calculate the pixels in certain boundary area (objects)
% Once you find white pixels, sum all upto certain boundary (Hint from given image)
% following is the code for all objects
nWhite_pixels=sum(BW2(:));
[rows columns depth]=size(BW2);
percentage_tot_area=((nWhite_pixels)/(rows*columns))*100;
fprintf('#The Percentage covered by all object is %f',percentage_tot_area);
disp('%');

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects 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!

Translated by