How can I detect 0.5 percent brightest pixels in an image?

I have a grayscale image.I need to find the 0.5 percent brightest pixels in that image. But my image contain differet object. I want to find the 0.5 percent brightest pixels in an for each object.
Could you help me ?

2 Comments

brightnessVal = prctile( img, 99.5 );
brightestPixels = img >= brightnessVal;
should give you a mask of the brightest pixels in a given greyscale image. How you take your original image and define objects from it to create individual img arguments for this is an entirely different question to the one in the title though and plenty more complicated.
Actually yes you are right about my question is complicated.
[L, num] = bwlabel(B);
for k = 1 : num
imarray{k} = ismember(L, k);
imarray{k}=imarray{k}.*(ResimOrjinal(:,:,1));
figure
imshow(imarray{k}, []);
end
with this code i am showing my single object from the image. And i want to calculate this each single object's 0.5 percent brightest pixels and showing them on the screen

Sign in to comment.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 25 Feb 2019

Commented:

on 25 Feb 2019

Community Treasure Hunt

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

Start Hunting!