xuepengqiang
2020-05-26 48bf06c1cadadcfb93faa8df63db71e59b534f55
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
45
46
47
48
//
// Created by Scheaven on 2020/5/20.
//
 
#ifndef INC_01_COORDINATE_TRANSFORMATION_SWITCHER_UTIL_H
#define INC_01_COORDINATE_TRANSFORMATION_SWITCHER_UTIL_H
 
#include "opencv2/opencv.hpp"
#pragma comment(lib, "opencv_core249.lib")
 
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <math.h>
#include "stdio.h"
#include "stdlib.h"
#include "con_target.h"
#include "homography_util.h"
 
using namespace std;
 
class CoordSwitcher
{
private:
    vector<uchar> inliers;
    vector<vector<SPoint2f>> reg_points_vec;
    float s_homography[3][3];
//    vector<float[3][3]> homography_vec;
    static SHomogtaphy* SHomogtaphy_pointer;
    static CoordSwitcher* instance;
public:
    void initHomography(CamVec *CV_Reg); 
    static CoordSwitcher* getInstance(CamVec *CV_Reg);
    CoordSwitcher(); 
    CoordSwitcher(CamVec *CV_Reg); 
    ~CoordSwitcher();
 
    // 转换坐标
    SPoint2f getTransPoint(const SPoint2f rightPoint, SMatrix& matrix);
 
    float compare(SPoint2f A, SPoint2f B, int h_index);
    float compare(float Ax, float Ay, float Bx, float By);
};
 
 
 
#endif //INC_01_COORDINATE_TRANSFORMATION_SWITCHER_UTIL_H