Filtering Images. Contents

Similar documents
Edge Detection Lecture 03 Computer Vision

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

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

Lecture: Edge Detection

Lecture 4: Image Processing

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

Part 3: Image Processing

Lecture 7: Most Common Edge Detectors

Edge detection. Gradient-based edge operators

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Neighborhood operations

Local Image preprocessing (cont d)

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

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

Image features. Image Features

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

Segmentation and Grouping

Filtering and Enhancing Images

Practical Image and Video Processing Using MATLAB

SURVEY ON IMAGE PROCESSING IN THE FIELD OF DE-NOISING TECHNIQUES AND EDGE DETECTION TECHNIQUES ON RADIOGRAPHIC IMAGES

Comparison between Various Edge Detection Methods on Satellite Image

Digital Image Processing. Image Enhancement - Filtering

Other Linear Filters CS 211A

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

EE795: Computer Vision and Intelligent Systems

SIFT - scale-invariant feature transform Konrad Schindler

What is an edge? Paint. Depth discontinuity. Material change. Texture boundary

Concepts in. Edge Detection

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

Point and Spatial Processing

Topic 4 Image Segmentation

SECTION 5 IMAGE PROCESSING 2

Image Processing

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Obtaining Feature Correspondences

Sobel Edge Detection Algorithm

EN1610 Image Understanding Lab # 3: Edges

Segmentation I: Edges and Lines

Lecture 6: Edge Detection

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

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

Anno accademico 2006/2007. Davide Migliore

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

Image Analysis. Edge Detection

Biomedical Image Analysis. Point, Edge and Line Detection

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

EECS490: Digital Image Processing. Lecture #19

PERFORMANCE ANALYSIS OF CANNY AND OTHER COMMONLY USED EDGE DETECTORS Sandeep Dhawan Director of Technology, OTTE, NEW YORK

Prof. Feng Liu. Winter /15/2019

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

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

Linear Operations Using Masks

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

Digital filters. Remote Sensing (GRS-20306)

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

Assignment 3: Edge Detection

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

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

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

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

Computer Vision for HCI. Topics of This Lecture

Coarse-to-fine image registration

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

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

Image Enhancement: To improve the quality of images

Image Analysis. Edge Detection

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

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

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

Chapter 3: Intensity Transformations and Spatial Filtering

EE368 Project Report CD Cover Recognition Using Modified SIFT Algorithm

Image Processing. Daniel Danilov July 13, 2015

Perception. Autonomous Mobile Robots. Sensors Vision Uncertainties, Line extraction from laser scans. Autonomous Systems Lab. Zürich.

Lecture 4: Spatial Domain Transformations

Lectures Remote Sensing

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

Line, edge, blob and corner detection

5. Feature Extraction from Images

Feature Detectors - Sobel Edge Detector

How and what do we see? Segmentation and Grouping. Fundamental Problems. Polyhedral objects. Reducing the combinatorics of pose estimation

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

Computer Vision I - Filtering and Feature detection

Edges and Binary Images

Edge Detection. EE/CSE 576 Linda Shapiro

Edge and corner detection

Local Features: Detection, Description & Matching

COMPARATIVE STUDY OF IMAGE EDGE DETECTION ALGORITHMS

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

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

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Lesson 6: Contours. 1. Introduction. 2. Image filtering: Convolution. 3. Edge Detection. 4. Contour segmentation

School of Computing University of Utah

Building a Panorama. Matching features. Matching with Features. How do we build a panorama? Computational Photography, 6.882

Image gradients and edges

CS4733 Class Notes, Computer Vision

ECG782: Multidimensional Digital Signal Processing

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Transcription:

Image Processing and Data Visualization with MATLAB Filtering Images Hansrudi Noser June 8-9, 010 UZH, Multimedia and Robotics Summer School Noise Smoothing Filters Sigmoid Filters Gradient Filters Contents

Noise Digital images can contain a variety of types of noise. Noise often is the result of errors in the image acquisition process pixel values that do not reflect the true intensities of a real scene Noise types Gaussian noise Salt and pepper noise White noise Gaussian Noise In the additive noise model the image information is given by the true image value and an additive noise component. The additive deviations of the noise have a Gaussian distribution, normally with a mean of zero and a given standard deviation σ. (, ) = (, ) + (, ) f i j s i j n i j The ratio of signal and noise is given by (Signal to Noise Ratio, SNR): SNR σ = σ s f 1 σ = n σ n Imnoise, mean 0, variance 0.01

Salt and Pepper Noise Salt and pepper noise has extreme values and is typically produced by transmission errors. White Noise White noise has a uniform frequency distribution

Smoothing filters Mean filtering Median filter Gaussian filter Sigmoid filter Gradient filter Discrete deviation Laplacian of Gaussian Edge detection Thresholds Zero crossings Canny method Filters Mean filtering Mean filtering, smoothing, averaging, box filtering The mean filter smoothes a signal and reduces noise. Each pixel is replaced by the mean value of its neighbors. It is a low pass filter and eliminates high frequencies.

Mean filtering The mean filter is a convolution filter defined by its kernel 1D: D: [ ] 1/3 1/3 1/3 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 If there exist high noise peaks (salt and pepper noise), a median filter produces better results. Multiple application of small filters (3x3) preserve better edges than the use of large filters (7x7). Median or rank filter A median filter is used to reduce noise. It preserves edges and details better than average filters. It is not a linear filter but it sorts the neighbors and uses the median as new pixel value. If the number of neighbors is even, the average value of both middle pixels is taken.

Median filter example The effect of median filters on a grayscale image (3x3 Kernel, upper right; 5x5 Kernel, lower left). Gaussian filter A Gaussian filter smoothes images and reduces noise, but also the image resolution Its kernel represents the Gaussian curve given by: x x 1 1 1D: G( x) e σ = D: ( ) = σ π σ π + y G x e σ

Gaussian Filter In practice such an infinite filter is approximated by a finite convolution filter that can be computed according to a given standard deviation. In the one dimensional case a convenient kernel size is between the doubled or tripled standard deviation: σ < k < 3σ k = round (.5 σ ) The larger the standard deviation, the stronger is also the smoothing effect of the filter, and the larger the kernel size has to be. Gaussian Filter The following equations compute one dimensional Gaussian kernel in real and integer arrays. Gauss, real (, ) ( ), ( 1,..., ) ( 1, ) ( 0, ) ( 1,..., ) ( 1, ) ( ) ( ), ( 1 ),..., () 1, ( 0) () 1,..., ( 1 ), ( ) Kernel x σ = G k G k + G G G G k G k = G k G k G G G G k G k ( x, σ ) KernelGauss,int = 1 G k 1 G 1 G( 0) G() 1 G( k 1 1,,...,,,,..., ) round round round round round,1 s G k G k G( k) G( k) G( k) ( ) ( ) G( 0) G( k) () ( ) G() i G( k) k 1 s = + round + round i= 1 The normalization factor s reduces the sum of all kernel elements to one

Gaussian Filter The Gaussian filter computes a weighted average of the neighbor pixels. Therefore it preserves better edges than a simple average filter. The Gaussian filter is circular symmetric and separable. Therefore a D operator can be composed by two 1D operators in x and y direction (,, σ ) ( σ ) 1 + x y x y 1 1 1 σ σ σ σ π σ π σ π G x y = e = e e G G f = G f σ σ 1 + σ Gaussian Filter Examples σ = 1 k = round(.5 1) = 3 0.0044 0.054 0.4 0.3989 0.4 0.054 0.0044 σ = 1.5 k = round(.5 1.5) = 4 0.0076 0.036 0.1093 0.13 0.66 0.13 0.1093 0.036 0.0076 σ = k = round(.5 ) = 5 0.0088 0.07 0.0648 0.11 0.176 0.1995 0.176 0.11 0.0648 0.07 0.0088

