#pragma once #ifndef _STRAIN_H_ #define _STRAIN_H_ #include "oc_array.h" #include "oc_nearest_neighbor.h" #include "oc_poi.h" #include "oc_point.h" namespace opencorr { struct PointIndex //structure for brute force search { int poi_idx; //index the poi queue float distance; //Euclidean distance to the processed POI }; //calculation of Green-Lagrangian strain class Strain { private: std::vector instance_pool; NearestNeighbor* getInstance(int tid); protected: float subregion_radius; //radius of subregion int min_neighbor_num; //minimum number of neighbor POI required by fitting float zncc_threshold; //POI with ZNCC above this threshold is regarded available int description; //description of strain, 1 for Lagranian and 2 for Eulerian int approximation; //approximation of strain, 1 for Cauchy strain and 2 for Green strain int thread_number; //CPU thread number public: Strain(float subregion_radius, int min_neighbor_num, int thread_number); ~Strain(); float getSubregionRadius() const; int getMinNeighborNumber() const; float getZnccThreshold() const; void setSubregionRadius(float subregion_radius); void setMinNeighborNumer(int min_neighbor_num); void setZnccThreshold(float zncc_threshold); void setDescription(int description); //"1" for Lagrangian, "2" for Eulerian void setApproximation(int approximation); //"1" for Cauchy strain, "2" for Green strain void prepare(std::vector& poi_queue); void prepare(std::vector& poi_queue); void prepare(std::vector& poi_queue); void compute(POI2D* poi, std::vector& poi_queue); void compute(POI2DS* poi, std::vector& poi_queue); void compute(POI3D* poi, std::vector& poi_queue); void compute(std::vector& poi_queue); void compute(std::vector& poi_queue); void compute(std::vector& poi_queue); }; bool sortByDistance(const PointIndex& p1, const PointIndex& p2); }//namespace opencorr #endif //_STRAIN_H_