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

Method update

dlib/image_processing/correlation_tracker.h:177–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175
176 template <typename image_type>
177 double update (
178 const image_type& img,
179 const drectangle& guess
180 )
181 {
182 double psr = update_noscale(img, guess);
183
184 // Now predict the scale change
185 make_scale_space(img, Fs);
186 for (unsigned long i = 0; i < Fs.size(); ++i)
187 fft_inplace(Fs[i]);
188 Gs = 0;
189 for (unsigned long i = 0; i < Fs.size(); ++i)
190 Gs += pointwise_multiply(Fs[i],conj(As[i]));
191 Gs = pointwise_multiply(Gs, reciprocal(Bs+get_regularizer_scale()));
192 ifft_inplace(Gs);
193 const double pos = max_point_interpolated(real(Gs)).y();
194
195 // update the rectangle's scale
196 position *= std::pow(get_scale_pyramid_alpha(), pos-(double)get_num_scale_levels()/2);
197
198
199
200 // Now update the scale filters
201 make_scale_target_location_image(pos, Gs);
202 Bs *= (1-get_nu_scale());
203 for (unsigned long i = 0; i < Fs.size(); ++i)
204 {
205 As[i] = get_nu_scale()*pointwise_multiply(Gs, Fs[i]) + (1-get_nu_scale())*As[i];
206 Bs += get_nu_scale()*(squared(real(Fs[i]))+squared(imag(Fs[i])));
207 }
208
209
210 return psr;
211 }
212
213 template <typename image_type>
214 double update_noscale (

Callers

nothing calls this directly

Calls 12

pointwise_multiplyFunction · 0.85
max_point_interpolatedFunction · 0.85
realFunction · 0.85
squaredFunction · 0.85
imagFunction · 0.85
updateFunction · 0.85
get_positionFunction · 0.85
fft_inplaceFunction · 0.50
conjFunction · 0.50
reciprocalFunction · 0.50
ifft_inplaceFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected