Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

Similar presentations


Presentation on theme: "1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB."— Presentation transcript:

1 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB

2 2 Outlines Edge detection. Rank filtering.

3 3 Edge Detection One of the major applications for convolution is in edge detection.

4 4 Edge Detection Noise and other uninteresting image feature can also generate noise. Given a noisy image, edge detection techniques aim to locate the edge pixels most likely to have been generated by scene elements, rather than by noise. Typical 3 steps are: Noise reduction – try to suppress much noise as possible, without smoothing away the meaningful edges. Edge enhancement – apply some kind of filter (e.g. high pass filter) that responds strongly at edges and weakly elsewhere. Edge localisation – decide which of the local maxima output by the filter are meaningful edges and which are caused by noise.

5 5 A Simple Edge Detector The simplest detector performs minimal noise smoothing and fairly crude localisation. There are based on the estimation of grey level gradient at a pixel. The gradient can be approximated in the x and y directions by: g x (x,y)≈ f(x+1,y) – f(x-1,y); g y (x,y)≈ f(x,y+1) – f(x,y-1); (7.14) (7.15)

6 6 A Simple Edge Detector These are known as the Prewitt kernels.

7 7 Sobel Kernels A similar pair of kernels (Prewitt kernels) are Sobel kernels. These give more weight to on-axis pixels.

8 8 Sobel Kernels

9 9

10 10 Sobel Kernels

11 11 Localisation In localisation step, we must identify the meaningful edges from gradient magnitude data. Typical assumption is that meaningful edges give rise to the strongest gradients, so a simple approach is to threshold the gradient magnitudes computed using equation 7.18 or 7.20. The threshold produces an ‘edge gap’- a binary image in which pixels set to 1 represent meaningful edges.

12 12 Localisation example

13 13 Sobel Example h y 0050 100 200 0050 100 200 0050 100 200 50 100 150 250 50 100 150 250 50 100 150 250 2 0 -2 00 11 00000000 200 00000000 0(-1)+0(-2)+ 50(-1)+50(0)+ 100(1)+50(2)+ 50(1)+0(0)+0(0)

14 14 Sobel Example h x 0050 100 200 0050 100 200 0050 100 200 50 100 150 250 50 100 150 250 50 100 150 250 0 0 0 2-2 1 1 400 0200 0 400 0200 0 400 0200 0 400 0200 0

15 Upper Left: Original Image Upper Middle:Prewitt Filtered – X Upper Right: Prewitt Filtered - Y Left:Combined Upper Left: Original Image Upper Middle:Prewitt Filtered – X Upper Right: Prewitt Filtered - Y Left:Combined

16 Upper Left: Original Image Upper Middle:Sobel Filtered - X Upper Right: Sobel Filtered - Y Left:Combined Upper Left: Original Image Upper Middle:Sobel Filtered - X Upper Right: Sobel Filtered - Y Left:Combined

17 17 Rank Filters Rank filtering transforms images based on the rank of a pixels value within a local neighborhood. Sort all of the pixels in the local region by intensity value (this yields a “rank” for every pixel). Median: The value of the output pixel is the value of the “median” pixel. Minimum: The output pixel is the lowest-ranked input Maximum: The output pixel is the highest-ranked input Range: The output is the difference between high and low. Advantage: Not being a kernel-based, so there is no problem with filtering over a small neighbourhood at the corners and sides of the image.

18 18

19 19 Rank Filtering

20 20 Median Filter Example Original Image (impulse noise)Median Filtered Image (3x3) Median Filters are great at preserving edges and eliminating impulse noise.

21 21 Min/Max Filter Example

22 22 Median Filters replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel (the original value of the pixel is included in the computation of the median) impulse noise  salt and pepper noiseprovide excellent noise-reduction capabilitiesless blurring than linear smoothing filters of similar size. quite popular because for certain types of random noise (impulse noise  salt and pepper noise), they provide excellent noise-reduction capabilities, with considering less blurring than linear smoothing filters of similar size.

23 23 Median Filters forces the points with distinct gray levels to be more like their neighbors. isolated clusters of pixels that are light or dark with respect to their neighbors, and whose area is less than n 2 /2 (one-half the filter area), are eliminated by an n x n median filter. eliminated = forced to have the value equal the median intensity of the neighbors. larger clusters are affected considerably less.

24 24 Example : Median Filters

25 25 Thank you Q&A


Download ppt "1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB."

Similar presentations


Ads by Google