#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(SINT32 nWidth, SINT32 nHeight); ~UnderStitch(); UPanInfo Init(FrameInfo info); BYTE8 GeoStitch(GD_VIDEO_FRAME_S img, FrameInfo para); // 接收帧 SINT32 ReceiveFrame(GD_VIDEO_FRAME_S img, FrameInfo para); // 处理帧 SINT32 ProcessFrame(); // 输出地理产品:kml png全景 bool ExportGeoPng(std::string dir, std::string name); // bool ExportGoogleTile(std::string dir, std::string name); 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 _recvFrameKey;// 接收帧总表 FileCache* _cache;//文件缓存,存储外部传入的原始帧信息以及预处理结果 private: googleTile _googleProduct; GeoSolver* _GeoSolver;//外参计算 FeatureMatcher* _FeaMatcher;//特征匹配 BA_Task* _BATask;//BA MapBlend* _BlendTask;// 融合模块 UPanInfo _panPara;//全景图配置 cv::Mat _H_pan;//全景图投影矩阵:从地理系到全景地图 cv::Mat _panImage; cv::Mat _panMask; //覆盖区域遮罩 int _totalFrameCnt;//处理帧计数 };