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

3 ビュー (過去 30 日間)
  2 件のコメント
alice shaarveina
alice shaarveina 2018 年 3 月 15 日
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.

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 3 月 14 日
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('%');
  1 件のコメント
alice shaarveina
alice shaarveina 2018 年 3 月 14 日
Thank you so much Sir. By the way is that possible to extract each object's area percentage sir?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by