How to find what percentage of image an object covers
1 view (last 30 days)
waqas on 26 Jan 2021
im = im2bw(imread('image.jpeg'));
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.