MCPcopy Create free account
hub / github.com/davisking/dlib / start_track

Method start_track

dlib/image_processing/correlation_tracker.h:53–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52 template <typename image_type>
53 void start_track (
54 const image_type& img,
55 const drectangle& p
56 )
57 {
58 DLIB_CASSERT(p.is_empty() == false,
59 "\t void correlation_tracker::start_track()"
60 << "\n\t You can't give an empty rectangle."
61 );
62
63 B.set_size(0,0);
64
65 point_transform_affine tform = inv(make_chip(img, p, F));
66 for (unsigned long i = 0; i < F.size(); ++i)
67 fft_inplace(F[i]);
68 make_target_location_image(tform(center(p)), G);
69 A.resize(F.size());
70 for (unsigned long i = 0; i < F.size(); ++i)
71 {
72 A[i] = pointwise_multiply(G, F[i]);
73 B += squared(real(F[i]))+squared(imag(F[i]));
74 }
75
76 position = p;
77
78 // now do the scale space stuff
79 make_scale_space(img, Fs);
80 for (unsigned long i = 0; i < Fs.size(); ++i)
81 fft_inplace(Fs[i]);
82 make_scale_target_location_image(get_num_scale_levels()/2, Gs);
83 Bs.set_size(0);
84 As.resize(Fs.size());
85 for (unsigned long i = 0; i < Fs.size(); ++i)
86 {
87 As[i] = pointwise_multiply(Gs, Fs[i]);
88 Bs += squared(real(Fs[i]))+squared(imag(Fs[i]));
89 }
90 }
91
92
93 unsigned long get_filter_size (

Callers 5

propagate_boxesFunction · 0.80
start_trackFunction · 0.80
perform_testMethod · 0.80
mainFunction · 0.80

Calls 11

pointwise_multiplyFunction · 0.85
squaredFunction · 0.85
realFunction · 0.85
imagFunction · 0.85
invFunction · 0.50
fft_inplaceFunction · 0.50
centerFunction · 0.50
is_emptyMethod · 0.45
set_sizeMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

perform_testMethod · 0.64