| 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 ( |
nothing calls this directly
no test coverage detected