• No results found

Vehicle Tracking with Heading Estimation using a Mono Camera System

N/A
N/A
Protected

Academic year: 2021

Share "Vehicle Tracking with Heading Estimation using a Mono Camera System"

Copied!
82
0
0

Loading.... (view fulltext now)

Full text

(1)

Master of Science Thesis in Electrical Engineering

Department of Electrical Engineering, Linköping University, 2018

Vehicle Tracking with

Heading Estimation using a

Mono Camera System

(2)

Vehicle Tracking with Heading Estimation using a Mono Camera System Fredrik Nilsson

LiTH-ISY-EX--18/5135--SE

Supervisor: Per Boström-Rost

isy, Linköping University Patrik Leissner

Veoneer Sweden AB

Examiner: Gustaf Hendeby

isy, Linköping University

Division of Automatic Control Department of Electrical Engineering

Linköping University SE-581 83 Linköping, Sweden Copyright © 2018 Fredrik Nilsson

(3)

Till min pappa Lars-Erik, min saknade mamma Karina,

min bror Johan och min kärlek Elin.

(4)
(5)

Abstract

Advanced driver assistance systems (adas) is a popular and evolving area of re-search and development. By providing assistance to the vehicle drivers, adas could significantly reduce the number of traffic accidents since 90 % of all acci-dents are caused by the human factor. adas with cameras provides a wide field of view and thanks to today’s advanced image processing techniques, lots of infor-mation can be extracted from the camera image. This thesis proposes a method of estimating the heading of vehicles using a mono camera system. The method con-sists of an extended Kalman filter with a constant velocity motion model to pre-dict the vehicle’s path, fed by classification measurements from machine learning algorithms together with angular rate measurements. Monte Carlo simulations performed in this thesis show promising results. The results on real-world data indicate that the method used to construct the angular rate measurements must be improved in order to reach the same results as obtained from the simulations. An additional measurement, the vehicle’s corners, is introduced in order to fur-ther provide the filter with information. The thesis shows that the mono camera system needs further improvements in order to reach the same level of perfor-mance as a stereo camera system.

(6)
(7)

Acknowledgments

After five long and intense years, I am writing the last report during my time at Linköping University. It has been five years of early mornings, late nights and and an uncountable amount of consumed cups of coffee. Although is has not been a walk in the park, I have almost felt joy and inspiration every day, because I have been surrounded by amazing people.

First of all, I would like to thank Veoneer for given me the opportunity to perform my Master’s thesis with them. I would especially like to thank Patrik Leissner, my supervisor at Veoneer, for always being available to answer my questions and for his excellent driving skills when we recorded the data sets. I would also like to thank everyone else at Veoneer who have helped me to complete this thesis. Secondly, I would like to thank my supervisor at the university, Per Boström-Rost, for never being more than an email away. I would also like to give credits to my examiner, Gustaf Hendeby. He helped me to point out the heading of this thesis during the ongoing work and played an important role for finalizing the structure of the thesis. I would also like to mention Gustav Sandvik for helping me to proofread the thesis, and my opponent Johan Svensson for providing an interesting opposition session.

Lastly, I would like to thank everyone that I have meet during my time at Linköping University. You have all helped me to become who I am today. Thank you to all of my closest friends and especially to my family. They have always supported me and brought so much joy and happiness into my life. Thank you all!

Linköping, June 2018 Fredrik Nilsson

(8)
(9)

Contents

Notation xi

1 Introduction 1

1.1 Background . . . 1

1.2 Purpose and Objective . . . 2

1.3 Limitations . . . 3

1.4 About Veoneer . . . 4

1.5 Thesis Outline . . . 4

2 Theoretical Background 5 2.1 General Target Tracking . . . 5

2.2 Vision Systems for Advanced Driver Assistance . . . 6

2.2.1 Vehicle Detection in Mono Camera Systems . . . 7

2.2.2 Vehicle Tracking in Mono Camera Systems . . . 7

2.3 Related Research . . . 8

2.4 Coordinate Systems . . . 9

2.5 The Pinhole Camera Model . . . 11

2.6 Homography . . . 12

2.6.1 Direct Linear Transform . . . 12

2.6.2 Random Sample Consensus . . . 13

2.7 Feature Points . . . 15

2.8 Extended Kalman Filtering . . . 16

2.9 Observability Analysis . . . 16

3 Filter Construction and Methodology 19 3.1 Vehicle Motion Model . . . 19

3.2 Measurement Vehicle Model . . . 21

3.2.1 ROI Horizontal Center Position Measurement . . . 22

3.2.2 ROI Width Measurement . . . 24

3.2.3 ROI Bottom Measurement . . . 26

3.2.4 Angular Rate Measurements . . . 27

3.2.5 Corner Measurements . . . 28

3.3 Rotation Estimation with EKF . . . 30 ix

(10)

3.4 Observability of the Filter . . . 30

3.5 Monte Carlo Simulations . . . 30

4 Performance Evaluation 33 4.1 Observability along Different Trajectories . . . 33

4.2 Monte Carlo Simulations . . . 35

4.3 Homography Estimation . . . 44

4.4 Comparison with a Stereo Camera System . . . 49

5 Conclusions and Future Work 55 5.1 Conclusions . . . 55

5.2 Suggestions for Future Work . . . 56

5.2.1 Homography Estimation . . . 56

5.2.2 Feature Point Correspondence . . . 57

5.2.3 Corner Measurements . . . 57

A Monte Carlo Simulations 61

(11)

Notation

abbreviations

Abbreviation Explanation

adas Advanced Driver Assistance Systems

aeb Automatic Emergency Braking

aes Automatic Emergency Steering

dlt Direct Linear Transform

ekf Extended Kalman Filter

klt Kanade-Lucas-Tomasi

mtt Multiple-Target Tracking

mse Mean-Square Error

ransac RANdom SAmple Consensus

rmse Root-Mean-Square Error

roi Region Of Interest

stt Single-Target Tracking

uav Unmanned Aerial Vehicle

Other notations

Notation Explanation

Target A vehicle which is of interest to track

Host The vehicle from which the tracking is performed, i.e.,

the ego vehicle

(12)
(13)

1

Introduction

This Master’s thesis deals with how to estimate the heading (orientation and an-gular rate) of other vehicles, using a camera mounted in the ego vehicle. The problem is easily solved by using a camera system consisting of two side-by-side mounted cameras. A camera system consisting of a single camera is cheaper than a system of two cameras which is a great motivation to why this problem is of interest to investigate.

1.1

Background

Today, autonomous driving and driver assistance systems is a popular area of research and development. Especially since it has the ability to make driving more safe. One organization, working with evaluation of car safety, is Euro NCAP. They have created a five-star safety rating system, in order to guide and assist the customers when they are purchasing a new car. The rating is based on a series of vehicle tests, representing everyday traffic scenarios. In order for the car manufactures to obtain a good rating by Euro NCAP, they need intelligent safety systems in their cars. This requires safety systems capable of handling e.g. interurban, city and pedestrian automatic emergency braking (aeb), i.e., a system that is capable of mitigating or avoiding collisions with pedestrians and cars. In the future, the automatic emergency steering (aes) and aeb systems will have more demanding requirements in order for the car manufactures to reach the highest safety ratings [15].

