MATLAB Answers

calculate the area

1 view (last 30 days)
Adam
Adam on 23 Mar 2012
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

Accepted Answer

Adam
Adam on 25 Mar 2012
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 Comments
Adam
Adam on 28 Mar 2012
sorry "obrazku" I forgot to translate the picture = obrazku.

Sign in to comment.

More Answers (1)

Matt Kindig
Matt Kindig on 23 Mar 2012
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 Comment
Adam
Adam on 24 Mar 2012
was enough I would sum all the white pixels in the picture. But I do not know how to get in this quest

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!