How to calculate the area of only white part in the image
조회 수: 9 (최근 30일)
이전 댓글 표시
I want to calculate the area of only white part as shown in the figure. I had used - bwarea(image). But I am not sure whether its calculating correct area or not. As I just need the white portion area.
Any help is much appreciated.
Thank you in advance!!
댓글 수: 2
Jonas
2021년 4월 22일
you could count the white pixels, divide it by overall number of pixels and multiply it with the real size of the image
채택된 답변
Image Analyst
2021년 4월 23일
You simply use nnz on your binary image to get the area in pixels
whiteArea = nnz(mask)
or you could use bwarea() - it uses a somewhat different algorithm for determining area (it's not just counting pixels).
whiteArea = bwarea(mask)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!