Commit b50e5a4a authored by Cresson Remi's avatar Cresson Remi

ENH: add BandMathX expression in bonus

parent ee7cc452
......@@ -404,6 +404,8 @@ private:
FloatVectorImageType::PixelType gain, offset;
gain.SetSize(refImage->GetNumberOfComponentsPerPixel());
offset.SetSize(refImage->GetNumberOfComponentsPerPixel());
std::stringstream exp;
exp << "{";
for (unsigned int band = 0 ; band < refImage->GetNumberOfComponentsPerPixel() ; band++)
{
float meanY = m_StatsFilter->GetMeans().at(band)[0][0];
......@@ -417,9 +419,20 @@ private:
otbAppLogINFO("Band " << band << " gain: " << b1 << " bias: " << b0);
if (band>0)
exp << ";";
exp << "im1b" << band << "*" << b1;
if (b0>0)
exp << "+" << b0;
else
exp << "" << b0;
gain[band] = b1;
offset[band] = b0;
}
exp << "}";
otbAppLogINFO("BandMathX expression: " << exp.str());
if (this->HasValue("out"))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment