Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T0283 - Computer Vision Tahun: 2010.

Similar presentations


Presentation on theme: "Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T0283 - Computer Vision Tahun: 2010."— Presentation transcript:

1

2 Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T0283 - Computer Vision Tahun: 2010

3 January 20, 2010T0283 - Computer Vision3 Learning Objectives After carefullylistening this lecture, students will be able to do the following : After carefully listening this lecture, students will be able to do the following : understand spatial information based image operation such as area-based processing understand spatial information based image operation such as area-based processing demonstrate how area-based image processing is performed (i.e. convolution-based image processing) demonstrate how area-based image processing is performed (i.e. convolution-based image processing)

4 January 20, 2010T0283 - Computer Vision4 What is a Mask ? A mask is a small matrix whose values are called weights Each mask has an origin, which is usually one of its positions The origin of symmetric masks are usually their center pixel position For non-symmetric masks, any pixel location may be chosen as the origin (depending on the intended use) 1111211 1112421 1111211 1

5 January 20, 2010T0283 - Computer Vision5 Linear filtering is filtering in which the value of an output pixel is a linear combination of the values of the pixels in the input pixel's neighborhood. Linear filtering of an image is accomplished through an operation called convolution. Convolution is a neighborhood operation in which each output pixel is the weighted sum of neighboring input pixels. The matrix of weights is called the convolution kernel, also known as the filter. Applying Masks to Images : Linear Filtering

6 January 20, 2010T0283 - Computer Vision6 Applying Masks to Images : Linear Filtering

7 January 20, 2010T0283 - Computer Vision7 Rotate the convolution kernel 180 degrees about its center element. Slide the center element of the convolution kernel so that it lies on top of the (2,4) element of A. Multiply each weight in the rotated convolution kernel by the pixel of A underneath. Sum the individual products from step 3. Hence the (2,4) output pixel is 1*2 + 8*9 + 15*4 + 7*7 + 14*5 + 16*3 + 13*6 + 20*1 + 22*8 = 575 Computing the (2,4) Output of Convolution

8 January 20, 2010T0283 - Computer Vision8 Computing the (2,4) Output of Convolution 17241815 23571416 46132022 101219213 11182529 294753 618 Image pixel values Center of Kernel Values of rotated Kernel

9 January 20, 2010T0283 - Computer Vision9 Slide the center element of the correlation kernel so that it lies on top of the (2,4) element of A. Multiply each weight in the rotated correlation kernel by the pixel of A underneath. Sum the individual products from step 2. Hence the (2,4) output pixel is 1*8 + 8*1 + 15*6 + 7*3 + 14*5 + 16*7+ 13*4 + 20*9 + 22*2 = 585 1*8 + 8*1 + 15*6 + 7*3 + 14*5 + 16*7+ 13*4 + 20*9 + 22*2 = 585 Computing the (2,4) Output of Correlation

10 January 20, 2010T0283 - Computer Vision10 17241815 23571416 46132022 101219213 11182529 816357 492 Image pixel values Center of Kernel Values of Correlation Kernel Computing the (2,4) Output of Correlation

11 January 20, 2010T0283 - Computer Vision11 Dealing with Image Borders Only convolve with interior Shrinks image Zero-padding Results in spurious gradients Border replication 3 2 1 2 2 1 3 2 32 21 22 32 1-2 24111

12 January 20, 2010T0283 - Computer Vision12 Filtering Example How to treat image borders : Zero Padding 1 12 111 22232133 2212 1322 Rotate 1 12111

13 January 20, 2010T0283 - Computer Vision13 3 2 1 2 2 1 3 2 32 21 22 325 3 2 122 1 3232 21 22321-2 24 111 1 12 111 Step 1

14 January 20, 2010T0283 - Computer Vision14 Step 2

15 January 20, 2010T0283 - Computer Vision15 3 2 1 2 2 1 3 2 32 21 22 32445 3 2 122 1 3232 21 22323-3 34-2 111 1 12 111 Step 3

16 January 20, 2010T0283 - Computer Vision16 3 2 1 2 2 1 3 2 32 21 22 3244-25 3 2 122 1 3232 21 22321-3-3 16-2 111 1 12 111 Step 4

17 January 20, 2010T0283 - Computer Vision17 3 2 1 2 2 1 3 2 32 21 22 3244 9 -25 3 2 122 1 3232 21 22322-2 14 221 1 12 111 Step 5

18 January 20, 2010T0283 - Computer Vision18 Final Result 2223 2133 2212 1322 12 7 648 6 14459 59 511-25 I’I’I

19 January 20, 2010T0283 - Computer Vision19 Smoothing (Low Pass Filtering) Useful for noise reduction and image blurring It removes the finer details of an image Averaging or Mean (Box) Filter The elements of the mask must be positive The size of the mask determines the degree of smoothing 111 111111 3 x 3 box filter kernel

20 January 20, 2010T0283 - Computer Vision20 Gaussian Filter (LPF) The weights are sampled from a Gaussian function which fall off to zero at the mask’s edges 0.003 0.013 0.022 0.013 0.003 0.013 0.059 0.097 0.059 0.013 0.022 0.097 0.159 0.097 0.022 0.013 0.059 0.097 0.059 0.013 0.003 0.013 0.022 0.013 0.003 5 x 5,  = 1

21 January 20, 2010T0283 - Computer Vision21 Gaussian Filter (cont’d) Gaussian smoothing can be implemented efficiently, thanks to the fact that the kernel is separable

22 January 20, 2010T0283 - Computer Vision22 To convolve an image I with a n x n Gaussian mask G with  =  G Build a 1-D Gaussian mask g, of width n, with  g  =  G Convolve each column of I with g, yielding a ne image I c Convolve each row of I c with g The value of  determines degree of smoothing Gaussian Filter (cont’d)

23 January 20, 2010T0283 - Computer Vision23 Gaussian Filter (examples)  = 1  = 3 7 x 7 kernel Original imageBox filter

24 January 20, 2010T0283 - Computer Vision24 Median Filter (non-linear) Effective for removing “salt & pepper” noise (random occurences of black & white pixels) Replace each pixel value by the median of the gray-levels in the neighborhood of the pixels 10 20 20 15 99 20 20 25 20 10 15 20 20 20 20 20 25 99 sort median

25 January 20, 2010T0283 - Computer Vision25 Median Filter (non-linear)

26 January 20, 2010T0283 - Computer Vision26 Median Filter (non-linear)

27 January 20, 2010T0283 - Computer Vision27 Sharpening (High Pass Filtering) It is used to emphasize the fine details of an image Points of high contrast can be detected by computing intensity differences in local image regions The weights of the mask are both positive and negative When the mask is over an area of constant or slowly varying gray level, the result of convolution will be close to zero When gray level is varying rapidly within the neighborhood, the result of convolution will be a large number Typically, such points form the border between different objects or scene parts (i.e., sharpening is a precursor step to edge detection

28 January 20, 2010T0283 - Computer Vision28 Sharpening (cont’d)


Download ppt "Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T0283 - Computer Vision Tahun: 2010."

Similar presentations


Ads by Google