1 / 56

DREAM

DREAM. IDEA. PLAN. IMPLEMENTATION. Introduction to Image Processing. Present to: Amirkabir University of Technology (Tehran Polytechnic) & Semnan University. Dr. Kourosh Kiani Email: kkiani2004@yahoo.com Email: Kourosh.kiani@aut.ac.ir Email : Kourosh.kiani@semnan.ac.ir

clyde
Download Presentation

DREAM

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. DREAM IDEA PLAN IMPLEMENTATION

  2. Introduction to Image Processing Present to:Amirkabir University of Technology (Tehran Polytechnic) & Semnan University Dr. Kourosh Kiani Email: kkiani2004@yahoo.com Email: Kourosh.kiani@aut.ac.ir Email: Kourosh.kiani@semnan.ac.ir Web: www.kouroshkiani.com

  3. Lecture 02 Histogram

  4. The Image Histogram Occurrence (# of pixels) Gray Level • H(k) specifies the # of pixels with gray-value k • Let N be the number of pixels: • P(k) = H(k)/N defines the normalized histogram • defines the accumulated histogram

  5. Histogram Normalized Histogram Accumulated Histogram

  6. Examples P(I) P(I) 1 1 0.5 I I H(I) H(I) 0.1 0.1 I I Pixel permutation of the left image • The image histogram does not fully represent the image

  7. No. of pixels 6 5 4 3 2 1 Gray level 4x4 image 0 1 2 3 4 5 6 7 8 9 Gray scale = [0,9] histogram Example

  8. Example

  9. Grayscale Histogram

  10. (3, 8, 5) What is histogram?

  11. Histogram image histogram

  12. Histogram PARTIAL IMAGE INFO: 117 83 59 59 68 77 84 94 82 67 62 70 83 86 85 81 71 65 77 89 86 82 76 67 72 90 97 86 66 54 68 104 121 107 85 46 58 89 138 165 137 91 38 80 147 200 211 187 138 40 80 149 197 202 187 146 56 76 114 159 181 160 113

  13. Image Histogram Plot of Pixel Count as a Function of Gray Level Value

  14. Image Histograms Frequencies Grey Levels The histogram of an image shows us the distribution of grey levels in the image Massively useful in image processing, especially in segmentation

  15. Original Dark Light

  16. Histogram An image has low contrast when the complete range of possible values is not used.  Inspection of the histogram shows this lack of contrast.

  17. Histogram

  18. rgbI = imread('kourosh.jpg'); grayI = rgb2gray(rgbI); %get image histogram [counts bins]=imhist(grayI); %show histogram bar(bins,counts);

  19. rgbI = imread('kouroshdark.jpg'); grayI = rgb2gray(rgbI); %get image histogram [counts bins]=imhist(grayI); %show histogram bar(bins,counts);

  20. rgbI = imread('kouroshbright.jpg'); grayI = rgb2gray(rgbI); %get image histogram [counts bins]=imhist(grayI); %show histogram bar(bins,counts);

  21. I= imread('pic01.png'); %get image histogram [counts bins]=imhist(I); %show histogram bar(bins,counts);

  22. I= imread('pic03.png'); %get image histogram [counts bins]=imhist(I); %show histogram bar(bins,counts);

  23. Histogram Equalization • The image shows the spatial distribution of gray values. • The image histogram discards the spatial information and shows the relative frequency of occurrence of the gray values.

  24. Histogram Equalization • The histogram typically plots the absolute pixel count as a function of gray value: For an image with dimensions M by N I max

  25. Probability Interpretation • The graph of relative frequency of occurrence as a function of gray value is also called a histogram: • Interpreting the relative frequency histogram as a probability distribution, then:  P(I(x,y) = i) = H(i)/(MxN)

  26. Gray Value Cumulative Density Function • Interpreting the relative frequency histogram as a probability distribution, then: • Curve is called the cumulative distribution function P(I(x,y) = i) = H(i)/(MxN)

  27. Histogram Equalization • Image histograms consist of peaks, valleys, and low plains • Peaks = many pixels concentrated in a few grey levels • Plains = small number of pixels distributed over a wider range of grey levels

  28. Histogram Equalization • The goal is to modify the gray levels of an image so that the histogram of the modified image is flat. • Expand pixels in peaks over a wider range of gray-levels. • “Squeeze” low plains pixels into a narrower range of gray levels. • Utilizes all gray values equally • Example Histogram: • Note low utilization of small gray values

  29. Desired Histogram • All gray levels are used equally. • Has a tendency to enhance contrast.

  30. Brute Force How are the gray levels in the original image changed to produce the enhanced image? Method 1. Choose points randomly. Method 2. Choice depends on the graylevelsof their neighboring points. Computationally expensive. Approximations.

  31. CH(j) i = MAX 0, round -1 Np M*N Np = G Histogram Equalization • Mapping from one set of grey-levels, I, to a new set, O. • Ideally, the number of pixels, Np, occupying each grey level should be: • To approximate this, apply the transform • Where CH is the cumulative histogram (see next slide) • j is the gray value in the source image • i is the gray value in the equalized image

  32. j CH(j) = S H(i) i=0 Example j H(j) CH(j) i 100 900 1600 2100 2200 2300 2400 2400 0 100 0 1 800 2 G=8 MxN=2400 Np=300 2 700 4 3 500 6 4 100 6 5 100 7 6 100 7 7 0 7 800 600 400 200 0 800 600 400 200 0 ideal 0 1 2 3 4 5 6 8 0 1 2 3 4 5 6 8

  33. Example rgbI = imread('ship1.png'); J = histeq(rgbI); imshow(rgbI) figure, imshow(J) %get image histogram [counts bins]=imhist(rgbI); %show histogram figure(3) bar(bins,counts); %get image histogram [counts bins]=imhist(J); %show histogram figure(4) bar(bins,counts);

  34. Example

  35. Histogram Equalization: Example

  36. Example

More Related