27 #include "../Config.h" 32 #define BOOST_TEST_NO_MAIN 33 #include <boost/test/unit_test.hpp> 41 std::map<std::string, std::string> rinfo;
42 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
48 std::map<std::string, std::string> orinfo;
49 orinfo[
"URI"] =
"cbers2b_rgb342_crop_linearMixtureModel.tif";
75 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
76 mmInputParameters.
m_components[
"clouds"].push_back(184.875);
77 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
79 mmInputParameters.
m_components[
"shadow"].push_back(42.075);
80 mmInputParameters.
m_components[
"shadow"].push_back(24.99);
81 mmInputParameters.
m_components[
"shadow"].push_back(49.98);
83 mmInputParameters.
m_components[
"vegetation"].push_back(99.96);
84 mmInputParameters.
m_components[
"vegetation"].push_back(64.005);
85 mmInputParameters.
m_components[
"vegetation"].push_back(154.02);
89 mmOutputParameters.
m_rInfo = orinfo;
90 mmOutputParameters.
m_rType =
"GDAL";
96 boost::numeric::ublas::matrix<double> transfMatrix;
98 BOOST_CHECK( algorithmInstance.
initialize(mmInputParameters) );
100 BOOST_CHECK(transfMatrix.size1() == 4 );
101 BOOST_CHECK(transfMatrix.size2() == 4 );
102 BOOST_CHECK( algorithmInstance.
execute(mmOutputParameters) );
112 std::map<std::string, std::string> rinfo;
113 rinfo[
"URI"] = TERRALIB_DATA_DIR
"/geotiff/cbers2b_rgb342_crop.tif";
119 std::map<std::string, std::string> orinfo;
120 orinfo[
"URI"] =
"cbers2b_rgb342_crop_PCAMixtureModel.tif";
146 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
147 mmInputParameters.
m_components[
"clouds"].push_back(184.875);
148 mmInputParameters.
m_components[
"clouds"].push_back(255.0);
150 mmInputParameters.
m_components[
"shadow"].push_back(42.075);
151 mmInputParameters.
m_components[
"shadow"].push_back(24.99);
152 mmInputParameters.
m_components[
"shadow"].push_back(49.98);
154 mmInputParameters.
m_components[
"vegetation"].push_back(99.96);
155 mmInputParameters.
m_components[
"vegetation"].push_back(64.005);
156 mmInputParameters.
m_components[
"vegetation"].push_back(154.02);
160 mmOutputParameters.
m_rInfo = orinfo;
161 mmOutputParameters.
m_rType =
"GDAL";
167 boost::numeric::ublas::matrix<double> transfMatrix;
169 BOOST_CHECK( algorithmInstance.
initialize(mmInputParameters) );
171 BOOST_CHECK(transfMatrix.size1() == 3);
172 BOOST_CHECK(transfMatrix.size2() == 3);
173 BOOST_CHECK( algorithmInstance.
execute(mmOutputParameters) );
179 BOOST_AUTO_TEST_SUITE_END()
Raster decomposition using mixture model.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
BOOST_AUTO_TEST_SUITE(mixtureModel_tests) BOOST_AUTO_TEST_CASE(linear_test)
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.
bool generateTransformMatrix(boost::numeric::ublas::matrix< double > &matrix)
Generates a Transform Matrix.
BOOST_AUTO_TEST_CASE(pca_test)
MixtureModel output parameters.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the mixing model using the parameters defined in inputParams and outputParams.
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.