diff --git a/Code/Radiometry/otbVegetationIndex.h b/Code/Radiometry/otbVegetationIndex.h index ead5d02719e3f2b4fb1dd1a097fef76e0327d16d..ba2763e05680eac2a46fa74939c6a604112faee5 100644 --- a/Code/Radiometry/otbVegetationIndex.h +++ b/Code/Radiometry/otbVegetationIndex.h @@ -241,12 +241,12 @@ public: { double dnir = static_cast<double>(nir); double dr = static_cast<double>(r); - double sqrt_value = (2*dr+1)*(2*dr+1) - 8*(dr-dnir); + double sqrt_value = (2*dnir+1)*(2*dnir+1) - 8*(dnir-dr); if ( sqrt_value < 0. ) { return static_cast<TOutput>(0.); } - return ( static_cast<TOutput>( (2*dr + 1 - vcl_sqrt(sqrt_value))/2. ) ); + return ( static_cast<TOutput>( (2*dnir + 1 - vcl_sqrt(sqrt_value))/2. ) ); } }; diff --git a/Testing/Code/Radiometry/CMakeLists.txt b/Testing/Code/Radiometry/CMakeLists.txt index 493460ffb68a41cf907b45769774043f3dc65e7e..c05f18b6ae2c2870a69f3a4dbab5cef3136fc1c5 100644 --- a/Testing/Code/Radiometry/CMakeLists.txt +++ b/Testing/Code/Radiometry/CMakeLists.txt @@ -489,8 +489,8 @@ ADD_TEST(raTvAtmosphericCorrectionSequencementTest ${RADIOMETRY_TESTS4} # ------- otb::RAndBAndNIRVegetationIndexImageFilter ------------------------------ ADD_TEST(raTvEVIRAndBAndNIRVegetationIndexImageFilter ${RADIOMETRY_TESTS4} - #--compare-image ${EPSILON} ${BASELINE}/raRAndBAndNIRVegetationIndex_EVI_poupees_subc1c2c3.tif - # ${TEMP}/raRAndBAndNIRVegetationIndex_EVI_poupees_subc1c2c3.tif + --compare-image ${EPSILON} ${BASELINE}/raRAndBAndNIRVegetationIndex_EVI_poupees_subc1c2c3.tif + ${TEMP}/raRAndBAndNIRVegetationIndex_EVI_poupees_subc1c2c3.tif otbEVIRAndBAndNIRVegetationIndexImageFilter EVI ${INPUTDATA}/poupees_sub_c1.png