Lecture Outline. Basics of Spatial Filtering Smoothing Spatial Filters. Sharpening Spatial Filters

Similar documents
Digital Image Processing. Lecture 6 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Chapter 3: Image Enhancement in the. Office room : 841

Enhancement Using Local Histogram

EDGES AND CONTOURS(1)

Image Enhancement (Spatial Filtering 2)

Review Smoothing Spatial Filters Sharpening Spatial Filters. Spatial Filtering. Dr. Praveen Sankaran. Department of ECE NIT Calicut.

Computer Vision & Digital Image Processing

CAP 5415 Computer Vision Fall 2011

CAP 5415 Computer Vision

Quadratic Functions. The graph of the function shifts right 3. The graph of the function shifts left 3.

. This is the Basic Chain Rule. x dt y dt z dt Chain Rule in this context.

ECE Digital Image Processing and Introduction to Computer Vision. Outline

Reading. 3. Image processing. Pixel movement. Image processing Y R I G Q

9.1 The Square Root Function

Image Enhancement: Methods. Digital Image Processing. No Explicit definition. Spatial Domain: Frequency Domain:

3. Several Random Variables

Objectives. By the time the student is finished with this section of the workbook, he/she should be able

Example: When describing where a function is increasing, decreasing or constant we use the x- axis values.

Digital Image Processing COSC 6380/4393

Midterm Summary Fall 08. Yao Wang Polytechnic University, Brooklyn, NY 11201

Local enhancement. Local Enhancement. Local histogram equalized. Histogram equalized. Local Contrast Enhancement. Fig 3.23: Another example

New Functions from Old Functions

Digital Image Processing COSC 6380/4393

Computed Tomography Notes, Part 1. The equation that governs the image intensity in projection imaging is:

Increasing and Decreasing Functions and the First Derivative Test. Increasing and Decreasing Functions. Video

9.3 Graphing Functions by Plotting Points, The Domain and Range of Functions

3.8 Combining Spatial Enhancement Methods 137

Filtering and Edge Detection

Department of Physics and Astronomy 2 nd Year Laboratory. L2 Light Scattering

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news

y2 = 0. Show that u = e2xsin(2y) satisfies Laplace's equation.

y,z the subscript y, z indicating that the variables y and z are kept constant. The second partial differential with respect to x is written x 2 y,z

Probabilistic Model of Error in Fixed-Point Arithmetic Gaussian Pyramid

Image Enhancement in the frequency domain. GZ Chapter 4

Colorado School of Mines Image and Multidimensional Signal Processing

Chapter 4 Image Enhancement in the Frequency Domain

Inverse of a Function

Histogram Processing

Machine vision. Summary # 4. The mask for Laplacian is given

Lab on Taylor Polynomials. This Lab is accompanied by an Answer Sheet that you are to complete and turn in to your instructor.

Local Enhancement. Local enhancement

Lecture 7: Edge Detection

This is only a list of questions use a separate sheet to work out the problems. 1. (1.2 and 1.4) Use the given graph to answer each question.

Machine vision, spring 2018 Summary 4

(One Dimension) Problem: for a function f(x), find x 0 such that f(x 0 ) = 0. f(x)

Lecture 04 Image Filtering

IMAGE ENHANCEMENT II (CONVOLUTION)

Edge Detection. Image Processing - Computer Vision

Mathematical Preliminaries. Developed for the Members of Azera Global By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

18-660: Numerical Methods for Engineering Design and Optimization

Saturday X-tra X-Sheet: 8. Inverses and Functions

Tangent Line Approximations

Perception III: Filtering, Edges, and Point-features

ELEG 3143 Probability & Stochastic Process Ch. 4 Multiple Random Variables

Syllabus Objective: 2.9 The student will sketch the graph of a polynomial, radical, or rational function.

Math Review and Lessons in Calculus

Least-Squares Spectral Analysis Theory Summary

( x) f = where P and Q are polynomials.

Computed Tomography Notes, Part 1. The equation that governs the image intensity in projection imaging is:

TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection

8.4 Inverse Functions

Image preprocessing in spatial domain

Wind-Driven Circulation: Stommel s gyre & Sverdrup s balance

The concept of limit

A NOVEL METHOD OF INTERPOLATION AND EXTRAPOLATION OF FUNCTIONS BY A LINEAR INITIAL VALUE PROBLEM

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Chapter 4 Imaging. Lecture 21. d (110) Chem 793, Fall 2011, L. Ma

0,0 B 5,0 C 0, 4 3,5. y x. Recitation Worksheet 1A. 1. Plot these points in the xy plane: A

Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ]

Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER?

Computer Vision & Digital Image Processing

RATIONAL FUNCTIONS. Finding Asymptotes..347 The Domain Finding Intercepts Graphing Rational Functions

Rolle s Theorem and the Mean Value Theorem. Rolle s Theorem

Computational Methods for Domains with! Complex Boundaries-I!

18/10/2017. Image Enhancement in the Spatial Domain: Gray-level transforms. Image Enhancement in the Spatial Domain: Gray-level transforms

Estimation of the Vehicle Sideslip Angle by Means of the State Dependent Riccati Equation Technique

MODULE 6 LECTURE NOTES 1 REVIEW OF PROBABILITY THEORY. Most water resources decision problems face the risk of uncertainty mainly because of the

CHAPTER 8 ANALYSIS OF AVERAGE SQUARED DIFFERENCE SURFACES

( 1) ( 2) ( 1) nan integer, since the potential is no longer simple harmonic.

Shai Avidan Tel Aviv University

Basic properties of limits

Asymptote. 2 Problems 2 Methods

Functions. Essential Question What are some of the characteristics of the graph of a logarithmic function?

Analog Computing Technique

ENSC327 Communications Systems 2: Fourier Representations. School of Engineering Science Simon Fraser University

Introduction to Computer Vision. 2D Linear Systems

4. References. words, the pseudo Laplacian is given by max {! 2 x,! 2 y}.

Feedback Linearization

Computer Vision Lecture 3

Part I: Thin Converging Lens

Optical Flow, KLT Feature Tracker.

Chapter 4 Image Enhancement in the Frequency Domain

Image Gradients and Gradient Filtering Computer Vision

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform

Differentiation. The main problem of differential calculus deals with finding the slope of the tangent line at a point on a curve.

Digital Image Processing. Filtering in the Frequency Domain

BANDELET IMAGE APPROXIMATION AND COMPRESSION

Mat 267 Engineering Calculus III Updated on 9/19/2010

Image Segmentation: Definition Importance. Digital Image Processing, 2nd ed. Chapter 10 Image Segmentation.

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading:

Transcription:

1

Lecture Outline Basics o Spatial Filtering Smoothing Spatial Filters Averaging ilters Order-Statistics ilters Sharpening Spatial Filters Laplacian ilters High-boost ilters Gradient Masks Combining Spatial Enhancement Methods

Spatial Domain Spatial Domain Operations procedures that operate directl on piels g = T[F] where is the input image g is the processed image T is an operator on deined over some neighborhood o 4

Mask / Filter Neighborhood o a point can be deined b using a square/rectangular commonl used or circular subimage area centered at mask or ilter The center o the subimage is moved rom piel to piel starting at the top let corner o the image 5

Spatial Filtering Use ilter can also be called as mask / kernel / template / window The values o a ilter subimage are reerred to as coeicients rather than piel intensities. Our ocus will be on masks o odd sizes e.g. 3X3 55. Can a ilter be o even size? 6

Spatial Filtering Process Simpl move the ilter mask rom point to point in an image At each point the response o the ilter at that point is calculated using a predeined relationship R = w z w z... = 1 mn i= i 1 w z i i w mn z mn Linear Filtering 7

Spatial Filtering Approaches Linear Filtering Non-linear Filtering Order-Statistics iltering Morphological iltering Adaptive Filtering 8

How Does Linear Filtering Work? 9

Linear Filtering Linear Filtering o an image o size MN b ilter b mask o size mn is given b the epression a g = s=a To generate a complete iltered image this equation must be applied or = 1... M-1 and = 1... N-1 Convolution process b t=b where a = m-1/ and b = n-1/ w s t s t 1

What Happens at the Borders? The mask alls outside the edge! Solutions? Ignore the edges The resultant image is smaller than the original Pad with zeros Introducing unwanted artiacts What else? 11

Smoothing Spatial Filters Use: For blurring images & noise reduction Blurring is used in preprocessing steps such as Removal o small details rom an image prior to object etraction Bridging o small gaps in lines or curves Noise Reduction can be accomplished b blurring with linear or non-linear ilters 1

