Loading...
Searching...
No Matches
WishartModel.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/rp/radar/WishartModel.h
22 \brief Wishart model data manipulation.
23*/
24
25#ifndef __TERRALIB_RP_RADAR_INTERNAL_WISHARTMODEL_H
26#define __TERRALIB_RP_RADAR_INTERNAL_WISHARTMODEL_H
27
28// TerraLib includes
29#include "../Config.h"
30#include "../../raster/Raster.h"
31#include "../../geometry/Polygon.h"
32
33// Boost includes
34#include <boost/numeric/ublas/matrix.hpp>
35#include <boost/math/distributions/chi_squared.hpp>
36
37#include <vector>
38#include <map>
39
40namespace te
41{
42 namespace rp
43 {
44 namespace radar
45 {
46 typedef std::complex< double > WishartFeatureType;
47 /*!
48 \class WishartModel
49
50 \brief Wishart model data manipulation.
51 */
53 {
54 public:
55
56 te::rst::Raster* m_inputRasterPtr; //!< Input raster.
57
58 std::vector< unsigned int > m_inputRastersBands; //!< Bands to process.
59
60 unsigned int m_numberOfColumns; //!< Number of columns that all input rasters must have.
61
62 unsigned int m_numberOfRows; //!< Number of rows that all input rasters must have.
63
64 std::vector< te::gm::Polygon* > m_polygonsSegImage; //!< Polygons of segmented image.
65
66 std::vector< te::gm::Polygon > m_polygonSamplesT; //!< Training samples polygons.
67 std::vector< std::vector< double > > m_polygonSamplesTNew; //!< Training samples polygons.
68 std::vector< int > m_numberOfSamples;
69
70 std::vector< unsigned int > m_classesIDT; //!< Training class ID.
71
72 typedef unsigned int ClassIDT; //!< Class ID type definiton.
73
74 typedef std::vector< WishartFeatureType > ClassSampleT; //!< Class sample type definition.
75
76 typedef std::vector< ClassSampleT > ClassSamplesContainerT; //!< Class samples container type definition.
77
78 typedef std::map< ClassIDT, ClassSamplesContainerT > MClassesSamplesCT; //!< Multi-classes samples container type definition.
79
80 typedef boost::shared_ptr< MClassesSamplesCT > MClassesSamplesCTPtr; //!< A shared pointer to a multi classes samples container type definition.
81
82 MClassesSamplesCTPtr m_trainSamplesPtr; //!< A shared pointer to a always-valid structure where training samples are stored.
83
84 ClassSamplesContainerT m_sigmaClassesParameter; //!< Sigma classes parameter.
85
86 std::vector< boost::numeric::ublas::matrix< WishartFeatureType > > m_sigmaClassesParameterMatrix;
87 //!< Sigma classes parameter matrix.
88
89 std::vector< unsigned int > m_classesIndex2ID; //!< A class index ordered vector of classes IDs for Sigma parameter.
90
91 ClassSamplesContainerT m_sigmaRegionsParameter; //!< Sigma regions parameter.
92
93 std::vector< boost::numeric::ublas::matrix< WishartFeatureType > > m_sigmaRegionsParameterMatrix; //!< Sigma regions parameter matrix.
94
95 std::string m_radarDataRepresentationType; //!< The radar data representation container (covarianceMatrix,lexicographicVector).
96
97 unsigned int m_vectorOrMatrixOrder; //!< The lexicographic vector and covariance matrix order.
98
99 double m_ENL; //!< Equivalent Number Look type.
100
101 unsigned int m_lagX; //!< The horizontal correlation value.
102
103 unsigned int m_lagY; //!< The vertical correlation value.
104
105 double m_betaValue; //!< Beta value for Renyi distance type.
106
107 double m_significanceLevel; //!< The significance level.
108
110 //!< The stochastic distance type definition.
111
112 std::vector < std::vector< double > > m_stochasticDistance; //!< Stochastic distance container.
113
114 std::vector < std::vector< double > > m_statisticalTest; //!< Statistical test container.
115
116 std::vector< std::vector< double > > m_pValue; //!< P-values container.
117
118 std::vector< double > m_regionsSize; //!< Size of regions.
119
120 std::vector< double > m_samplesSize; //!< Size of sample containers.
121
122 /*! \brief Constructor. */
124
125 /*! \brief Destructor. */
127
128 boost::numeric::ublas::matrix< WishartFeatureType > checkCovarianceMatrix(boost::numeric::ublas::matrix< WishartFeatureType >);
129
131
132 bool LoadingSamples(void);
133
135
137
139
141
142 bool execute(void);
143 };
144
145 } // end namespace radar
146 } // end namespace rp
147} // end namespace msc
148
149#endif
150
151
Wishart model data manipulation.
Definition: WishartModel.h:53
double m_significanceLevel
The significance level.
Definition: WishartModel.h:107
double m_betaValue
Beta value for Renyi distance type.
Definition: WishartModel.h:105
unsigned int m_lagX
The horizontal correlation value.
Definition: WishartModel.h:101
std::map< ClassIDT, ClassSamplesContainerT > MClassesSamplesCT
Multi-classes samples container type definition.
Definition: WishartModel.h:78
double m_ENL
Equivalent Number Look type.
Definition: WishartModel.h:99
std::vector< std::vector< double > > m_stochasticDistance
Stochastic distance container.
Definition: WishartModel.h:112
std::vector< unsigned int > m_classesIDT
Training class ID.
Definition: WishartModel.h:70
std::vector< std::vector< double > > m_statisticalTest
Statistical test container.
Definition: WishartModel.h:114
te::rst::Raster * m_inputRasterPtr
Input raster.
Definition: WishartModel.h:56
unsigned int m_vectorOrMatrixOrder
The lexicographic vector and covariance matrix order.
Definition: WishartModel.h:97
boost::numeric::ublas::matrix< WishartFeatureType > checkCovarianceMatrix(boost::numeric::ublas::matrix< WishartFeatureType >)
std::vector< ClassSampleT > ClassSamplesContainerT
Class samples container type definition.
Definition: WishartModel.h:76
unsigned int ClassIDT
Class ID type definiton.
Definition: WishartModel.h:72
unsigned int m_numberOfRows
Number of rows that all input rasters must have.
Definition: WishartModel.h:62
std::string m_stochasticDistanceType
The stochastic distance type definition.
Definition: WishartModel.h:109
std::string m_radarDataRepresentationType
The radar data representation container (covarianceMatrix,lexicographicVector).
Definition: WishartModel.h:95
std::vector< WishartFeatureType > ClassSampleT
Class sample type definition.
Definition: WishartModel.h:74
std::vector< int > m_numberOfSamples
Definition: WishartModel.h:68
std::vector< te::gm::Polygon > m_polygonSamplesT
Training samples polygons.
Definition: WishartModel.h:66
std::vector< te::gm::Polygon * > m_polygonsSegImage
Polygons of segmented image.
Definition: WishartModel.h:64
unsigned int m_numberOfColumns
Number of columns that all input rasters must have.
Definition: WishartModel.h:60
std::vector< double > m_regionsSize
Size of regions.
Definition: WishartModel.h:118
boost::shared_ptr< MClassesSamplesCT > MClassesSamplesCTPtr
A shared pointer to a multi classes samples container type definition.
Definition: WishartModel.h:80
std::vector< boost::numeric::ublas::matrix< WishartFeatureType > > m_sigmaRegionsParameterMatrix
Sigma regions parameter matrix.
Definition: WishartModel.h:93
std::vector< unsigned int > m_inputRastersBands
Bands to process.
Definition: WishartModel.h:58
unsigned int m_lagY
The vertical correlation value.
Definition: WishartModel.h:103
std::vector< double > m_samplesSize
Size of sample containers.
Definition: WishartModel.h:120
MClassesSamplesCTPtr m_trainSamplesPtr
A shared pointer to a always-valid structure where training samples are stored.
Definition: WishartModel.h:82
std::vector< std::vector< double > > m_pValue
P-values container.
Definition: WishartModel.h:116
std::vector< unsigned int > m_classesIndex2ID
A class index ordered vector of classes IDs for Sigma parameter.
Definition: WishartModel.h:89
bool GettingCompleteSigmaMatrixes(void)
ClassSamplesContainerT m_sigmaRegionsParameter
Sigma regions parameter.
Definition: WishartModel.h:91
ClassSamplesContainerT m_sigmaClassesParameter
Sigma classes parameter.
Definition: WishartModel.h:84
std::vector< boost::numeric::ublas::matrix< WishartFeatureType > > m_sigmaClassesParameterMatrix
Sigma classes parameter matrix.
Definition: WishartModel.h:86
std::vector< std::vector< double > > m_polygonSamplesTNew
Training samples polygons.
Definition: WishartModel.h:67
An abstract class for raster data strucutures.
Definition: Raster.h:72
std::complex< double > WishartFeatureType
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139