One possible technical solution to reach the safety requirements is to use vision based safety assistance systems. By using a camera system, capable of captur-ing a wide scene in front of the vehicle combined with image processcaptur-ing

(14)

niques, good knowledge about the surrounding environment of the vehicle can be obtained. Vision safety systems are typically constructed with either one or two cameras, denoted mono camera systems and stereo camera systems, respec-tively. One of the great advantages from using a stereo camera system, instead of a mono camera system, is the ability to gain depth information from the disparity mapping [19]. This is exactly the same ability as the human eyes have when we observe the world, i.e., reconstruction of 3d images. This significantly improves the ability to obtain information about how vehicles are e.g. oriented. One bene-fit of knowing how vehicles are oriented, and how they are rotating, is that more information can be used when predicting the future path of the vehicles. Espe-cially, since e.g. a vehicle has constraints that limits its movements, knowing the orientation and angular rate can give large benefits.

The lack of distance information is a challenge that must be handled when devel-oping a mono camera system. It is however not impossible to gain some depth information from mono camera systems. One method is to assume a width or height of an observed object in the image. Another method is to use machine learning algorithms to recover the depth information from images [18]. Today, advanced driver assistance systems (adas) can fuse the information from a mono camera system together with data from e.g. a radar system. This utilizes the cameras capability of detecting objects in a wide field of view together with the distance information from the radar.

Stereo cameras seem like the obvious choice. However, they are more expensive since more hardware is used. For a car that is already expensive, this might not be a problem. Although, in order to improve the overall traffic situation more cars must use a driving assistance system. The fact is that more than 90 % of all acci-dents on the road are caused by the human error [15]! The cheaper mono camera system is a competitive alternative to use in order to equip more cars with adas. In order for the mono camera system to be a reasonable substitute for the stereo camera system, functionality that exists in a stereo camera system must also be a feature in the mono camera system. Thus, in order to make vision systems more available for all car manufactures and all car models, further development of the mono camera systems is necessary.

1.2

Purpose and Objective

The purpose of this Master’s thesis is to investigate if and how the heading of ve-hicles can be estimated in a mono camera system. Further, the thesis shall analyse how well the mono camera system performs compared to a stereo camera system. From this, the thesis can preferably come up with some conclusions about the possibilities of replacing a stereo camera system with a mono camera system. The main idea is to research the subject and find promising algorithms for head-ing estimation, implement and evaluate one algorithm and compare the results with the results from a stereo camera system. The objective can be formulated into several questions:

(15)

1.3 Limitations 3

• Can the heading of a vehicle be estimated using a mono camera system? • What kind of algorithms and models are suitable for solving the problem? • How well does the estimates from a mono camera system perform

com-pared to those from a stereo camera system?

1.3

Limitations

In order to make the thesis feasible, some limitations must be accepted. These are:

• The heading estimation algorithm will only be evaluated on cars.

If the rotation is successfully estimated on a car, generalizations to other vehicles, e.g. buses and trucks should not be that complicated.

• The size of the tracked car is assumed to be known.

For simplification and in order to have some distance information, it is as-sumed that we have knowledge about the width and length of the tracked car. It is future work to investigate how incorrect assumptions about the size affects the final results.

• The algorithm is not required to work in real-time.

Since it is initially unknown if it is possible to estimate the heading of ve-hicles in a mono camera system, the focus is on proof-of-concept and not on real-time performance. However, the real-time aspect should be kept in mind when designing the algorithm.

• The tracking algorithm does not need to complete all necessary steps auto-matically.

The algorithm can e.g. be informed if the host car is observing the front or rear of the target car.

• It is assumed that we have perfect knowledge about the ego vehicle’s ego motion.

By assuming that the knowledge about the ego vehicle’s ego motion is per-fect, the step of compensating the states of the target, i.e., the position and orientation, is (almost) trivial. Therefore, this thesis has dealt only with tracking performed from a car which is standing still, in order to simulate perfect ego motion.

(16)

1.4

About Veoneer

Veoneer is a worldwide leader company in automotive safety. During 2018, the company Autoliv split up the two business areas, passive and active safety, into two separate companies. Autoliv continued to be responsible for the passive busi-ness area while Veoneer took over the responsibility for the active safety. Veoneer constructs software for adas, night-vision systems, radar and LiDAR systems as well as hardware constructions. [21]

1.5

Thesis Outline

The thesis is structured the following way:

Chapter 2 includes relevant theory about different algorithms that can possibly

be used to solve the problem and other theory necessary to understand the thesis.

Chapter 3 describes the proposed method regarding target modelling and

track-ing algorithm for solvtrack-ing the problem of headtrack-ing estimation.

Chapter 4 presents the result of the algorithm evaluation and comparison with

a stereo camera system.

(17)

2

Theoretical Background

This chapter describes relevant theory for solving the heading estimation prob-lem. In order to estimate a vehicle’s heading, we must track its movement, i.e.,

performtarget tracking of the vehicle. Target tracking is the task of tracking

tar-gets, objects of interest, given measurements, outputs from sensors, with different variations of uncertainty. The camera system is used to detect and input measure-ments to a filter which process the measuremeasure-ments and predicts the movement of the vehicle. When using a camera system, it is necessary to use different coordi-nate systems in order to separate the image information from world information.

2.1

General Target Tracking

The main objective of target tracking is to estimate the states of a target, given measurements or observations from one or more sensors. A target can be any object for which we are interested in estimating e.g. the position, velocity,

ac-celeration, orientation etc. Atrack is a confirmed target, i.e., a target that has

been associated with a number of measurements under a certain time. When performing target tracking, one can be interested in tracking just a single object or tracking multiple objects at the same time. These two cases are referred to as single-target tracking (stt) and multiple-target tracking (mtt) [2]. A typical flow chart of a mtt system can be seen in Figure 2.1. Each stage of the procedure in Figure 2.1 is described in detail in Table 2.1. When tracking only a single object, the gating and measurement association are simplified compared to mtt. Applications of target tracking can be found in e.g. radar-based air surveillance, military missile guidance and adas.

(18)

Sensor data and measurement processing Gating and measurement association Track maintenance Filtering and prediction

Figure 2.1: A flow chart of a typical mtt system.

Table 2.1: Description of each stage of the mtt system.

Stage Description

Sensor data and measurement processing

External sensors input data to the tracking system. The data might have to be pre-processed. Examples of measurement quantities are: distances, velocities and image coordinates.

Gating and measurement association

The gating determine which observations that are possible for each track. This information is used to limit which measurements that are possible to asso-ciate with a target. The measurements that passed the gate, gets associated with tracks according to some association algorithm. One example of an as-sociation algorithm is the global nearest neighbour algorithm [2].

Track maintenance Handles the maintenance of tracks, initializes new

tracks and deletes missing tracks. Usually some logic is used here, in order not to create new tracks from sparse measurements or delete tracks if just a single measurement is missing.

Filtering and prediction Here, tracks gets updated with the information

from the associated measurements. A prediction to the next measurements is also performed.

2.2

Vision Systems for Advanced Driver Assistance

In [19], three different kinds of road environmental sensors are described: radars, LiDARs and cameras. Radars and LiDARs emits electromagnetic signals and re-ceives echos from the surrounding environment while cameras capture the