Smoothing Linear Filters Output is simpl the average o the piels contained in the neighborhood o the ilter mask Also reerred to as averaging ilters or lowpass ilters eplained in uture lecture 13

Averaging Filter: An Intuitive Approach Replace each piel b the average o piels in a square window surrounding this piel 33 averaging ilter What happens i we use an averaging ilter with a larger window? 14

Eample: Appling 33 Averaging Filter Assume edges ignored thus resultant image is 33 15

More Eamples Original image size 55 piels Results o smoothing with averaging ilter masks o size n=3 5 9 15 35 respectivel order: let to right top to bottom 16

Eample: Space Imager 17

Smoothing Linear Filters Able to reduce sharp transitions in gra levels Random noise in the image Edges o objects in the image Smoothing can reduce noises desirable and blur edges undesirable 18

33 Smoothing Linear Filters bo ilter weighted average 19

Weighted Averaging Filter Instead o averaging all the piel values in the window give the closer-b piels higher weighting and ar-awa piels lower weighting Reduce value o coeicients as a unction o increasing distance rom the origin An attempt to reduce blurring in the smoothing process

1 General orm: Smoothing Mask Filter o size m n m and n odd = = = = = a a s b b t a a s b b t t s w t s t s w g Summation o all coeicients o the mask

Eample: Lena 'Smoothen'

Other Common Smoothing Filters Criteria or designing a smoothing ilter ws t unction as averaging a s=a b t=b w st =1 mean value is preserved Another popular smoothing ilter: Gaussian ilter 3

Order-Statistics Filters Non-linear ilters Response is based on ordering ranking the piels contained in the image area encompassed b the ilter Eample: Median ilter: Ma ilter: Min ilter: R=median z k k=1...n n R=ma z k k=1...n n R=min z k k=1...n n Note: n n is the size o the mask 4

Median Filters Replaces the value o a piel b the median o the gra levels in the speciied neighborhood o that piel Original value o the piel is included in the computation o the median Popularl used or certain tpes o random noise impulse noise salt and pepper noise Ecellent noise-reduction capabilities Less blurring eect that linear smoothing ilters o similar size Intuitivel how do the work? 5

Eample: Fighting Salt and Pepper Noise 6

Sharpening Spatial Filters Sharpening: to enhance line structures or other details in an image Sharpening Spatial Filters: To highlight ine detail or edges in an image To enhance and ocus on details that has been blurred either in error or as a natural eect o a particular method o image acquisition 7

Image Sharpening g = ± c Blur the original image Add the Laplacian 6

Blurring vs. Sharpening Blurring can be done in spatial domain b piel averaging in the neighborhood o a piel Since averaging is analogous to integration... Can we conclude that sharpening is accomplished b spatial dierentiation? 8

Derivative Operator The strength o the response o a derivative operator is proportional to the degree o discontinuit o the image at the point at which the operator is applied Image dierentiation Enhances edges and other discontinuities such as noise De-emphasizes area with slowl varing gra-level values 9

First-order Derivative A basic deinition o the irst-order derivative o a one-dimensional unction is the dierence = 1 3

Second-order Derivative Similarl the second-order derivative o a onedimensional unction is the dierence = 1 1 31

3 First & Second Derivatives o Consider an image unction o two variables we are dealing with partial derivatives along the two spatial aes. = = = Laplacian operator Gradient operator

