├── .gitattributes ├── README.md ├── choose_video.m ├── data.rar ├── download_videos.m ├── external.txt ├── fhog.m ├── gaussian_correlation.m ├── gaussian_shaped_labels.m ├── get_features.m ├── get_subwindow.m ├── gradientMex.mexa64 ├── gradientMex.mexw64 ├── linear_correlation.m ├── load_video_info.m ├── polynomial_correlation.m ├── precision_plot.m ├── readme.txt ├── run_tracker.m ├── show_video.m ├── target_sz.m ├── tracker.m ├── videofig.m └── 流程图.rar /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KCF-FOR-MATLAB 2 | -------------------------------------------------------------------------------- /choose_video.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/choose_video.m -------------------------------------------------------------------------------- /data.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/data.rar -------------------------------------------------------------------------------- /download_videos.m: -------------------------------------------------------------------------------- 1 | 2 | % This script downloads and extracts all videos to the path specified 3 | % below. 4 | % 5 | % Joao F. Henriques, 2014 6 | % http://www.isr.uc.pt/~henriques/ 7 | 8 | 9 | %local path where the videos will be located. 10 | %note that if you change it here, you must also change it in RUN_TRACKER. 11 | base_path = './data/Benchmark/'; 12 | 13 | 14 | %list of videos to download 15 | videos = {'basketball', 'bolt', 'boy', 'car4', 'carDark', 'carScale', ... 16 | 'coke', 'couple', 'crossing', 'david2', 'david3', 'david', 'deer', ... 17 | 'dog1', 'doll', 'dudek', 'faceocc1', 'faceocc2', 'fish', 'fleetface', ... 18 | 'football', 'football1', 'freeman1', 'freeman3', 'freeman4', 'girl', ... 19 | 'ironman', 'jogging', 'jumping', 'lemming', 'liquor', 'matrix', ... 20 | 'mhyang', 'motorRolling', 'mountainBike', 'shaking', 'singer1', ... 21 | 'singer2', 'skating1', 'skiing', 'soccer', 'subway', 'suv', 'sylvester', ... 22 | 'tiger1', 'tiger2', 'trellis', 'walking', 'walking2', 'woman'}; 23 | 24 | 25 | if ~exist(base_path, 'dir'), %create if it doesn't exist already 26 | mkdir(base_path); 27 | end 28 | 29 | if ~exist('matlabpool', 'file'), 30 | %no parallel toolbox, use a simple 'for' to iterate 31 | disp('Downloading videos one by one, this may take a while.') 32 | disp(' ') 33 | 34 | for k = 1:numel(videos), 35 | disp(['Downloading and extracting ' videos{k} '...']); 36 | unzip(['http://cvlab.hanyang.ac.kr/tracker_benchmark/seq/' videos{k} '.zip'], base_path); 37 | end 38 | 39 | else 40 | %download all videos in parallel 41 | disp('Downloading videos in parallel, this may take a while.') 42 | disp(' ') 43 | 44 | if matlabpool('size') == 0, 45 | matlabpool open; 46 | end 47 | parfor k = 1:numel(videos), 48 | disp(['Downloading and extracting ' videos{k} '...']); 49 | unzip(['http://cvlab.hanyang.ac.kr/tracker_benchmark/seq/' videos{k} '.zip'], base_path); 50 | end 51 | end 52 | 53 | -------------------------------------------------------------------------------- /external.txt: -------------------------------------------------------------------------------- 1 | 2 | NOTE: The following files are part of Piotr's Toolbox, and are provided for 3 | convenience only: 4 | 5 | fhog.m 6 | gradientMex.mexa64 7 | gradientMex.mexw64 8 | 9 | You are encouraged to get the full version of this excellent library, at which 10 | point they can be safely deleted. 11 | 12 | Piotr's Toolbox (3.25) -- http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html 13 | 14 | 15 | _______________________________________________________________________________ 16 | 17 | Copyright (c) 2012, Piotr Dollar 18 | All rights reserved. 19 | 20 | Redistribution and use in source and binary forms, with or without 21 | modification, are permitted provided that the following conditions are met: 22 | 23 | 1. Redistributions of source code must retain the above copyright notice, this 24 | list of conditions and the following disclaimer. 25 | 2. Redistributions in binary form must reproduce the above copyright notice, 26 | this list of conditions and the following disclaimer in the documentation 27 | and/or other materials provided with the distribution. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 30 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 31 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 32 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 33 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 36 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | The views and conclusions contained in the software and documentation are those 41 | of the authors and should not be interpreted as representing official policies, 42 | either expressed or implied, of the FreeBSD Project. 43 | 44 | -------------------------------------------------------------------------------- /fhog.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/fhog.m -------------------------------------------------------------------------------- /gaussian_correlation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/gaussian_correlation.m -------------------------------------------------------------------------------- /gaussian_shaped_labels.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/gaussian_shaped_labels.m -------------------------------------------------------------------------------- /get_features.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/get_features.m -------------------------------------------------------------------------------- /get_subwindow.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/get_subwindow.m -------------------------------------------------------------------------------- /gradientMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/gradientMex.mexa64 -------------------------------------------------------------------------------- /gradientMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/gradientMex.mexw64 -------------------------------------------------------------------------------- /linear_correlation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/linear_correlation.m -------------------------------------------------------------------------------- /load_video_info.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/load_video_info.m -------------------------------------------------------------------------------- /polynomial_correlation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/polynomial_correlation.m -------------------------------------------------------------------------------- /precision_plot.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/precision_plot.m -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | 2 | High-Speed Tracking with Kernelized Correlation Filters 3 | 4 | J. F. Henriques R. Caseiro P. Martins J. Batista 5 | TPAMI 2014 6 | 7 | ________________ 8 | To be published. 9 | arXiv pre-print: http://arxiv.org/abs/1404.7584 10 | Project webpage: http://www.isr.uc.pt/~henriques/circulant/ 11 | 12 | This MATLAB code implements a simple tracking pipeline based on the Kernelized 13 | Correlation Filter (KCF), and Dual Correlation Filter (DCF). 14 | 15 | It is free for research use. If you find it useful, please acknowledge the paper 16 | above with a reference. 17 | 18 | 19 | __________ 20 | Quickstart 21 | 22 | 1. Extract code somewhere. 23 | 24 | 2. The tracker is prepared to run on any of the 50 videos of the Visual Tracking 25 | Benchmark [3]. For that, it must know where they are/will be located. You can 26 | change the default location 'base_path' in 'download_videos.m' and 'run_tracker.m'. 27 | 28 | 3. If you don't have the videos already, run 'download_videos.m' (may take some time). 29 | 30 | 4. Execute 'run_tracker' without parameters to choose a video and test the KCF on it. 31 | 32 | 33 | Note: The tracker uses the 'fhog'/'gradientMex' functions from Piotr's Toolbox. 34 | Some pre-compiled MEX files are provided for convenience. If they do not work for your 35 | system, just get the toolbox from http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html 36 | 37 | 38 | __________ 39 | 40 | The main interface function is 'run_tracker'. You can test several configurations (KCF, 41 | DCF, MOSSE) by calling it with different commands: 42 | 43 | 44 | run_tracker 45 | Without any parameters, will ask you to choose a video, track using 46 | the Gaussian KCF on HOG, and show the results in an interactive 47 | figure. Press 'Esc' to stop the tracker early. You can navigate the 48 | video using the scrollbar at the bottom. 49 | 50 | run_tracker VIDEO 51 | Allows you to select a VIDEO by its name. 'all' will run all videos 52 | and show average statistics. 'choose' will select one interactively. 53 | 54 | run_tracker VIDEO KERNEL 55 | Choose a KERNEL. 'gaussian'/'polynomial' to run KCF, 'linear' for DCF. 56 | 57 | run_tracker VIDEO KERNEL FEATURE 58 | Choose a FEATURE type, either 'hog' or 'gray' (raw pixels). 59 | 60 | run_tracker(VIDEO, KERNEL, FEATURE, SHOW_VISUALIZATION, SHOW_PLOTS) 61 | Decide whether to show the scrollable figure, and the precision plot. 62 | 63 | Useful combinations: 64 | >> run_tracker choose gaussian hog %Kernelized Correlation Filter (KCF) 65 | >> run_tracker choose linear hog %Dual Correlation Filter (DCF) 66 | >> run_tracker choose gaussian gray %Single-channel KCF (ECCV'12 paper) 67 | >> run_tracker choose linear gray %MOSSE filter (single channel) 68 | 69 | 70 | For the actual tracking code, check out the 'tracker' function. 71 | 72 | 73 | Though it's not required, the code will make use of the MATLAB Parallel Computing 74 | Toolbox automatically if available. 75 | 76 | 77 | __________ 78 | References 79 | 80 | [1] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, "High-Speed Tracking with 81 | Kernelized Correlation Filters", TPAMI 2014 (to be published). 82 | 83 | [2] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, "Exploiting the Circulant 84 | Structure of Tracking-by-detection with Kernels", ECCV 2012. 85 | 86 | [3] Y. Wu, J. Lim, M.-H. Yang, "Online Object Tracking: A Benchmark", CVPR 2013. 87 | Website: http://visual-tracking.net/ 88 | 89 | [4] P. Dollar, "Piotr's Image and Video Matlab Toolbox (PMT)". 90 | Website: http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html 91 | 92 | [5] P. Dollar, S. Belongie, P. Perona, "The Fastest Pedestrian Detector in the 93 | West", BMVC 2010. 94 | 95 | 96 | _____________________________________ 97 | Copyright (c) 2014, Joao F. Henriques 98 | 99 | Permission to use, copy, modify, and distribute this software for research 100 | purposes with or without fee is hereby granted, provided that the above 101 | copyright notice and this permission notice appear in all copies. 102 | 103 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 104 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 105 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 106 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 107 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 108 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 109 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 110 | 111 | -------------------------------------------------------------------------------- /run_tracker.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/run_tracker.m -------------------------------------------------------------------------------- /show_video.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/show_video.m -------------------------------------------------------------------------------- /target_sz.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/target_sz.m -------------------------------------------------------------------------------- /tracker.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/tracker.m -------------------------------------------------------------------------------- /videofig.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/videofig.m -------------------------------------------------------------------------------- /流程图.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsuradaYuci/KCF-FOR-MATLAB/9c9fc513dabd0f9432ee3523dbf6ebef21ea6ee1/流程图.rar --------------------------------------------------------------------------------