You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.7 KiB
76 lines
1.7 KiB
3 months ago
|
|
||
|
#pragma once
|
||
|
|
||
|
#ifndef _FFTCC_H_
|
||
|
#define _FFTCC_H_
|
||
|
|
||
|
#include <vector>
|
||
|
#include "fftw3.h"
|
||
|
|
||
|
#include "oc_array.h"
|
||
|
#include "oc_dic.h"
|
||
|
#include "oc_image.h"
|
||
|
#include "oc_poi.h"
|
||
|
#include "oc_point.h"
|
||
|
#include "oc_subset.h"
|
||
|
|
||
|
namespace opencorr
|
||
|
{
|
||
|
class FFTW
|
||
|
{
|
||
|
public:
|
||
|
float* ref_subset;
|
||
|
float* tar_subset;
|
||
|
float* zncc;
|
||
|
fftwf_complex* ref_freq;
|
||
|
fftwf_complex* tar_freq;
|
||
|
fftwf_complex* zncc_freq;
|
||
|
fftwf_plan ref_plan;
|
||
|
fftwf_plan tar_plan;
|
||
|
fftwf_plan zncc_plan;
|
||
|
|
||
|
static FFTW* allocate(int subset_radius_x, int subset_radius_y);
|
||
|
static FFTW* allocate(int subset_radius_x, int subset_radius_y, int subset_radius_z);
|
||
|
|
||
|
static void release(FFTW* instance);
|
||
|
|
||
|
static void reallocate(FFTW* instance, int subset_radius_x, int subset_radius_y);
|
||
|
static void reallocate(FFTW* instance, int subset_radius_x, int subset_radius_y, int subset_radius_z);
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
class FFTCC2D : public DIC
|
||
|
{
|
||
|
private:
|
||
|
std::vector<FFTW*> instance_pool; //pool of FFTW instances for multi-thread processing
|
||
|
FFTW* getInstance(int tid); //get an instance according to the number of current thread id
|
||
|
|
||
|
public:
|
||
|
FFTCC2D(int subset_radius_x, int subset_radius_y, int thread_number);
|
||
|
~FFTCC2D();
|
||
|
|
||
|
void compute(POI2D* poi);
|
||
|
void compute(std::vector<POI2D>& poi_queue);
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
class FFTCC3D : public DVC
|
||
|
{
|
||
|
private:
|
||
|
std::vector<FFTW*> instance_pool; //pool of FFTW instances for multi-thread processing
|
||
|
FFTW* getInstance(int tid); //get an instance according to the number of current thread id
|
||
|
|
||
|
public:
|
||
|
FFTCC3D(int subset_radius_x, int subset_radius_y, int subset_radius_z, int thread_number);
|
||
|
~FFTCC3D();
|
||
|
|
||
|
void compute(POI3D* poi);
|
||
|
void compute(std::vector<POI3D>& poi_queue);
|
||
|
};
|
||
|
|
||
|
}//namespace opencorr
|
||
|
|
||
|
#endif //_FFTCC_H_
|