Sharpening through spatial filtering

Similar documents
Intensity transformations

Lectures 6&7: Image Enhancement

Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition

Introduction. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

jorge s. marques image processing

Convolution. 1D Formula: 2D Formula: Example on the web:

Edge detection. (Trucco, Chapt 4 AND Jain et al., Chapt 5) -Edges are significant local changes of intensity in an image.

2.2 Creaseness operator

DATA ANALYSIS II. Matrix Algorithms

Digital Imaging and Multimedia. Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Correlation and Convolution Class Notes for CMSC 426, Fall 2005 David Jacobs

Admin stuff. 4 Image Pyramids. Spatial Domain. Projects. Fourier domain 2/26/2008. Fourier as a change of basis

Computational Foundations of Cognitive Science

REAL TIME TRAFFIC LIGHT CONTROL USING IMAGE PROCESSING

High Quality Image Magnification using Cross-Scale Self-Similarity

Canny Edge Detection

DERIVATIVES AS MATRICES; CHAIN RULE

Drawing Lines with Pixels. Joshua Scott March 2012

Fluid Dynamics and the Navier-Stokes Equation

High Quality Image Deblurring Panchromatic Pixels

A Learning Based Method for Super-Resolution of Low Resolution Images

Assessment. Presenter: Yupu Zhang, Guoliang Jin, Tuo Wang Computer Vision 2008 Fall

Data Mining: Algorithms and Applications Matrix Math Review

How to resize, rotate, and crop images

Sachin Patel HOD I.T Department PCST, Indore, India. Parth Bhatt I.T Department, PCST, Indore, India. Ankit Shah CSE Department, KITE, Jaipur, India

Module II: Multimedia Data Mining

Automatic Restoration Algorithms for 35mm film

Comparison of Non-linear Dimensionality Reduction Techniques for Classification with Gene Expression Microarray Data

Automatic Traffic Estimation Using Image Processing

Adaptive Coded Aperture Photography

Section 8.2 Solving a System of Equations Using Matrices (Guassian Elimination)

A New Image Edge Detection Method using Quality-based Clustering. Bijay Neupane Zeyar Aung Wei Lee Woon. Technical Report DNA #

Face detection is a process of localizing and extracting the face region from the

Image Interpolation by Pixel Level Data-Dependent Triangulation

Component Ordering in Independent Component Analysis Based on Data Power

Assessment of Camera Phone Distortion and Implications for Watermarking

Robotics. Lecture 3: Sensors. See course website for up to date information.

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Image Authentication Scheme using Digital Signature and Digital Watermarking

Digital Image Processing

Chapter 6. Orthogonality

9 MATRICES AND TRANSFORMATIONS

Analecta Vol. 8, No. 2 ISSN

Metrics on SO(3) and Inverse Kinematics

15.1. Exact Differential Equations. Exact First-Order Equations. Exact Differential Equations Integrating Factors

Galaxy Morphological Classification

H.Calculating Normal Vectors

Geometric description of the cross product of the vectors u and v. The cross product of two vectors is a vector! u x v is perpendicular to u and v

Solving Simultaneous Equations and Matrices

A vector is a directed line segment used to represent a vector quantity.

Image Segmentation and Registration

Armstrong Atlantic State University Engineering Studies MATLAB Marina Image Processing Primer

DIGITAL IMAGE PROCESSING AND ANALYSIS

Math 215 HW #6 Solutions

Knowledge Discovery and Data Mining. Structured vs. Non-Structured Data

Detection and Restoration of Vertical Non-linear Scratches in Digitized Film Sequences

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Forecasting Geographic Data Michael Leonard and Renee Samy, SAS Institute Inc. Cary, NC, USA

Orthogonal Projections

Spatial Statistics Chapter 3 Basics of areal data and areal data modeling

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

Sub-pixel mapping: A comparison of techniques

OBJECT TRACKING USING LOG-POLAR TRANSFORMATION

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

PERFORMANCE ANALYSIS OF HIGH RESOLUTION IMAGES USING INTERPOLATION TECHNIQUES IN MULTIMEDIA COMMUNICATION SYSTEM

HSI BASED COLOUR IMAGE EQUALIZATION USING ITERATIVE n th ROOT AND n th POWER

Linear Filtering Part II

Elasticity Theory Basics

Interactive simulation of an ash cloud of the volcano Grímsvötn

Supporting Online Material for

Blind Deconvolution of Barcodes via Dictionary Analysis and Wiener Filter of Barcode Subsections

Spectral Line II. G ij (t) are calibrated as in chapter 5. To calibrated B ij (ν), observe a bright source that is known to be spectrally flat

