Skip to content

Apply histogram-specification method to achieve contrast enhancement.

License

Notifications You must be signed in to change notification settings

yuhung1206/Histogram-Specification-HS-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Histogram-Specification(HS)

Apply histogram-specification method to achieve contrast enhancement.

Instructions

  • HS operation can be customized in the section(2) in the program file for other purpose & utilization
    image

  • In this study, to enhance the contrast of the input picture, the parameters of histogram are self-defined as:

image image

Program

Program function
HS_BW.m HS operation toward Black & White image
HS_RGB.m HS operation toward RGB image
HS_func.m function call by HS_RGB.m

Implementation process

  1. Calculate the PDF and CDF of original data
  2. According to the desired histogram, construct the customized PDF and CDF
  3. With the two CDFs, we could build the mapping between input image and output image via image
  4. Utilize the mapping function and the original data to obtain the output data
  5. Export those new pixels as an image

Theory and Experimental Results

  • original and output histograms (after HS operation)

    From the two pictures below, we could directly find that the output histogram is parser than the original histogram. Apart from that, we could also discover that more pixels concentrate near zero gray level in the output histogram than in the original one, which would probably make the dark area darker. Additionally, the increase of pixels also take place around 200~250 gray level, revealing that the bright area would possibly become brighter. I suppose that the effects are closely associated with the desired histogram. image image

  • Image after HS operation
    image
    From the desired histogram, we could discover that it has a tendency to make the bright area much brighter and the dark region darker. The distribution of intermediate color is relatively lower. As a consequence, the scheme would lead to a higher contrast in the processed picture.

  • Table of transformation function to show the mapping from the input gray level r to the output gray level z

  • In the table, the green columns represent the corresponding gray level for each input (0~255). It is obvious that some numbers are lost in the sequence in the green columns, which reflects the result of the sparser histogram. image

    To further discuss the Transformation function, we could plot the above figure.(x-axis : input, y-axis : output). Apparently, we could discover that the part in the frame with red dotted line is upper than the diagonal line, which would make the color within the range brighter than before. Adversely, the part in the blue frame would let the color in the range become darker.

About

Apply histogram-specification method to achieve contrast enhancement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages