Presentation is loading. Please wait.

Presentation is loading. Please wait.

September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 1 Boundary-following Robot Rules 1  2  3  4  5.

Similar presentations


Presentation on theme: "September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 1 Boundary-following Robot Rules 1  2  3  4  5."— Presentation transcript:

1 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 1 Boundary-following Robot Rules 1  2  3  4  5

2 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 2 Boundary-following Robot (2) Rules 1  2  3  4  5

3 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 3 Thanks to Roshanak

4 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 4 Linear Separability To explain linear separability, let us consider the function f:R n  {0, 1} with where x 1, x 2, …, x n represent real numbers. This will also be useful for understanding the computations of artificial neural networks later in the course.

5 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 5Networks x1x1 x2x2 w 1 =? w 2 =?  =? Example: x 1 w 1 + x 2 w 2 >=  ? x 1 or x 2 x1x1 123-3-2 x2x2 1 2 3 -3 -2 0 1 1011 x2x2 x1x1 0 1 01 x 1 =0.5, x 2 =0: 0.5w 1 + 0*w 2 =  x 1 =0, x 2 =0.5: 0*w 1 + 0.5w 2 =  w1 = w2 = 2 

6 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 6 Realizing Robot Functions s2s2 s3s3 0.5 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x1x1x1x1 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x2x2x2x2 s4s4 s5s5 1 x1x2x1x2 1 -2 s 2 w 2 + s 3 w 3 + s 4 w 4 + s 5 w 5 >=  ? Apply weights and threshold: s 2 1 + s 3 1 - 2s 4 - 2s 5 >= 0.5? When s 2 =1, s 3 =1, s 4 =0, s 5 =0 s 2 w 2 + s 3 w 3 + s 4 w 4 + s 5 w 5 =2 When s 2 =0, s 3 =1, s 4 =1, s 5 =0 s 2 w 2 + s 3 w 3 + s 4 w 4 + s 5 w 5 =-1 x

7 September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 7 Linear Separability So by varying the weights and the threshold, we can realize any linear separation of the input space into a region that yields output 1, and another region that yields output 0. As we have seen, a two-dimensional input space can be divided by any straight line. A three-dimensional input space can be divided by any two-dimensional plane. In general, an n-dimensional input space can be divided by an (n-1)-dimensional plane or hyperplane. Of course, for n > 3 this is hard to visualize.

8 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 8 let’s take a look at… Computer Vision

9 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 9 Computer Vision In grid-space world, sensory inputs are very simple: Only the state of neighboring cells can be perceived. In the real world, the visual input is highly complex, noisy, and often ambiguous (3D  2D projection). While humans can seemingly effortless extract all relevant information from within their visual field, this is an extremely difficult task for machines. For example, one major problem for computers is perceptual grouping, that is, determining which parts of an image belong to the same object.

10 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 10 Computer Vision In the following lectures, we will look at some “classical” approaches to computer vision. These approaches are not intended to replicate vision in humans or animals. Later in the course, we will also study artificial neural networks for vision problems, which are supposed (to some extent) to imitate the biological example.

11 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 11 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis Bitmap image Scene description feedback (tuning) Prepare image for scene analysis Build an iconic model of the world

12 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 12 Image Processing Image is represented as an m  n array, I(x, y) of numbers (image intensity array). Each number indicates the light intensity at one of the pixels in the image. Many basic image processing techniques are based on convolution. In a convolution, a convolution filter is applied to every pixel to create a filtered image I*(x, y):

13 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 13 x y Image Processing Example: Averaging filter:0000001/91/91/90 01/91/91/90 01/91/91/90 00000

14 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 14 Image Processing Grayscale Image: 16329 2113100 510697 31028 4429101/91/91/91/91/91/9 1/91/91/9 Averaging Filter:

15 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 15 Image Processing Original Image: 16329 2113100 510697 31028 442910 Filtered Image:0000000 00 00 00000 1/91/91/91/91/91/9 1/91/91/9 value = 1  1/9 + 6  1/9 + 3  1/9 + 2  1/9 + 11  1/9 + 3  1/9 + 5  1/9 + 10  1/9 + 6  1/9 = 47/9 = 5.222 5

