Sharpening through spatial filtering

Similar documents
Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

EE795: Computer Vision and Intelligent Systems

Chapter 3: Intensity Transformations and Spatial Filtering

3.4& Fundamentals& mechanics of spatial filtering(page 166) Spatial filter(mask) Filter coefficients Filter response

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

SYDE 575: Introduction to Image Processing

Digital Image Processing. Image Enhancement - Filtering

Chapter 3 Image Enhancement in the Spatial Domain

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

Biomedical Image Analysis. Spatial Filtering

Fourier transform of images

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

Topological structure of images

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

Digital Image Processing

ECG782: Multidimensional Digital Signal Processing

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

ECG782: Multidimensional Digital Signal Processing

Biomedical Image Analysis. Point, Edge and Line Detection

Image Enhancement in Spatial Domain (Chapter 3)

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Segmentation algorithm for monochrome images generally are based on one of two basic properties of gray level values: discontinuity and similarity.

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Topological structure of images

Lecture 6: Edge Detection

Lecture 7: Most Common Edge Detectors

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

Image compression. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

Other Linear Filters CS 211A

Image Processing

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

Anno accademico 2006/2007. Davide Migliore

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Lecture 4: Image Processing

Digital Image Processing, 2nd ed. Digital Image Processing, 2nd ed. The principal objective of enhancement

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

EECS490: Digital Image Processing. Lecture #19

Edge detection. Gradient-based edge operators

Topic 4 Image Segmentation

Lecture 4: Spatial Domain Transformations

Digital Image Processing

Point and Spatial Processing

Image gradients and edges

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Edge Detection. CS664 Computer Vision. 3. Edges. Several Causes of Edges. Detecting Edges. Finite Differences. The Gradient

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Lecture: Edge Detection

Edge and local feature detection - 2. Importance of edge detection in computer vision

Point Operations and Spatial Filtering

Sobel Edge Detection Algorithm

Digital Image Processing (CS/ECE 545) Lecture 5: Edge Detection (Part 2) & Corner Detection

Broad field that includes low-level operations as well as complex high-level algorithms

Local Image preprocessing (cont d)

Neighborhood operations

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

PROCESS > SPATIAL FILTERS

Linear Operations Using Masks

Segmentation and Grouping

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Image Differentiation

Digital Image Processing, 3rd ed.

Filtering Images. Contents

An Algorithm for Blurred Thermal image edge enhancement for security by image processing technique

Chapter - 2 : IMAGE ENHANCEMENT

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Edge Detection. CMPUT 206: Introduction to Digital Image Processing. Nilanjan Ray. Source:

Line, edge, blob and corner detection

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Comparison between Various Edge Detection Methods on Satellite Image

An Edge Detection Algorithm for Online Image Analysis

Digital Image Processing ERRATA. Wilhelm Burger Mark J. Burge. An algorithmic introduction using Java. Second Edition. Springer

Digital Image Procesing

Image features. Image Features

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Edge Detection. Today s reading. Cipolla & Gee on edge detection (available online) From Sandlot Science

(10) Image Segmentation

Ulrik Söderström 16 Feb Image Processing. Segmentation

Noise Model. Important Noise Probability Density Functions (Cont.) Important Noise Probability Density Functions

SIFT - scale-invariant feature transform Konrad Schindler

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

the most common approach for detecting meaningful discontinuities in gray level. we discuss approaches for implementing

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Computer Vision I - Basics of Image Processing Part 1

Edge Detection. EE/CSE 576 Linda Shapiro

Neighbourhood Operations

EELE 5310: Digital Image Processing. Lecture 2 Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

EELE 5310: Digital Image Processing. Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

Comparative Analysis of Edge Detection Algorithms Based on Content Based Image Retrieval With Heterogeneous Images

Filtering and Enhancing Images

Computer Vision I - Filtering and Feature detection

Performance Evaluation of Edge Detection Techniques for Images in Spatial Domain

Transcription:

Sharpening through spatial filtering Stefano Ferrari Università degli Studi di Milano stefano.ferrari@unimi.it Methods for Image Processing academic year 2017 2018 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: the crisper the intensity transitions, the sharper the image is perceived. The intensity transition between adjacent pixels is related to the derivatives of the image in that position. Hence, operators (possibly expressed as linear filters) able to compute the derivatives of a digital image are very interesting. Stefano Ferrari Methods for Image processing a.a. 2017/18 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. equal to zero in the regions where the intensity is constant; 2. different from zero for an intensity transition; 3. 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 beginning 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 Methods for Image processing a.a. 2017/18 2

Derivatives of an image: an example Note: at the step, the second derivative s sign switches (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 simplest isotropic derivative operator (wrt. the principal directions): 2 f = 2 f x 2 + 2 f y 2 Stefano Ferrari Methods for Image processing a.a. 2017/18 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) 0 1 0 1-4 1 Laplacian filter invariant to 90 rotations 0 1 0 1 1 1 1-8 1 Laplacian filter invariant to 45 rotations 1 1 1 Stefano Ferrari Methods for Image processing a.a. 2017/18 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: g = f + c 2 f, 1 c 0 (a) (b) (c) (a) Original image, (b) Laplacian filtered, (c) Laplacian with diagonals filtered. Stefano Ferrari Methods for Image processing a.a. 2017/18 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 Methods for Image processing a.a. 2017/18 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 Methods for Image processing a.a. 2017/18 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 Methods for Image processing a.a. 2017/18 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 gradient smoothed using a 5 5 averaging filter is reported in (c); Sobel filters have been used for the gradient. (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 Methods for Image processing a.a. 2017/18 9

Combined methods (3) The image (d) can be added to the original image, which results in the image (e). The dynamic range can be enlarged applying a power transformation (f). The intensity transformation make the noise more visible, but also enhance other details, such as the tissues around the skeleton. (e) (f) Bilateral Filtering * The image g is obtained from f, through 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 Methods for Image processing a.a. 2017/18 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 Methods for Image processing a.a. 2017/18 11

Homeworks and suggested readings DIP, Sections 3.6, 3.7 pp. 157 173 GIMP Filters Enhance Sharpen Unsharp mask Generic Convolution matrix Stefano Ferrari Methods for Image processing a.a. 2017/18 12