Finding pixels having a specific intensity value
14 views (last 30 days)
Show older comments
Kaan Yilmaz
on 30 May 2015
Answered: Image Analyst
on 30 May 2015
Hi, I want to find the pixels or the infinitesimal areas having an intensity value of 255 in a grayscaled image and calculate the area they occupy in the image. Can anyone help me?
0 Comments
Accepted Answer
Image Analyst
on 30 May 2015
To "find the pixels", as in getting the rows and columns where they live , do this:
[rows, columns] = find(grayImage == 255);
To get the area in pixels, use the formula like Walter gave.
0 Comments
More Answers (1)
Walter Roberson
on 30 May 2015
Area255 = sum(GrayMatrix(:)==255);
This presumes that each pixel contributes 1 square unit of area. If you are working with projective maps that would not be true, naturally.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!