Intensity Transformations (Histogram Processing)

Slides:



Advertisements
Similar presentations
Image Processing Lecture 4
Advertisements

CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
Image Histograms Cumulative histogram
Histogram Specification
Topic 4 - Image Mapping - I DIGITAL IMAGING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Intensity Transformations (Chapter 3)
EE4H, M.Sc Computer Vision Dr. Mike Spann
EE663 Image Processing Histogram Equalization Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Digital Image Processing
Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(rk)=nk, where: rk is the kth gray level nk.
Course Website: Digital Image Processing Image Enhancement (Histogram Processing)
ECE 472/572 - Digital Image Processing
Image Enhancement in the Spatial Domain II Jen-Chang Liu, 2006.
Image Enhancement in the Spatial Domain
Image (and Video) Coding and Processing Lecture 5: Point Operations Wade Trappe.
Intensity Transformations
Digital Image Processing
1 of 17 Digital Image Processing Image Enhancement Ashourian.
Image Enhancement by Modifying Gray Scale of Individual Pixels
انجمن دانشجویان ایران – مرجع دانلود کتاب ، نمونه سوال و جزوات درسی دانلود جزوات کارشناسی ارشد نرم افزار علوم تحقیقات البرز دانشگاه آزاد کرج Karaj.unicloob.ir.
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Lecture 4 Digital Image Enhancement
Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr. Bart ter Haar Romeny Prof.dr.ir. Marcel Breeuwer dr. Anna Vilanova Histogram equalization.
Image Enhancement in the Spatial Domain (chapter 3) Math 5467, Spring 2008 Most slides stolen from Gonzalez & Woods, Steve Seitz and Alexei Efros.
CS 376b Introduction to Computer Vision 02 / 25 / 2008 Instructor: Michael Eckmann.
Digital Image Processing
Lecture 2. Intensity Transformation and Spatial Filtering
DIGITAL IMAGE PROCESSING Instructors: Dr J. Shanbehzadeh M.Gholizadeh M.Gholizadeh
Lecture 4 Digital Image Enhancement
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
 Image Enhancement in Spatial Domain.  Spatial domain process on images can be described as g(x, y) = T[f(x, y)] ◦ where f(x,y) is the input image,
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Image Restoration and Reconstruction (Noise Removal)
University of Ioannina - Department of Computer Science Intensity Transformations (Point Processing) Christophoros Nikou Digital Image.
Digital Image Processing Contrast Enhancement: Part I
CS6825: Point Processing Contents – not complete What is point processing? What is point processing? Altering/TRANSFORMING the image at a pixel only.
Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
CS654: Digital Image Analysis Lecture 18: Image Enhancement in Spatial Domain (Histogram)
انجمن دانشجویان ایران – مرجع دانلود کتاب ، نمونه سوال و جزوات درسی
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Application) Digital Image Processing Christophoros Nikou
Digital Image Processing CSC331 Image Enhancement 1.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
EE 7730 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter.
Lecture Six Figures from Gonzalez and Woods, Digital Image Processing, Second Edition, Copyright 2002.
Digital Image Processing
IMAGE PROCESSING INTENSITY TRANSFORMATION AND SPATIAL FILTERING
Digital Image Processing
Image Enhancement.
Digital Image Processing
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Image Enhancement in the Spatial Domain
Lecture Five Figures from Gonzalez and Woods, Digital Image Processing, Second edition, Prentice-Hall,2002.
Digital Image Processing
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Digital Image Processing
Histogram Probability distribution of the different grays in an image.
Digital Image Processing
Digital Image Processing Week III
Histogram Equalization
Digital Image Procesing Introduction to Image Enhancement Histogram Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL PROCESSING IMPERIAL.
Image Enhancement To process an image so that the result is more suitable than the original image for a specific application. Spatial domain methods and.
Digital Image Processing
Intensity Transformations and Spatial Filtering
Intensity Transform Contrast Stretching Y ← u0+γ*(Y-u)/s
Image Enhancement in the Spatial Domain
Presentation transcript:

Intensity Transformations (Histogram Processing) Digital Image Processing Intensity Transformations (Histogram Processing) Christophoros Nikou cnikou@cs.uoi.gr

Contents Over the next few lectures we will look at image enhancement techniques working in the spatial domain: Histogram processing Spatial filtering Neighbourhood operations

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

Histogram Examples Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Examples (cont…) A selection of images and their histograms Notice the relationships between the images and their histograms Note that the high contrast image has the most evenly spaced histogram Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Contrast Stretching We can fix images that have poor contrast by applying a pretty simple contrast specification The interesting part is how do we decide on this transformation function?

