[GRASS-SVN] r54984 - grass/trunk/imagery/i.vi

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 8 06:25:37 PST 2013


Author: ychemin
Date: 2013-02-08 06:25:36 -0800 (Fri, 08 Feb 2013)
New Revision: 54984

Added:
   grass/trunk/imagery/i.vi/evi2.c
Modified:
   grass/trunk/imagery/i.vi/i.vi.html
   grass/trunk/imagery/i.vi/main.c
Log:
Added EVI2

Added: grass/trunk/imagery/i.vi/evi2.c
===================================================================
--- grass/trunk/imagery/i.vi/evi2.c	                        (rev 0)
+++ grass/trunk/imagery/i.vi/evi2.c	2013-02-08 14:25:36 UTC (rev 54984)
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<math.h>
+#include<stdlib.h>
+
+    /* EVI2: Enhanced Vegetation Index
+     * Zhangyan Jiang ; Alfredo R. Huete ; Youngwook Kim and Kamel Didan
+     * 2-band enhanced vegetation index without a blue band and its application to AVHRR data
+     * Proc. SPIE 6679, Remote Sensing and Modeling of Ecosystems for Sustainability IV, 667905 (October 09, 2007)
+     * doi:10.1117/12.734933
+     * http://dx.doi.org/10.1117/12.734933
+     */ 
+double e_vi2(double redchan, double nirchan) 
+{
+    double tmp, result;
+
+    tmp = nirchan + 2.4 * redchan + 1.0;
+    if (tmp == 0.0) {
+        result = -1.0;
+    }
+    else {
+        result = 2.5 * (nirchan - redchan) / tmp;
+    }
+    return result;
+}
+

Modified: grass/trunk/imagery/i.vi/i.vi.html
===================================================================
--- grass/trunk/imagery/i.vi/i.vi.html	2013-02-08 11:41:31 UTC (rev 54983)
+++ grass/trunk/imagery/i.vi/i.vi.html	2013-02-08 14:25:36 UTC (rev 54984)
@@ -7,6 +7,7 @@
   <li>ARVI: atmospherically resistant vegetation indices</li>
   <li>DVI: Difference Vegetation Index</li>
   <li>EVI: Enhanced Vegetation Index</li>
+  <li>EVI2: Enhanced Vegetation Index 2</li>
   <li>GARI: Green atmospherically resistant vegetation index</li>
   <li>GEMI: Global Environmental Monitoring Index</li>
   <li>GVI: Green Vegetation Index</li>
@@ -53,15 +54,36 @@
 <div class="code"><pre>
 EVI: Enhanced Vegetation Index
 
+The enhanced vegetation index (EVI) is an optimized index designed to enhance
+the vegetation signal with improved sensitivity in high biomass regions and
+improved vegetation monitoring through a de-coupling of the canopy background
+signal and a reduction in atmosphere influences.
+
 Huete A.R., Liu H.Q., Batchily K., vanLeeuwen W. (1997). 
 A comparison of vegetation indices global set of TM images for 
 EOS-MODIS. Remote Sensing of Environment, 59:440-451.
+
 EVI = 2.5 * ( nirchan - redchan ) / 
 ( nirchan + 6.0 * redchan - 7.5 * bluechan + 1.0 )
 evi( bluechan, redchan, nirchan )
 </pre></div>
 
 <div class="code"><pre>
+EVI2: Enhanced Vegetation Index 2
+
+A 2-band EVI (EVI2), without a blue band, which has the best
+similarity with the 3-band EVI, particularly when atmospheric
+effects are insignificant and data quality is good. 
+
+Zhangyan Jiang ; Alfredo R. Huete ; Youngwook Kim and Kamel Didan
+2-band enhanced vegetation index without a blue band and its application to AVHRR data.
+Proc. SPIE 6679, Remote Sensing and Modeling of Ecosystems for Sustainability IV, 667905 (october 09, 2007) <a href="http://dx.doi.org/10.1117/12.734933">doi:10.1117/12.734933</a>
+EVI2 = 2.5 * ( nirchan - redchan ) / 
+( nirchan + 2.4 * redchan + 1.0 )
+evi2 ( redchan, nirchan )
+</pre></div>
+
+<div class="code"><pre>
 GARI: green atmospherically resistant vegetation index
 
 GARI = ( nirchan - (greenchan-(bluechan - redchan))) / 

