Combining histograms of images

4 views (last 30 days)
Jason
Jason on 20 Nov 2014
Commented: Jason on 20 Nov 2014
I am wanting to combine the histograms of 10 images (12 bit grayscale). Due to image processing prior, although the max level should be 4095, there is some PRNU correction so each image has a slightly different max value and one that is bigger than 4095 by a small number.
I currently read each image in a foor loop
for i=1:10
IM=imread(file)
[maxval,idx]=max(IM(:));
maxval= double(maxval);
[counts,x] = imhist(HX,maxval);
%Assign each counts and x to an index array
HX(i)=counts
HY(i)=x
end
%Then to view the composite histogram:
figure
stem(HY,HX,'b', '.');
But this don't work.
  1 Comment
Jason
Jason on 20 Nov 2014
just to add, to account for the small variation in the max grayscale level, i have redefined maxval as the maxlevel plus 10%. I've also tried just adding counts from histogram, but Im making a mistake somewhere.
[maxval,idx]=max(IM(:));
maxval= double(maxval*1.1)
[counts,x] = imhist(IM,maxval)
Totalcounts=Totalcounts+counts;

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!