33 Discrete orm o Laplacian From ield 1 1 = 1 1 = ] 4 1 1 1 1 [ =

Laplacian Mask The Laplacian mask contains the coeicients o the Laplacian operator second-order derivatives 34

Laplacian Mask witih Diagonal Terms This Laplacian mask is implemented dierentl b incorporating the diagonal directions. The center value is now -8 due to the total subtracted rom the dierence terms. 35

Other Implementations o Laplacian Masks These masks dierence in sign give the same result as the previous two masks. The dierence in sign must be kept in mind when combining add / subtract a Laplacian-iltered image with another image 36

Eect o Laplacian Operator Tends to produce images that have Graish edge lines and other discontinuities in brighter intensities all superimposed on a dark eatureless background To correct the eect o eatureless background Add the original and Laplacian-iltered image together Be careul with the Laplacian ilter used g = i the center coeicient o the Laplacian mask is negative i the center coeicient o the Laplacian mask is positive 37

Eample: Moon Images Image o the moon Laplacian-iltered image with 1 1 1 1-8 1 1 1 1 Laplacian image scaled or displa purposes Image enhanced sharpened b adding Laplacian-iltered image to the original image Note: let to right top to bottom 38

39 Simpliications To simpli the computation we can create a mask which do both operations Laplacian ilter and Addition o original image Composite Laplacian Mask 1] 1 1 1 [ 5 4 1] 1 1 1 [ = = g -1-1 5-1 -1

Composite Laplacian Mask 4

Composite Laplacian Mask Which composite mask normal Laplacian / Laplacian with diagonal terms can produce better image sharpening? -1-1 -1 5-1 -1 9-1 -1-1 41

4 Composite Laplacian Mask -1-1 9-1 -1-1 -1 5-1 -1 = g 1-1 -1 4-1 -1 = 1-1 -1 8-1 -1 =

Unsharp Masking A process used man ears in the publishing industr to sharpen images Sharpened image: Subtracting a blurred version o an image rom the image itsel s = sharpened image = original image blurred image 43

Unsharp Masking Can ou make sense o unsharp masking? 44

45 High-Boost Filtering High-boost Filtering: A urther generalization o unsharp masking A hb = 1 1 A A s hb = = A 1 where

High-Boost Filtering This general equation does not state eplicitl how the sharp image is obtained... I we choose to use Laplacian operator to sharpen the image we get hb = A 1 hb A = A s i the center coeicient o the Laplacian mask is negative i the center coeicient o the Laplacian mask is positive 46

High-Boost Filtering A 1 I A = 1 it becomes a standard Laplacian sharpening 47

Eample: High-Boost Filtering 48

Eample: Lena 'Sharpened' 49

5 First Derivatives: Gradient Operator First derivatives are implemented using the magnitude o the gradient = = G G 1 1 ] [ = = = G G mag The magnitude becomes nonlinear G G Approimation:

Gradient Mask On the basis o a irst-order derivative o a -D unction the simplest approimation o the gradient mask: G = = z8 z5 and G = z6 z5 1 [ G G ] = [ z8 z5 z6 z5 z 8 z5 z6 z5 ] 1 z 1 z z 3 z 4 z 5 z 6 z 7 z 8 z 9 51

Gradient Mask Roberts cross-gradient operators [1965] G = z9 z5 and G = z8 z6 z 1 z z 3 1 1 = [ G G ] = [ z9 z5 z8 z6 ] z 4 z 5 z 6 z z 7 z 8 z 9 9 z5 z8 z6 5

Sobel operators 33 Gradient Mask G G = = z z 7 3 z z 8 6 G G z z 9 9 z z 1 1 z z 4 z z 3 7 z 1 z z 3 z 4 z 5 z 6 z 7 z 8 z 9 The weight value is to achieve smoothing b giving more important to the center point 53

Eample: Gradient Filtering More on gradient masks will be covered under Edge Detection Image Segmentation 54

Gradient Mask The summation o coeicients in gradient masks equals indicating that the would give a response o in an area o constant gra level 55

Figure out! The summation o coeicients in a mask equals or both gradient operators 1 st derivative and Laplacian operators nd derivative The summation o coeicients in a smoothing mask equals 1 Wh??? 56

Separable Filters In D iltering some ilters can be implemented b successive application o two simpler ilters One horizontal ollowed b another vertical This can signiicantl lower the computational compleit B how much? For a mask o size n n Originall n multiplications and n 1 additions Ater separation n multiplications and n additions 57

Values Outside the Range? Linear iltering might bring the intensit outside the displa range Solutions? Clip values = 55 Scaling transormation g L = 55 g g H L i < i 55 i > 55 Transorm values in [g L g H ] to [ 55] 58

Eample: Combining Spatial Enhancement Methods Target: To sharpen the original image and bring out more skeletal detail Problems: Narrow dnamic range o gra level High noise content makes image diicult to enhance 59

Eample: Combining Spatial Enhancement Methods Solution: I. Laplacian to highlight ine details II.Gradient to enhance prominent edges III.Gra level transormation to increase the dnamic range o gra levels 6

Eample: Combining Spatial Enhancement Methods 61

Eample: Combining Spatial Enhancement Methods 6