代码拉取完成,页面将自动刷新
#ifndef _AREA_INTEGRATOR_HXX_
#define _AREA_INTEGRATOR_HXX_
#include <vector>
#include <map>
#include "GeoTiffImage.hxx"
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv2/opencv.hpp>
#include <string.h>
struct AILabel
{
    int Index;
    std::string Name;
    double Area;
    AILabel()
    {
        Index = 0;
        Name = "None";
        Area = 0.0;
    }
    AILabel(int idx, std::string name)
    {
        Index = idx;
        Name = name;
        Area = 0.0;
    }
};
class AreaIntegrator
{
public:
    AreaIntegrator();
    inline void setLabelFile(const char* labelFile) { strcpy(_labelFileName, labelFile); }
    inline void setDEMFile(const char* demFile) { strcpy(_demFileName, demFile); }
    inline void setOrthFile(const char* orthoFile) { strcpy(_orthoFileName, orthoFile); }
    inline void addLabel(AILabel label ) { _labels[label.Index] = label; }
    inline std::map<int, AILabel> getLabels() { return _labels; }
public: 
    bool computeAreas();
private:
    void computeLabelAreas();
    double computePixelArea(const int ix, const int iy, const double* upperRow, const double* centerRow, const double* lowerRow);
    double getDEMValue(float px, float py);
    void computeDEMRows(int rowIdx, double* upperRow, double* centerRow, double* lowerRow);
private:
    std::map<int, AILabel> _labels;
    char _labelFileName[256];
    char _demFileName[256];
    char _orthoFileName[256];
    GeoTiffImage* _orthoImage;
    GeoTiffImage* _demImage;
    cv::Mat _labelImage;
    cv::Mat _labelPalette;
};
#endif 
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
 马建仓 AI 助手
马建仓 AI 助手