IMAGE RECOGNITION FOR CATS AND DOGS

The Image Deblurring Problem

The Quantum Harmonic Oscillator Stephen Webb

STATIC SIGNATURE RECOGNITION SYSTEM FOR USER AUTHENTICATION BASED TWO LEVEL COG, HOUGH TRANSFORM AND NEURAL NETWORK

Linear Threshold Units

Logistic Regression. Jia Li. Department of Statistics The Pennsylvania State University. Logistic Regression

A synonym is a word that has the same or almost the same definition of

Linear and Non-linear Contrast Enhancement Image

siftservice.com - Turning a Computer Vision algorithm into a World Wide Web Service

MMGD0203 Multimedia Design MMGD0203 MULTIMEDIA DESIGN. Chapter 3 Graphics and Animations

Tracking in flussi video 3D. Ing. Samuele Salti

Numerical Methods For Image Restoration

Image Compression and Decompression using Adaptive Interpolation

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

PHOTO RESIZING & QUALITY MAINTENANCE

A Novel Method to Improve Resolution of Satellite Images Using DWT and Interpolation

A Primer on Index Notation

A Simple Feature Extraction Technique of a Pattern By Hopfield Network

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

Feature Tracking and Optical Flow

Bernice E. Rogowitz and Holly E. Rushmeier IBM TJ Watson Research Center, P.O. Box 704, Yorktown Heights, NY USA

Section 1.1 Linear Equations: Slope and Equations of Lines

Time series analysis Matlab tutorial. Joachim Gross

Differentiation of vectors

Transcription:

Sharpening through spatial filtering Stefano Ferrari Università degli Studi di Milano stefano.ferrari@unimi.it Elaborazione delle immagini (Image processing I) academic year 2011 2012 Sharpening The term sharpening is referred to the techniques suited for enhancing the intensity transitions. In images, the borders between objects are perceived because of the intensity change: more crisp the intensity transitions, more sharp the image. The intensity transitions between adjacent pixels are related to the derivatives of the image. Hence, operators (possibly expressed as linear filters) able to compute the derivatives of a digital image are very interesting. Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 1

First derivative of an image Since the image is a discrete function, the traditional definition of derivative cannot be applied. Hence, a suitable operator have to be defined such that it satisfies the main properties of the first derivative: 1. it is equal to zero in the regions where the intensity is constant; 2. it is different from zero for an intensity transition; 3. it is constant on ramps where the intensity transition is constant. The natural derivative operator is the difference between the intensity of neighboring pixels (spatial differentiation). For simplicity, the monodimensional case can be considered: f x = f (x + 1) f (x) Since f x is defined using the next pixel: it cannot be computed for the last pixel of each row (and column); it is different from zero in the pixel before a step. Second derivative of an image Similarly, the second derivative operator can be defined as: 2 f = f (x + 1) f (x) (f (x) f (x 1)) x 2 = f (x + 1) 2f (x) + f (x 1) This operator satisfies the following properties: 1. it is equal to zero where the intensity is constant; 2. it is different from zero at the begin of a step (or a ramp) of the intensity; 3. it is equal to zero on the constant slope ramps. Since 2 f is defined using the previous and the next pixels: x 2 it cannot be computed with respect to the first and the last pixels of each row (and column); it is different from zero in the pixel that precedes and in the one that follows a step. Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 2

Derivatives of an image: an example Note: at the step, the second derivative switch the sign (zero crossing). Laplacian Usually the sharpening filters make use of the second order operators. A second order operator is more sensitive to intensity variations than a first order operator. Besides, partial derivatives has to be considered for images. The derivative in a point depends on the direction along which it is computed. Operators that are invariant to rotation are called isotropic. Rotate and differentiate (or filtering) has the same effects of differentiate and rotate. The Laplacian is the simpler isotropic derivative operator (wrt. the principal directions): 2 f = 2 f x 2 + 2 f y 2 Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 3

Laplacian filter In a digital image, the second derivatives wrt. x and y are computed as: 2 f x 2 = f (x + 1, y) 2f (x, y) + f (x 1, y) 2 f y 2 = f (x, y + 1) 2f (x, y) + f (x, y 1) Hence, the Laplacian results: 2 f (x, y) = f (x + 1, y) + f (x 1, y) + f (x, y + 1) +f (x, y 1) 4f (x, y) Also the derivatives along to the diagonals can be considered: 2 f (x, y) + f (x 1, y 1) + f (x + 1, y + 1) + f (x 1, y + 1) + f (x + 1, y 1) 4f (x, y) Laplacian filter (2) Laplacian filter invariant to 90 rotations Laplacian filter invariant to 45 rotations Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 4

