How to find what percentage of image an object covers
4 次查看(过去 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?
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!