pktools  2.6.7
Processing Kernel for geospatial data
ImgRegression.h
1 /**********************************************************************
2 ImgRegression.h: class to calculate regression between two raster datasets
3 Copyright (C) 2008-2014 Pieter Kempeneers
4 
5 This file is part of pktools
6 
7 pktools is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 pktools is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with pktools. If not, see <http://www.gnu.org/licenses/>.
19 ***********************************************************************/
20 #ifndef _IMGREGRESSION_H_
21 #define _IMGREGRESSION_H_
22 
23 #include <vector>
24 #include "imageclasses/ImgReaderGdal.h"
25 #include "imageclasses/ImgWriterGdal.h"
26 #include "StatFactory.h"
27 
28 namespace imgregression
29 {
31  public:
32  ImgRegression(void);
33  ~ImgRegression(void);
34  double getRMSE(ImgReaderGdal& imgReader1, ImgReaderGdal& imgReader2, double &c0, double &c1, unsigned short b1=0, unsigned short b2=0, short verbose=0) const;
35  double getRMSE(ImgReaderGdal& imgReader, unsigned short b1, unsigned short b2, double& c0, double& c1, short verbose=0) const;
36  double getR2(ImgReaderGdal& imgReader1, ImgReaderGdal& imgReader2, double &c0, double &c1, unsigned short b1=0, unsigned short b2=0, short verbose=0) const;
37  double pgetR2(ImgReaderGdal& imgReader1, ImgReaderGdal& imgReader2, double& c0, double& c1, unsigned short band1, unsigned short band2, short verbose=0) const;
38  double getR2(ImgReaderGdal& imgReader, unsigned short b1, unsigned short b2, double& c0, double& c1, short verbose=0) const;
39  double pgetR2(ImgReaderGdal& imgReader, unsigned short band1, unsigned short band2, double& c0, double& c1, short verbose=0) const;
40 
41  void setThreshold(double theThreshold){m_threshold=theThreshold;};
42  void setDown(int theDown){m_down=theDown;};
43  private:
44  int m_down;
45  double m_threshold;
46  };
47 }
48 #endif //_IMGREGRESSION_H_