kalman tracking for image processing applications student : julius oyeleke supervisor : dr martin...

17
Kalman Tracking for Image Processing Applications Student: Julius Oyeleke Supervisor: Dr Martin Glavin Co-Supervisor: Dr Fearghal Morgan

Upload: nicholas-stevenson

Post on 24-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Kalman Tracking for Image Processing Applications

Student: Julius Oyeleke

Supervisor: Dr Martin Glavin

Co-Supervisor: Dr Fearghal Morgan

Page 2: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Objective of Project

1. To track a red ball over a frame of video

2. Image Thresholding 3. Find the centre point of the ball

4. The use of Kalman filtering to • track the red ball in the image. • predict the path of the ball in future as an aid of detection.

5. Display with Overlay

OpenCV (computer vision library) is being used in this project

Page 3: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Why OpenCVReal time computer vision.

Provides powerful function to assist in object identification, motion tracking etc.

Virtually assist in any image processing application.

C-based program computer vision repository.

Page 4: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step1: Image Acquiring

commission the OpenCV system to load frames of video into memory.

cvNamedWindow(“C:/Users/julius/Desktop/FYP/redblue.bmp);

// opens a window on the screen that can contain and display

an image

cvShowImage( “redblue.bmp”, img );

// show a named window that already exist

IplImage* img = cvLoadImage( argv[1] );

//determines the file format to be loaded based on the file

name

Page 5: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step1: Problem & Solution

Problem:

• Commissioning OpenCV to read images

• Installation of OpenCV 2.0

Solution: • Uninstall OpenCV 2.0

• Install OpenCV 1.0

Page 6: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step2: Image Thresholding

convert the RGB frames to the HSV format.

RGB HSV RGB HSV RGB

threshold the HSV to identify the region of interest.

RGB HSV Threshold RGB output to screen

cvCvtColor(src,gray,CV_BGR2GRAY);

cvThreshold(gray,gray,150,255,CV_THRESH_BINARY); //Threshold to make the gray black

//Create gray image

Page 7: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan
Page 8: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step2: Problems & SolutionsProblems:

• Circle Detection with OpenCV 1.0

• OpenCV 1.0 takes hue value to be 0-255

Solutions:

• Uninstall OpenCV 1.0

• Install OpenCV 2.0

• In OpenCV 2.0 hue value is 0-180 (works better for the red colour detection) • OpenCV 2.0 has a better algorithm for circle detection.

Page 9: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

C-make • C-make helped in compiling OpenCV from the source code

• OpenCV 2.0 needs different files for different versions of studio.

• One will need to complete visual studio 2008 for OpenCV 2.0

Page 10: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Example 1:

Page 11: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Example2

Page 12: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step3: Centre Point detection

Finding the centre point of the red ball

• Hough transform

Page 13: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Kalman Tracking-Predicting the path of the Red ball

Step4: Implementation of the Kalman Filtering

Page 14: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Centre point& predicted values

Page 15: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step4: Problems & Solutions

Problems:

• Kalman not tracking & predicting properly

• OpenCV only has a 1-D example

• Program Crashed at the lineCvKalmanCorrect( Kalman, z_k ); // Correct Kalman filter state

Solutions:• 2-D was needed for this project

• I added "if (circles->total > 0)

Page 16: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Step5: Display with Overlay

Displaying with overlay

Page 17: Kalman Tracking for Image Processing Applications Student : Julius Oyeleke Supervisor : Dr Martin Glavin Co-Supervisor : Dr Fearghal Morgan

Conclusions

• Project was hampered by issues, most of which were overcome.

• Ambitious goal of the project was fully fulfilled

• Further work would lead to a complete solution