Intensity Transformations (Chapter 3)

Slides:



Advertisements
Similar presentations
Histogram Processing The histogram of a digital image with gray levels in the range [0, L-1] is a discrete function h(rk) = nk where rk is the kth gray.
Advertisements

Digital Image Processing
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Image Processing Lecture 4
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
Chapter - 2 IMAGE ENHANCEMENT
Image Histograms Cumulative histogram
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.
ECE 472/572 - Digital Image Processing
Image Enhancement in the Spatial Domain
Image (and Video) Coding and Processing Lecture 5: Point Operations Wade Trappe.
Intensity Transformations
Digital Image Processing
BYST Eh-1 DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Image Enhancement.
Image Enhancement by Modifying Gray Scale of Individual Pixels
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Lecture 4 Digital Image Enhancement
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Digital Image Processing
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.
EEE 498/591- Real-Time DSP1 What is image processing? x(t 1,t 2 ) : ANALOG SIGNAL x : real value (t 1,t 2 ) : pair of real continuous space (time) variables.
Probability Review 1 CS479/679 Pattern Recognition Dr. George Bebis.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Probability Theory Part 2: Random Variables. Random Variables  The Notion of a Random Variable The outcome is not always a number Assign a numerical.
Digital Image Processing
Image Enhancement.
Review of Probability and Random Processes
Lecture 2. Intensity Transformation and Spatial Filtering
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture II-2: Probability Review
Entropy and some applications in image processing Neucimar J. Leite Institute of Computing
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,
Continuous Probability Distributions  Continuous Random Variable  A random variable whose space (set of possible values) is an entire interval of numbers.
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
CIS 601 Image ENHANCEMENT in the SPATIAL DOMAIN Dr. Rolf Lakaemper.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Intensity Transformations or Translation in Spatial Domain.
Discrete Random Variables. Numerical Outcomes Consider associating a numerical value with each sample point in a sample space. (1,1) (1,2) (1,3) (1,4)
Intensity Transformations (Histogram Processing)
CIS 601 – 04 Image ENHANCEMENT in the SPATIAL DOMAIN Longin Jan Latecki Based on Slides by Dr. Rolf Lakaemper.
Image Subtraction Mask mode radiography h(x,y) is the mask.
PROBABILITY AND STATISTICS FOR ENGINEERING Hossein Sameti Department of Computer Engineering Sharif University of Technology Mean, Variance, Moments and.
Digital Image Processing EEE415 Lecture 3
Random Variables. Numerical Outcomes Consider associating a numerical value with each sample point in a sample space. (1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
Instructor: Mircea Nicolescu Lecture 4 CS 485 / 685 Computer Vision.
1 Review of Probability and Random Processes. 2 Importance of Random Processes Random variables and processes talk about quantities and signals which.
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
Lecture 02 Point Based Image Processing Lecture 02 Point Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
Digital Image Processing Image Enhancement in Spatial Domain
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter.
Random Variables By: 1.
IMAGE PROCESSING INTENSITY TRANSFORMATION AND SPATIAL FILTERING
3.1 Expectation Expectation Example
Digital Image Processing
Image Enhancement in the Spatial Domain
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Digital Image Processing Week III
Digital Image Procesing Introduction to Image Enhancement Histogram Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL PROCESSING IMPERIAL.
Grey Level Enhancement
Image Enhancement in the Spatial Domain
Presentation transcript:

Intensity Transformations (Chapter 3) CS474/674 – Prof. Bebis

Spatial Domain Methods f(x,y) g(x,y) Point Processing g(x,y) f(x,y) Area/Mask Processing

Point Processing Transformations Convert a given pixel value to a new pixel value based on some predefined function.

Identity Transformation

Negative Image O(r,c) = 255-I(r,c)

Contrast Stretching or Compression Stretch gray-level ranges where we desire more information (slope > 1). Compress gray-level ranges that are of little interest (0 < slope < 1).

Thresholding Special case of contrast compression

Intensity Level Slicing Highlight specific ranges of gray-levels only. Same as double thresholding!

Bit-level Slicing Highlighting the contribution made by a specific bit. For pgm images, each pixel is represented by 8 bits. Each bit-plane is a binary image

Logarithmic transformation Enhance details in the darker regions of an image at the expense of detail in brighter regions. compress stretch

Exponential transformation Reverse effect of that obtained using logarithmic mapping. stretch compress

Histogram Equalization A fully automatic gray-level stretching technique. Need to talk about image histograms first ...

Image Histograms An image histogram is a plot of the gray-level frequencies (i.e., the number of pixels in the image that have that gray level).

Image Histograms (cont’d) Divide frequencies by total number of pixels to represent as probabilities.

Image Histograms (cont’d)

Properties of Image Histograms Histograms clustered at the low end correspond to dark images. Histograms clustered at the high end correspond to bright images.

Properties of Image Histograms (cont’d) Histograms with small spread correspond to low contrast images (i.e., mostly dark, mostly bright, or mostly gray). Histograms with wide spread correspond to high contrast images.

Properties of Image Histograms (cont’d) Low contrast High contrast

Histogram Equalization The main idea is to redistribute the gray-level values uniformly.

Histogram Equalization (cont’d) In practice, the equalized histogram might not be completely flat.

Probability - Definitions Random experiment: an experiment whose result is not certain in advance (e.g., throwing a die) Outcome: the result of a random experiment Sample space: the set of all possible outcomes (e.g., {1,2,3,4,5,6}) Event: a subset of the sample space (e.g., obtain an odd number in the experiment of throwing a die = {1,3,5})

Random Variables - Review A function that assigns a real number to random experiment outcomes (i.e., helps to reduce space of possible outcomes) X(j) X: # of heads

Random Variables - Example Consider the experiment of throwing a pair of dice Define the r.v. X=“sum of dice” X=x corresponds to the event

Probability density function The probability density function (pdf) is a real-valued function fX(x) describing the density of probability at each point in the sample space. In the discrete case, this is just a histogram! Gaussian

Probability distribution function The integral of fX(x) defines the probability distribution function FX(x) (i.e., cumulative probability) In the discrete case, simply take the sum: fX(x) FX(x) Gaussian fX(a)da non-decreasing

Probability distribution function (cont’d)

Uniform Distribution fX(x) FX(x) B_Parvin@lbl.gov

Random Variable Transformations Suppose Y=T(X) e.g., Y=X+1 If we know fX(x), can we find fY(y)? Yes - it can be shown that:

Transformations of r.v. - Example μ=0, σ=1 μ=1, σ=1

Special transformation! Proof:

Histogram Equalization (cont’d) The intensity levels can be viewed as a random variable in [0,1] pr(r) ps(s)

Histogram Equalization (cont’d) For PGM images: L=256 (graylevels) k=0,1,2, …, L-1 (possible graylevels) rk=k/(L-1) (normalized graylevel in [0, 1])

Histogram Equalization (cont’d) then, de-normalize: sk x (L-1)

Histogram Equalization Example 3 bit 64 x 64 image input histogram equalized histogram

Histogram Equalization Examples original images and histograms equalized images and histograms

Histogram Specification (Matching) Histogram equalization yields a uniform pdf only. What if we want to obtain a histogram other than uniform? fR(r) fR(a)da fZ(a)da fZ(z) only desired histogram is known so, Q(r)=G-1(T(r))

Histogram Specification (cont’d) fS(s) and fV(v) are uniform G(z) can be computed by specifying fZ(z) but I2 and I’2 are unknown! z=G-1(v) requires that v is a r.v. with uniform pdf IDEA: use z=G-1(s) instead of z=G-1(v) s is a r.v. with uniform pdf The desired transformation is z=G-1(T(r)) fR(a)da fz(a)da

Histogram Specification (cont’d) Comments We do not need to apply T( ) and G-1( ) separately! Combine them: Q=G-1T, thus, z=Q(r) Histogram specification assumes that we know G-1 (not always easy to find). G( ) must be in [0,1] and must be non-decreasing. z=G-1(T(r))=Q(r)

Histogram Specification Example 3 bit 64 x 64 image input histogram specified histogram actual histogram

Histogram Specification (cont’d) Histogram specification might yield superior results than histogram equalization. results of histogram equalization

Histogram Specification (cont’d) results of histogram specification G(z) G-1(z)

Local Histogram Processing Histogram equalization/specification are global methods. The intensity transformation is computed using pixels from the entire image. Global transformations are not appropriate for enhancing little details in an image. The number of pixels in these areas might be very small, contributing very little to the computation of the transformation.

Local Histogram Processing Idea: Define a transformation function based on the intensity distribution in a neighborhood of every pixel in the image!

Local Histogram Processing (cont’d) 1. Define a neighborhood and move its center from pixel to pixel. 2. At each location, the histogram of the points in the neighborhood is computed. Obtain histogram equalization or histogram specification transformation. 3. Map the intensity of the pixel centered in the neighborhood. 4. Move to the next location and repeat the procedure.

Local Histogram Processing: Example equalization 3 x 3 neighborhood global histogram equalization

Histogram Statistics Mean (average intensity) n-th moment around mean Variance (2nd moment)

Example: Comparison of Standard Deviation Values σ is useful for estimating image contrast!

Local Histogram Statistics

Using Histogram Statistics for Image Enhancement Useful when parts of the image might contain hidden features. Task: enhance dark areas without changing bright areas. Idea: Find dark, low contrast areas using local statistics.

Using Histogram Statistics for Image Enhancement: Example

Question Intensity operations can yield pixel values outside of the range [0 – 255]. You should convert values back to the range [0 – 255] to ensure that the image is displayed properly. How would you find the following mapping? [fmin – fmax]  [ 0 – 255]