This repository has been archived by the owner on Oct 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrbf.h
44 lines (33 loc) · 1.35 KB
/
rbf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef RBF_H
#define RBF_H
#include <vector>
#include <opencv2/core/core.hpp>
class RBF
{
private:
cv::Mat m_data_inv;
std::vector<cv::Point2f> m_oriSpace;
std::vector<cv::Point2f> m_defSpace;
std::vector<cv::Point2f> m_S;
static void initDataMatrix(const std::vector<cv::Point2f>& origPList,
cv::Mat* data_inv);
static bool generateSModificator(const std::vector<cv::Point2f>& oriSpace,
const std::vector<cv::Point2f>& defSpace,
const cv::Mat& data_inv,
std::vector<cv::Point2f>& S);
static bool modifyPoints(std::vector<cv::Point2f>* pList,
const std::vector<cv::Point2f>& oriSpace,
const std::vector<cv::Point2f>& S);
public:
RBF(){}
~RBF(){}
void setOriginalSpace(const std::vector<cv::Point2f>& oriSpace);
bool setDeformedSpace(const std::vector<cv::Point2f>& defSpace);
bool interpolate(const std::vector<cv::Point2f>& oriPoints,
std::vector<cv::Point2f>* defPoints);
static bool interpolate(const std::vector<cv::Point2f>& oriSpace,
const std::vector<cv::Point2f>& defSpace,
const std::vector<cv::Point2f>& oriPoints,
std::vector<cv::Point2f>* defPoints);
};
#endif // RBF_H