14 std::cout <<
"Raster decomposition using Mixture Model module." << std::endl << std::endl;
17 std::map<std::string, std::string> rinfo;
18 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
21 bool executeok =
false;
24 std::cout <<
"Using Linear Mixture Model" << std::endl;
27 std::map<std::string, std::string> orinfo;
28 orinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop_linearMixtureModel.tif";
45 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
46 mmInputParameters.
m_components[
"clouds"].push_back(184.875);
47 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
49 mmInputParameters.
m_components[
"shadow"].push_back(42.075);
50 mmInputParameters.
m_components[
"shadow"].push_back(24.99);
51 mmInputParameters.
m_components[
"shadow"].push_back(49.98);
53 mmInputParameters.
m_components[
"vegetation"].push_back(99.96);
54 mmInputParameters.
m_components[
"vegetation"].push_back(64.005);
55 mmInputParameters.
m_components[
"vegetation"].push_back(154.02);
63 mmOutputParameters.
m_rInfo = orinfo;
64 mmOutputParameters.
m_rType =
"GDAL";
70 initok = mmInstance.
initialize(mmInputParameters);
73 executeok = mmInstance.
execute(mmOutputParameters);
76 std::cout <<
"Problems in linear mixture model." << std::endl;
85 std::cout <<
"Done!" << std::endl << std::endl;
87 catch(
const std::exception& e)
89 std::cout << std::endl <<
"An exception has occurred in MixtureModel(): " << e.what() << std::endl;
93 std::cout << std::endl <<
"An unexpected exception has occurred in MixtureModel()!" << std::endl;
Raster decomposition using mixture model.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
These routines show how to use the RP (raster processing) module.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output raster (as described in te::raster::RasterFactory).
An abstract class for raster data strucutures.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
This file contains include headers for the TerraLib Raster Processing module.
MixtureModel output parameters.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the mixing model using the parameters defined in inputParams and outputParams.
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the generated output raster, one band per component plus one error band per component (w...
bool m_createErrorRaster
A flag to indicate that output raster will include the error bands.
bool initialize(const AlgorithmInputParameters &inputParams)
Initializes model with paramters defined in inputParams.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.