All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClassifierSAMStrategy.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/ClassifierSAMStrategy.h
22  \brief Spectral Angle Mapper classification strategy.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_CLASSIFIERSAMSTRATEGY_H
26 #define __TERRALIB_RP_INTERNAL_CLASSIFIERSAMSTRATEGY_H
27 
28 #include "ClassifierStrategy.h"
30 #include "Config.h"
31 
32 namespace te
33 {
34  namespace rp
35  {
36  /*!
37  \class ClassifierSAMStrategy
38 
39  \brief Spectral Angle Mapper classification strategy.
40 
41  \details This algorithm maps the spectral similarity of input raster
42  to the given reference spectra wich can be either laboratory of field spectra.
43  This method assumes that the data have been reduced to apparent reflectance
44  with all dark current and path radiance biases removed.
45  Reference: The spectral image processing system (SIPS)- interactive
46  visualization and analysis of imaging spectrometer data. Kruse, F. A.;
47  Lefkoff, A. B.; Boardman, J. W.; Heidebrecht, K. B.; Shapiro, A. T.;
48  Barloon, P. J.; Goetz, A. F. H. The earth and space science information
49  system (ESSIS). AIP Conference Proceedings, Volume 283, pp. 192-201 (1993).
50  */
52  {
53  public:
54 
55  typedef unsigned int ClassIDT; //!< Class ID type definition (zero means invalid ID).
56 
57  typedef std::vector< double > SampleT; //!< Class sample type definition.
58 
59  typedef std::vector< SampleT > SamplesT; //!< Class samples container type definition.
60 
61  typedef std::map< ClassIDT, SamplesT > ClassesSamplesT; //!< Classes samples container type definition.
62 
63  /*!
64  \class Parameters
65 
66  \brief Classifier Parameters
67  */
69  {
70  public:
71 
72  ClassesSamplesT const* m_trainSamplesPtr; //!< A pointer to a always-valid structure where trainning samples are stored.
73 
74  std::vector< double > m_maxAngularDistances; //!< This is a vector of maximum acceptable angles (radians) between one pixel spectra and the reference spectra for each class (pixels with angular distance higher than this value will not be classifyed as belonging to each class (common used default:0.1 radians).
75 
76  Parameters();
77 
78  ~Parameters();
79 
80  //overload
81  const Parameters& operator=(const Parameters& params);
82 
83  //overload
84  void reset() throw( te::rp::Exception );
85 
86  //overload
87  AbstractParameters* clone() const;
88  };
89 
91 
93 
94  //overload
95  bool initialize(StrategyParameters const* const strategyParams) throw(te::rp::Exception);
96 
97  //overload
98  bool execute(const te::rst::Raster& inputRaster, const std::vector<unsigned int>& inputRasterBands,
99  const std::vector<te::gm::Polygon*>& inputPolygons, te::rst::Raster& outputRaster,
100  const unsigned int outputRasterBand, const bool enableProgressInterface) throw(te::rp::Exception);
101 
102  protected :
103 
104  bool m_isInitialized; //!< Is this instance initialized?
105 
106  ClassifierSAMStrategy::Parameters m_initParams; //!< Initialization parameters.
107 
108  SamplesT m_classesMeans; //!< Classes means.
109 
110  std::vector< ClassIDT > m_classesIndex2ID; //!< An class index ordered vector of classes IDs;
111  };
112 
113  /*!
114  \class ClassifierSAMStrategyFactory
115 
116  \brief Spectral Angle Mapper strategy factory.
117  */
119  {
120  public:
121 
123 
125 
126  //overload
128  };
129 
130  } // end namespace rp
131 } // end namespace te
132 
133 #endif // __TERRALIB_RP_INTERNAL_CLASSIFIERSAMSTRATEGY_H
134 
Spectral Angle Mapper strategy factory.
Raster strategy parameters base class.
std::vector< double > m_maxAngularDistances
This is a vector of maximum acceptable angles (radians) between one pixel spectra and the reference s...
std::vector< double > SampleT
Class sample type definition.
std::vector< SampleT > SamplesT
Class samples container type definition.
Spectral Angle Mapper classification strategy.
Raster classifier strategy base class.
std::map< ClassIDT, SamplesT > ClassesSamplesT
Classes samples container type definition.
Raster classifier strategy factory base class.
Configuration flags for the Raster Processing module of TerraLib.
ClassesSamplesT const * m_trainSamplesPtr
A pointer to a always-valid structure where trainning samples are stored.
unsigned int ClassIDT
Class ID type definition (zero means invalid ID).
Raster classifier strategy base class.
Raster classifier strategy factory base class.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:91