Giter Club home page Giter Club logo

kcf_and_kalman_filter's Introduction

KCF tracker with Kalman filter

What?

Here lies my university course project

Why?

I had an idea to increase accuracy and robustness of a famous KCF tracker. And I thought maybe a Kalman filter can do its filtering thing and place a bounding box more accurately. But I didn't want to select parameters of Kalman filter by hand, so I implemented some sort of genetic algorithm to do it for me.

What Algorithm?

I used generic Kalman filter algorithm. The state vector was as follows: (x1, y1,), where (x1, y1) - is the center of the bounding box.

Genetic algorithm selected elements for B, u, S, R and A matrices. I used f-measure with beta = 3 as a fitness function. Other parameters of the fitness function were accuracy and robustness. They were calculated plain VOT way, although I used DIOU instead of IOU, and omit less then 10 frames before calculation of the metrics.

Where is the best genome?

Here:

-1.04996 -0.35197 2.14865 1.81949 1.0531 0.379274 -0.972355 -4.83614 -0.664763 1.58524 3.81422 0.125361 -0.805518 1.51277 -2.40536 -3.02137 2.54712 0.250593 0.310221 0.0344269 -0.52078 2.17617 0.0965927 0.910537 0.0220096 0.745542 -1.34083 0.2846 -1.66556 -1.72201 -0.333888 2.63724 1.7406 -2.1478 -0.25823 0.908437 3.43149 -0.00610241 -0.767901 0.0167775 1.48063 0.0126195 0.167397 -0.0533417 -0.0268063 -0.04304 -0.0294877 -2.30189 0.188723 -0.300192 1.17634 1.12888 0.0306505 0.0520604 -0.249356 -3.18886

Some more details

Compiled and tested with OpenCV 4.2.0

How to load VOT2017 dataset

pip install git+https://github.com/votchallenge/vot-toolkit-python
# if you have the same problem with numpy version that I did, then run this command:
# pip install numpy=1.21

mkdir vot2017
vot initialize vot2017 --workspace vot2017
# After loading process finishes, 
# you'll have directory with 60 sequences

How to build and run

Build train code and test code

mkdir build && cd build
cmake ..
make -j4
# Start train

KCF
# Or run test on a webcam stream. 
# Genome already included in code (look at src/runtracker.cpp)

run_tracker

# When you run run_tracker, 
# press B and select BBox to track, than press Enter

Acknowledgments

KCF repository

kcf_and_kalman_filter's People

Contributors

joaofaro avatar kseniaryabinova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kcf_and_kalman_filter's Issues

What should I do to run it?

Hi,I ran your codes in my vs2019,and then fixed some miscompatibles with the current version of opencv.
Now the bugs are all cleaned,but when I run it, I only got :
start to read gt files
start to run population
1 of 110
Then the programs stopped with nothing else happens.
Please,pls tell me what to do to run the code correctly :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.