27 #include "../raster.h" 28 #include "../rp/Filter.h" 36 double minShadow,
double maxShadow, std::vector<te::rp::Filter::InputParameters::FilterType> vecFilter, std::vector<int> vecIt)
48 for (
unsigned int i = 0; i < vecFilter.size(); i++)
61 std::map< std::string, std::string > dummyRInfo;
64 algoOutputParams.
m_rInfo = dummyRInfo;
65 algoOutputParams.
m_rType =
"MEM";
67 if (algorithmInstance.
initialize(algoInputParams))
69 if (!algorithmInstance.
execute(algoOutputParams))
84 for (std::size_t t = 0; t < nBands; ++t)
90 delete limiarCloudRaster;
91 delete limiarShadowRaster;
99 std::vector<te::rst::BandProperty*> bprops;
104 bprops.push_back(bp);
106 std::map< std::string, std::string > dummyRInfo;
114 for (
unsigned int row = 0; row < nRows; ++row)
119 bin.getValue(
col, row, val);
121 if (val >= minCloud && val <= maxCloud)
134 std::vector<te::rst::BandProperty*> bprops;
139 bprops.push_back(bp);
141 std::map< std::string, std::string > dummyRInfo;
149 for (
unsigned int row = 0; row < nRows; ++row)
154 bin.getValue(
col, row, val);
156 if (val >= minShadow && val <= maxShadow)
169 std::vector<te::rst::BandProperty*> bprops;
173 bprops.push_back(bp);
175 std::map< std::string, std::string > dummyRInfo;
184 for (
unsigned int row = 0; row < nRows; ++row)
189 cloudBand.getValue(
col, row, cloudValue);
191 if (cloudValue == 255.)
virtual void setValue(unsigned int c, unsigned int r, const double value, std::size_t b=0)
Sets the attribute value in a band of a cell.
A raster band description.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
bool execute(AlgorithmOutputParameters &outputParams) _NOEXCEPT_OP(false)
Executes the algorithm using the supplied parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
te::rst::Raster * generateSumRasters(te::rst::Raster *cloudRaster, te::rst::Raster *shadowRaster)
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
te::rst::Raster * executeCloudDetection(te::rst::Raster *cloudRaster, te::rst::Raster *shadowRaster, int cloudBand, int shadowBand, double minCloud, double maxCloud, double minShadow, double maxShadow, std::vector< te::rp::Filter::InputParameters::FilterType > vecFilter, std::vector< int > vecIt)
This method is used to run cloud detection operation.
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
unsigned int unsigned int nCols
An abstract class for raster data strucutures.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
BandProperty * getProperty()
Returns the band property.
A raster band description.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
Grid * getGrid()
It returns the raster grid.
A series of well-known filtering algorithms for images, linear and non-linear..
te::rst::Raster * generateCloudRaster(te::rst::Raster *raster, int cloudBand, double minCloud, double maxCloud)
static Raster * make()
It creates and returns an empty raster with default raster driver.
bool initialize(const AlgorithmInputParameters &inputParams) _NOEXCEPT_OP(false)
Initialize the algorithm instance making it ready for execution.
Filter output parameters.
A rectified grid is the spatial support for raster data.
te::rst::Raster * generateShadowRaster(te::rst::Raster *raster, int shadowBand, double minShadow, double maxShadow)
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer the ge generated output raster (label image).
virtual void getValue(unsigned int c, unsigned int r, double &value) const =0
Returns the cell attribute value.