Laplacian filter: example The Laplacian has often negative values. In order to be visualized, it must be properly scaled to the representation interval [0,..., L 1]. (a) (b) (c) (a) Original image, (b) its Laplacian, (c) its Laplacian scaled such that zero is displayed as the intermediate gray level. Laplacian filter: example (2) The Laplacian is positive at the onset of a step and negative at the end. Subtracting the Laplacian (or a fraction of it) from the image, the height of the step is increased. (a) (b) (c) (a) Original image, (b) Laplacian filtered, (c) Laplacian with diagonals filtered. Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 5

Unsharp masking The technique known as unsharp masking is a method of common use in graphics for making the images sharper. It consists of: 1. defocusing the original image; 2. obtaining the mask as the difference between the original image and its defocused copy; 3. adding the mask to the original image. The process can be formalized as: g = f + k (f f h) where f is the original image, h is the smoothing filter and k is a constant for tuning the mask contribution. If k > 1, the process is called highboost filtering. Unsharp masking (2) original image defocused image unsharping mask unsharped image highboosted image Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 6

Gradient The gradient of a function is the vector formed by its partial derivatives. For a bidimensional function, f (x, y): f grad(f ) [ gx g y ] = f x f y The gradient vector points toward the direction of maximum variation. The gradient magnitude, M(x, y) is: M(x, y) = mag( f ) = g 2 x + g 2 y It is also called gradient image. Often approximated as M(x, y) gx + g y. Derivative operators Basic definitions: g x (x, y) = f (x + 1, y) f (x, y) g y (x, y) = f (x, y + 1) f (x, y) Roberts operators: g x : -1 1 g y : -1 1 g x (x, y) = f (x + 1, y + 1) f (x, y) g y (x, y) = f (x, y + 1) f (x 1, y) g x : -1 0 0 1 g y : 0-1 1 0 Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 7

Derivative operators (2) Sobel operators: g x (x, y) = f (x 1, y 1) 2f (x 1, y) f (x 1, y + 1) + f (x + 1, y 1) + 2f (x + 1, y) + f (x + 1, y + 1) g y (x, y) = f (x 1, y 1) 2f (x, y 1) f (x + 1, y 1) + f (x 1, y + 1) + 2f (x, y + 1) + f (x + 1, y + 1) -1-2 -1-1 0 1 g x : 0 0 0 g y : -2 0 2 1 2 1-1 0 1 Example of gradient based application The Sobel filtering reduces the visibility of those regions in which the intensity changes slowly, allowing to highlight the defects (and making defects detection easier for automatic processing). Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 8

Combined methods Often, a single technique is not sufficient for obtaining the desired results. For example, the image (a) is affected by noise and has a narrow dynamic range. (a) (b) Laplacian filtering (b) enhance the details, but also the noise. The gradient is less sensitive to the noise than the Laplacian (which is a second order operator). Combined methods (2) The gradient, smoothed in order to avoid the noise, can be used for weighting the contribution of the Laplacian. The image (c), the Sobel filtering gradient smoothed using a 5 5 averaging filter is reported. (c) (d) This mask multiplied by the Laplacian results in the image in (d). The intensity changes are preserved, while the noise has been attenuated. Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 9

Combined methods (3) The image (d) can be added to the original image, which results in the image (e). The dynamical range can be enlarged applying a power transformation (e). The intensity transformation make the noise more visible, but also enhance other details, such as the tissues around the skeleton. (e) (f) Bilateral Filtering * Giving f an image, g is the image after bilateral filtering: g(p) = 1 W p exp ( q N p ) q p 2 σs 2 exp ( where W p is the normalization factor: W p = exp ( q N p ) q p 2 σs 2 exp ( and N p is a suitable neighborhood of p. ) f (q) f (p) 2 σi 2 f (q) ) f (q) f (p) 2 σi 2 What is the effect produced by the filter? Notes: when σ i grows, the filter tends to an averaging filter; the filter is not linear. Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 10

Bilateral Filtering * (a) (b) (c) (a) original image (100 100, 256 gray levels) (b) after filtering with Gaussian filter (7 7, σ s = 3) (c) after filtering with bilateral filter (7 7, σ s = 3, σ i = 50) Bilateral Filtering * (a) (b) (c) (a) Original image (107 90, 256 gray levels) (b) after filtering with Gaussian filter (7 7, σ s = 3) (c) after filtering with bilateral filter (7 7, σ s = 3, σ i = 30) Stefano Ferrari Elaborazione di immagini (Image processing) a.a. 2011/12 11