1
Self-Driving Car
SUPERVISED BY:
Dr\ IBRAHIM L. ABDALLA
Dr\ AZHAR A. HAMDY
Team Members:
Ahmed Emad Mohamed Ahmed
Ayman Ezz El-Din Mohamed
Ayman Yousef Esmaiel El-Gammal
Ahmed Mohamed Abo-Yehia
Hassan Mohamed Hassan
Salma Fahmy El-Shabrawy Fahmy
Norhan Mohamed Mohamed
Sara Abd-Elnabi Mohamed
Ahmed Maher Abdel-Fattah
Omar Soliman Elsayed
Outline
2
AI part
Embedded part
Cloud part
Introduction
3
Introduction
4
Introduction
5
Source: https://www.nhtsa.gov/technology-innovation/automated-vehicles-safety
Introduction
Basic Physical idea of an Autonomous Vehicle:
6
Project main idea
7
Project main idea
8
Project main parts
9
Project main parts
10
Project main parts
11
Part 1
Part 5
Part 2
Part 3
Part 4
Project main parts
12
Computer Vision part:
13
Image
Collect data
Labelling
Prepare data
Pre-trained model
Transfer learning
Test model
Object detection
Prepare data
(Image Processing)
Lane detection
Calculating the steering angle
Steering Angle
Collect data
Data visualization
Build model
Train model
Test model
Predict steering angle
Behavioral
cloning
Computer Vision part:
1- Lane Detection: Build an algorithm to detect the lane lines in the track in the front of the car.
- convert to gray scale: convert from 3 channel image to one channel. (less data)
14
Computer Vision part:
1- Lane Detection:
- Reduce noise by applying Gaussian blur filter.
15
Gaussian Blur
Computer Vision part:
1- Lane Detection:
- Identify edges (Canny function) input :gray , output : edges .
important parameters (high_threshold & low_threshold)
16
canny
Computer Vision part:
1- Lane Detection:
- region of interest: focus on a specific region in the image to not confuse the algorithm.
bitwise_and =
17
Computer Vision part:
1- Lane Detection:
2. Find lanes:-
- Haugh transform:
A quick summary of Haugh Transform
18
Image Space
Haugh Space
Computer Vision part:
1- Lane Detection:
2. Find lanes:-
- Haugh transform:
Haugh Transform follows Vote Technique
19
Computer Vision part:
1- Lane Detection:
2. Find lanes:-
But the form Y=mX+b cannot represent vertical lines in Haugh Transform So we're going to deal with the polar coordinates.
20
Computer Vision part:
1- Lane Detection:
2. Find lanes:-
Lets look for an example
21
Computer Vision part:
1 - Lane Detection:
2. Find lanes:-
Our result
22
Computer Vision part:
1- Lane Detection:
2. Find lanes:-
Optimization : We will calculate the average slope of the set of these lines and draw the best fit line.
By the slope of the lanes . Left_fit when slope < 0 & right_fit when slope > 0 then we take the average
Finally we have got
the two lanes
23
Computer Vision part:
2- Steering angle calculation:
1- joystick
2- from the two lane lanes slope
24
Computer Vision part:
2- Steering angle calculation:
Calculate steering angle of the two lanes lines.
line = [x1,y1,x2,y2] , The equation to represent
the line is y = mx+b.
where: m : slope & b intercept.
25
θ
(X2,Y2)
(X1,Y1)
tan(θ) =
Opposite
Adjacent
Opposite = X1 – X2
Adjacent = H/2
θ = atan
Opposite
Adjacent
Computer Vision part:
2- Steering angle calculation:
Calculate steering angle of the two lanes lines.
problem: what if the car sees just one lane!?
the solution: we will take the same slope
like the lane line For the steering angle.
26
Computer Vision part:
2- Steering angle calculation:
Calculate steering angle of the two lane lines.
27
Make car more stable for sudden change in angles.(ML)
Computer Vision part:
behavioral cloning : is a method by which human sub cognitive skills can be captured and reproduced in a computer program. (AI)
Artificial intelligence (AI) : refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions.
28
Computer Vision part:
Machine learning classifications :
1- supervised learning:
Classification & regression problems.
29
Computer Vision part:
Machine learning classifications :
1- unsupervised learning:
Clustering problems.
30
Computer Vision part:
Machine learning :
- Main problems solved By ML
31
Computer Vision part:
Machine learning :
(regression problem) & we will use supervised machine learning
32
The input
Expected output
100
Computer Vision part:
CNN(convolutional neural network ): is a class of deep neural network, most commonly applied to analyze visual images.
33
NVIDIA Model
34
Input
Extract
Save This Data: (Steering Angle) : To Build Model.
Processing:
- Move The car on the track.
- Read frames from Video.
- Calculate Steering angle in each frame.
- Store this steering in file.
- We will train our model on 5k images
35
Save This Data: (Steering Angle) : To Build Model.
Processing:
* data visualization
* Split into training and validation sets.(4k,1k)
* Image augmentation.
�
36
Save This Data: (Steering Angle) : To Build Model.
Processing:
image preprocess: we also need to change our images into the color space and size that the NVIDIA model accept.
* Crop the top half of the image.
* Convert to YUV color space
* Resize the image to the required size (66,200)
�
37
Build the Model: (Steering Angle)
Processing:
Training the model using Google colab software.
�
38
Object Detection
The signs to be detected and then making decisions depends on the movement of the car.
39
Stop Sign Detection
Traffic Lights Detection
Bump Sign Detection
1.Capture positive & negative samples
40
Positive Samples
Negative Samples
2.Convert images to grayscale and crop positive samples
41
3.Modify the Parameters �
1. Pre-calculation buffer size
2. Number of Threads
3. Acceptance Ratio break value
4. Sample width & height
5.Feature Type
42
4.Wait for the training to complete
43
5.Test the model
44
5.Result
2. Traffic Lights Detection
45
3.Anomaly Detection
46
Project main parts (Embedded part)
47
Project main parts (Embedded part)
48
ATmega32a MCU
L298 motor driver.
The car
USBasp
Project main parts (Embedded part)
49
Tiva C is better choice
Project main parts (Embedded part)
50
Project main parts (Embedded part)
51
DC motor driver
Project main parts (Embedded part)
52
Project main parts (Embedded part)
53
Servo motor driver
Equation of PWM frequency
ICR1 Register = TOP
Project main parts (Embedded part)
54
Project main parts (Embedded part)
55
Project main parts (Embedded part)
56
Ultrasonic driver
Project main parts (Embedded part)
57
MPU6050
GPS module
Project main parts (Embedded part)
58
MPU6050 pinout
Project main parts (Embedded part)
59
Project main parts (Embedded part)
60
Application
HAL
MCAL
Visibility
https://github.com/aymanyou15/Self_Driving_Car_final
Project main parts (communication)
61
SPI driver
SPI in main.c
Project main parts (Cloud part)
Introduction:
62
Project main parts (Cloud part)
63
Cloud VS Dedicated Servers:
Project main parts (Cloud part)
Implementation:
64
Project main parts (Cloud part)
Implementation:
# Install below packages: -
65
Project main parts (Cloud part)
66
Conclusion
67
Conclusion
By the help of Allah and our supervisors, we can say that we are one step closer to the next generation of smart cars.
By designing this car and solving the problems we faced, we have increased our knowledge and our greed for more experiences.
As a conclusion of our project, we designed a Self Driving Car that can drive itself in certain roads (level 4).
68
Results
69
Results
70
Click on any sentence to display its video
Future Work
71
Future Work
72
73
THANK YOU