Trying to find extraneous points on in an image using a histogram to find cut off

2 views (last 30 days)
Hello, I am trying to find the hot pixels in an image by using a histogram to see the cut off. There are a few hot pixels amongst the 1000 by 1000 image therefore to see the cut off I need to take take the log of the number of counts in each bin of the histogram. How do I plot such a histogram thanks in advance!

Answers (1)

Image Analyst
Image Analyst on 27 Nov 2015
Just use histogram() or imhist():
[counts, grayLevels] = imhist(grayImage, 256);
bar(grayLevels, counts, 'FaceColor', 'b', 'BarWidth', 1);
If you want to take the log of the counts, do so
[counts, grayLevels] = imhist(grayImage, 256);
bar(grayLevels, log(counts+1), 'FaceColor', 'b', 'BarWidth', 1);

Community Treasure Hunt

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

Start Hunting!