(19)

cur-2.2 Vision Systems for Advanced Driver Assistance 7

rent view by saving light intensities in an image.

There are several advantages of using cameras over radars or LiDARs for an adas, but also some disadvantages [19].

Advantages:

• Can capture a wider field of view compared to a radar.

• Capable of recognizing different objects by using machine learning and im-age processing.

• Intuitive for humans to understand. Disadvantages:

• Can be sensitive to light and weather conditions.

• Can have higher computing cost due to e.g. image processing.

Before an object can be tracked by the vision system, it has to be detected in the image frame.

2.2.1

Vehicle Detection in Mono Camera Systems

Two examples of approaches to vehicle detection are appearance-based and motion-based methods [19].

Appearance-based methods: Appearance-based methods use techniques to

di-rectly detect a vehicle in the image frame. Two different types of appearance-based methods are feature and classification methods. Feature methods use im-age processing techniques to look for e.g. edges and symmetry in the imim-age to detect a vehicle. Classification methods include machine learning algorithms trained to recognize vehicles in the image. One example on what the output from an appearance-based classification method can look like, can be seen in Fig-ure 2.2.

Motion-based methods: Motion-based methods detect vehicles over a sequence

of image frames. Optical flow is one example of a method that can be used. Opti-cal flow is the motion of objects between frames, i.e., how the pixels have moved from one frame to another. The concept exists both as sparse optical flow, i.e., the optical flow for a certain number of points in the image, and dense optical flow, i.e., optical flow for all points in an image.

2.2.2

Vehicle Tracking in Mono Camera Systems

The goal of vehicle tracking is to predict and estimate e.g. the position and veloc-ity of the targets. Many of the general object tracking aspects play an important role in vehicle tracking, e.g. measurements, data association and mtt. When tracking vehicles in a mono camera system, some alternatives are possible on how to select the states. One can either track the vehicle in the image frame us-ing image coordinates for position and velocity, or track in 3d world coordinates and thus use meter and meter per second as units. Since no depth information

(20)

Figure 2.2: An example of a vehicle that has been detected in a mono cam-era system using a classification appearance-based method. The vehicle has been marked by a box, referred to as the region of interest (roi).

can be obtained from just a mono camera, some additional assumptions or other methods must be used if it is desired to track the target in 3d world coordinates. One of the main purposes of vehicle tracking is to maintain a state estimate of a vehicle even if it is not detected in a certain frame. The tracking can e.g. be performed with a filter of Kalman filter [19] type.

2.3

Related Research

There exist several successful attempts of estimating the 3d pose of objects using a mono camera system. The problem of estimating the heading (including both the orientation and angular rate) of a vehicle can be seen as a special case of a full

3dpose estimation problem. A vehicle does not have the same degrees of freedom

since it has limited rotational freedom. Figure 2.3 shows the rotation of interest, i.e., the rotation around the axis which is perpendicular to the vehicle’s ground plane. Some different approaches found in the literature will be mentioned here. One straightforward way of estimating the 3d pose of an object is to track a num-ber of feature points over time and let an extended Kalman filter (ekf) estimate the rotation and translation parameters [7]. By including the projection from 3d to 2d, the ekf estimates all necessary states directly. No extra step to deal with the image projection is necessary. The drawback is that the initial 3d coordinates of the feature points must be known to a certain degree, which can be difficult to obtain from just a single image. This method utilizes only image coordinates from the selected feature points as measurements.

In [3], another approach of estimating the 3d pose is proposed. Here, the 3d tra-jectory and object structure are recovered from a sequence of images. Especially, the optical flow for each selected feature point is utilized to improve the estimate

(21)

2.4 Coordinate Systems 9

Figure 2.3: An illustration of which axis rotation that is of interest to

esti-mate for a vehicle.

instead of just using the image coordinates of feature points. The usage of quater-nions can be questioned, but might be good if the tracked object rotates in all three degrees of freedoms. Using quaternions avoids the gimbal lock, which can occur when the pitch angle approaches 90 degrees [6].

Using the concept of homographies, i.e., to estimate how planes have transformed between frames, is another concept, utilized in [5]. Here, the homography is estimated between frames in order to create a measurement of the angular rate of the target vehicle. This method relies on having good correspondence between feature points in consecutive frames. The Kanade-Lucas-Tomasi (klt) feature tracker, e.g. [20], were used to track feature correspondences, between image frames. The constructed measurement was used together with an ekf to obtain the state estimates.

In [14], the homography concept is used in a somewhat similar manner. Here, the yaw angle of an unmanned aerial vehicle (uav) is estimated by calculating the homographies over time. A helipad is placed on the ground as a reference plane onto which the homography is estimated. Two flight tests were presented,

and the resulting root-mean-square error (rmse) of the yaw angle were 2.5◦and

4.9◦, respectively. A IMU was used as ground truth data.

2.4

Coordinate Systems

To describe tracking targets from a host, referring to the host as the ego vehicle in which the camera system is located, some terminology about different coordinate systems is necessary. First, we have the difference between a world coordinate sys-tem and an image coordinate syssys-tem. A world coordinate syssys-tem is a coordinate system in 3d representing how objects are positioned in the world. An image coordinate system is the 3d world coordinates projected onto a 2d image plane.

(22)

The image coordinate system is defined in Figure 2.4. It is used to e.g. express measurements from a mono camera system.

Two world coordinate systems are defined and used in this thesis: the target’s coordinate system and the host’s coordinate system. The states of the tracked tar-get will be expressed in both the host’s world coordinate system and the tartar-get’s world coordinate system. They are defined in Figures 2.5 and 2.6, respectively.

u

v

Figure 2.4: The definition of the image coordinate system. The origin is

located in the upper left corner.

y

x z

Traveling direction

Figure 2.5: The definition of the host’s coordinate system. The coordinate

system is placed at the height of the mounted camera system with the ori-gin placed at the principal point of the camera. The x-direction points in the same direction as the host itself, the y-direction points to the left when looking in the host’s direction and the z-direction points upwards.

(23)

2.5 The Pinhole Camera Model 11

z x

y

Traveling direction

Figure 2.6: The definition of the target’s coordinate system. The coordinate

system is placed at the center of the rear axis of the target. The x-direction points in the same direction as the target itself, the y-direction points to the left when looking in the target’s direction and the z-direction points up-wards.

2.5

The Pinhole Camera Model

One basic camera model is the pinhole camera model [9]. It describes how a point in world coordinates projects onto the image coordinate system. Figure 2.7

illustrates how a point (x, y, z)T is mapped onto the image plane. If the camera

has the focal lengths fuand fv, and by identifying similar triangles, the resulting

mapping from 3d to 2d is (x, y, z)T 7→  fu y x, fv z x T , (2.1a) i.e., (u, v)T 7→  fu y x, fv z x T . (2.1b) y x z Image plane (x, y, z) fv fvxz

Figure 2.7: A world coordinate (x, y, z)T is projected onto the image plane.

(24)

2.6

Homography

The homography is a projective transformation. The exact definition and more about projective transformations can be found in e.g. [9], more precisely as Def-initions 2.9 and 2.11, and Theorem 2.10. Definition 2.11 from [9] is of special interest, so it is recapitulated here and referred to as Definition 2.1.

