Skip to content

Commit

Permalink
Added an example for the correlation_tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed Feb 3, 2015
1 parent 9b22f91 commit 35aba91
Show file tree
Hide file tree
Showing 154 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ add_example(timer_ex)
add_example(train_object_detector)
add_example(train_shape_predictor_ex)
add_example(using_custom_kernels_ex)
add_example(video_tracking_ex)
add_example(xml_parser_ex)


Expand Down
Binary file added examples/video_frames/frame_000100.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000101.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000102.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000103.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000104.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000105.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000106.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000107.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000108.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000109.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000110.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000111.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000112.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000113.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000114.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000115.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000116.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000117.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000118.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000119.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000120.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000121.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000122.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000123.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000124.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/video_frames/frame_000125.jpg
Binary file added examples/video_frames/frame_000126.jpg
Binary file added examples/video_frames/frame_000127.jpg
Binary file added examples/video_frames/frame_000128.jpg
Binary file added examples/video_frames/frame_000129.jpg
Binary file added examples/video_frames/frame_000130.jpg
Binary file added examples/video_frames/frame_000131.jpg
Binary file added examples/video_frames/frame_000132.jpg
Binary file added examples/video_frames/frame_000133.jpg
Binary file added examples/video_frames/frame_000134.jpg
Binary file added examples/video_frames/frame_000135.jpg
Binary file added examples/video_frames/frame_000136.jpg
Binary file added examples/video_frames/frame_000137.jpg
Binary file added examples/video_frames/frame_000138.jpg
Binary file added examples/video_frames/frame_000139.jpg
Binary file added examples/video_frames/frame_000140.jpg
Binary file added examples/video_frames/frame_000141.jpg
Binary file added examples/video_frames/frame_000142.jpg
Binary file added examples/video_frames/frame_000143.jpg
Binary file added examples/video_frames/frame_000144.jpg
Binary file added examples/video_frames/frame_000145.jpg
Binary file added examples/video_frames/frame_000146.jpg
Binary file added examples/video_frames/frame_000147.jpg
Binary file added examples/video_frames/frame_000148.jpg
Binary file added examples/video_frames/frame_000149.jpg
Binary file added examples/video_frames/frame_000150.jpg
Binary file added examples/video_frames/frame_000151.jpg
Binary file added examples/video_frames/frame_000152.jpg
Binary file added examples/video_frames/frame_000153.jpg
Binary file added examples/video_frames/frame_000154.jpg
Binary file added examples/video_frames/frame_000155.jpg
Binary file added examples/video_frames/frame_000156.jpg
Binary file added examples/video_frames/frame_000157.jpg
Binary file added examples/video_frames/frame_000158.jpg
Binary file added examples/video_frames/frame_000159.jpg
Binary file added examples/video_frames/frame_000160.jpg
Binary file added examples/video_frames/frame_000161.jpg
Binary file added examples/video_frames/frame_000162.jpg
Binary file added examples/video_frames/frame_000163.jpg
Binary file added examples/video_frames/frame_000164.jpg
Binary file added examples/video_frames/frame_000165.jpg
Binary file added examples/video_frames/frame_000166.jpg
Binary file added examples/video_frames/frame_000167.jpg
Binary file added examples/video_frames/frame_000168.jpg
Binary file added examples/video_frames/frame_000169.jpg
Binary file added examples/video_frames/frame_000170.jpg
Binary file added examples/video_frames/frame_000171.jpg
Binary file added examples/video_frames/frame_000172.jpg
Binary file added examples/video_frames/frame_000173.jpg
Binary file added examples/video_frames/frame_000174.jpg
Binary file added examples/video_frames/frame_000175.jpg
Binary file added examples/video_frames/frame_000176.jpg
Binary file added examples/video_frames/frame_000177.jpg
Binary file added examples/video_frames/frame_000178.jpg
Binary file added examples/video_frames/frame_000179.jpg
Binary file added examples/video_frames/frame_000180.jpg
Binary file added examples/video_frames/frame_000181.jpg
Binary file added examples/video_frames/frame_000182.jpg
Binary file added examples/video_frames/frame_000183.jpg
Binary file added examples/video_frames/frame_000184.jpg
Binary file added examples/video_frames/frame_000185.jpg
Binary file added examples/video_frames/frame_000186.jpg
Binary file added examples/video_frames/frame_000187.jpg
Binary file added examples/video_frames/frame_000188.jpg
Binary file added examples/video_frames/frame_000189.jpg
Binary file added examples/video_frames/frame_000190.jpg
Binary file added examples/video_frames/frame_000191.jpg
Binary file added examples/video_frames/frame_000192.jpg
Binary file added examples/video_frames/frame_000193.jpg
Binary file added examples/video_frames/frame_000194.jpg
Binary file added examples/video_frames/frame_000195.jpg
Binary file added examples/video_frames/frame_000196.jpg
Binary file added examples/video_frames/frame_000197.jpg
Binary file added examples/video_frames/frame_000198.jpg
Binary file added examples/video_frames/frame_000199.jpg
Binary file added examples/video_frames/frame_000200.jpg
Binary file added examples/video_frames/frame_000201.jpg
Binary file added examples/video_frames/frame_000202.jpg
Binary file added examples/video_frames/frame_000203.jpg
Binary file added examples/video_frames/frame_000204.jpg
Binary file added examples/video_frames/frame_000205.jpg
Binary file added examples/video_frames/frame_000206.jpg
Binary file added examples/video_frames/frame_000207.jpg
Binary file added examples/video_frames/frame_000208.jpg
Binary file added examples/video_frames/frame_000209.jpg
Binary file added examples/video_frames/frame_000210.jpg
Binary file added examples/video_frames/frame_000211.jpg
Binary file added examples/video_frames/frame_000212.jpg
Binary file added examples/video_frames/frame_000213.jpg
Binary file added examples/video_frames/frame_000214.jpg
Binary file added examples/video_frames/frame_000215.jpg
Binary file added examples/video_frames/frame_000216.jpg
Binary file added examples/video_frames/frame_000217.jpg
Binary file added examples/video_frames/frame_000218.jpg
Binary file added examples/video_frames/frame_000219.jpg
Binary file added examples/video_frames/frame_000220.jpg
Binary file added examples/video_frames/frame_000221.jpg
Binary file added examples/video_frames/frame_000222.jpg
Binary file added examples/video_frames/frame_000223.jpg
Binary file added examples/video_frames/frame_000224.jpg
Binary file added examples/video_frames/frame_000225.jpg
Binary file added examples/video_frames/frame_000226.jpg
Binary file added examples/video_frames/frame_000227.jpg
Binary file added examples/video_frames/frame_000228.jpg
Binary file added examples/video_frames/frame_000229.jpg
Binary file added examples/video_frames/frame_000230.jpg
Binary file added examples/video_frames/frame_000231.jpg
Binary file added examples/video_frames/frame_000232.jpg
Binary file added examples/video_frames/frame_000233.jpg
Binary file added examples/video_frames/frame_000234.jpg
Binary file added examples/video_frames/frame_000235.jpg
Binary file added examples/video_frames/frame_000236.jpg
Binary file added examples/video_frames/frame_000237.jpg
Binary file added examples/video_frames/frame_000238.jpg
Binary file added examples/video_frames/frame_000239.jpg
Binary file added examples/video_frames/frame_000240.jpg
Binary file added examples/video_frames/frame_000241.jpg
Binary file added examples/video_frames/frame_000242.jpg
Binary file added examples/video_frames/frame_000243.jpg
Binary file added examples/video_frames/frame_000244.jpg
Binary file added examples/video_frames/frame_000245.jpg
Binary file added examples/video_frames/frame_000246.jpg
Binary file added examples/video_frames/frame_000247.jpg
Binary file added examples/video_frames/frame_000248.jpg
Binary file added examples/video_frames/frame_000249.jpg
Binary file added examples/video_frames/frame_000250.jpg
6 changes: 6 additions & 0 deletions examples/video_frames/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Please read terms of use for the content of this zip file at this websites:
English: http://creativecommons.org/licenses/by-sa/3.0/de/deed.en
German: http://creativecommons.org/licenses/by-sa/3.0/de/


