analyze the subtracted histogram of two images using matlab to find the difference at each point in amplitude

954 views Asked by At

I have two grayscale images of same pixel and size of material at different voltages. I have to compare them using histograms in matlab to find difference of all pixel values at different bins means all sample points. Beacause I need to check the max diff and min diff so that I could find the min and max vibration. I can find histogram of different images. and also i can find histogram of subtracted image. But how to analyze subtracted image to get the compared data.Please help with proper matlab code

Edit: What OP has tried so far:

%two histograms in one fig
image1 = imread('0_25_1.jpg'); % Image 1
image2 = imread('0_35_1.jpg'); % Image 2

figure
subplot(2,2,1);
imhist(image1);
subplot(2,2,2);
imhist(image2);
subplot(2,2,3);
imhist(image1-image2);

%second one is.....
image1 = imread('0_25_1.jpg'); % Image 1
image2 = imread('0_35_1.jpg'); % Image 2
[counts,x] = imhist(image1);
stem(counts,x,'b');
hold on
[counts,x] = imhist(image2);
stem(counts,x,'r')
hold off
1

There are 1 answers

1
user1543042 On

Are you saying you want the minimum and maximum differences?

[maxVal, maxLocation] = max(image1(:)-image2(:));
[minVal, minLocation] = min(image1(:)-image2(:));