Definition 2.1 (Projective transformation). A planar projective transformation

is a linear transformation on homogeneous 3d vectors represented by a nonsin-gular 3 × 3 matrix:         x01 x02 x03         =         h11 h12 h13 h21 h22 h23 h31 h32 h33                 x1 x2 x3         , (2.2) or in short, x0 = H x.

As described in [16], any nonzero scalar multiplied into H is also a representative of the same homography. The projective transformation can therefore be formu-lated as

x0 ∼ H x, (2.3a)

or by using an equality sign,

γ x0= H x, (2.3b)

for some nonzero scalar γ. One example of how a projective transformation can be used, mentioned in [9], is mapping between planes. This is the idea used in [5] to estimate the angular rate of vehicles and in [14] to estimate the yaw angle of a uav.

The problem of estimating how a plane in 3d, given a set of image coordinates

xi ∈ P2and a corresponding set of image coordinates x

0

i ∈ P2, has moved

(trans-lated and rotated) between two frames is equivalent to finding the homography H

for the two correspondence set of homogeneous image coordinates x = (ui, vi, 1)T

and x0 = (ui0, vi0, 1)T. The interpretation of corresponding points is a point before and the same point after the homography transformation. There exist several methods for finding the homography from the corresponding points.

2.6.1

Direct Linear Transform

The homography matrix, H, can be estimated given a set of N image coordi-nates, xi = (ui, vi, 1)T, and the correspondence set of N image coordinates, x0i =

(u0i, v0i, 1)T, in another frame.

By rewriting (2.3b), and by substituting the third row, γi = h31ui+ h32vi + h33,

into the other two rows, a resulting linear equation system on the form

(25)

2.6 Homography 13

is obtained and is referred to as a direct linear transformation (dlt), e.g. [9] and [16], where A is a 2N × 9 matrix and h is a 9 × 1 vector,

A =                    u1 0 −u1u10 v1 0 −v1u01 1 0 −u 0 1 0 u1 −u1v01 0 v1 −v1v10 0 1 −v 0 1 .. . ... ... ... ... ... ... ... ... uN 0 −uNuN0 vN 0 −vNu0N 1 0 −u 0 N 0 uNuNv0N 0 vNvNvN0 0 1 −v 0 N                    , h =                                   h11 h21 h31 h12 h22 h32 h13 h23 h33                                   . (2.5)

Viewing (2.4) as a least squares problem, turns (2.4) into the optimization prob-lem min h X i ui0− h11ui+ h12vi+ h13 h31ui+ h32vi+ h33 !2 + v0ih21ui+ h22vi+ h23 h31ui+ h32vi+ h33 !2 . (2.6)

2.6.2

Random Sample Consensus

If the data contains outliers, the dlt solution generally results in a bad estimate. Since all data points have equal weights, outliers, i.e., points that do not fit the estimated model, can have significant impact on the estimation result. Random sample consensus (ransac), e.g. [9] and [16], is one method which can improve the result if the data set contains outliers. The method contains some tuning parameters selected by the user. Some notable notations used in the algorithm are:

Trial setT A random subset of the total data set.

Consensus set C All data points satisfying the homography estimated from T .

Thresholdt Determines if a corresponding point pair belongs to C or not.

Number of trialsr The number of times a trial set T is selected.

The complete algorithm with all details can be found in [16]. Here, a brief overview of the algorithm is provided in Algorithm 2.1.

(26)

Algorithm 2.1 A ransac algorithm for estimating the homography

inputdata set D, threshold t, number of trials r

Initialize Hest= ∅ and Cest= ∅

whilei = {1, . . . , r} do

Pick a random subset T with 4 pairs of corresponding points from D Determine H from T using the dlt method

Initialize C = ∅

for allpoint pair {x0, x} in the data sets D do

Compute an error , measuring how well {x0, x} fits H

if < t then Add {x0, x} to C end if

end for

ifsize of C is larger than size of Cestthen

Set Hest= H and Cest= C

end if end while

(27)

2.7 Feature Points 15

2.7

Feature Points

In order to get the corresponding image coordinates, mentioned in Section 2.6, and the optical flow, mentioned in Section 2.2.1, a selection of certain points from the image, referred to as feature points, has to be done. An example of detected feature points in an image can be seen in Figure 2.8. There exist mainly three different steps, where the last step can be performed in two ways, when detecting feature points and finding the correspondence between images [20]. They are:

Feature detection Find and extract image points that are easily recognisable

and distinguishable from its surroundings. Typically, this means points that have a large image gradient.

Feature description A descriptor is an alternative representation of the image

point. Its purpose is to be a robust description of the feature point and its surrounding region. Examples of descriptors are: Scale-invariant feature transform (SIFT) and gradient location and orientation histogram (GLOH) [20].

Feature matching Feature points are separately extracted from two consecutive

images and then the descriptors are compared in order to matched points between the two images.

Feature tracking Instead of matching extracted feature points between two

images, one can in the second frame search for the feature points detected in the first frame, i.e., track the feature points. The klt tracker is a popular feature point tracker.

Figure 2.8: An example of an image with detected feature points marked as

green crosses. Here, the Harris–Stephens corner detection algorithm [8] was used to detect interesting points.

(28)

2.8

Extended Kalman Filtering

Kalman filtering [6] is one filtering method used to track a target. If the target

is moving according to some motion model, f (xk, uk, vk), and measurements are

generated according to some measurement model, h(xk, uk, ek), the system is

de-scribed by

xk+1 = f (xk, uk, vk), yk = h(xk, uk, ek).

(2.7) Here, xkis the state of the target, ukis an input or control signal to the system, vk

is the process noise and ek is the measurement noise. The process and

measure-ment noise are assumed to be Gaussian with zero mean and covariance matrices denoted Q and R, respectively. The motion and measurement models used in this thesis are nonlinear, thus the ekf can be applied. The algorithm to perform

ekf filtering can be found in [6] and is recapitulated in Algorithm 2.2. In the

algorithm outline, the input signal uk has been omitted.

Algorithm 2.2 Extended Kalman filtering algorithm

Given some initial conditions, ˆx1|0and P1|0, the ekf solves the filtering problem

by a, two step, recursion algorithm. Measurement update: Sk = Rk+ h 0 ( ˆxk|k−1)Pk|k−1(h 0 ( ˆxk|k−1))T (2.8a) Kk = Pk|k−1(h 0 ( ˆxk|k−1))TS1 k (2.8b) k = yk− h( ˆxk|k−1) (2.8c) ˆ xk|k = ˆxk|k−1+ Kkk (2.8d) Pk|k = Pk|k−1− Kkh 0 ( ˆxk|k−1)Pk|k−1 (2.8e) Time update: ˆ xk+1|k= f ( ˆxk|k) (2.8f) Pk+1|k= Qk+ f 0 ( ˆxk|k)Pk|k(f 0 ( ˆxk|k))T (2.8g)

Here, f0( ˆxk) and h0( ˆxk) are the Jacobians of f ( ˆxk) and h( ˆxk), respectively. The

matrices Rk and Qk are the covariance matrices of ek and vk, respectively. The

algorithm is based on the first order moment Taylor expansion.

2.9

Observability Analysis

To be able to estimate the state xk, from the available measurements, the system

