- Visual Media Processing Using Matlab Beginner's Guide
- George Siogkas
- 156字
- 2021-08-06 16:37:55
Histogram equalization for contrast enhancement
A very common method of enhancing the contrast of an image is by transforming its pixel values so that its new histogram matches a predefined distribution. MATLAB offers a function for this process called as histeq
. The function can also be called with one input, in which case it uses the default target histogram. Let's see what this function does, by writing the following script:
img = imread('my_image.bmp'); img_eq = histeq(img); subplot(2,2,1),imshow(img),title('Original Image'); subplot(2,2,2),imshow(img_eq),title('Equalized Image'); subplot(2,2,3),imhist(img,64),title('Original Image Histogram'); subplot(2,2,4),imhist(img_eq,64),title('Equalized Image Histogram');
Saving this script as HistogramEqualization.m
and typing it in the command line, leads to the following result:

As we can see, the contrast of the image is enhanced and the values are almost evenly spread throughout the range of possible values (0 to 255). This process usually has the effect of enhancing useful details, but also at the same time enhancing unwanted noise. Therefore, this approach should be used cautiously.
- 新型電腦主板關鍵電路維修圖冊
- Mastering Delphi Programming:A Complete Reference Guide
- 計算機組裝·維護與故障排除
- Unity 5.x Game Development Blueprints
- Camtasia Studio 8:Advanced Editing and Publishing Techniques
- 筆記本電腦維修不是事兒(第2版)
- Mastering Adobe Photoshop Elements
- R Deep Learning Essentials
- 筆記本電腦應用技巧
- 超大流量分布式系統架構解決方案:人人都是架構師2.0
- 電腦組裝與維護即時通
- Python Machine Learning Blueprints
- IP網絡視頻傳輸:技術、標準和應用
- 基于網絡化教學的項目化單片機應用技術
- Building Machine Learning Systems with Python