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.

38 lines
861 B

#ifndef GOOGLE_TILE_H
#define GOOGLE_TILE_H
6 months ago
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
6 months ago
class googleTile
6 months ago
{
public:
struct TileInfo
6 months ago
{
int x;
int y;
double north;
double south;
double east;
double west;
};
6 months ago
googleTile(const cv::Mat& img, const std::vector<std::pair<double, double>>& geoCorners, int zoom, const std::string& outputDir);
6 months ago
void generateTiles();
6 months ago
private:
cv::Mat image_;
std::vector<std::pair<double, double>> geoCorners_; // 左上、右上、右下、左下
int zoom_;
std::string outputDir_;
cv::Point2f latLonToGlobal(double lat, double lon);
std::pair<double, double> globalToLatLon(const cv::Point2f& pt);
cv::Mat computeHomography();
void generateKML(const std::vector<TileInfo>& tiles);
};
#endif // GOOGLE_TILE_H