Image Enhancement in the Spatial Domain

Slides:



Advertisements
Similar presentations
Digital Image Processing
Advertisements

Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
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
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.
Digital Image Processing
Image Enhancement in the Spatial Domain II Jen-Chang Liu, 2006.
Image Enhancement in the Spatial Domain
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
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.
Digital Image Processing
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.
Chapter 3 (cont).  In this section several basic concepts are introduced underlying the use of spatial filters for image processing.  Mainly spatial.
Lecture 4 Digital Image Enhancement
Chap2 Image enhancement (Spatial domain)
 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,
Presentation Image Filters
Spatial Filtering: Basics
Chapter 3 Image Enhancement in the Spatial Domain.
DIGITAL IMAGE PROCESSING
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
Image Restoration Chapter 5.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods  Process an image so that the result will be more suitable.
Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter.
Spatial Filtering.
Ch5 Image Restoration CS446 Instructor: Nada ALZaben.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
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
Image Processing Lab Section 28/3/2016 Prepared by Mahmoud Abdelsatar Demonstrator at IT Dep. Faculty of computers and information Assuit University.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Miguel Tavares Coimbra
Image Subtraction Mask mode radiography h(x,y) is the mask.
Chapter 3: Image Enhancement in the Spatial Domain
Fundamentals of Spatial Filtering:
IMAGE ENHANCEMENT TECHNIQUES
ECE 692 – Advanced Topics in Computer Vision
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
Image Enhancement.
Digital Image Processing
Intensity Transformations and Spatial Filtering
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
ENG4BF3 Medical Image Processing
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
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 – Simple Intensity Processing
Department of Computer Engineering
CIS 4350 Image ENHANCEMENT SPATIAL DOMAIN
Intensity Transformations and Spatial Filtering
IT523 Digital Image Processing
Presentation transcript:

Image Enhancement in the Spatial Domain Lecture 3 Image Enhancement in the Spatial Domain

Lecture 3 Image Enhancement in Spatial Domain Machine Vision R. Ebrahimpour, 2008

Principle Objective of Enhancement

Image Enhancement in 2 domains Spatial Domain : (image plane) Techniques are based on direct manipulation of pixels in an image Frequency Domain : Techniques are based on modifying the Fourier transform of an image There are some enhancement techniques based on various combinations of methods from these two categories.

Good images For human visual The visual evaluation of image quality is a highly subjective process. It is hard to standardize the definition of a good image. For machine perception The evaluation task is easier. A good image is one which gives the best machine recognition results. A certain amount of trial and error usually is required before a particular image enhancement approach is selected.

Spatial domain Spatial domain processing: procedures that operate directly on the pixels of the input image to generate the pixel values of processed (output) image. g(x,y)=T[f(x,y)] f(x,y): input image g(x,y): processed image T: an operator defined over some neighborhood of (x,y) Neighborhood around (x,y): usually a square or rectangular subimage area centered at (x,y). The center of the subimage is moved pixel by pixel. At each location (x,y) the operator T is applied to find the value of g(x,y).

Point Processing Simplest form of T (the operator): the neighborhood is 1x1. g(x,y) only depends of value of f at (x,y). T: a gray-level transformation (mapping) This type of processing is called point processing

Spatial domain: Point Processing s=T(r) • r: gray-level at (x,y) in original image f(x,y) • s: gray-level at (x,y) in processed image g(x,y)

Example: Contrast Stretching & Thresholding

3 basic gray-level transformation functions 1)Linear function Negative and identity transformations 2) Logarithm function Log and inverse-log transformation 3) Power-law function nth power and nth root transformations

Image Negatives s = L – 1 –r

Log Transformations s = c log (1+r) c is a constant and r>=0 Log curve maps a narrow range of low gray-level values in the input image into a wider range of output levels Used to expand the values of dark pixels in an image while compressing the higher-level values.

Example: s = log (1+r)

Power-law transformation

Gamma Correction

Piecewise-Linear Transformation Functions

Gray-level slicing Objective: Highlighting a specific range of gray levels in an image

Bit-plane slicing

Histogram Processing Normalized Histogram: gives an estimate of the probability of occurrence of gray level. The sum of all components of a normalized histogram is equal to 1.

Histogram Equalization As the low-contrast image’s histogram is narrow and centered toward the middle of the gray scale, if we distribute the histogram to a wider range the quality of the image will be improved. We can do it by adjusting the Probability Density Function(PDF) of the original histogram of the image so that the probability spread Equally.

Histogram transformation S=T(r)

Histogram Equalization The PDF of the transformed variable s is determined by the gray-level PDF of the input image and by the chosen transformation function A transformation function is a cumulative distribution function (CDF) of random variable r:

The discrete version of transformation

The discrete version of transformation 3 6 2 3 4 5 The discrete version of transformation 3 6 8 9 4x4 Image with Gray Levels between 0 and 9 Input Image Output Image r Nr ÷16 Pr S (تجمعی) x9 New S → 1 2 6 6/16 6/16 = 0.3750 3.375 ≈ 3 3 5 تقسیم بر 16 5/16 11/16 = 0.6875 ضرب در 9 6.375 ≈ 6 4 4/16 15/16 = 0.9375 8.4375 ≈ 8 1/16 16/16 = 1.0000 9 7 8

