//
|
// 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
|