must be observable. For a system on linear state-space form, xk+1= Akxk+ Bkuk,

yk = Ckxk+ Dkuk,

(29)

2.9 Observability Analysis 17

the observability can be determined using the observability Gramian [17]. Recall-ing the definition of observability from [17], which gives Definition 2.2.

Definition 2.2 (Observability). The linear state-space model (2.9) is observable

in the interval [t0, tN] if any initial state x0 is uniquely determined by the

corre-sponding zero-input response yk for k = t0, . . . , tN−1.

The condition for having an observable linear state equation is given by Theo-rem 2.3 from [17].

Theorem 2.3. The linear state equation (2.9) is observable on [t0, tN] if and only

if the n × n matrix M(t0, tN) = tN−1 X j=t0 ΦT(j, t0)CjTCjΦ (j, t0) (2.10) is invertible.

Here, the matrix M is the observability Gramian and Φ is the transition matrix, which is, for k ≥ j, given by

Φ (k, j) =        Ak−1Ak−2· · · Aj if k ≥ j + 1, I if k = j. (2.11)

In the case of a nonlinear state-space model, xk+1= f (xk),

yk= h(xk),

(2.12)

where the control signal uk has been omitted, the state-space model first has to

be linearized. By linearizing using a Taylor expansion and retaining only the first order terms, the resulting linearized state-space model is

¯ xk+1= f 0 ( ˜xk) ¯xk, ¯ yk = h 0 ( ˜xk) ¯xk, (2.13)

where xk = ˜xk + ¯xk and ˜xk is the point around which the Taylor expansion took

place, the matrix f0( ˜xk) is the Jacobian of f (xk) and h0( ˜xk) is the Jacobian of h(xk),

respectively. The model now fits into the structure of Definition 2.2 and Theo-rem 2.3.

(30)
(31)

3

Filter Construction and Methodology

In this chapter, a method is proposed to solve the heading estimation problem. The main idea is to compute how the front (or the back) of the target has moved between two consecutive frames, i.e., estimate the homography. From the ho-mography, the relative rotation, i.e., the angular rate, can be extracted and used as a measurement. By combining the new angular rate measurement and roi measurements from machine learning algorithms, together with a suitable vehi-cle and motion model, the system can be implemented in matlab and evaluated against results from a stereo camera system.

The chapter describes the motion model used to predict the motion of the target, the measurement model for both the image detections and angular rate and how all measurements are fused together in an ekf. It also describes how to, if they were accessible, incorporate measurements of the target vehicle’s corners into the model.

3.1

Vehicle Motion Model

By taking inspiration from a standard constant velocity model e.g. mentioned in [6], a motion model is constructed for target vehicles. In discretized form, under the assumption that the target vehicle moves with constant velocity during

(32)

a sample interval T , the motion model is described by xk+1 yk+1 ! = xk yk ! + R (ψk+ ωkT ) vk0T ! + v x vy ! , (3.1a) zk+1= zk+ vz, (3.1b) vk+1= vk+ vv, (3.1c) ψk+1= ψk+ ωkT + vψ, (3.1d) ωk+1= ωk+ vω, (3.1e)

where R is the 2d rotation matrix, defined as

R(θ) = cos θ − sin θ

sin θ cos θ

! , and vx, vy, vz, vv, vψand vωare the process noise.

The notation used in (3.1) is defined in Table 3.1 and Figure 3.1 illustrates how the notions are related to the target vehicle. One thing to note is that the tracking is performed relative to the host, i.e., the position and orientation are expressed in the host’s world coordinate system. Compared to the constant velocity model in [6], some differences can be noted. The z-position is assumed to be constant for natural reasons. The angular rate ω is also assumed to be constant and the yaw angle ψ is updated accordingly.

(x, y, z)

v ψ, ω

Figure 3.1: The notation in the motion model related to the target vehicle.

If the host is moving while tracking the target, at each sample, i.e., frame, the state of the target must be compensated with respect to the host’s ego motion. It has been omitted from (3.1) in order to simplify the expressions and as men-tioned in Chapter 1, the thesis deals only with host cars with no ego motion. A generalized formulation of the compensation is

xk+1= fMotion



fEgo(xk)



, (3.2)

where fEgo is the function which compensates for the host’s ego motion and

(33)

3.2 Measurement Vehicle Model 21

Table 3.1: The variables in the motion model for the target.

Notation Definition

x The target’s state vector, i.e., x = (x, y, z, v, ψ, ω)T.

x The target’s position in the x-direction of the host’s

coordi-nate system.

y The target’s position in the y-direction of the host’s

coordi-nate system.

z The target’s position in the z-direction of the host’s

coordi-nate system.

v The velocity of the target in the x-direction of the target’s

coordinate system.

ψ The yaw angle of the target compared to the host.

ω The yaw rate of the target.

3.2

Measurement Vehicle Model

In order to estimate the orientation and angular rate, i.e., the heading of a target, a measurement model must be constructed. In Figure 3.2, the target vehicle is modelled as a rectangle. The notation used in Figure 3.2 is further described in Table 3.2. Since no direct distance measurement can be obtained, two assump-tions about the width and length of the target must be used.

Table 3.2: Notations used for describing the target vehicle.

Notation Description

(x, y, z) World coordinates of the target’s position in the host’s

co-ordinate system.

v The velocity of the target, i.e., the target’s absolute velocity.

ψ Yaw angle of the target compared to the host.

w Assumed width of the target.

l Assumed length of the target.

α Ratio describing the length of the car behind the rear axis.

By using the detection methods described in Section 2.2.1, image measurement models can be derived.

(34)

(x, y, z)

v

ψ

αl

l

w

z

Host

x

Host

y

Host

Figure 3.2: The model of a target vehicle. The direction of the x-axis of

the host’s coordinate system coincides with the target’s x-axis when the yaw angle ψ is zero.

3.2.1

ROI Horizontal Center Position Measurement

First, we have the measurement of the horizontal center position of the roi. In Figure 3.3, a geometric view of the measurement is presented. The observation is the middle of the back, or the front, of the target. By utilizing the properties of the pinhole camera model, the measurement equation is

pHCP, back= −fu y + (0, 1, 0)R(ψ)(−αl, 0, 0)T x + (1, 0, 0)R(ψ)(−αl, 0, 0)T + eHCP, back = −fu y − αl sin(ψ) x − αl cos(ψ)+ eHCP, back, (3.3)

where eHCP, backis the measurement noise and R is the 3d rotation matrix defined

as R(θ) =         cos θsin θ 0 sin θ cos θ 0 0 0 1         .

The measurement is the the number of pixels offset for the horizontal center posi-tion, compared to the center of the image in the u-direction. This is illustrated in Figure 3.4. If instead the front of the target is observed, the factor α is changed

(35)

measure-3.2 Measurement Vehicle Model 23

ment equation is

pHCP, front= −fu

y − (α − 1)l sin(ψ)

x − (α − 1)l cos(ψ)+ eHCP, front, (3.4)

where eHCP, frontis the measurement noise.

v ψ αl l w Image plane fu x yp H CP

Figure 3.3: The measurement model for the roi horizontal center position

when observing the back of the target.

pHCP

Figure 3.4: The roi horizontal center position measurement from

(36)

3.2.2

