TerraLib 4.1
TePDICorrelationMatching Class Reference

Area matching using correlation ( only offset distortion is supported ). More...

#include <TePDICorrelationMatching.hpp>

Inheritance diagram for TePDICorrelationMatching:
TePDIAlgorithm

List of all members.

Classes

class  CorrThread
 Correlation thread class. More...

Public Member Functions

 TePDICorrelationMatching ()
 Default Constructor.
 ~TePDICorrelationMatching ()
 Default Destructor.
bool CheckParameters (const TePDIParameters &parameters) const
 Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

Protected Types

typedef TePDIMatrix< double > ImgMatrixT
 A type definition for a image matrix.

Protected Member Functions

bool RunImplementation ()
 Runs the current algorithm implementation.
void ResetState (const TePDIParameters &params)
 Reset the internal state to the initial state.
bool checkTPs (const TeCoordPairVect &tpsvec) const
 Check tie-points indexes for repeated values.

Static Protected Member Functions

static bool loadImage (const TeThreadParameters &params)
 A thread entry point to load raster data into a simple matrix.
static void matrix2Tiff (const ImgMatrixT &input_matrix, const std::string &out_file_name, const std::vector< TeCoord2D > &maxima_points)
 Save the output matrix to a geotiff file.
static void raster2Tiff (const TePDITypes::TePDIRasterPtrType &input_raster_ptr, unsigned int raster_channel, const std::string &out_file_name, const std::vector< TeCoord2D > &maxima_points, const TeSharedPtr< TeCoordPairVect > &out_tie_points_ptr, unsigned int tie_points_space)
 Save the output matrix to a geotiff file.

Detailed Description

Area matching using correlation ( only offset distortion is supported ).

Author:
Emiliano F. Castejon <castejon@dpi.inpe.br>
Note:
Better used for searching a small image inside a big image.
The required parameters are:
Parameters:
input_image1_ptr(TePDITypes::TePDIRasterPtrType) - The input image 1.
input_channel1( unsigned int ) - Band to process from input_image1.
input_image2_ptr(TePDITypes::TePDIRasterPtrType) - The input image 2.
input_channel2( unsigned int ) - Band to process from input_image2.
out_tie_points_ptr( TeSharedPtr< TeCoordPairVect > ) - The output tie- points where TeCoordPair.pt1 are input_image1 matricial indexes and TeCoordPair.pt2 are input_image2 matricial indexes.
Note:
The Optional parameters are:
Parameters:
input_box1( TeBox ) - Box (image matrix coords) to process from input_image1 ( the entire image will be used if no box was supplied )
input_box2( TeBox ) - Box (image matrix coords) to process from input_image2 ( the entire image will be used if no box was supplied )
enable_multi_thread(int) - If present (any value) a multi-threaded processing will be used; Some TeDecoders do not support multi-thread so use it with cation (default: multi-thread disabled).
enable_threaded_raster_read(int) - If present (any value) a multi-threaded input rasters data reading will be performed if enable_multi_thread is also enabled; Some TeDecoders do not support multi-thread so use it with caution (default: multi-threaded raster read disabled).
pixel_x_relation(double) - The pixel resolution relation pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
pixel_y_relation(double) - The pixel resolution relation pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);
max_size_opt(unsigned int) - The maximum image box allowed size (size = pixels number = lines * columns); when the images pixels number exceed this value a downsample will be performed for optimization (default value=0 wich means optimization disabled).
best_cor_value_ptr(double*) - A pointer to an output double variable where to store the best found correlation value.
dummy_value(double) - Force a dummy value (image elements with dummy values are discarted - default = 0).
Examples:

TePDICorrelationMatching_test.cpp.


Member Typedef Documentation

A type definition for a image matrix.


Constructor & Destructor Documentation

TePDICorrelationMatching::TePDICorrelationMatching ( )

Default Constructor.

TePDICorrelationMatching::~TePDICorrelationMatching ( )

Default Destructor.


Member Function Documentation

bool TePDICorrelationMatching::CheckParameters ( const TePDIParameters parameters) const [virtual]

Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

Note:
Error log messages must be generated. No exceptions generated.
Parameters:
parametersThe parameters to be checked.
Returns:
true if the parameters are OK. false if not.

Implements TePDIAlgorithm.

bool TePDICorrelationMatching::checkTPs ( const TeCoordPairVect tpsvec) const [protected]

Check tie-points indexes for repeated values.

Parameters:
maximasTie-points vector.
Returns:
true if OK, false on errors.
bool TePDICorrelationMatching::loadImage ( const TeThreadParameters params) [static, protected]

A thread entry point to load raster data into a simple matrix.

Parameters:
paramsThe parameters needed for the thread execution.
Returns:
true if OK, false on errors.
void TePDICorrelationMatching::matrix2Tiff ( const ImgMatrixT input_matrix,
const std::string out_file_name,
const std::vector< TeCoord2D > &  maxima_points 
) [static, protected]

Save the output matrix to a geotiff file.

Parameters:
input_matrixInput matrix.
out_file_nameOutput file name.
maxima_pointsThe maxima points to be filled with 255
void TePDICorrelationMatching::raster2Tiff ( const TePDITypes::TePDIRasterPtrType input_raster_ptr,
unsigned int  raster_channel,
const std::string out_file_name,
const std::vector< TeCoord2D > &  maxima_points,
const TeSharedPtr< TeCoordPairVect > &  out_tie_points_ptr,
unsigned int  tie_points_space 
) [static, protected]

Save the output matrix to a geotiff file.

Parameters:
input_rasterInput raster.
raster_channelRaster channel.
out_file_nameOutput file name.
maxima_pointsThe maxima points to be drawed.
out_tie_points_ptrThe tie-points to be drawed.
tie_points_spaceThe tie-points space (pt1 or pt2).
void TePDICorrelationMatching::ResetState ( const TePDIParameters params) [protected, virtual]

Reset the internal state to the initial state.

Parameters:
paramsThe new parameters referente at initial state.

Implements TePDIAlgorithm.

bool TePDICorrelationMatching::RunImplementation ( ) [protected, virtual]

Runs the current algorithm implementation.

Returns:
true if OK. false on error.

Implements TePDIAlgorithm.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines