Hello. I have a tif image and plot the histogram (its generally 12 bit grayscale, max value =4095)
I want to be able to do 2 things that I am struggling with.
1: I use the following to obtain and count the number of "saturated pixels" . But how can i modify it to say count the number of pixels above a certain value i.e.3500 counts
[maxval1,idx]=max(IM(:))[row,col]=ind2sub(size(image), idx)%count elements
n=numel(row)
2: After plotting a histogram of the intensities using
[counts,x] = imhist(IM,maxval);stem(x,counts,'b');xlim([0 maxval]);ylim([0 max(counts)]);
(where I have allowed the axes to scale automatically to the max values), how can I superimpose on top of this in a different colour only part of the histogram that has intensities 3500 to 4095?
Thanks for any help. Jason
Best Answer