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.
|
|
|
#ifndef GOOGLE_TILE_H
|
|
|
|
#define GOOGLE_TILE_H
|
|
|
|
|
|
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
struct TileInfo
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
double north;
|
|
|
|
double south;
|
|
|
|
double east;
|
|
|
|
double west;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class googleTile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
googleTile();
|
|
|
|
~googleTile();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// 输出kml png
|
|
|
|
void ExportGeoPng(cv::Mat _pan, TileInfo info, std::string dir, std::string name);
|
|
|
|
|
|
|
|
// 输出tile
|
|
|
|
void ExportTile(cv::Mat _pan, TileInfo info, std::string dir, std::string name);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void generateTiles();
|
|
|
|
|
|
|
|
private:
|
|
|
|
cv::Mat image_;
|
|
|
|
std::vector<std::pair<double, double>> geoCorners_; // 左上、右上、右下、左下
|
|
|
|
int zoom_;
|
|
|
|
|
|
|
|
|
|
|
|
cv::Point2f latLonToGlobal(double lat, double lon);
|
|
|
|
std::pair<double, double> globalToLatLon(const cv::Point2f& pt);
|
|
|
|
cv::Mat computeHomography();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GOOGLE_TILE_H
|