 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,

Slides:



Advertisements
Similar presentations
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Spatial Filtering (Chapter 3)
Image Processing Lecture 4
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Spatial Filtering.
Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level.
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 6 Sharpening Filters
Chapter - 2 IMAGE ENHANCEMENT
Histogram Specification
Intensity Transformations (Chapter 3)
EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more.
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 II Jen-Chang Liu, 2006.
Image Enhancement in the Spatial Domain
Intensity Transformations
Digital Image Processing
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
Chapter 3: Image Enhancement in the Spatial Domain
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.
6/9/2015Digital Image Processing1. 2 Example Histogram.
Machine Vision and Dig. Image Analysis 1 Prof. Heikki Kälviäinen CT50A6100 Lectures 6&7: Image Enhancement Professor Heikki Kälviäinen Machine Vision and.
Digital Image Processing
Image Enhancement.
2-D, 2nd Order Derivatives for Image Enhancement
Lecture 2. Intensity Transformation and Spatial Filtering
Chapter 3 Image Enhancement in the Spatial Domain.
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
Lecture 4 Digital Image Enhancement
Chapter 3: Image Enhancement in the Spatial Domain
Chap2 Image enhancement (Spatial domain)
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Presentation Image Filters
Digital Image Processing
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
Intensity Transformations (Histogram Processing)
Digital Image Processing Image Enhancement in the Spatial Domain.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods  Process an image so that the result will be more suitable.
Spatial Filtering.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
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.
Digital Image Processing EEE415 Lecture 3
İmage enhancement Prepare image for further processing steps for specific applications.
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
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 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.
Image Enhancement in the Spatial Domain.
Fundamentals of Spatial Filtering:
IMAGE ENHANCEMENT TECHNIQUES
Digital Image Processing
ECE 692 – Advanced Topics in Computer Vision
Image Enhancement.
CIS 350 – 3 Image ENHANCEMENT SPATIAL DOMAIN
Image Enhancement in the Spatial Domain
Lecture 3 (2.5.07) Image Enhancement in Spatial Domain
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Digital Image Processing
Chapter 3 Image Enhancement in the Spatial Domain
Histogram Equalization
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.
Image Enhancement in the Spatial Domain
Presentation transcript:

 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, g(x,y) is the output image, T is an operator ◦ T operates on the neighbors of (x, y)  a square or rectangular sub-image centered at (x,y) to yield the output g(x, y).

 The simplest form of T is the neighborhood of size 1  1.  g depends on the value of f at (x, y) which is a gray level transformation as s = T(r) ◦ where r and s are the gray-level of f(x, y) and g(x, y) at any point (x, y). ◦ Enhancement of any point depends on that point only.  Point processing  Larger neighborhood provides more flexibility. ◦ Mask processing or filtering

 Three basic functions used in image enhancement ◦ Linear (negative and identity transformation) s = L-1-r ◦ Logarithmic (log and inverse log) s = c log(1+r) ◦ Power law (nth power and nth root transformation) s = cr  or s = c(r+  ) 

  correction ◦ The CRT devices have an intensity-to-voltage response which is a power function. ◦ ranges from 1.8 to 2.5 ◦ Without  correction, the monitor output will become darker than the original input.

 Piecewise-Linear Transformation Functions ◦ Contrast stretching

 The histogram of a digital image with gray-levels in the range [0, L-1] is a discrete function h(r k ) = n k where r k is the kth level and n k is the number of pixels having the gray-level r k.  A normalized histogram h(r k )=n k /n, n is the total number of pixels in the image.

 Histogram equalization is to find a transformation s = T(r) 0  r  1 that satisfies the following conditions: ◦ T(r) is single-valued and monotonically increasing in the interval 0  r  1 ◦ 0  T(r)  1 for 0  r  1 ◦ T(r) is single-valued so that its inverse function exist.

 The gray-level in an image may be viewed as a random variable, so we let p r (r) and p s (s) denote the probability density function of random variables r and s.  If p r (r) and T(r) are known and T -1 (s) is single- valued and monotonically increased function then  Assume the transformation function as where w is a dummy variable, s = T(r) is a cumulative distribution function (CDF) of the random variable r.

 Proof

 For discrete case p r (r k ) = n k /n for k = 0,1….L-1  The discrete version of the transformation function is s k = T(r k ) =  Advantage: ◦ automatic, without the need for parameter specifications.

 Given the input image with p r (r), and the specific output image with p z (z), find the transfer function between the r and z.  Let s = T(r) =  Define a random variable z with the property G(z) = = s  From the above equations G(z) = T(r) we have z = G -1 (s) = G -1 [T(r)]

 For discrete case:  From given histogram p r (r k ), k=0, 1,….L-1 s k = T(r k ) =  From given histogram p z (z i ), i=0, 1,…L-1 v k = G(z k ) = = s k  Finally, we have G(z k ) = T(r k ), and z k =G -1 (s k )=G -1 [T(r k )]

