简体   繁体   English

使用Matlab进行图像增强的直方图规范

[英]Histogram specification using matlab for image enhancement

In histogram specification we specify the shape of the desired histogram. 在直方图规范中,我们指定所需直方图的形状。 For an image we should modify the histogram such that it is close to the shape of the desired histogram. 对于图像,我们应该修改直方图,使其接近所需直方图的形状。 Can anyone tell me how can I do that. 谁能告诉我该怎么做。

Histogram equalization used histeq(). 直方图均衡使用histeq()。 Is there any special function for histogram specification. 直方图规格是否有任何特殊功能。

If you look at the documentation for histeq you will see that it accepts an optional second argument which is the desired histogram: 如果您查看histeq的文档,您会发现它接受一个可选的第二个参数,它是所需的直方图:

J = histeq(I, hgram) transformsthe intensity image I so that the histogram of the output intensity image J with length(hgram) bins approximately matches hgram . J = histeq(I, hgram)变换强度图像I,以使具有length(hgram) bin的输出强度图像J的直方图近似匹配hgram The vector hgram should contain integer counts for equally spaced bins with intensity values in the appropriate range: [0, 1] for images of class double, [0, 255] for images of class uint8, and [0, 65535] for images of class uint16 . 向量hgram应包含强度值在适当范围内的等距bin的整数计数:对于double类的图像,为[0,1],对于uint8类的图像,为[0,255],对于强度为的图像,为[0,65535] uint16类。 histeq automatically scales hgram so that sum(hgram) = prod(size(I)) . histeq自动缩放hgram使sum(hgram) = prod(size(I)) The histogram of J will better match hgram when length(hgram) is much smaller than the number of discrete levels in I. length(hgram)远小于I中离散级别的数量时,J的直方图将更好地匹配hgram

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM