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.

73 lines
1.8 KiB

6 months ago
// 全局BA
/*********版权所有C2025武汉高德红外股份有限公司***************************************
* Arith_BAProc.h
* BA
*
*
* V0.5
* 04046wcw
* 2025/01/15
*
*****************************************************************************************/
#pragma once
#include "StitchStruct.h"
6 months ago
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include "Arith_GeoStitcher.h"
#include "Arith_FeaMatch.h"
6 months ago
using cv::Mat_;
class BA_Task
{
public:
6 months ago
BA_Task(GeoStitcher* pGeoTrans);
6 months ago
~BA_Task();
6 months ago
// 加入优化帧
6 months ago
SINT32 addFrame(GD_VIDEO_FRAME_S img, FrameInfo para);
6 months ago
// 设置全景参数
void setPanPara(PanInfo info);
6 months ago
void Test();
6 months ago
// BA优化
void optimizeBA(cv::Mat H_pan);
6 months ago
// 使用地理系H矩阵和全景图H重投影所有帧
void remap(vector<cv::Mat_<double>>H_Vec, cv::Mat_<double > H_pan, std::string winname);
6 months ago
private:
SINT32 CalMatchMat(float fiou_thre);//计算匹配性矩阵(以IOU约束)
6 months ago
private:
6 months ago
GeoStitcher* _GeoStitcher;//外参计算
FeatureMatcher* _FeaMatcher;//特征匹配
PanInfo _panPara;//全景图配置
6 months ago
6 months ago
private:
Mat_<int> _MatchMat;//配准点邻接表
Mat_<float> _IOUMat;//交汇邻接表
6 months ago
vector<cv::Mat_<double>> _origMatrix;//初始H矩阵
vector<cv::Mat_<double>> _currMatrix;//当前H矩阵
6 months ago
//超大空间考虑文件cache todo
private:
vector<cv::Mat> _imgVec;//图像缓存
6 months ago
vector<vector<cv::KeyPoint>> _FeaPtVec;//特征点缓存
vector<cv::Mat> _FeaDespVec;//特征点描述子
vector<FrameInfo> _paraVec;
vector<vector<cv::Point2f>> _polygon;//帧包围四边形
6 months ago
};
6 months ago
6 months ago
6 months ago
6 months ago
void drawPolygons(cv::Mat& image, const std::vector<std::vector<cv::Point2f>>& polygons);