Giter Site home page Giter Site logo

kcfcpp-py-wrapper's Introduction

I write a python wrapper for KCFcpp, some of the code are modified from http://nicellama.blogspot.com/2015/06/cython-wrapper-between-opencv-mat-in-c.html .

Requirements

  • Python 2.7
  • NumPy
  • Cython
  • OpenCV (both C++ and Python interfaces)

Build

python setup.py build_ext --inplace

or

python setup.py install

Usage

python run.py
python run.py 1
python run.py test.avi

References

  1. Cython: A Guide for Python Programmers by Kurt Smith
  2. Cython wrapper between opencv Mat in C++ and numpy http://nicellama.blogspot.com/2015/06/cython-wrapper-between-opencv-mat-in-c.html


ORIGINAL README:

C++ KCF Tracker

This package includes a C++ class with several tracking methods based on the Kernelized Correlation Filter (KCF) [1, 2].
It also includes an executable to interface with the VOT benchmark.

[1] J. F. Henriques, R. Caseiro, P. Martins, J. Batista,
"High-Speed Tracking with Kernelized Correlation Filters", TPAMI 2015.

[2] J. F. Henriques, R. Caseiro, P. Martins, J. Batista,
"Exploiting the Circulant Structure of Tracking-by-detection with Kernels", ECCV 2012.

Authors: Joao Faro, Christian Bailer, Joao F. Henriques
Contacts: [email protected], [email protected], [email protected]
Institute of Systems and Robotics - University of Coimbra / Department of Augmented Vision DFKI

Algorithms (in this folder)

"KCFC++", command: ./KCF
Description: KCF on HOG features, ported to C++ OpenCV. The original Matlab tracker placed 3rd in VOT 2014.

"KCFLabC++", command: ./KCF lab
Description: KCF on HOG and Lab features, ported to C++ OpenCV. The Lab features are computed by quantizing CIE-Lab colors into 15 centroids, obtained from natural images by k-means.

The CSK tracker [2] is also implemented as a bonus, simply by using raw grayscale as features (the filter becomes single-channel).

Compilation instructions

There are no external dependencies other than OpenCV 3.0.0. Tested on a freshly installed Ubuntu 14.04.

  1. cmake CMakeLists.txt
  2. make

Running instructions

The runtracker.cpp is prepared to be used with the VOT toolkit. The executable "KCF" should be called as:

./KCF [OPTION_1] [OPTION_2] [...]

Options available:

gray - Use raw gray level features as in [1].
hog - Use HOG features as in [2].
lab - Use Lab colorspace features. This option will also enable HOG features by default.
singlescale - Performs single-scale detection, using a variable-size window.
fixed_window - Keep the window size fixed when in single-scale mode (multi-scale always used a fixed window).
show - Show the results in a window.

To include it in your project, without the VOT toolkit you just need to:

// Create the KCFTracker object with one of the available options
KCFTracker tracker(HOG, FIXEDWINDOW, MULTISCALE, LAB);

// Give the first frame and the position of the object to the tracker
tracker.init( Rect(xMin, yMin, width, height), frame );

// Get the position of the object for the new frame
result = tracker.update(frame);

kcfcpp-py-wrapper's People

Contributors

joaofaro avatar uoip avatar

Stargazers

杨先生 avatar

Watchers

James Cloos avatar

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.