| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDICluster.hpp
Go to the documentation of this file.

    00001 /*
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular
    00017 purpose. The library provided hereunder is on an "as is" basis, and the
    00018 authors have no obligation to provide maintenance, support, updates,
    00019 enhancements, or modifications.
    00020 In no event shall INPE be held liable to any party
    00021 for direct, indirect, special, incidental, or consequential damages arising
    00022 out of the use of this library and its documentation.
    00023 */
    00024
    00025 #ifndef TEPDICLUSTER_HPP
    00026   #define TEPDICLUSTER_HPP
    00027
    00028 #include "TePDIRegion.hpp"
    00029 #include <iostream>
    00030 #include <vector>
    00031 #include "../kernel/TeAgnostic.h"
    00032
    00033 using namespace std;
    00034
    00041 class PDI_DLL TePDICluster
    00042 {
    00043   private:
    00047     int id;
    00048
    00052     int nbands;
    00053
    00057     int nElems;
    00058
    00062     long area;
    00063
    00067     long nreg;
    00068
    00072     vector<double> variance;
    00073
    00077     vector<double> eVec;
    00078
    00082     vector<double> e2Vec;
    00083
    00087     vector<double> mean;
    00088
    00092     TeMatrix covar;
    00093
    00097     TeMatrix lu;
    00098
    00102     double lndet;
    00103
    00107     bool initialized;
    00108
    00109   public:
    00110
    00114     TePDICluster()
    00115     { id = 0; nbands = 0; area = 0L; lndet = 0.0; initialized = false; };
    00116
    00121     TePDICluster( int nBands );
    00122
    00126     ~TePDICluster();
    00127
    00131     const TePDICluster& operator=( const TePDICluster& clu);
    00132
    00136     bool operator==(TePDICluster clu);
    00137
    00144     bool Init(int ident, TePDIRegion reg);
    00145
    00151     bool AddRegion(TePDIRegion reg);
    00152
    00158     double Distance(TePDIRegion reg);
    00159
    00165     double Distance(TePDICluster clu);
    00166
    00172     void SetId( int newid )
    00173     { id = newid; }
    00174
    00178     int GetId(){ return id; }
    00179
    00185     double Mean(int ind);
    00186
    00190     TeMatrix GetCovariance()
    00191     { return covar; }
    00192
    00196     long GetArea()
    00197     { return area; }
    00198
    00202     int GetNban()
    00203     { return nbands; }
    00204
    00208     double GetLnDet()
    00209     { return lndet; }
    00210
    00216     void Merge(TePDICluster clu);
    00217
    00221     bool GetInitialized()
    00222     { return initialized; }
    00223
    00227   void add( vector<double> pixValue );
    00228
    00232   double  dist( vector<double> pixValue )const;
    00233
    00239   double getVariance( int ind )const;
    00240
    00245   double maxVar()const;
    00246
    00251   int maxVarBand()const;
    00252
    00257   void resetCount();
    00258
    00263   void updateStatistics();
    00264
    00269   TePDICluster splitLeft()const;
    00270
    00275   TePDICluster splitRight()const;
    00276
    00281     void clear();
    00282
    00283 };
    00284
    00285 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines