Week 9 Lecture Notes
Week 9 Lecture Notes
Self-Driving
Vehicles
MECH-8000-8/9
Week #10
Schedule
24-Feb-22 Reading week, No Lecture
1
3/20/2022
Introduction to
Computer
Vision
2
3/20/2022
3
3/20/2022
4
3/20/2022
Challenges
• humans, can easily classify images because of our outstanding
generalization capability.
• Generalization: the act or process whereby a learned response is made
to a stimulus similar to but not identical with the conditioned stimulus.
10
10
5
3/20/2022
Challenges (Cont.)
• Achieving the same task with computers is very challenging.
• Numerical representation of different images will be very different, a
simple numerical compare wouldn’t work.
11
11
Challenges (Cont.)
• Viewpoints,
• Camera Limitation,
• Lighting,
• Scaling,
• Object Variation,
12
12
6
3/20/2022
Challenges (Cont.)
• Viewpoints,
• Camera Limitation,
• Lighting,
• Scaling,
• Object Variation,
13
13
Challenges (Cont.)
• Viewpoints,
• Camera Limitation,
• Lighting,
• Scaling,
• Object Variation,
14
14
7
3/20/2022
Challenges (Cont.)
• Viewpoints,
• Camera Limitation,
• Lighting,
• Scaling,
• Object Variation,
15
15
Challenges (Cont.)
• Viewpoints,
• Camera Limitation,
• Lighting,
• Scaling,
• Object Variation,
16
16
8
3/20/2022
17
17
18
18
9
3/20/2022
19
19
20
20
10
3/20/2022
21
21
Python OpenCV
OpenCV (Open Source Computer Vision Library) is a library of
programming functions mainly aimed at real-time computer vision.
The library is cross-platform and free for use under the open-source
Apache 2 License. Starting with 2011, OpenCV features GPU acceleration
for real-time operations.
To install:
pip install opencv-python
22
22
11
3/20/2022
Color Selection
Find lane markings by only selecting pixels that are very close to white
color.
23
23
24
24
12
3/20/2022
25
25
26
26
13
3/20/2022
Convolutions
• In image processing, a kernel, convolution matrix, or mask is a small matrix
used for blurring, sharpening, embossing, edge detection, and more. This
is accomplished by doing a convolution between the kernel and an
image.
• Kernels are used in machine learning for feature extraction to select most
important pixels of an image.
27
27
Convolutions (Cont.)
Demo:
https://setosa.io/ev/image-kernels/ 28
28
14
3/20/2022
Edge Detection
• Edge detection is a tool that identifies points in a digital image at which
the image brightness changes sharply or has discontinuities.
• Edge detection is important tool in computer vision especially for feature
extraction/detection.
• Uses Derivative to find edges
29
29
30
30
15
3/20/2022
• Approximate strength: 𝐺 + 𝐺
31
31
32
32
16
3/20/2022
33
33
34
34
17
3/20/2022
35
35
36
36
18
3/20/2022
Image Transformation
Image transformations are used to correct distortions and/or change
perspectives.
• Rotation
• Translation
• Resizing
• Perspective Transform
• Cropping
• Dilation and Erosion
• Region of Interest Masking
• Hough Transform 37
37
38
38
19
3/20/2022
39
39
40
40
20
3/20/2022
M = cv2.getPerspectiveTransform(Source_points, Destination_points)
warped = cv2.warpPerspective(image, M, (width, height)) 41
41
42
42
21
3/20/2022
43
43
44
44
22
3/20/2022
45
45
46
46
23
3/20/2022
47
47
48
48
24
3/20/2022
49
49
50
50
25
3/20/2022
51
51
52
26
3/20/2022
Reminders:
• Please divide in groups of 5-6, send one email
per group to instructor including group
members Full Name, UWindsor Email, and
Student ID.
• Assignment 3 posted online, please complete
and submit by deadline.
Thank You • Submit Student ID card to Blackboard.
53
53
THANK YOU
54
54
27