Histogram Equalisation Spreading out the frequencies in an image (or equalising the image) is a simple way to improve dark or washed out images. At first, the continuous case will be studied: r is the intensity of the image in [0, L-1]. we focus on transformations s=T(r): T(r) is strictly monotonically increasing. T(r) must satisfy:

Histogram Equalisation (cont...) The condition for T(r) to be monotonically increasing guarantees that ordering of the output intensity values will follow the ordering of the input intensity values (avoids reversal of intensities). If T(r) is strictly monotonically increasing then the mapping from s back to r will be 1-1. The second condition (T(r) in [0,1]) guarantees that the range of the output will be the same as the range of the input.

Histogram Equalisation (cont...) We cannot perform inverse mapping (from s to r). Inverse mapping is possible.

Histogram Equalisation (cont...) We can view intensities r and s as random variables and their histograms as probability density functions (pdf) pr(r) and ps(s). Fundamental result from probability theory: If pr(r) and T(r) are known and T(r) is continuous and differentiable, then

Histogram Equalisation (cont...) The pdf of the output is determined by the pdf of the input and the transformation. This means that we can determine the histogram of the output image. A transformation of particular importance in image processing is the cumulative distribution function (CDF) of a random variable:

Histogram Equalisation (cont...) It satisfies the first condition as the area under the curve increases as r increases. It satisfies the second condition as for r=L-1 we have s=L-1. To find ps(s) we have to compute

Histogram Equalisation (cont...) Substituting this result: to yields Uniform pdf

Histogram Equalisation (cont...) The formula for histogram equalisation in the discrete case is given where rk: input intensity sk: processed intensity nj: the frequency of intensity j MN: the number of image pixels.

Histogram Equalisation (cont...) Example A 3-bit 64x64 image has the following intensities: Applying histogram equalization:

Histogram Equalisation (cont...) Example Rounding to the nearest integer:

Histogram Equalization (cont…) Example Notice that due to discretization, the resulting histogram will rarely be perfectly flat. However, it will be extended. Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Transformation Function Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Examples 1 Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Transformation Functions The functions used to equalise the images in the previous example Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Examples 2 Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Transformation Functions The functions used to equalise the images in the previous example Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equalisation Examples (cont…) 3 Images taken from Gonzalez & Woods, Digital Image Processing (2002) 4

Equalisation Transformation Functions The functions used to equalise the images in the previous examples Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Specification Histogram equalization does not always provide the desirable results. Images taken from Gonzalez & Woods, Digital Image Processing (2002) Image of Phobos (Mars moon) and its histogram. Many values near zero in the initial histogram

Histogram Specification (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Histogram equalization

Histogram specification (cont.) In these cases, it is more useful to specify the final histogram. Problem statement: Given pr(r) from the image and the target histogram pz(z), estimate the transformation z=T(r). The solution exploits histogram equalization. Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram specification (cont…) Equalize the initial histogram of the image: Equalize the target histogram: Obtain the inverse transform: In practice, for every value of r in the image: get its equalized transformation s=T(r). perform the inverse mapping z=G-1(s), where s=G(z) is the equalized target histogram. Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram specification (cont…) The discrete case: Equalize the initial histogram of the image: Equalize the target histogram: Obtain the inverse transform: Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Specification (cont...) Example Consider again the 3-bit 64x64 image: It is desired to transform this histogram to: with

Histogram Specification (cont...) Example The first step is to equalize the input (as before): The next step is to equalize the output: Notice that G(z) is not strictly monotonic. We must resolve this ambiguity by choosing, e.g. the smallest value for the inverse mapping.

Histogram Specification (cont...) Example Perform inverse mapping: find the smallest value of zq that is closest to sk: e.g. every pixel with value s0=1 in the histogram-equalized image would have a value of 3 (z3) in the histogram-specified image.

Histogram Specification (cont...) Example Notice that due to discretization, the resulting histogram will rarely be exactly the same as the desired histogram. Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Histogram Specification (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Original image Histogram equalization

Histogram Specification (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Histogram equalization

Histogram Specification (cont...) Specified histogram Transformation function and its inverse Images taken from Gonzalez & Woods, Digital Image Processing (2002) Resulting histogram

Local Histogram Processing Images taken from Gonzalez & Woods, Digital Image Processing (2002) Image in (a) is slightly noisy but the noise is imperceptible. HE enhances the noise in smooth regions (b). Local HE reveals structures having values close to the values of the squares and small sizes to influence HE (c).

Summary We have looked at: Different kinds of image enhancement Histograms Histogram equalisation Histogram specification Next time we will start to look at spatial filtering and neighbourhood operations