#pragma once #ifndef BASETOOL_H #define BASETOOL_H #include "BaseConstVariable.h" /// /// 基本类、基本函数 /// // //#include #include #include #include #include #include #include #include #include #include #include #include #include #include "GeoOperator.h" #include #include #include #include #include "LogInfoCls.h" ///////////////////////////////////// 运行时间打印 ///////////////////////////////////////////////////////////// QString getCurrentTimeString(); QString getCurrentShortTimeString(); std::vector splitString(const QString& str, char delimiter); std::vector convertQStringListToStdVector(const QStringList& qStringList); /////////////////////////////// 基本图像类 结束 ///////////////////////////////////////////////////////////// std::string Convert(float Num); QString JoinPath(const QString& path, const QString& filename); ////////////////////////////// 坐标部分基本方法 ////////////////////////////////////////// ////////////////////////////// 坐标部分基本方法 ////////////////////////////////////////// ////////////////////////////// 插值 //////////////////////////////////////////// std::complex Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX> img); std::complex Cubic_kernel_weight(double s); double Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12,Landpoint p22); bool onSegment(Point3 Pi, Point3 Pj, Point3 Q); Point3 invBilinear(Point3 p, Point3 a, Point3 b, Point3 c, Point3 d); // // WGS84 到J2000 坐标系的变换 // 参考网址:https://blog.csdn.net/hit5067/article/details/116894616 // 资料网址:http://celestrak.org/spacedata/ // 参数文件: // a. Earth Orientation Parameter 文件: http://celestrak.org/spacedata/EOP-Last5Years.csv // b. Space Weather Data 文件: http://celestrak.org/spacedata/SW-Last5Years.csv // 备注:上述文件是自2017年-五年内 /** 在wgs84 坐标系转到J2000 坐标系 主要 涉及到坐标的相互转换。一般给定的WGS坐标为 给定时刻的 t ,BLH 转换步骤: step 1: WGS 84 转换到协议地球坐标系 step 2: 协议地球坐标系 转换为瞬时地球坐标系 step 3: 瞬时地球坐标系 转换为 瞬时真天球坐标系 step 4: 瞬时真天球坐标系 转到瞬时平天球 坐标系 step 5: 瞬时平天球坐标系转换为协议天球坐标系(J2000) **/ double sind(double degree); double cosd(double d); // 插值 ErrorCode polyfit(const double* x, const double* y, int xyLength, int poly_n, std::vector& out_factor, double& out_chisq); // 叉乘 Point3 crossProduct(const Point3& a, const Point3& b); Eigen::Matrix3d rotationMatrix(const Eigen::Vector3d& axis, double angle); long double convertToMilliseconds(const std::string& dateTimeStr); /// /// list 应该是按照从小到大的顺序排好 /// /// /// /// long FindValueInStdVector(std::vector& list,double& findv); long InsertValueInStdVector(std::vector& list, double insertValue, bool repeatValueInsert = false); long FindValueInStdVectorLast(std::vector& list, double& findv); ErrorCode polynomial_fit(const std::vector& x, const std::vector& y, int degree, std::vector& out_factor, double& out_chisq); QVector SatellitePos2SatelliteAntPos(QVector poses); QVector SatelliteAntPos2SatellitePos(QVector poses); #endif