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.

93 lines
2.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include "API_UnderStitch.h"
#include "opencv2/opencv.hpp"
#include "Arith_GeoSolver.h"
#include "Arith_FeaMatch.h"
#include "StitchStruct.h"
#include "Arith_BATask.h"
#include "FileCache.h"
#include "GoogleTile.h"
#include "Arith_BlendMap.h"
class UnderStitch :public API_UnderStitch
{
public:
UnderStitch(std::string cachedir = "./cache");
~UnderStitch();
UPanInfo Init(FrameInfo info);
void SetOutput(std::string filename, std::string outdir);
BYTE8 GeoStitch(GD_VIDEO_FRAME_S img, FrameInfo para);
// 实时裁切瓦片
void CutTileRealTime();
// 接收帧
SINT32 ReceiveFrame(GD_VIDEO_FRAME_S img, FrameInfo para);
// 处理帧
SINT32 ProcessFrame();
// 输出地理产品:kml png全景
bool ExportGeoPng();
//
bool ExportGoogleTile();
public:
GD_VIDEO_FRAME_S ExportPanAddr();
// 全景图地理信息计算
PointBLH getBLHFromPan(cv::Point2f ptInPan, cv::Mat _H_panPara);
cv::Point2f getPanXYFromBLH(PointBLH ptInBLH, cv::Mat _H_panPara);
private:
cv::Mat getAffineFromGeo2Pan(UPanInfo _pan);//计算全景图投影,从地理系到全景地图,统一计算
UPanInfo InitMap(FrameInfo info);
private:
vector<KeyType> _recvFrameKey;// 接收帧总表
FileCache<FrameCache>* _cache;//文件缓存,存储外部传入的原始帧信息以及预处理结果
private:
googleTile _googleProduct;
GeoSolver* _GeoSolver;//外参计算
FeatureMatcher* _FeaMatcher;//特征匹配
BA_Task* _BATask;//BA
MapBlend* _BlendTask;// 融合模块
private:
UPanInfo _panPara;//全景图配置
TileInfo _panTile;//全景图瓦片配置
cv::Mat _H_pan;//全景图投影矩阵:从地理系到全景地图
vector<TileInfo> _taskTilesVec;//划分的小瓦片方案
cv::Mat _panImage;
cv::Mat _panMask; //覆盖区域遮罩
int _totalFrameCnt;//处理帧计数
private:
string _kmlPath;
string _filename;//输出文件标识
string _outDir;//输出拼接成果路径
string _cacheDir;//缓存路径优先使用SSD
};