我有两个在不同电压下具有相同像素和材料尺寸的灰度图像。我必须使用 matlab 中的直方图对它们进行比较,以找出不同 bin 中所有像素值的差异意味着所有样本点。因为我需要检查最大差异和最小差异,以便找到最小和最大振动。我可以找到不同图像的直方图。我也可以找到减去图像的直方图。但是如何分析减去的图像以获得比较的数据。请帮助使用正确的matlab代码
编辑:到目前为止,OP 已经尝试过什么:
%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