Note that this video is from the BoBoT dataset (see http://www.iai.uni-bonn.de/~kleind/tracking/) but has been compressed a lot, cropped, and converted to grayscale to make the dlib archive file as small as possible.
61 changes: 61 additions & 0 deletions examples/video_tracking_ex.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
/*
This is an example illustrating the use of the Bulk Synchronous Parallel (BSP)
processing tools from the dlib C++ Library. These tools allow you to easily setup a
number of processes running on different computers which cooperate to compute some
result.
*/

#include <dlib/image_processing.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_io.h>
#include <dlib/dir_nav.h>


using namespace dlib;
using namespace std;

int main(int argc, char** argv) try
{
if (argc != 2)
{
cout << "Call this program like this: " << endl;
cout << "./video_tracking_ex ../video_frames" << endl;
return 1;
}

std::vector<file> files = get_files_in_directory_tree(argv[1], match_ending(".jpg"));
std::sort(files.begin(), files.end());
if (files.size() == 0)
{
cout << "No images found in " << argv[1] << endl;
return 1;
}

array2d<unsigned char> img;
load_image(img, files[0]);

correlation_tracker tracker;
tracker.start_track(img, centered_rect(point(93,110), 38, 86));

image_window win;
for (unsigned long i = 1; i < files.size(); ++i)
{
load_image(img, files[i]);
tracker.update(img);

win.set_image(img);
win.clear_overlay();
win.add_overlay(tracker.get_position());

cout << "hit enter to process next frame" << endl;
cin.get();
}
}
catch (std::exception& e)
{
cout << e.what() << endl;
}

0 comments on commit 35aba91

Please sign in to comment.