Gaussian Filter Example The effect of Gaussian filters on a grayscale image (upper left). (Upper right: sigma 1, 5x5 kernel; lower left: sigma 1.5, 9x9 kernel; lower right: sigma, 11x11 kernel) Sigmoid Filter With a Sigmoid filter a gray value range a around a given value b can be enhanced. It is a one pixel operator. The new pixel value is determined by the following equation: f max min ( x) = min+ [ min, max] 1+ e b x a The values a and be define the value range to be enhanced and the interval [min,max] determines the target range of the new values. We get: f ( b) = 0.5( max min ) f ( ) = min f ( ) = max

Sigmoid Filter Sigmoid-Filter applied on a grayscale image (upper left): (upper right: a=80; lower left: a=0; lower right: a=00). The gray value window of the original window is [0, 55]. The window of the target images is the same. The centre of the value range to enhance is 00 (min=0, max=55, b=00). Gradient Filter: Discrete Derivation of order one The first partial derivation in an image is given by (, ) (, ) (, ) f xy f xy f x Δxy gx = x Δx (, ) (, ) (, ) f xy f xy f xy Δy g y = y Δy In the discrete case we get Δ x= 1, Δ y = 1 x y (, ) ( 1, ) (, ) (, 1) g = f x y f x y g = f x y f x y The corresponding kernels are given by: [ 1 1] 1 1

Gradient Image The gradient image g(x,y) shows the regions of the largest variation in the image. g x It consists of the lengths of the gradient vectors ( ) = + g xy g g, x y g y The directions of the D vectors are given by the angle g Φ ( xy, ) = arctan x g y Prewitt and Sobel Gradient Filter Use of larger neighborhood to reduce noise (, ) (, ) (, ) h= 1 ( 1, ) ( 1, ) f x y f x+ h y f x h y f x+ y f x y = limh 0 x h Prewitt filter: 3 point neighborhood Strong effect on horizontal and vertical edges Direction dependent Sobel filter: Weighted smoothing Slightly directional (horizontal and vertical edges) Most popular gradient filter 1 0 1 1 1 1 1 0 1, 0 0 0 1 0 1 1 1 1 1 0 1 1 1 0, 0 0 0 1 0 1 1 1

Sobel Filter Example Laplace Filter ( nd Derivation) The second derivation in x-direction: gxx = gx+ 1 gx = f x+ 1, y f x, y f x, y f x 1, y = ( ( ) ( )) ( ( ) ( )) f ( x+ 1, y) + f ( x 1, y) f ( x, y) The second derivation y-direction g yy = f ( x, y+ 1 ) + f ( x, y 1) f ( x, y) The Laplace operator is given by the sum of the second partial derivations (, ) (, ) f xy f xy ( ) f x, y + x The corresponding 1D kernel matrices y [ 1 1] 1 1

D Laplace Filter In the D case the Laplace operator is: (, ) ( 1, ) ( 1, ) (, 1 ) (, 1) 4 (, ) = xx + yy = + + + + + f xy g g f x y f x y f xy f xy f xy 4 neighborhood kernel: 0 1 0 1 4 1 0 1 0 1 1 1 8 neighborhood kernel: 1 8 1 Properties: 1 1 1 Rotation invariant Sensitive to noise Strong detection of single points, thin lines, and end of lines (only 1 pixel thick) Laplace Operator Example

Laplacian of Gaussian As the Laplace filter is sensitive to noise the image should be smoothed before using it. The Laplacian of Gaussian (LOG) combines a low pass filter with a high pass filter, i.e. it smoothes first the image and enhances afterwards the contrast. According to neuro physiological studies this principle is similar to human vision. First a Gaussian filter is applied, followed by a Laplace filter: ( ) ( ) ( ( ) ( )) ( ) = G x, y f x, y G x, y f x, y x 1 x + y (, ) 1 4 + y σ G x y = e πσ σ DOG or Mexican-Hat Operator The LOG can be approximated by the difference of two Gaussian filters with different variances, called also Difference of Gaussian (DOG) or Mexican-Hat Operator because of its shape

