1 / 33

直方图

直方图. 陈荣钦 chen_rongqin@163.com. 直方图. 本节课程 灰度直方图 直方图均衡化 直方图变换 色彩直方图. 灰度图. 灰度图像是指每个像素的信息由一个量化的灰度级来描述的图像,没有彩色信息. 灰度直方图. 1. 2. 3. 4. 5. 6. 6. 4. 3. 2. 2. 1. 1. 6. 6. 4. 6. 6. 3. 4. 5. 6. 6. 6. 1. 4. 6. 6. 2. 3. 1. 3. 6. 4. 6. 6.

joy-reed
Télécharger la présentation

直方图

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 直方图 陈荣钦 chen_rongqin@163.com

  2. 直方图 • 本节课程 • 灰度直方图 • 直方图均衡化 • 直方图变换 • 色彩直方图

  3. 灰度图 • 灰度图像是指每个像素的信息由一个量化的灰度级来描述的图像,没有彩色信息

  4. 灰度直方图 1 2 3 4 5 6 6 4 3 2 2 1 1 6 6 4 6 6 3 4 5 6 6 6 1 4 6 6 2 3 1 3 6 4 6 6 • 灰度直方图(histogram)是灰度级的函数,它表示图像中具有每种灰度级的像素的个数,反映图像中每种灰度出现的频率

  5. 灰度直方图 • 下图所示,灰度直方图的横坐标是灰度级,纵坐标是该灰度级出现的频率,是图像的最基本的统计特征

  6. 直方图举例 Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  7. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 典型图像Lena的灰度分布

  8. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  9. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 图像的灰度级较高

  10. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  11. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 图像的灰度级较低

  12. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  13. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 图像的灰度主要分布在中等的灰度级中

  14. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  15. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 灰度分布比较均匀

  16. 直方图举例(续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 注意图像和直方图之间的关系 • 注意高对比度的图像有更平坦的直方图

  17. 直方图的应用 Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 直方图给出了一个简单可见的指示,用来判断一幅图像是否合理的利用了全部被允许的灰度级范围。一幅图像应该利用全部或几乎全部可能的灰度级,否则等于增加了量化间隔。丢失的信息将不能恢复。

  18. 直方图的应用 Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 假设某图像的灰度直方图具有 二峰性,则表明这个图像较亮的区域和较暗的区域可以较好地分离,取二峰间的谷点为阈值点,可以得到好的2值处理效果

  19. 直方图数学解析 • 从概率角度看,灰度频率就是灰度出现的概率,直方图就是概率密度函数,而概率分布函数就是直方图的累积和,即概率密度函数的积分 ,离散情况下: • k: 灰度范围内的一个值 (比如0~255) • nj:灰度 j的频率 • n:所有频率之和

  20. 直方图均衡化 • 直方图均衡化是通过灰度变换将一幅图像转换为另一幅具有均衡直方图的图像,即在每个灰度级上都具有相同的像素点数的过程,便于进行图像比较或分割 • 下图为执行均衡化后的飞机图

  21. 直方图均衡化 • 通过将图像的灰度调整为均匀分布,可以有效的增强图像的整体对比度,直方图均衡化就是利用了直方图的累积和(概率分布函数),其变换函数f(k)为: • rk:输入灰度 • f(k):处理后的灰度 • k:灰度范围内的一个值 (比如0~255) • nj:灰度 j的频率 • n:所有频率之和 • max通常为255

  22. 直方图规一化 • 通常也对图像的直方图进行规一化处理,即灰度值范围变成0.0~1.0,此时的变换函数f(k)为: • rk:输入灰度 • f(k):处理后的灰度 • k:灰度范围内的一个值 (比如0~255) • nj:灰度 j的频率 • n:所有频率之和

  23. 直方图变换函数 Images taken from Gonzalez & Woods, Digital Image Processing (2002)

  24. 均衡化举例 Images taken from Gonzalez & Woods, Digital Image Processing (2002) 1

  25. 直方图变换函数 Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 均衡上一张图片所用到的函数

  26. 均衡化举例 Images taken from Gonzalez & Woods, Digital Image Processing (2002) 2

  27. 直方图变换函数 Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 均衡上一张图片所用到的函数

  28. 均衡化举例 (续…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) 3 4

  29. 直方图变换函数 Images taken from Gonzalez & Woods, Digital Image Processing (2002) • 均衡上几张图片所用到的函数

  30. 直方图规范化 • 直方图规范化是指将一幅图像通过灰度变换后,使其具有特定的直方图形式,如使图像与某一标准图像具有相同的直方图,或使图像具有某一特定函数形式

  31. 色彩直方图 • 色彩直方图是相对于灰度直方图而言的,用于统计色彩的出现频率,即色彩的概率分布信息。 • 通常通过量化,将色彩分成几类。将亮度分离掉后对色彩信息进行统计 • 一般不直接在RGB空间进行,而是转化到HSI空间(I为亮度)或YUV空间(Y为亮度),这样可以去除亮度信息

  32. 色彩直方图 • 通过色彩直方图可以实现图像检索

  33. 小结 • 本节课我们已经了解了: • 灰度直方图 • 直方图均衡化 • 直方图变换 • 色彩直方图 • 下一次课我们将学习点运算。

More Related