Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Image Processing Grass Sky Tree ? ? Sharpening Spatial Filters.

Similar presentations


Presentation on theme: "Introduction to Image Processing Grass Sky Tree ? ? Sharpening Spatial Filters."— Presentation transcript:

1 Introduction to Image Processing Grass Sky Tree ? ? Sharpening Spatial Filters

2 Edge Detection The goal is to mark points at which image intensity changes sharply Sharp changes in image properties reflect important events To detect such changes (edges) find peaks in the 1st derivative of intensity or zero-crossings in the 2nd derivative

3 The Theory An intensity jump (edge) generates a peak in the 1 st derivative, and the peak generates a zero-crossing in the 2 nd derivative (when the first derivative is at a maximum, the second derivative is zero) Gradient methods detect edges by looking for the maximum and minimum in the first derivative of the image Laplacian methods search for zero crossings in the second derivative of the image to find edges

4 Sharpening filters are based on computing spatial derivatives of an image. The first-order derivative of a one-dimensional function f(x) is The second-order derivative of a one-dimensional function f(x) is Alternative 1 st and 2 nd Derivatives

5 Properties of the 1 st and 2 nd Derivatives

6 Profile for 1 st Derivative 5543210006000013100007777 006-600012-20007000

7 Profile for 2 nd Derivative 5543210006000013100007777 0000106 -12 60011-411007-700

8 1st Derivative in One Dimension I 0 1 2 x Derivative of function I at 1: I’(1) = (I(2) - I(0))/2 Rearranging it we have: 2*I’(1) = -1*I(0) + 0*I(1) + 1*I(2) Equivalent to local filter operation using 01 01 -202 01 -2 000 121 012 01 -20 The standard definition of the Sobel operator omits the 1/8 term –doesn’t make a difference for edge detection –the 1/8 term is needed to get the right gradient value, however

9 Computing 2nd Derivatives I 0 1 2 x I’’(1) = (I’(1.5) - I’(0.5))/1 I’(0.5) = (I(1) - I(0))/1 and I’(1.5) = (I(2) - I(1))/1 I’’(1) = 1*I(0) – 2*I(1) + 1*I(2) Equivalent to local filter operation with 1-21 The theory can be carried over to 2D as long as there is a way to approximate the derivative of a 2D image

10 Roberts cross-gradient operators Prewitt operators Sobel operators 1st Derivative Gradient Operators

11 Prewitt masks for detecting diagonal edges Sobel masks for detecting diagonal edges 1st Derivative Gradient Operators

12 First-order derivatives: –The gradient of an image G xy at location (x,y) is defined as the vector: –The magnitude of this vector: –The direction of this vector: Properties of Image Gradient

13 Gradients in 2D For an image function, I(x,y), the gradient direction, (x,y), gives the direction of steepest image gradient: (x,y)  atan(Gy/Gx) This gives the direction of a line perpendicular to the edge  GxGx GyGy G xy

14 Sobel Operator Original Sobel

15 Gradient Operators: Examples

16

17

18 Note that Prewitt operator is a box filter convolved with a derivative operator Also note a Sobel operator is a [1 2 1] filter convolved with a derivative operator Important Observation

19 Development of the Laplacian method –The two dimensional Laplacian operator for continuous functions: –The Laplacian is a linear operator. Laplacian Operator

20

21 Applying the Laplacian to an image we get a new image that highlights edges and other discontinuities Original Image Laplacian Filtered Image Laplacian Filtered Image Scaled for Display Laplacian Operator

22 But That Is Not Very Enhanced! The result of a Laplacian filtering is not an enhanced image We have to do more work in order to get our final image Subtract the Laplacian result from the original image to generate our final sharpened enhanced image Laplacian Filtered Image Scaled for Display

23 Laplacian Image Enhancement In the final sharpened image edges and fine detail are much more obvious - = Original Image Laplacian Filtered Image Sharpened Image

24 Simplified Image Enhancement The entire enhancement can be combined into a single filtering operation

25 Composite Laplacian Mask This gives us a new filter which does the whole job for us in one step 00 5 0 0

26 Composite Laplacian Mask

27 1 st & 2 nd Derivatives Comparisons Observations: –1 st order derivatives generally produce thicker edges –2 nd order derivatives have a stronger response to fine detail e.g. thin lines –2 nd order derivatives produce a double response at step changes in grey level The 2 nd derivative is more useful for image enhancement than the 1 st derivative –Stronger response to fine detail –Simpler implementation –Because these kernels approximate a second derivative measurement on the image, they are very sensitive to noise. To counter this, the image is often Gaussian smoothed before applying the Laplacian filter

28 Acknowlegements Slides are modified based on the original slide set from Dr Li Bai, The University of Nottingham, Jubilee Campus plus the following sources: Digital Image Processing, by Gonzalez and Woods http://www.comp.dit.ie/bmacnamee/materials/dip/lectures /ImageProcessing6-SpatialFiltering2.ppt


Download ppt "Introduction to Image Processing Grass Sky Tree ? ? Sharpening Spatial Filters."

Similar presentations


Ads by Google