【发布时间】:2016-04-25 14:16:46
【问题描述】:
我有一个包含负值和正值的矩阵:
我成功地使用这个命令绘制了它的 pdf:
[n,xout] = hist(A(:), 256);
pdf = n/numel(A);
figure; stem(xout, pdf, 'marker', 'none');
不幸的是,我不能使用unique(A) 代替256,因为它会重复返回我的矩阵的值!
这是 pdf:pdf 如何进行直方图均衡?我使用此命令计算了 pdf 的累积总和:
ind = find(pdf == max(pdf));
cdf1 = cumsum(pdf(ind:end));
cdf2 = cumsum(pdf(ind-1:-1:1));
cdf = [flipud(cdf2); cdf1];
figure; stem(xout, cdf, 'marker', 'none');
结果 cdf 为:cdf
是真的吗?如果是,那之后我该怎么办?最后如何将均衡直方图转换为均衡图像(矩阵)?
任何帮助将不胜感激。
【问题讨论】:
-
以前版本中的
histogram或hist怎么样?