Histogram Matching (Specification) Histogram equalization has a disadvantage which is that it can generate only one type of output image. With Histogram Specification, we can specify the shape of the histogram that we wish the output image to have. It doesn’t have to be a uniform histogram. Procedure …. 1) Obtain the transformation function T(r) by calculating the histogram equalization of the input image: 2) Obtain the transformation function G(z) by calculating histogram equalization of the desired density function Obtain the inversed transformation function Obtain the output image by applying the processed gray-level from the inversed transformation function to all the pixels in the input image

Example: Desired probability density function:

گام اول گام دوم گام سوم

Indirect approach: First equalize the histogram using transform s = T(r). Equalize the desired histogram v = G(z). Set v = s to obtain the composite transform

Histogram specification is a trial-and-error process There are no rules for specifying histograms, and one must resort to analysis on a case-by-case basis for any given enhancement task. Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level content of an entire image.

Local Enhancement

Enhancement using Arithmetic/Logic Operations Mask Processing Enhancement using Arithmetic/Logic Operations Logical Operations

Image Subtraction h(x,y) is the mask

Image Averaging A noisy image: Averaging M different noisy images:

a) original image b) image corrupted by additive Gaussian noise with zero mean and a standard deviation of 64 gray levels. c). -f). results of averaging K = 8, 16, 64 and 128 noisy images

Spatial Filtering use filter (can also be called as mask/ kernel/ template or window) odd sizes, e.g. 3x3, 5x5,… (for a 3 x 3 filter)

simply move the filter mask from point to point in an image.

Linear Filtering Also called convolution a=(m-1)/2 and b=(n-1)/2, m x n (odd numbers) Also called convolution

Smoothing Spatial Filters used for blurring and for noise reduction blurring is used in preprocessing steps, such as removal of small details from an image prior to object extraction bridging of small gaps in lines or curves noise reduction can be accomplished by blurring with a linear filter and also by a nonlinear filter

Averaging Filters output is simply the average of the pixels contained in the neighborhood of the filter mask. called averaging filters or lowpass filters. replacing the value of every pixel in an image by the average of the gray levels in the neighborhood will reduce the “sharp” transitions in gray levels. sharp transitions random noise in the image edges of objects in the image thus, smoothing can reduce noises (desirable) and blur edges (undesirable)

3x3 Smoothing Linear Filters weighted average box filter the center is the most important and other pixels are inversely weighted as a function of their distance from the center of the mask

Weighted average filter the basic strategy behind weighting the enter point the highest and then reducing the value of the coefficients as a function of increasing distance from the origin is simply an attempt to reduce blurring in the smoothing process. General form : smoothing mask مجموع کلیه ضرایب ماسک

Example:

Example:

Order-Statistics Filters )nonlinear Filters) the response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter. Example: Median Filter Max Filter Min Filter Median filtering Used primarily for noise reduction without any changes in edge of objects: The gray level of each pixel is replaced by the median of the gray levels in the neighborhood of that pixel (instead of by the average as before). quite popular because for certain types of random noise (impulse noise, salt and pepper noise) , they provide excellent noise-reduction capabilities, with considering less blurring than linear smoothing filters of similar size.

Project # 2 Median Filter forces the points with distinct gray levels to be more like their neighbors.

Sharpening Spatial Filters To highlight fine detail or to enhance blurred detail. smoothing ~ integration sharpening ~ differentiation Averaging is analogous to integration and causes blurring, so differentiation is expected to have opposite results and sharpen an image thus, image differentiation enhances edges and other discontinuities (noise) deemphasizes area with slowly varying gray-level values. Categories of sharpening filters: Derivative operators Basic highpass spatial filtering High-boost filtering

First derivative: Second derivative: Gradient operator Laplacian operator

Discrete Form of Laplacian

Laplacian mask

Effect of Laplacian Operator as it is a derivative operator, it highlights gray-level discontinuities in an image it deemphasizes regions with slowly varying gray levels tends to produce images that have featureless background. Correct the effect of featureless background: easily by adding the original and Laplacian image. Sharpen image by Laplacian with addition of original image(Laplacian enhanced image)

Example:

Mask of Laplacian + addition(Laplacian enhanced image)

High-boost Filtering (UNSHARP MASKING) The complete unsharp filtering operator(Unsharp Maskingenhanced image) Unsharp masking: Highpass filtered image = Original – lowpass filtered image Sharpened image = original image – blurred image High-boost Filtering: :(A-1)Original+Original-Lowpass : (A-1)Original+Highpass

if we use Laplacian filter to create sharpen image fs(x,y) with addition of original image:

High-boost Masks A >=1 if A = 1, it becomes “standard” Laplacian sharpening

Project # 3 Example:

Gradient Operator first derivatives are implemented using the magnitude of the gradient

Gradient Mask simplest approximation, 2x2

Roberts cross-gradient operators, 2x2

Sobel operators, 3x3

Example:

Sobel Edge Detector Threshold Edges Image I

Sobel Edge Detector

Project # 4 Sobel Edge Detector