Commit bf213b2237790e68c9e31b518effe1c30668ca44

Authored by Jordi Inglada
1 parent d17fafb2

BUG: correct validity check for normalised indices

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
include/iota2FeatureExtraction.h
... ... @@ -116,10 +116,10 @@ public:
116 116 auto red = *(inIt+m_RedIndex-1);
117 117 auto nir = *(inIt+m_NIRIndex-1);
118 118 auto swir = *(inIt+m_SWIRIndex-1);
119   - auto ndvi = std::fabs(nir-red)<10e-6?
  119 + auto ndvi = std::fabs(nir+red)<10e-6?
120 120 ValueType{0}:(nir-red)/(nir+red);
121   - auto ndwi = std::fabs(nir-red)<10e-6?
122   - ValueType{0}:(swir-nir)/(swir+nir);
  121 + auto ndwi = std::fabs(swir+red)<10e-6?
  122 + ValueType{0}:(swir-nir)/(swir+nir);
123 123 decltype(inVec) tmpVec(m_ComponentsPerDate);
124 124 std::transform(inIt, inIt+m_ComponentsPerDate,tmpVec.begin(),
125 125 [](decltype(*inIt)x){ return x*x;});
... ...