16 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 16 Image Processing Original Image: 16329 2113100 510697 31028 442910 Filtered Image:0000000 00 00 00000 1/91/91/91/91/91/9 1/91/91/9 value = 6  1/9 + 3  1/9 + 2  1/9 + 11  1/9 + 3  1/9 + 10  1/9 + 10  1/9 + 6  1/9 + 9  1/9 = 60/9 = 6.667 57

17 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 17 Image Processing Original Image: 16329 2113100 510697 31028 442910 Filtered Image:000000 0 0 0 0 0 00000 57 5 5 5 56 64 Now you can see the averaging (smoothing) effect of the 3  3 filter that we applied.

18 Questions How about the boundaries?

19 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 19 Image Processing More common: Gaussian Filters 14741 41626164 72641267 4162616414741 Discrete version: 1/273 implement decreasing influence by more distant pixels

20 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 20 Image Processing original 33333333 99999999 15  15 Effect of Gaussian smoothing:

21 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 21 Different Types of Filters Smoothing can reduce noise in the image.Smoothing can reduce noise in the image. This can be useful, for example, if you want to find regions of similar color or texture in an image.This can be useful, for example, if you want to find regions of similar color or texture in an image. However, there are different types of noise.However, there are different types of noise. For so-called “salt-and-pepper” noise, for example, a median filter can be more effective.For so-called “salt-and-pepper” noise, for example, a median filter can be more effective. http://www.mathworks.co.uk/help/images/ref/medfilt2.html

22 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 22 Median Filter Use, for example, a 3  3 filter and move it across the image like we did before.Use, for example, a 3  3 filter and move it across the image like we did before. For each position, compute the median of the brightness values of the nine pixels in question.For each position, compute the median of the brightness values of the nine pixels in question. –To compute the median, sort the nine values in ascending order. –The value in the center of the list (the fifth value) is the median. Use the median as the new value for the center pixel.Use the median as the new value for the center pixel.

23 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 23 Median Filter Is Median Filter a convolution filter?Is Median Filter a convolution filter? If not, what is the difference?If not, what is the difference? –Median vs. Gaussian and Average Filters Size of median filter?Size of median filter? Advantage of the median filter: Capable of eliminating outliers such as the extreme brightness values in salt-and-pepper noise, and preserve edges (contours).Advantage of the median filter: Capable of eliminating outliers such as the extreme brightness values in salt-and-pepper noise, and preserve edges (contours). Disadvantage: The median filter may change the contours of objects in the image. (distorted)Disadvantage: The median filter may change the contours of objects in the image. (distorted)

24 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 24 Median Filter original image 3  3 median 7  7 median

25 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 25 Different Types of Filters How can an algorithm extract relevant information from an image that enables the algorithm to recognize objects? The most important information for the interpretation of an image (for both technical and biological systems) is the contour of objects. The most important information for the interpretation of an image (for both technical and biological systems) is the contour of objects. Contours are indicated by abrupt changes in brightness. Contours are indicated by abrupt changes in brightness. We can use edge detection filters to extract contour information from an image. We can use edge detection filters to extract contour information from an image.

26 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 26 Edge Detection Filters Let us take a look at the one-dimensional case:Let us take a look at the one-dimensional case: A change in brightness:A change in brightness: Its first derivative:Its first derivative: Its second derivative:Its second derivative:

27 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 27 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative of the (2D) image, compute the second derivative of the (2D) image, Find the pixels where the brightness function “crosses” 0 and mark them. Find the pixels where the brightness function “crosses” 0 and mark them. We can actually devise convolution filters that carry out the smoothing and the computation of the second derivative.

28 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 28 Laplacian Filters Continuous variant: Discrete variants (applied after smoothing): 0101-41 0101111-81 111

29 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 29 Laplacian Filters Let us apply a Laplacian filter to the following image:

30 September 12, 2012Introduction to Artificial Intelligence Lecture 3: Computer Vision I 30 Laplacian Filters 5  5 Laplacian zero detection 7  7 Laplacian 3  3 Laplacian


Download ppt "September 10, 2012Introduction to Artificial Intelligence Lecture 2: Perception & Action 1 Boundary-following Robot Rules 1  2  3  4  5."

Similar presentations


Ads by Google