Modified: grass/trunk/imagery/i.vi/main.c
===================================================================
--- grass/trunk/imagery/i.vi/main.c	2013-02-08 11:41:31 UTC (rev 54983)
+++ grass/trunk/imagery/i.vi/main.c	2013-02-08 14:25:36 UTC (rev 54984)
@@ -4,10 +4,11 @@
  * MODULE:       i.vi
  * AUTHOR(S):    Baburao Kamble baburaokamble at gmail.com
  *		 Yann Chemin - yann.chemin at gmail.com
- * PURPOSE:      Calculates 14 vegetation indices
+ *		 Nikos Alexandris - nik at nikosalexandris.net
+ * PURPOSE:      Calculates 15 vegetation indices
  * 		 based on biophysical parameters.
  *
- * COPYRIGHT:    (C) 2002-2008 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2002-2013 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *   	    	 License (>=v2). Read the file COPYING that comes with GRASS
@@ -22,6 +23,7 @@
  *
  * Changelog:	 Added EVI on 20080718 (Yann)
  * 		 Added VARI on 20081014 (Yann)
+ * 		 Added EVI2 on 20130208 (NikosA)
  *
  *****************************************************************************/
 
@@ -38,6 +40,7 @@
 double ip_vi(double redchan, double nirchan);
 double d_vi(double redchan, double nirchan);
 double e_vi(double bluechan, double redchan, double nirchan);
+double e_vi2(double redchan, double nirchan);
 double p_vi(double redchan, double nirchan);
 double wd_vi(double redchan, double nirchan);
 double sa_vi(double redchan, double nirchan);
@@ -97,11 +100,12 @@
     input1->description = _("Name of vegetation index");
     desc = NULL;
     G_asprintf(&desc,
-	       "arvi;%s;dvi;%s;evi;%s;gvi;%s;gari;%s;gemi;%s;ipvi;%s;msavi;%s;"
+	       "arvi;%s;dvi;%s;evi;%s;evi2;%s;gvi;%s;gari;%s;gemi;%s;ipvi;%s;msavi;%s;"
 	       "msavi2;%s;ndvi;%s;pvi;%s;savi;%s;sr;%s;vari;%s;wdvi;%s",
 	       _("Atmospherically Resistant Vegetation Indices"),
 	       _("Difference Vegetation Index"),
 	       _("Enhanced Vegetation Index"),
+	       _("Enhanced Vegetation Index 2"),
 	       _("Green Vegetation Index"),
 	       _("Green atmospherically resistant vegetation index"),
 	       _("Global Environmental Monitoring Index"),
@@ -115,7 +119,7 @@
 	       _("Visible Atmospherically Resistant Index"),
 	       _("Weighted Difference Vegetation Index"));
     input1->descriptions = desc;
-    input1->options = "arvi,dvi,evi,gvi,gari,gemi,ipvi,msavi,msavi2,ndvi,pvi,savi,sr,vari,wdvi";
+    input1->options = "arvi,dvi,evi,evi2,gvi,gari,gemi,ipvi,msavi,msavi2,ndvi,pvi,savi,sr,vari,wdvi";
     input1->answer = "ndvi";
 
     input2 = G_define_standard_option(G_OPT_R_INPUT);
@@ -245,6 +249,9 @@
                 || !(input5->answer)) )
 	G_fatal_error(_("evi index requires blue, red and nir maps"));
 
+	if (!strcasecmp(viflag, "evi2") && (!(input2->answer) || !(input3->answer) ) )
+	G_fatal_error(_("evi2 index requires red and nir maps"));
+	
     if (!strcasecmp(viflag, "vari") && (!(input2->answer) || !(input4->answer)
                 || !(input5->answer)) )
 	G_fatal_error(_("vari index requires blue, green and red maps"));
@@ -450,6 +457,9 @@
 		if (!strcasecmp(viflag, "evi"))
 		    outrast[col] = e_vi(d_bluechan, d_redchan, d_nirchan);
 
+		if (!strcasecmp(viflag, "evi2"))
+		    outrast[col] = e_vi2(d_redchan, d_nirchan);
+
 		if (!strcasecmp(viflag, "pvi"))
 		    outrast[col] = p_vi(d_redchan, d_nirchan);
 
@@ -521,4 +531,3 @@
 
     exit(EXIT_SUCCESS);
 }
-



More information about the grass-commit mailing list