| 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/TePDICorrelationMatching.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 TEPDICORRELATIONMATCHING_HPP
    00026   #define TEPDICORRELATIONMATCHING_HPP
    00027
    00028   #include "TePDIAlgorithm.hpp"
    00029   #include "TePDIMatrix.hpp"
    00030
    00031   #include "../kernel/TeThreadParameters.h"
    00032   #include "../kernel/TeThread.h"
    00033   #include "../kernel/TeMutex.h"
    00034
    00098   class PDI_DLL TePDICorrelationMatching : public TePDIAlgorithm {
    00099     public :
    00100
    00105       TePDICorrelationMatching();
    00106
    00110       ~TePDICorrelationMatching();
    00111
    00121       bool CheckParameters( const TePDIParameters& parameters ) const;
    00122
    00123     protected :
    00124
    00129       typedef TePDIMatrix< double > ImgMatrixT;
    00130
    00135       class PDI_DLL CorrThread : public TeThread
    00136       {
    00137         public :
    00138
    00139           CorrThread( TePDIPIManager& progress, ImgMatrixT& bigMatrix,
    00140             ImgMatrixT& smallMatrix, TeMutex& mutex,
    00141             volatile unsigned int& nextLineToProcess, volatile bool& abortFlag,
    00142             volatile bool& bestCorValueFound,
    00143             volatile double& bestCorValue, volatile unsigned int& bestCorLine,
    00144             volatile unsigned int& bestCorCol, double dummyValue )
    00145             : progress_( progress ), returnValue_( false ),
    00146               abortFlag_( abortFlag ), bestCorValueFound_( bestCorValueFound ),
    00147               bestCorValue_( bestCorValue ),
    00148               bestCorLine_( bestCorLine ), bestCorCol_( bestCorCol ),
    00149               nextLineToProcess_( nextLineToProcess ), dummyValue_( dummyValue ),
    00150               bigMatrix_( bigMatrix ),
    00151               smallMatrix_( smallMatrix ), mutex_( mutex )
    00152             {
    00153             };
    00154
    00155           ~CorrThread() {};
    00156
    00157           inline bool getReturnValue() const
    00158           {
    00159             return returnValue_;
    00160           };
    00161
    00162         protected :
    00163
    00166           TePDIPIManager& progress_;
    00167
    00170           volatile bool returnValue_;
    00171
    00173           volatile bool& abortFlag_;
    00174
    00176           volatile bool& bestCorValueFound_;
    00177
    00179           volatile double& bestCorValue_;
    00180
    00182           volatile unsigned int& bestCorLine_;
    00183
    00185           volatile unsigned int& bestCorCol_;
    00186
    00188           volatile unsigned int& nextLineToProcess_;
    00189
    00191           double dummyValue_;
    00192
    00194           ImgMatrixT& bigMatrix_;
    00195
    00197           ImgMatrixT& smallMatrix_;
    00198
    00200           TeMutex& mutex_;
    00201
    00202           //overload
    00203           void run();
    00204       };
    00205
    00211       bool RunImplementation();
    00212
    00219       void ResetState( const TePDIParameters& params );
    00220
    00228       static bool loadImage( const TeThreadParameters& params );
    00229
    00237       static void matrix2Tiff(
    00238         const ImgMatrixT& input_matrix,
    00239         const std::string& out_file_name,
    00240         const std::vector< TeCoord2D >& maxima_points );
    00241
    00252       static void raster2Tiff(
    00253         const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
    00254         unsigned int raster_channel,
    00255         const std::string& out_file_name,
    00256         const std::vector< TeCoord2D >& maxima_points,
    00257         const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
    00258         unsigned int tie_points_space );
    00259
    00265       bool checkTPs(
    00266         const TeCoordPairVect& tpsvec ) const;
    00267   };
    00268
    00273 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines