How to find what percentage of image an object covers
9 ビュー (過去 30 日間)
古いコメントを表示
From the given image, how can i find the percentage of cells covers the image or in other words what percentage of cell covers that image or what is the percentage of foreground image?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499373/image.jpeg)
0 件のコメント
回答 (1 件)
waqas
2021 年 1 月 26 日
im = im2bw(imread('image.jpeg'));
imshow(bw)
whitearea = bwarea(bw);
blackarea = bwarea(~bw);
conversion to black and white is not perfect in the above code but this should give you the idea. You can use thresholding before converting to black and white image. This will take care of the pixels that are removed from the cells.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!