,Preface
Section 1: OpenCV and Sensors and Signals
Chapter 1: OpenCV Basics and Camera Calibration
Technical requirements4
Introduction to OpenCV and NumPy4
OpenCV and NumPy 4
Image size 5
Grayscale images 5
RGB images 6
Working with image files7
Working with video files9
Working with webcams 10
Manipulating images10
Flipping an image 10
Blurring an image 11
Changing contrast, brightness, and gamma 13
Drawing rectangles and text 15
Pedestrian detection using HOG15
Sliding window 16
Using HOG with OpenCV 16
Introduction to the camera 18
Camera terminology 18
,The components of a camera 25
Considerations for choosing a camera 26
Strengths and weaknesses of cameras 27
Camera calibration with OpenCV28
Distortion detection 29
Calibration 30
Summary31
Questions32
Chapter 2: Understanding and Working with Signals
Technical requirements34
Understanding signal types34
Analog versus digital34
Serial versus parallel36
Universal Asynchronous Receive and Transmit (UART) 38
Differential versus single-ended 41
I2C 44
SPI 48
Framed-based serial protocols50
Understanding CAN 51
Ethernet and internet protocols 55
Understanding UDP 56
Understanding TCP 59
, Summary62
Questions63
Further reading63
Open source protocol tools 63
Chapter 3: Lane Detection
Technical requirements66
How to perform thresholding66
How thresholding works on different color spaces 67
RGB/BGR 67
HLS 69
HSV 70
LAB 70
YCbCr 71
Our choice 71
Perspective correction72
Edge detection74
Interpolated threshold 76
Combined threshold 77
Finding the lanes using histograms78
The sliding window algorithm79
Initialization 80
Coordinates of the sliding windows 81