Finding pixels having a specific intensity value

14 views (last 30 days)
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?

Accepted Answer

Image Analyst
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.

More Answers (1)

Walter Roberson
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.

Tags

Community Treasure Hunt

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

Start Hunting!