Hi,

The formula to compute the mean would look like :
"avg(im1b1,im1b2,im1b3,[...],im1b12)"

Once you have produced the image containing the mean values, you can use it back in the otbcli_BandMath.
Lets say you set the input image list parameter "il" to :
 - first image : the 12-band initial image
- second image : the mean image
The formula for std dev. would look like :
"sqrt(avg( (im1b1-im2b1)*(im1b1-im2b1),(im1b2-im2b1)*(im1b2-im2b1),[...],(im1b12-im2b1)*(im1b12-im2b1) ))"

Regards,
Guillaume

Le 03/09/2014 17:43, dcd a écrit :
Hi Julien,

I was just re-reading this post as it's referenced on gis.stackexchange.com <http://gis.stackexchange.com/questions/88996/per-pixel-statistical-calculations-on-a-raster-stack-using-gdal/111103#111103>. I noticed I missed something in your answer:

On Tuesday, 11 March 2014 03:54:21 UTC-4, Julien Michel wrote:


    2) Regarding your second question, it depends on what you intent
    to calculate : the mean and std dev of one layer, or the mean and
    std dev of one pixel accross several layers ? The latter is
    already possible (you just need to write the mathematical
    expression), while the former again requires more code on OTB side
    (but it would be useful to be able to call std(im1b1) for instance
    in a formula).


The intent was to calculate the mean and std. dev. of a single pixel across several layers. Ideally, I'd like to calculate the cv of each pixel. The reply above appears to indicate that this is already possible within OTB. If so, how would you write the expression using otbcli_BandMath given a multilayer image (e.g., 12 bands?).

In other words, if I had a 12 band image of average monthly temperature, how would I calculate the mean (or std.dev., or cv) of each pixel across several layers using otbcli_BandMath?

Thanks!
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.


--
<www.c-s.fr>      *Guillaume PASERO*
Ingénieur d'études et développement
*Business Unit E-SPACE & Geo Information* <https://thor.si.c-s.fr/blogs/cs-blogs-business/>*- Département APPLICATIONS*

*CS Systèmes d'Information*
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to