LOG Example The filter size should be at least 6. In the slide before a 13x13 Filter with Sigma = 1.5 was used. It is given by: 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0001 0.0001 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.000 0.0005 0.0009 0.0011 0.0009 0.0005 0.000 0.0001 0.0000 0.0000 0.0000 0.0001 0.0003 0.0011 0.005 0.0040 0.0046 0.0040 0.005 0.0011 0.0003 0.0001 0.0000 0.0000 0.000 0.0011 0.0035 0.0066 0.0083 0.0085 0.0083 0.0066 0.0035 0.0011 0.000 0.0000 0.0001 0.0005 0.005 0.0066 0.0083 0.003-0.009 0.003 0.0083 0.0066 0.005 0.0005 0.0001 0.0001 0.0009 0.0040 0.0083 0.003-0.04-0.039-0.04 0.003 0.0083 0.0040 0.0009 0.0001 0.0001 0.0011 0.0046 0.0085-0.009-0.039-0.069-0.039-0.009 0.0085 0.0046 0.0011 0.0001 0.0001 0.0009 0.0040 0.0083 0.003-0.04-0.039-0.04 0.003 0.0083 0.0040 0.0009 0.0001 0.0001 0.0005 0.005 0.0066 0.0083 0.003-0.009 0.003 0.0083 0.0066 0.005 0.0005 0.0001 0.0000 0.000 0.0011 0.0035 0.0066 0.0083 0.0085 0.0083 0.0066 0.0035 0.0011 0.000 0.0000 0.0000 0.0001 0.0003 0.0011 0.005 0.0040 0.0046 0.0040 0.005 0.0011 0.0003 0.0001 0.0000 0.0000 0.0000 0.0001 0.000 0.0005 0.0009 0.0011 0.0009 0.0005 0.000 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0001 0.0001 0.0001 0.0000 0.0000 0.0000 0.0000 Edge detection Edge detection is an important topic in image processing and feature extraction. With gradient filters edges can be enhanced. However these filters are very sensitive for noise It is necessary to smooth images beforehand.

Edge detection: Thresholds A simple method for detecting edges consists in enhancing edges with a gradient filter then to apply thresholding to label the edges by choosing a threshold and defining all pixels that are larger than the threshold T as edge pixels. However in practice this method is sensitive to noise and doesn't work well. The choice of the threshold value is critical. Examples of Thresholding The following images have been processed with a Gaussian filter (3x3, 1), a Sobel filter, and labeled by thresholding with different threshold values (00, 300, 400, 500). Low threshold values segment also noisy parts High thresholds miss weak edges.

Threshold: 00 Threshold: 300

Threshold: 400 Threshold: 500

Zero Crossings with Laplacians Another possibility for detecting edges in images consists in using Laplacian filters, and in marking the zero crossings as edges. This procedure produces sharp edges but is strongly disturbed by the presence of noise. Example of Zero Crossings Two LOG (default sigma ), automatic threshold 0.07 threshold 0

Canny method The Canny method applies two thresholds to the gradient: a high threshold for low edge sensitivity and a low threshold for high edge sensitivity. The method starts with the low sensitivity result and then grows it to include connected edge pixels from the high sensitivity result. This helps fill in gaps in the detected edges. The Canny method is robust and is frequently used in practice Canny Method: Principle First the image is smoothed with a Gaussian kernel. Then a gradient image is produced. Next the regions around local maxima are suppressed in order to produce only one pixel large edges. Then the edges are refined by a two threshold method. If a pixel has a value larger than the higher threshold then it is immediately recognized as edge pixel. If a value is below the lower threshold then the pixel is immediately rejected. If the pixel value is between both thresholds then it is only accepted if there exists a path to an edge pixel whose value is larger than the higher threshold.

Canny Method: Example Canny method for edge detection applied on 8bit JPG image, Threshold Min Max: 0.0375 0.0938, Sigma Gauss: 1