필터 지우기
필터 지우기

calculate the area

조회 수: 4 (최근 30일)
Adam
Adam 2012년 3월 23일
hello everyone I need help. I have a picture consisting only of black and white. Does anybody know of any function which I figured would be an area of white on obazku.
Thank you so much to everyone

채택된 답변

Adam
Adam 2012년 3월 25일
solution to my problem was easier than it seemed ...
A=[0 1 0 0 0 0 1; 1 0 1 0 1 1 0; 0 0 1 1 1 0 1]
figure, imshow(A)
B = sum(sum(A))
  댓글 수: 2
Image Analyst
Image Analyst 2012년 3월 25일
What is obazku? Is that zero or black? What if there are several disconnected areas of white? Your method would give the total area but not the area of each one individually. If you want the total white area in a binary black and white grayscale image then your method is fine.
Adam
Adam 2012년 3월 28일
sorry "obrazku" I forgot to translate the picture = obrazku.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt Kindig
Matt Kindig 2012년 3월 23일
Do you want just the total number of pixels of white? If so, just sum the image (sum all 1's).
If you want the area of contiguous objects of white, check out the 'regionprops' function in the Image Processing Toolbox.
  댓글 수: 1
Adam
Adam 2012년 3월 24일
was enough I would sum all the white pixels in the picture. But I do not know how to get in this quest

댓글을 달려면 로그인하십시오.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by