《KCF源码代码详解》是一本深入解析基于Kernel Correlation Filters的目标跟踪算法核心代码的书籍,适合计算机视觉领域的研究人员和开发者阅读。书中不仅详细解释了KCF算法的工作原理,还提供了实际应用案例与源码分析,帮助读者更好地理解和实现该算法。
## Tracking with Kernelized Correlation Filters
Code Author: Tomas Vojir
This is a C++ reimplementation of the algorithm described in the paper High-Speed Tracking with Kernelized Correlation Filters.
For more information and implementations in other languages, visit the authors webpage.
The code includes an extension for scale estimation (using seven different scales) and incorporates RGB channels as well as Color Names features. Data for the Color Names feature was obtained from the SAMF tracker repository.
It is free to use for research purposes. If you find it useful or use it in your work, please acknowledge my git repository and cite the original paper [1].
The code relies on OpenCV 2.4+ library and can be built using cmake toolchain.
### Quick Start Guide
For Linux: open terminal in the directory with the code
```
$ mkdir build; cd build; cmake .. ; make
```
This compiles into binary **kcf_vot**
- kcf_vot:
- Uses VOT 2014 methodology.
- INPUT: Two files are expected, images.txt (list of sequence images with absolute path) and region.txt (initial bounding box in the first frame in format top_left_x, top_left_y, width, height or four corner points listed clockwise starting from bottom left corner).
- OUTPUT: output.txt containing the bounding boxes in the format top_left_x, top_left_y, width, height.
- kcf_trax:
- Uses VOT 2014+ trax protocol.
- Requires [trax](https://github.com/votchallenge/trax) library to be compiled with OpenCV support and installed. See trax instructions for compiling and installing.
### Performance
| | **VOT2016 - baseline EAO** | **VOT2016 - unsupervised EAO** | [TV77](http://cmp.felk.cvut.cz/~vojirtom/dataset/index.html) Avg. Recall |
|:---------------|:--------------:|:------------------:|:----------------:|
| kcf | 0.1530 | 0.3859 | 51% |
| skcf | 0.1661 | 0.4155 | 56% |
| skcf-cn | 0.178 | 0.4136 | 58% |
| kcf-master | **0.1994** | **0.4376** | **63%** |
### References
[1] João F. Henriques, Rui Caseiro, Pedro Martins, Jorge Batista, High-Speed Tracking with Kernelized Correlation Filters, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015.
[2] J. van de Weijer, C. Schmid, J. J. Verbeek, and D. Larlus. Learning color names for real-world applications. TIP, 18(7):1512–1524, 2009.
### Copyright
Copyright (c) 2014 Tomáš Vojíř
Permission to use, copy, modify and distribute this software for research purposes is hereby granted provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
### Additional Library
NOTE: The following files are part of Piotr’s Toolbox and were modified for use with C++:
- srcpiotr_fhoggradientMex.cpp
- srcpiotr_fhogsse.hpp
- srcpiotr_fhogwrappers.hpp
You can get the full version of this library from its official source.
### Copyright (c) 2012, Piotr Dollar. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING PROCUREMENT OF SUBSTITUTE GOODS