how can i find the ratio of area of white color and black color area in binary image or the output images of edge detection filters

1 回表示 (過去 30 日間)
I have done edge detection on an image and output image we get in binary or b&w image. I want to calculate the ratio of area covered by white color to black color. I also want to know the area of white color( I have calculated it but the number i get is like '1.4187e+04' , I need the unit to define it).

回答 (1 件)

Santhana Raj
Santhana Raj 2017 年 3 月 31 日
When you get a binary image, You just add all the pixels in the image. Then you get the no of pixels with white. Subtract it with the total no of pixels (length x breadth), you get the no of black. You can take percentage, ratio or whatever you want now.
As for the area of the white pixels of the image, considering you have just counted the number of pixels, the unit will be (1)pixels (for a simple analysis) (2) if you want in SI units, then you have to multiply with the image sensor resolution which will give you the area in square meter.
Hope it helps.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by