第四章图像增强(1).ppt

因为 r0=0 经变换得 s0= 1/7 ,所以有790个像素取 s0 这个灰度值,r1 映到 s1 ,所以有1023个像素取 s1=3/7 这一灰度值,以此类推,有850个像素取 s2 =5/7 这一灰度值。 但是,因为 r3 和 r4 均映射到 s3 = 6/7 这一灰度级,所以有656+329=985个像素取这个值。同样,有245+122+81=448个像素取 s4 =1 这个新灰度值。用n=4096来除上述这些 nk 值便可得到新的直方图。新直方图如图3—6 (c)所示。 图3—6 直方图均衡化处理 由上面的例子可见,利用累积分布函数作为灰度变换函数,经变换后得到的新灰度的直方图虽然不很平坦,但毕竟比原始图像的直方图平坦得多,而且其动态范围也大大地扩展了。因此这种方法对于对比度较弱的图像进行处理是很有效的。 因为直方图是近似的概率密度函数,所以用离散灰度级作变换时很少能得到完全平坦的结果。另外,从上例中可以看出变换后的灰度级减少了,这种现象叫做“简并”现象。 由于简并现象的存在,处理后的灰度级总是要减少的。这是像素灰度有限的必然结果。由于上述原因,数字图像的直方图均衡只是近似的。 产生简并现象的根源是利用变换公式 求新灰度时,所得到的 sk 往往不是允许的灰度值,这时就要采用舍入的方法求近似值,以便用与它最接近的允许灰度来代替它。 那么如何减少简并现象呢? 在舍入的过程中,一些相邻的 Sk 值变成了相同的 值,这就发生了简并现象,于是也就造成了一些灰度层次的损失。 减少简并现象的简单方法是增加像素的比特数。比如,通常用8bit来代表一个像素,而现在用12bit来表示一个像素,这样就可减少简并现象发生的机会,从而减少灰度层次的损失。 一般实现方法采用如下几步: 1、统计原始图像的直方图,求出 Pr(rk) ; 2、用累积分布函数作变换 ,求变换后的新灰度; 3、用新灰度代替旧灰度,求出 Ps(sk) ,这一步是近似的,力求合理,同时把灰度相等的或相近的合在一起。 * * The solid black curve represents the amount of light being reflected from the figure at the top. The red curve represents the brightnesses of this figure as it is usually perceived. To the left of the point where the figure just starts to get lighter people usually see a dark bar that is slightly darker that the area to the left of it. At the point where the brightness just stops increasing, people usually perceive a bright bar. This phenomenon was discovered by the famous physicist, Ernst Mach and it is in his honor that these dark and bright bars are called Mach Bands. These Mach Bands can be explained by center-surround receptive field interactions which is discussed elsewhere in this book. The receptive fields are represented as a disk (+) and annulus (-). The center disk is an excitatory area and the annulus an inhibitory area. The receptive fields in the uniformly white and uniformly black areas receive about the same stimulation in their excitatory centers and inhibitory surrounds. Therefore the ce

文档评论(0)

1亿VIP精品文档

相关文档