Beruflich Dokumente
Kultur Dokumente
ON
1
TABLE OF CONTENTS
Sr. TITLE
No.
1 Problem statement
2 Brief Theory
3 Project work
4 Project Status
PROBLEM STATEMENT
2
One of the important features of an autonomous Unmanned Ground Vehicle
up. The vehicle should be able to detect the lane on the road and navigate. The
BRIEF THEORY
3
For navigation in outdoor environment the possible approaches are ROS
(Image processing and machine learning). The approach adopted for lane
techniques so that computers can see and understand the environment in the
programmed.
4
extraction easier. These can include the use of one or multiple of the
following techniques:
1.1 Region of interest (ROI) selection: ROI selection means cropping the
received image to have only required information and remove all
unnecessary information. The main reason for focusing on ROI is to
increase computation efficiency and reduce false lane detections. The
figure below shows a typical example of ROI selection.
image due to environmental factors like rain, Fog, Shadows etc. The
5
eliminated. The mean filter is one of the techniques used to blur an
pixel values within n x n kernel. The pixel intensity of the center element
is then replaced by the mean. This eliminates some of the noise in the
image and smoothes the edges of the image. A typical De-noising action
perspective into bird’s eye view. This view makes the width of the road
equal size at any distance. Otherwise in one point perspective view, the
intent is to extract features that resemble lane markings, this could be achieved
6
2.1.1 Canny Edge Detection: As its name implies, the algorithm aims to detect
all the edges in an image. We can recognize an image as a matrix or an array of
pixels. A pixel contains the light intensity at some location in the image. Each
pixel's intensity is denoted by a numeric value that ranges from 0 to 255, an
intensity value of zero indicates no intensity if something is completely black
whereas 255 represents maximum intensity something being completely white.
A gradient is the change in brightness over a series of pixels. A strong gradient
indicates a steep change whereas a small gradient represents a shallow change.
The figure below explains the theory.
straight lines, Hough Transform algorithm is used. It uses the edge pixel
7
images. It is one of the most widely used algorithms for lane detection. This
It is possible to associate with each line of the image a pair . The plane is
sometimes referred to as Hough space for the set of straight lines in two
Slope of line is given then the line can be plotted in the Hough Space as a single
dot. There are many possible lines that can pass through this dot. Now in order
to identify the lines, we will first split our Hough space into a grid. Each bin
inside the grid corresponding to the slope and y intercept value of the line. For
every point of intersection in a Hough Space bin we're going to cast a vote
inside of the bin that it belongs to. The bin with maximum number of votes will
be our line. However, this method is designed to detect straight lines in the
8
Figure 7: Left lane identification by Hough Transform
path using geometric models. The generated path is later used for various
aim of this model is to fit a curve as accurately as possible with given features.
method.
observations. Assuming that this set contains both inliers (points which
approximately can be fitted to a line) and outliers (points which cannot be fitted
to this line). RANSAC attempts to exclude the outliers and find a linear model
9
Figure 8: Fitted line with RANSAC; outlier does not affect the result.
2.2.2 Kalman Filter: It is a process that filters out noise from given noise data.
estimate a process and minimizes the mean of squared error, predicting a future
state from the previous ones. An illustration of Kalman Filter is shown below.
10
2.2.3 Polynomial Fitting: Curve/polynomial fitting is a mathematical technique
method is that given a set of points, the aim is to fit them in a smooth curve that
passes through the aforementioned points and the order of the function depends
fitting.
vehicle receives the coordinates for desired heading, the trajectory is derived on
11
- 3D plane. It includes estimation of lane curvature, Lane offset and estimated
12
PROJECT WORK
Project work is being carried out for lane detection and tracking for UGV
using image processing and machine learning. The software used are as
mentioned below.
Operating System: Ubuntu 16.04 LTS
13
Stage 1: preprocessing the Image which includes ROI calculation and Grey
scale conversion.
Source Code:
import
matplotlib.pylab as
plt
import
cv2
import
numpy as np
image =
cv2.imread('road.jp
g')
image =
cv2.cvtColor(image,
cv2.COLOR_BGR2RGB
)
print(image.
shape)
height =
image.shape[0]
width =
image.shape[1]
region_of_interest_
vertices = [
(0,
height),
(width/2,
height/2),
(width,
height)
]
def
14
region_of_interest(im
g, vertices):
mask =
np.zeros_like(im
g)
channel_count =
img.shape[2]
match_mask_color =
(255,) * channel_count
cv2.fillPoly(mask,
vertices,
match_mask_color)
masked_image =
cv2.bitwise_and(img,
mask)
return
masked_imag
e
cropped_image =
region_of_interest(ima
ge,
np.array([region_of_inter
est_vertices], np.int32),)
plt.imshow(cropp
ed_image)
plt.show()
Result: The result of source code execution is shown below.
15
Figure 13: Sample image with ROI shown
Stage 2: incorporating feature extraction like edge detection and lane detection
on the image
Source Code:
import
matplotlib.pylab
as plt
import
cv2
import
numpy as np
def
region_of_interest(im
g, vertices):
mask =
np.zeros_like(im
g)
#channel_count =
img.shape[2]
match_mask_c
olor = 255
cv2.fillPoly(mask,
vertices,
match_mask_color)
16
masked_image =
cv2.bitwise_and(img,
mask)
return
masked_imag
e
def
drow_the_lines(im
g, lines):
img =
np.copy(img
)
blank_image =
np.zeros((img.shape[0],
img.shape[1], 3),
dtype=np.uint8)
for line in
lines:
for x1, y1, x2,
y2 in line:
cv2.line(blank_image,
(x1,y1), (x2,y2), (0, 255,
0), thickness=10)
img =
cv2.addWeighted(img,
0.8, blank_image, 1, 0.0)
return
img
image =
cv2.imread('road.j
pg')
image =
cv2.cvtColor(image,
cv2.COLOR_BGR2RGB
)
print(image.
17
shape)
height =
image.shape[0]
width =
image.shape[1
]
region_of_interest
_vertices = [
(0,
height)
,
(width/2,
height/2),
(width,
height)
]
gray_image =
cv2.cvtColor(image,
cv2.COLOR_RGB2GRA
Y)
canny_image =
cv2.Canny(gray_image,
100, 200)
cropped_image =
region_of_interest(canny
_image,
np.array([region_of_inter
est_vertices], np.int32),)
lines =
cv2.HoughLinesP(crop
ped_image,
rho=
6,
theta=np.pi/
180,
threshold=
160,
lines=np.arra
y([]),
minLineLengt
h=40,
18
maxLineGap
=25)
image_with_lines =
drow_the_lines(image, lines)
plt.imshow(image_wi
th_lines)
plt.show()
Result: The result of source code execution is shown below. The detected lane is
highlighted with green color edges.
PROJECT STATUS
Finished: Task 1 of detecting lane in the image.
image processing to make the lane detection and tracking more efficient.
Final Goal: Real time video based lane detection trails to be conducted with
19