【发布时间】:2018-06-16 05:50:44
【问题描述】:
我一直在从事与 MATLAB 中的图像分析相关的项目。其中一部分需要我创建多组直方图来比较我为图像计算的 GCLM 系数值的分布。
我正在使用 PH2 数据库,共有 200 张图像(按诊断分为三个类别,分别为 80、80、40 张)。我制作了显示每个诊断分布的直方图,我还想覆盖直方图以显示分布的比较情况。这是我正在使用的代码:
% DECOMP MAX
figure
for k=1:4
subplot(2,2,1)
h0 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 0,k),10);
h0.FaceColor = 'green';
title('Typical')
subplot(2,2,2)
h1 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 1,k),10);
h1.FaceColor = 'yellow';
title('Atypical')
subplot(2,2,3)
h2 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 2,k),10);
h2.FaceColor = 'red';
title('Melanoma')
subplot(2,2,4)
h0 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 0,k),10);
hold on
h1 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 1,k),10);
h2 = histogram(gclm_decomp_max_p(diagn.ClinicalDiagnosis == 2,k),10);
h0.FaceColor = 'green';
h1.FaceColor = 'yellow';
h2.FaceColor = 'red';
title('Overlayed')
suptitle(names_gclm{:,k})
fname = sprintf('maxdecomp%d', k);
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
saveas(gcf,fname,'png')
close all
end
我的问题从覆盖部分开始。尽我所能,我无法让所有三种诊断的垃圾箱看起来都一样。我尝试手动设置 bin 编号以及栏和 bin 宽度。有什么我想念的吗?我还能尝试什么?我很感激任何建议,因为我已经不知所措了。
这是两个示例图像 - 如您所见,黑色素瘤直方图在第一个中看起来与其他图像完全不同。在第二个中,每个组看起来都不同,因此无法比较分布。
【问题讨论】:
-
当您说您希望 bin 统一时,您的意思是 histogram equalization 还是您希望 bin 具有统一的间距,即每个 bin 具有相同的宽度?
-
如果你能发布一个示例输出图像并描述它的问题可能会更容易。
-
@jodag - 我用图片编辑了帖子。我希望我的问题现在更有意义!
-
您是否尝试过指定 bin edges 而不是每个直方图中的 bin 数量?
标签: matlab image-processing statistics histogram