#include <cassert>
#include "debug.h"
-Fft::~Fft()
-{
-
-}
-
void Fft::init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales)
{
m_width = width;
class Fft
{
public:
- virtual void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
- virtual void set_window(const MatDynMem &window);
- virtual void forward(const MatScales &real_input, ComplexMat &complex_result);
- virtual void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
- virtual void inverse(ComplexMat &complex_input, MatScales &real_result);
- virtual ~Fft() = 0;
+ void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
+ void set_window(const MatDynMem &window);
+ void forward(const MatScales &real_input, ComplexMat &complex_result);
+ void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
+ void inverse(ComplexMat &complex_input, MatScales &real_result);
static cv::Size freq_size(cv::Size space_size)
{
{
public:
cuFFT();
- void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales) override;
- void set_window(const MatDynMem &window) override;
- void forward(const MatScales &real_input, ComplexMat &complex_result) override;
- void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp) override;
- void inverse(ComplexMat &complex_input, MatScales &real_result) override;
- ~cuFFT() override;
+ void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
+ void set_window(const MatDynMem &window);
+ void forward(const MatScales &real_input, ComplexMat &complex_result);
+ void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
+ void inverse(ComplexMat &complex_input, MatScales &real_result);
+ ~cuFFT();
protected:
cufftHandle create_plan_fwd(uint howmany) const;
{
public:
Fftw();
- void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales) override;
- void set_window(const MatDynMem &window) override;
- void forward(const MatScales &real_input, ComplexMat &complex_result) override;
- void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp) override;
- void inverse(ComplexMat &complex_input, MatScales &real_result) override;
- ~Fftw() override;
+ void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
+ void set_window(const MatDynMem &window);
+ void forward(const MatScales &real_input, ComplexMat &complex_result);
+ void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
+ void inverse(ComplexMat &complex_input, MatScales &real_result);
+ ~Fftw();
protected:
fftwf_plan create_plan_fwd(uint howmany) const;
class FftOpencv : public Fft
{
public:
- void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales) override;
- void set_window(const MatDynMem &window) override;
- void forward(const MatScales &real_input, ComplexMat &complex_result) override;
- void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp) override;
- void inverse(ComplexMat &complex_input, MatScales &real_result) override;
- ~FftOpencv() override;
+ void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
+ void set_window(const MatDynMem &window);
+ void forward(const MatScales &real_input, ComplexMat &complex_result);
+ void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
+ void inverse(ComplexMat &complex_input, MatScales &real_result);
+ ~FftOpencv();
private:
cv::Mat m_window;
};
#include "debug.h"
#include <limits>
-#ifdef FFTW
-#include "fft_fftw.h"
-#define FFT Fftw
-#elif defined(CUFFT)
-#include "fft_cufft.h"
-#define FFT cuFFT
-#else
-#include "fft_opencv.h"
-#define FFT FftOpencv
-#endif
-
#ifdef OPENMP
#include <omp.h>
#endif // OPENMP
#endif
#include "cnfeat.hpp"
-#include "fft.h"
+#ifdef FFTW
+#include "fft_fftw.h"
+#define FFT Fftw
+#elif defined(CUFFT)
+#include "fft_cufft.h"
+#define FFT cuFFT
+#else
+#include "fft_opencv.h"
+#define FFT FftOpencv
+#endif
#include "pragmas.h"
class Kcf_Tracker_Private;
double getFilterResponse() const; // Measure of tracking accuracy
private:
- Fft &fft;
+ FFT &fft;
// Initial pose of tracked object in internal image coordinates
// (scaled by p_downscale_factor if p_resize_image)