Raster Processing

This module contains several processing operations applied to an image. The following figure shows a diagram presenting the main steps of raster processing.

The main algorithms of this module are related in raster processing algorithms.

Design

From Theory to Practice

To use the algorithms from this module, it is needed to load the input image, set the algorithms specific parameters, and set the output image. After, the algorithms presents two basic methods, which are initialize and execute. The first method checks the consistency of the parameters, and the second performs the raster processing and stores it in the output raster.

As follows, there is one example of raster processing to perform a contrast enhancement in one image.

// open input raster
std::map<std::string, std::string> rinfo;
rinfo["URI"] = "input.tif";
te::rst::Raster* rin = te::rst::RasterFactory::open(rinfo);
 
// link specific parameters with chosen implementation
te::rp::Contrast::InputParameters contInputParameters;
contInputParameters.m_type = te::rp::Contrast::InputParameters::LinearContrastT;
contInputParameters.m_lCMinInput = 100;
contInputParameters.m_lCMaxInput = 200;
contInputParameters.m_inRasterPtr = rin;
for (unsigned b = 0; b < rin->getNumberOfBands(); b++)
  contInputParameters.m_inRasterBands.push_back(b);
 
// set output raster for linear contrast
std::map<std::string, std::string> orinfo;
orinfo["URI"] = "output-linear-contrast.tif";
 
te::rp::Contrast::OutputParameters contOutputParameters;
contOutputParameters.m_createdOutRasterInfo = orinfo;
contOutputParameters.m_createdOutRasterDSType = "GDAL";
 
// execute the algorithm
te::rp::Contrast continstance;
bool initok = continstance.initialize(contInputParameters);
if (initok)
  continstance.execute(contOutputParameters);
 
// clean up
delete rin;

Module Summary

-------------------------------------------------------------------------------
Language          files     blank   comment      code    scale   3rd gen. equiv
-------------------------------------------------------------------------------
C++                  33      2412      1141      9024 x   1.51 =       13626.24
C/C++ Header         37      1621      2473      2723 x   1.00 =        2723.00
-------------------------------------------------------------------------------
SUM:                 70      4033      3614     11747 x   1.39 =       16349.24
-------------------------------------------------------------------------------

Final Remarks

Some algorithms are not implemented yet, like many classifiers, registration, and filters.

References

  • Rafael Gonzalez. Digital Image Processing. 2009. ISBN 9788131726952. Pearson Education.
  • Robert Jensen. Introductory digital image processing: a remote sensing perspective. 2005. ISBN 9780131453616. Prentice Hall.

QR Code
QR Code wiki:designimplementation:rp (generated for current page)