ROI Width Measurement

The width of the roi is another image measurement model. It is described in

Figure 3.5 and Figure 3.6. By taking the difference between i1 and i2, the

mea-surement equation becomes pWidth, back=i1−i2 =fu y + (0, 1, 0)R(ψ)(−αl, w/2, 0)T x + (1, 0, 0)R(ψ)(−αl, w/2, 0)Tfuy + (0, 1, 0)R(ψ)(−αl, −w/2, 0) T x + (1, 0, 0)R(ψ)(−αl, −w/2, 0)T + eWidth, back =fu y − αl sin(ψ) + w cos(ψ)/2 x − αl cos(ψ) − w sin(ψ)/2fuy − αl sin(ψ) − w cos(ψ)/2

x − αl cos(ψ) + w sin(ψ)/2+ eWidth, back =fu

(y − αl sin(ψ) + w cos(ψ)/2)(x − αl cos(ψ) + w sin(ψ)/2) (x − αl cos(ψ))2−w2sin2(ψ)/4

fu(y − αl sin(ψ) − w cos(ψ)/2)(x − αl cos(ψ) − w sin(ψ)/2)

(x − αl cos(ψ))2−w2sin2(ψ)/4

+ eWidth, back

= − fu

αlw − y sin(ψ)w − x cos(ψ)w

(x − αl cos(ψ))2−w2sin2(ψ)/4+ eWidth, back,

(3.5)

where eWidth, back is the measurement noise. If instead the front is observed, the

factor α becomes α − 1 and the order of the observed points is interchanged yield-ing the equation

pWidth, front=i1−i2 =fu y + (0, 1, 0)R(ψ)((1 − α)l, −w/2, 0)T x + (1, 0, 0)R(ψ)((1 − α)l, −w/2, 0)Tfuy + (0, 1, 0)R(ψ)((1 − α)l, w/2, 0) T x + (1, 0, 0)R(ψ)((1 − α)l, w/2, 0)T + eWidth, front =fu (α − 1)lw − y sin(ψ)w − x cos(ψ)w

(x − (α − 1)l cos(ψ))2−w2sin2(ψ)/4+ eWidth, front,

(3.6)

(37)

3.2 Measurement Vehicle Model 25 v ψ αl l w Image plane fu x y i1 i2 pW idth

Figure 3.5: The measurement model for the roi width when observing the

back of the target.

pWidth

(38)

3.2.3

ROI Bottom Measurement

The bottom of the roi can also be used as a measurement. The measurement equation, according to Figure 3.7, then becomes

pBottom, back= −fv

z + (0, 0, 1)R(ψ)(−αl, 0, 0)T

x + (1, 0, 0)R(ψ)(−αl, 0, 0)T + eBottom, back

= −fv z

x − αl cos(ψ)+ eBottom, back,

(3.7)

where eBottom, backis the measurement noise. The measurement is the number of

pixels offset for the bottom position, compared to the center of the image in the v-direction. This is illustrated in Figure 3.8. If instead the front of the target is observed, the factor α is changed to α − 1 and the measurement equation becomes

pBottom, front= −fv

z

x − (α − 1)l cos(ψ)+ eBottom, front, (3.8)

where eBottom, frontis the measurement noise.

Image plane Host pbottom fv x − αl cos(ψ) Target −z

Figure 3.7: The measurement model for the roi bottom point when

observ-ing the back of the target.

pBottom

(39)

3.2 Measurement Vehicle Model 27

3.2.4

Angular Rate Measurements

By selecting feature points inside the lower half of the roi, and by using the knowledge about how pairs of feature points have moved between two images, the homography can be estimated. The lower half of the roi was selected in order to get feature points lying on a planar surface. The homography can be decomposed into a rotation matrix R, translation vector t and a plane normal vector n. Here, the plane normal is the normal of the plane before the homog-raphy transformation. A brief overview of the decomposition will be presented here. More details can be found in [10].

The homography matrix H can be decomposed as

H = R + tnT. (3.9)

The rotation matrix R describes how the plane has rotated between two images. Since the rotation is relative to the previous image, no absolute angle can be mea-sured. Instead, the rotation can be used to create the angular rate since the time between two images is assumed to be known, i.e., the camera’s frame rate. By extracting the Euler angles from the rotation matrix, the angular rate can be cal-culated and used as a measurement. The measurement equation simply becomes

yH= ω + eH, (3.10)

where eH is the measurement noise when using the homography H to construct

the angular rate measurements.

As mentioned in both [5] and [10], there exist several solutions (up to eight) to the decomposition of the homography matrix. One problem this method is facing is to decide which solution to choose. In [10], some methods are described to reduce the number of reasonable solutions from eight to two. But still, there exists no method to decide the final solution.

Here, some alternatives are proposed on how to select the final solution. • Select the solution closest to the current state of the angular rate.

This will tend to conserve the current state and could fail to detect a sudden change in the angular rate.

• Select the solution which has the smallest absolute angular rate.

Since cars do not usually turns very sharply, one can argue for always choos-ing the smallest absolute angular rate to be a reasonable alternative. • Use both solutions in the filter and later decide which track to drop.

Use both measurements and run two parallel hypotheses until one is more likely then the other, and than discard the least likely one. This method will however generate an exponential growth of hypotheses. This must be taken into consideration if this particular alternative is selected.

(40)

By using simulated data, the ground truth and the correct decomposition is known and the selected solution can be verified.

3.2.5

Corner Measurements

In order to get better information about the heading of the target, using mea-surements from the corners of the target should improve the estimation. The available corners for measurements can be seen in Figure 3.9 and a hypothetical example from real-world data can be seen in Figure 3.10. The measurement equa-tions can be constructed by writing the 3d coordinates of each of the four corners and then project them onto the image plane. They can be projected in both the image u-direction and v-direction.

These types of measurements in world coordinates can easily be obtained with a stereo camera system, since it has access to depth information from the disparity image. The purpose of introducing these measurements into the mono camera system, is to show what performance could be expected if these types of measure-ments would be available there as well. Although, the measuremeasure-ments would be in image coordinates rather than in world coordinates.

The equations of the 3d positions of the corners are

RR3d = (x, y, z)T + R(ψ) (−αl, −w/2, 0)T , (3.11) RL3d = (x, y, z)T + R(ψ) (−αl, w/2, 0)T , (3.12) FR3d = (x, y, z)T + R(ψ)(1 − α)l, −w/2, 0T, (3.13) FL3d = (x, y, z)T + R(ψ)(1 − α)l, w/2, 0T. (3.14)

By using the pinhole camera model and projecting the 3d positions onto the im-age plane, the resulting measurement equations for the imim-age u-coordinate of the corners are

puRR= −fu RR3d y RR3d x + eRRu , (3.15) pRLu = −fu RL3d y RL3d x + eRLu , (3.16) pFRu = −fu FR3d y FR3d x + eFRu , (3.17) puFL= −fu FL3d y FL3d x + eFLu , (3.18)

where eRRu , eRLu , eFRu and eFLu is the measurement noise, respectively. The same

strategy could also be used to get the v-coordinates in the image by interchanging futo fvand RR3dy to RR

3d

(41)

3.2 Measurement Vehicle Model 29

RL

RR

FR

FL

(x, y, z)

v

ψ

αl

l

w

Figure 3.9: Measurement model of the corners available to measure on the

target.

FL

RL RR

Figure 3.10: An example of what the measurements from corners could look

(42)

3.3

Rotation Estimation with EKF

Using the motion model and measurement models defined in the preceding sec-tions, the heading can be estimated using the ekf and by applying Algorithm 2.2. The state vector is

x =x y z v ψ ωT ,

and the measurement vector is

y =                     

roihorizontal center position

roibottom roiwidth Angular rate Corner coordinates in u Corner coordinates in v                      .

The process and measurement noise covariance matrices Q and R are tuning pa-rameters which have to be manually tuned in order to get a good state estimate.

3.4

Observability of the Filter

In order to know if it is possible to get a reasonable solution with the proposed filter structure, the theory from Section 2.9 is applied. Since the filter is nonlin-ear, one can only achieve an observability result around a certain trajectory. This means that it is not possible to make a general conclusion about the observability of the filter. Although, by simulating a number of trajectories which could rep-resent interesting real-world scenarios, at least something can be said about the observability.

The Jacobians in each frame in the trajectory have to be calculated and then (2.10) in Theorem 2.3 can be applied to calculate the observability Gramian of the tra-jectory. In order to check if the observability Gramian is invertible, the rank of the matrix can be investigated in each sample.

3.5

Monte Carlo Simulations

One way to get knowledge about the expected performance of the filter, is to use the Monte Carlo method, i.e., run simulations multiple times and calculate the mean of all observed results (rmse). By first simulating a trajectory and gen-erating measurements accordingly, one can use the generated measurements to estimate the simulated trajectory. This enables several things:

• The simulated trajectory works as ground truth. • All kinds of trajectories can be simulated.

(43)

3.5 Monte Carlo Simulations 31

• The expected performance of the filter can be measured.

Using the Monte Carlo method, the same trajectory is simulated multiple times with different noise realizations and the mean of the rmse’s of the estimated trajectories are calculated. In this thesis, the number of Monte Carlo runs for each trajectory were selected to 1000.

(44)
(45)

4

Performance Evaluation

The filter has been evaluated in several different ways. To get an idea if the fil-ter structure is reasonably formulated or not, an initial observability analysis has been done. If the filter structure, including the target modelling and measure-ment setups, is not plausible, a reformulation of the problem might be necessary. Monte Carlo simulations were then used to obtain some statistical properties, and a theoretical performance analysis, without having to calculate it analytically. Since the filter depends on the quality of the constructed angular rate measure-ments, the selected homography estimation method has been evaluated through simulations.

To see how the filter perform compared to a stereo camera system, two sequences were recorded and the output has been compared with the output from the filter constructed in this thesis.

4.1

Observability along Different Trajectories

In order to see if the filter structure is reasonably formulated, i.e., if the target modelling and the measurement setups have been suitably chosen, an observ-ability analysis according to Section 3.4 has been performed and summarized in Table 4.1. The results show that the filter is formulated such that a trajectory with a moving target seems to be observable. A trajectory of a target with no ego motion is observable only if all three types of measurements are available. It is not observable if only roi and angular rate measurements are available.

An intuitive explanation to why that particular situation is not observable is that, if the target has no ego motion and only roi and angular rate are used as mea-surements, the same roi measurements could be observed from several different

(46)

Table 4.1: A summary of the observability analysis results for different tra-jectories and different measurement setups.

Observable

Description roi roi and

an-gular rate

roi, angular

rate and corners The target is standing still with

an arbitrary initial yaw angle.

No No Yes

The target is driving straight to-wards or straight away from the host.

Yes Yes Yes

The target is driving towards or away from the host applying sine steering.

Yes Yes Yes

The target is driving away from

the host and makes a 45◦

turn.

Yes Yes Yes

The target is driving across the host’s lane with constant speed and constant yaw angle.

Yes Yes Yes

target state vectors. For example could the same roi appear if the target is

ro-tated either ±ψ and the (x, y, z)T position is adjusted accordingly. The roi will

appear the same in the image plane.

Since it is difficult to prove general observability for nonlinear systems, these results at least gives a hint if the filtering problem is solvable or not. The filter should, in the selected test cases where the target had an ego motion, be able to estimate the given trajectory.

(47)

4.2 Monte Carlo Simulations 35

4.2

Monte Carlo Simulations

By first simulating the filter using the Monte Carlo method, a rough evaluation of the filter’s performance can be obtained. In Monte Carlo simulations, the avail-able measurements and the measurement noise levels can be controlled. It is always good to know what to strive for when running the filter on real-world data. The goal of performing the Monte Carlo simulations is to get results about what qualities on the measurements that are required in order to get a good state estimate, especially regarding the angular rate measurements.

Two different scenarios were simulated, with different noise realisations. The applied noise was Gaussian, with zero mean and different covariance matrices.

The covariance matrices Qsimand Rsimwere used when simulating the trajectory

and generating the measurements while Q and R were used when estimating the trajectory. The simulation covariance matrices were

Qsim=                      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0001 0 0 0 0 0 0 0 0 0 0 0 0 0 sim                      , (4.1) Rsim=                      10 0 0 0 0 0 0 10 0 0 0 0 0 0 10 0 0 0 0 0 0 Rsimω 0 0 0 0 0 0 10 0 0 0 0 0 0 10                      . (4.2)

The Q and R matrices were tuned in order to get good state estimates. The initial state, x0, of the target was set to

x0=



pBottom pHCP −1.5 0 0 0

T .

Here, pBottom and pHCPmeans that the measurement equations for the roi

bot-tom and roi horizontal center position were used to initialize the x and y states, respectively.

(48)

First, a simulation of a target detected 15 meters in front of the host, driving straight away with a constant velocity of 5 m/s, was evaluated. The used

mea-surements and the parameters Qsimω and Rsimω varied according to Table 4.2.

Table 4.2: The simulation parameters and available measurements for

dif-ferent setup cases of the first simulated scenario.

Setup no. Measurements Qsimω (rad/s) Rsimω (rad/s)

1 roi 1.7 · 10−6 –

2 roiand angular rate 1.7 · 10−6 0.1

3 roiand angular rate 1.7 · 10−6 0.5

4 roiand angular rate 1.7 · 10−6 1

5 roi, angular rate and

corners

1.7 · 106

0.1

In this scenario, the covariance matrices Q and R were

Q =                      0.25 0 0 0 0 0 0 0.1 0 0 0 0 0 0 0.05 0 0 0 0 0 0 1 0 0 0 0 0 0 0.00017 0 0 0 0 0 0 0.0017                      , (4.3) R = 10Rsim, (4.4)

in all setup cases. The matrix Rsimis given by (4.2).

The results for each setup can be seen in Figures 4.1–4.5. Examples of the simu-lated trajectories can be found in Figures A.1–A.6 in Appendix A.

If only roi measurements were used, the filter performed poorly as can be seen in Figure 4.1. Especially with regard to the orientation, i.e., the yaw angle. If additionally to the roi measurements, angular rate measurements were added, a significant improvement were obtained, as can be seen in Figure 4.2. Here, the noise variance level were 0.1 rad/s. In Figures 4.3 and 4.4, the rmse of the es-timated states diverged quickly due to the high noise level of the angular rate measurements. The noise variance levels were 0.5 rad/s and 1 rad/s, respec-tively. Note especially the difference in the yaw angle comparing Figure 4.2 to Figures 4.3 and 4.4. The idea of adding the measurements of the target’s corners, considering Figure 4.5, resulted in an excellent state estimate.

(49)

4.2 Monte Carlo Simulations 37 0 2 4 6 0 5 10 15 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 20 40

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.2 0.4 Position [m] 0 2 4 6 Time [s] 0 0.05 0.1 0.15

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

Figure 4.1: Monte Carlo simulation result of scenario 1 with setup 1.

0 2 4 6 0 1 2 3 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.1 0.2 0.3 Position [m] 0 2 4 6 0 5 10 15

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.05 0.1 Position [m] 0 2 4 6 Time [s] 0 0.05 0.1

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

(50)

0 2 4 6 0 5 10 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.2 0.4 0.6 Position [m] 0 2 4 6 0 10 20 30

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.1 0.2 0.3 Position [m] 0 2 4 6 Time [s] 0 0.05 0.1 0.15

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

Figure 4.3: Monte Carlo simulation result of scenario 1 with setup 3.

0 2 4 6 0 5 10 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 10 20 30

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.2 0.4 Position [m] 0 2 4 6 Time [s] 0 0.05 0.1 0.15

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

(51)

4.2 Monte Carlo Simulations 39 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.05 0.1 0.15 Position [m] 0 2 4 6 0 5 10

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.05 0.1 0.15 Position [m] 0 2 4 6 Time [s] 0 0.05 0.1

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

(52)

Secondly, a simulation of a target (detected 15 meters in front of the host) per-forming a turn to the right, was evaluated. The target drove with a constant velocity of 4 m/s and after 2 seconds, it performed a turn to the right. The used

measurements and the parameters Qsimω and Rsimω varied according to Table 4.3.

Table 4.3: The simulation parameters and available measurements for

dif-ferent setup cases of the second simulated scenario.

Setup no. Measurements Qsimω (rad/s) Rsimω (rad/s)

6 roi 1.7 · 10−6 –

7 roiand angular rate 1.7 · 10−6 0.1

8 roiand angular rate 1.7 · 10−6 0.5

9 roiand angular rate 1.7 · 10−6 1

10 roi, angular rate and

corners

1.7 · 106

0.1

In this scenario, the covariance matrices Q and R were

Q =                      0.25 0 0 0 0 0 0 0.1 0 0 0 0 0 0 0.05 0 0 0 0 0 0 1 0 0 0 0 0 0 0.00017 0 0 0 0 0 0 0.0017                      , (4.5) R = 10Rsim, (4.6)

in all setup cases. The matrix Rsimis given by (4.2).

The results for each setup can be seen in Figures 4.6–4.10. Examples of the simu-lated trajectories can be found in Figures A.7–A.12 in Appendix A.

Figure 4.6 shows that if only roi measurements are used, a large rmse were ob-tained of the estimated states. The large rmse of the angular rate state during the turn affects the rest of the states, especially the yaw angle. In the simulation, as in the first scenario, the results are improved by adding angular rate measure-ments. In Figure 4.7, the angular rate noise variance level were 0.1 rad/s. If the angular rate measurements had too high noise variance level, the rmse of the estimated state started to diverge, as in Figures 4.8 and 4.9. The angular rate mea-surements variance noise levels were 0.5 rad/s and 1 rad/s, respectively. As well as in the previous simulation, the result got significantly improved by adding the measurements of the target’s corners, considering Figure 4.10.

(53)

4.2 Monte Carlo Simulations 41 0 2 4 6 0 2 4 6 Position [m] 0 2 4 6 0 2 4 Velocity [m/s] 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 10 20 30

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.1 0.2 Position [m] 0 2 4 6 Time [s] 0 0.2 0.4 0.6

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

Figure 4.6: Monte Carlo simulation result of scenario 2 with setup 6.

0 2 4 6 0 1 2 Position [m] 0 2 4 6 0 2 4 Velocity [m/s] 0 2 4 6 0 0.1 0.2 0.3 Position [m] 0 2 4 6 0 5 10 15

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.05 0.1 0.15 Position [m] 0 2 4 6 Time [s] 0 0.2 0.4

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

(54)

0 2 4 6 0 2 4 Position [m] 0 2 4 6 0 2 4 Velocity [m/s] 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 10 20

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.05 0.1 0.15 Position [m] 0 2 4 6 Time [s] 0 0.2 0.4

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

Figure 4.8: Monte Carlo simulation result of scenario 2 with setup 8.

0 2 4 6 0 2 4 6 Position [m] 0 2 4 6 1 2 3 4 Velocity [m/s] 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 10 20 30

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.1 0.2 Position [m] 0 2 4 6 Time [s] 0 0.2 0.4

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

(55)

4.2 Monte Carlo Simulations 43 0 2 4 6 0 0.5 1 Position [m] 0 2 4 6 0 2 4 6 Velocity [m/s] 0 2 4 6 0 0.05 0.1 0.15 Position [m] 0 2 4 6 0 5 10

Yaw angle [degrees]

0 2 4 6 Time [s] 0 0.05 0.1 0.15 Position [m] 0 2 4 6 Time [s] 0 0.2 0.4

Yaw rate [rad/s]

RMSE of the estimated states from 1000 Monte Carlo simulations

Figure 4.10: Monte Carlo simulation result of scenario 2 with setup 10.

The purpose of performing Monte Carlo simulations was to show which perfor-mance, i.e., measurement noise level, that must be achieved in order to produce a good state estimated with the proposed filter structure. This was especially inter-esting for the angular rate measurements. From the two simulated scenarios, the results have shown that a measurement variance of 0.1 rad/s for the angular rate should be good enough. A measurement noise variance of 0.5 rad/s is too large in order to obtain a good state estimate.

References

Related documents

The last line under specific aim for paper IV: The word ”living” is missing in the sentence: ..adults (living) with type 1 diabetes during transition to adult life and care..

Andrea de Bejczy*, MD, Elin Löf*, PhD, Lisa Walther, MD, Joar Guterstam, MD, Anders Hammarberg, PhD, Gulber Asanovska, MD, Johan Franck, prof., Anders Isaksson, associate prof.,

Even though the tunneling electrons represent a strongly nonequilibrium environment in- teracting with the mechanical subsystem, the analysis presented in this thesis shows that

“Det är dålig uppfostran” är ett examensarbete skrivet av Jenny Spik och Alexander Villafuerte. Studien undersöker utifrån ett föräldraperspektiv hur föräldrarnas

The effect of pre-treatments such as osmotic treatment with sugars, ethanol dehydration, calcium infusion and freezing combined with air drying and microwave drying on the kinetics

We found a perturbed protein expression of E-cadherin, Beta-catenin, Claudin 1,2,7 and Occludin in tumor sections compared to normal mucosa, but no relation to tumor volume or

The main result are that leadership in complex, stressful rescue operations can be understood as consisting of three broad time- related parts: everyday working

Up-regulation of small intestinal IL-17 immunity in untreated celiac disease but not in potential celiac disease or in type 1 diabetes.. LAHDENPERÄ, Karin Fälth-Magnusson,