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.
69 lines
1.4 KiB
69 lines
1.4 KiB
|
|
|
|
#pragma once
|
|
|
|
#ifndef _DIC_H_
|
|
#define _DIC_H_
|
|
|
|
#include "oc_array.h"
|
|
#include "oc_image.h"
|
|
#include "oc_poi.h"
|
|
#include "oc_subset.h"
|
|
|
|
namespace opencorr
|
|
{
|
|
//structure for brute force searching
|
|
struct KeypointIndex
|
|
{
|
|
int kp_idx; //index in keypoint queue
|
|
float distance; //Euclidean distance to the POI
|
|
};
|
|
|
|
class DIC
|
|
{
|
|
public:
|
|
Image2D* ref_img = nullptr;
|
|
Image2D* tar_img = nullptr;
|
|
|
|
int subset_radius_x, subset_radius_y;
|
|
int thread_number; //OpenMP thread number
|
|
|
|
DIC();
|
|
virtual ~DIC() = default;
|
|
|
|
void setImages(Image2D& ref_img, Image2D& tar_img);
|
|
void setSubsetRadius(int radius_x, int radius_y);
|
|
|
|
virtual void prepare();
|
|
virtual void compute(POI2D* poi) = 0;
|
|
virtual void compute(std::vector<POI2D>& poi_queue) = 0;
|
|
|
|
};
|
|
|
|
class DVC
|
|
{
|
|
public:
|
|
Image3D* ref_img = nullptr;
|
|
Image3D* tar_img = nullptr;
|
|
|
|
int subset_radius_x, subset_radius_y, subset_radius_z;
|
|
int thread_number; //OpenMP thread number
|
|
|
|
DVC();
|
|
virtual ~DVC() = default;
|
|
|
|
void setImages(Image3D& ref_img, Image3D& tar_img);
|
|
void setSubsetRadius(int radius_x, int radius_y, int radius_z);
|
|
|
|
virtual void prepare();
|
|
virtual void compute(POI3D* POI) = 0;
|
|
virtual void compute(std::vector<POI3D>& poi_queue) = 0;
|
|
};
|
|
|
|
bool sortByZNCC(const POI2D& p1, const POI2D& p2);
|
|
|
|
bool sortByDistance(const KeypointIndex& kp1, const KeypointIndex& kp2);
|
|
|
|
}//namespace opencorr
|
|
|
|
#endif //_DIC_H_
|
|
|