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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by