1. Obtain the histogram of each given image. 2. Pre-compute a mapped level s k for each level r k. 3. Obtain the transformation function G from given p(z) 4. Precompute z k for each value s k using iterative scheme as follows: 1.To find z k = G -1 (s k ) = G -1 (v k ), however, it may not exist such z k. 2.Since we are dealing with integer, the closest we can get to satisfying G(z k ) – s k = 0 5. For each pixel in the original image, if the value of that pixel is r k, map this value to its corresponding levels s k ; then map level s k into the final level z k.

 Spatial filtering: using a filter kernel ( which is a subimage, w(x, y)) to operate on the image f(x,y).  The response R of the pixel (x, y) after filtering is R = w(-1, -1)f(x-1, y-1) +w(-1, 0)f(x-1, y)+….+w(0, 0)f(x, y)+….+w(1, 0)f(x+1, y)+w(1, 1)f(x+1, y+1) The output image g(x,y) is:

3.6 Smoothing Spatial Filters Weighted Averaging

 Median Filter ◦ The response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter, and then replacing the value of the center pixel with the value determined by the ranking result  For certain noise, such as salt-and-pepper noise, median filter is effective.

 Image averaging – low-pass filtering – image blurring –spatial integration  Image sharpening – high-pass filtering – spatial differentiation. ◦ It enhances the edges and the other discontinuities ◦ First order difference is  f/  x = f(x+1, y) - f(x, y)  f/  y = f(x, y+1) - f(x, y) ◦ Second order difference  2 f/  x 2 = f(x+1, y) + f(x-1, y) - 2f(x, y)

 Isotropic filter, rotational invariant- Laplacian  2 f =  2 f/  x 2 +  2 f/  y 2  2 f = [f(x+1,y)+f(x-1,y)+f(x, y+1)+f(x, y-1)]- 4f(x,y)

 Image enhancement g(x,y)=f(x,y)   2 f(x,y) g(x,y)=f(x,y) +  2 f(x,y)  Unsharp masking f s (x,y)=f(x,y) - f*(x,y), where f*(x,y) is the blurred image.  High boost filtering f hb (x,y)=Af(x,y)-f*(x,y)=(A-1)f(x,y)+f(x,y)-f*(x,y) =(A-1)f (x,y)+f s (x,y) ◦ Using Laplacian f hb (x,y)=Af(x,y)  2 f (x,y) f hb (x,y)=Af(x,y)+  2 f (x,y)

Shapening 的結果可能會有負值; 要做 rescaling 把灰階的範圍調回 0~255 找出最小值 t ;如果 t<0 ,把所有 的像素加上 |t| 。 找出最大值 M :如果 M>255 ,重 新計算每一點灰階 p ; p’=(p/M)x255 p’ 代表最後的灰階值。

  f(x,y)=[G x, G y ]=[  f/  x,  f/  y ]   f(x,y)=mag (  f )=[G x 2, G y 2 ] 1/2 =[(  f/  x) 2 +(  f/  y) 2 ] 1/2  Robert operator G x =  f/  x=z 9 -z 5 G y =  f/  y =z 8 -z 6  f(x,y)= [(z 9 -z 5 ) 2, (z 8 -z 6 ) 2 ] 1/2 =|z 9 -z 5 |+|z 8 -z 6 | Sobel operator  f(x,y)=|z 7 +2z 8 +z 9 )-(z 1 +2z 2 +z 3 )| +|(z 3 +2z 6 +z 9 )-(z 1 +2z 4 +z 7 )|

3.8 Combining Spatial Enhancement Methods