[GRASS-user] Differences Between ERDAS and GRASS About NDVI Statistics

Hi,
This will not be a specific GRASS question. My friend and I tried to calculate NDVIs of same data set and results seem same to us. But checking statistics of each output we saw that statistics are very different. I mean, median, mean, std.dev values of Grass output and Erdas output are different. We couldn’t find an explanation for this situation. What can be the reason for this?

PS:
For NDVI, we used this formula: (NIR_Band - RED_Band) / (NIR_Band + RED_Band)

Hi, Please make sure that the output images are of the same type in both cases and that your statistic calculation method is the same. NDVI is a float (or double) result if your initial data are integers (usually they are). Perhaps one of your images is automatically converted to 8 bit integer type? Cheers, Angelos

···

On 01/14/2013 01:03 AM, Gökçen Güner wrote:

Hi,
This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us. But checking
statistics of each output we saw that statistics are very different. I
mean, median, mean, std.dev values of Grass output and Erdas output are
different. We couldn't find an explanation for this situation. What can be
the reason for this?

PS:
For NDVI, we used this formula: (NIR_Band - RED_Band) / (NIR_Band +
RED_Band)

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

-- 
Angelos Tzotsos
Remote Sensing Laboratory
National Technical University of Athens
[http://users.ntua.gr/tzotsos](http://users.ntua.gr/tzotsos)

Hi,
We did both statistics calculation using QGis because ERDAS couldn’t calculate statistics for Grass output (or we couldn’t do it). I’m sure that Grass output is floating point map but I’ll check Erdas one.
Thanks

2013/1/14 Angelos Tzotsos <gcpp.kalxas@gmail.com>

On 01/14/2013 01:03 AM, Gökçen Güner wrote:

Hi,
This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us. But checking
statistics of each output we saw that statistics are very different. I
mean, median, mean, std.dev values of Grass output and Erdas output are
different. We couldn't find an explanation for this situation. What can be
the reason for this?

PS:
For NDVI, we used this formula: (NIR_Band - RED_Band) / (NIR_Band +
RED_Band)

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

Hi,

Please make sure that the output images are of the same type in both cases and that your statistic calculation method is the same.
NDVI is a float (or double) result if your initial data are integers (usually they are).
Perhaps one of your images is automatically converted to 8 bit integer type?

Cheers,
Angelos

-- 
Angelos Tzotsos
Remote Sensing Laboratory
National Technical University of Athens
[http://users.ntua.gr/tzotsos](http://users.ntua.gr/tzotsos)

On Monday 14 of January 2013 01:03:42 Gökçen Güner wrote:

Hi,

Hi!

This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us. But checking
statistics of each output we saw that statistics are very different. I
mean, median, mean, std.dev values of Grass output and Erdas output are
different.

How different? Can you please post exact numbers if that is ok? If differences
are minor, you can simply ignore them :slight_smile:

We couldn't find an explanation for this situation. What can be
the reason for this?

There are reasons. For example, different pixel inclusion rules (of course I
have in mind border-near pixels). Other reasons might be the spatial
resolution and extent (remember, GRASS-GIS is strict with that) and the
presence of a MASK.

The experts might give better clues.

Best, Nikos

PS:
For NDVI, we used this formula: (NIR_Band - RED_Band) / (NIR_Band +
RED_Band)

Note, grass7 has i.vi for this job :slight_smile:

Gökçen Güner:

> This will not be a specific GRASS question. My friend and I tried to
> calculate NDVIs of same data set and results seem same to us.

What kind of images are those, if I may ask? Which sensor?

> But checking statistics of each output we saw that statistics are very
> different. I mean, median, mean, std.dev values of Grass output and Erdas
> output are different.

> We couldn't find an explanation for this situation. What can be
> the reason for this?

There are reasons. For example, different pixel inclusion rules (of course I
have in mind border-near pixels). Other reasons might be the spatial
resolution and extent (remember, GRASS-GIS is strict with that) and the
presence of a MASK.

Also,

what about NULL or NoData cells? How does ERDAS deal with them -- I don't
remember now. How are they defined, if they exist, in your image?

What does "r.describe -r" return for the data set(s) in question?

Thanks, Nikos

Hi Nikos,

Thank you for reply. I don’t have exact NDVI band statistics but I have statistics of NDVI difference maps. We calculated NDVI’s of different times for same area and then subtract one from another. I mean we have NDVI of 2000 and 2010 for the same area and we subtracted NDVI 2000 from NDVI 2010. I can send statistics of original NDVI files tomorrow. These are statistics of difference maps. I attached them to my post.

I’m not sure about ‘different pixel inclusion rules’ but I think ‘spatial resolution and extent’ is same for both, you can see it in stat files I sent. Also we didn’t use MASK in both.
Thanks.

2013/1/14 Nikos Alexandris <nik@nikosalexandris.net>

On Monday 14 of January 2013 01:03:42 Gökçen Güner wrote:

Hi,

Hi!

This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us. But checking
statistics of each output we saw that statistics are very different. I
mean, median, mean, std.dev values of Grass output and Erdas output are
different.

How different? Can you please post exact numbers if that is ok? If differences
are minor, you can simply ignore them :slight_smile:

We couldn’t find an explanation for this situation. What can be
the reason for this?

There are reasons. For example, different pixel inclusion rules (of course I
have in mind border-near pixels). Other reasons might be the spatial
resolution and extent (remember, GRASS-GIS is strict with that) and the
presence of a MASK.

The experts might give better clues.

Best, Nikos

PS:
For NDVI, we used this formula: (NIR_Band - RED_Band) / (NIR_Band +
RED_Band)

Note, grass7 has i.vi for this job :slight_smile:

(attachments)

erdasStat.txt (2.27 KB)
grassStat.txt (1.31 KB)

Hi,

a quick look at the stats files show some differences:

  • “Dimensions”

  • “Layer Extent”

  • not the same range of data (from -2 to 2 in ERDAS ? oO)

so that’s totally logical to get different mean and stdev …

take care to use exactly the same extent/res when you are comparing 2 files :wink:

cheers,
Sylvain

···

2013/1/14 Nikos Alexandris <nik@nikosalexandris.net>

Gökçen Güner:

This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us.

What kind of images are those, if I may ask? Which sensor?

But checking statistics of each output we saw that statistics are very
different. I mean, median, mean, std.dev values of Grass output and Erdas
output are different.

We couldn’t find an explanation for this situation. What can be
the reason for this?

There are reasons. For example, different pixel inclusion rules (of course I
have in mind border-near pixels). Other reasons might be the spatial
resolution and extent (remember, GRASS-GIS is strict with that) and the
presence of a MASK.

Also,

what about NULL or NoData cells? How does ERDAS deal with them – I don’t
remember now. How are they defined, if they exist, in your image?

What does “r.describe -r” return for the data set(s) in question?

Thanks, Nikos


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi,
@Nikos:
I’ll send information about maps tonight. I’ll send ‘r.describe -r’ output also.
@Sylvain:
Thank you, I didn’t noticed the differences, my friend might had done histogram strecthing over results, so this may be the reason for -2/2 thing, I will check this.
By the way I’m not sure how we can make data to have same layer extent and dimension in both programs. I didn’t do a special thing before calculation, I just used g.region and
r.mapcalc methods.

2013/1/14 Sylvain Maillard <sylvain.maillard@gmail.com>

···

2013/1/14 Nikos Alexandris <nik@nikosalexandris.net>

Gökçen Güner:

This will not be a specific GRASS question. My friend and I tried to
calculate NDVIs of same data set and results seem same to us.

What kind of images are those, if I may ask? Which sensor?

But checking statistics of each output we saw that statistics are very
different. I mean, median, mean, std.dev values of Grass output and Erdas
output are different.

We couldn’t find an explanation for this situation. What can be
the reason for this?

There are reasons. For example, different pixel inclusion rules (of course I
have in mind border-near pixels). Other reasons might be the spatial
resolution and extent (remember, GRASS-GIS is strict with that) and the
presence of a MASK.

Also,

what about NULL or NoData cells? How does ERDAS deal with them – I don’t
remember now. How are they defined, if they exist, in your image?

What does “r.describe -r” return for the data set(s) in question?

Thanks, Nikos


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Güner:

Hi Güner!

@Nikos: I'll send information about maps tonight. I'll send 'r.describe -r'
output also.

I think it might not be necessary. As Sylvain pointed-out, and I confirm this
(had a quick look in the morning), the reported layere dimensions are
different! Check it out please.

This might be the single root of evil in this case.

@Sylvain: Thank you, I didn't noticed the differences, my friend might had
done histogram strecthing over results, so this may be the reason for -2/2
thing, I will check this.

By the way I'm not sure how we can make data to have same layer extent and
dimension in both programs. I didn't do a special thing before calculation,
I just used g.region and r.mapcalc methods.

How exactly? After importing you need to

g.region rast=ImportedRasterMap

or similar.

[rest deleted]

Best, Nikos

Hi Nikos,
Yes I didn’t noticed the differences until Sylvain said, too :slight_smile:
I did g.region you are right, I did it to the imported maps, I wrote it in my last post. What i don’t know is how to do same thing in Erdas but this is grass mailing list so my friend will ask about this in erdas forums.

2013/1/14 Nikos Alexandris <nik@nikosalexandris.net>

g.region rast=ImportedRasterMap