Again thanks for your suggestion.

However, the ComputeImageStatistics application only generates the mean and 
std and we need the min and max to re-scale the images.
our images are not NDVI but the normalized diffferences calculated with all 
possible combinations of WorldView bands. therefore we prefer using the 
exact min and max of each image (rather than applying the same scaling to 
all the images)

we are now moving back to GDAL to calculate the min and max but we are 
still wondering what might have gone wrong with the OTB  Convert and 
Rescale applications.
Gillaume/Jordi/Others: any ideas/suggestions?

FYI: the purpose of re-scaling the images to 8 bits is to use them as 
inputs to calculate (Haralick) textural metrics. yet, I am thinking now 
that perhaps it is easier to pass to Haralick the image min and max and fix 
the number of bins to 8. (Recall from the post above that Convert/Rescale 
cannot properly identify the min/max of the images...)

Thanks,
Raul

On Wednesday, December 16, 2015 at 4:37:38 PM UTC+1, Jordi Inglada wrote:
>
>
> You can use the ComputeImageStatistics application to generate an xml 
> (horror!) file with mean and std. You can then parse this with some 
> python to generate the BandMath expression. 
>
> However, if you know that you have NDVI values, you may consider 
> applying the same rescaling to all images. 
>
> Jordi 
>
> > On Wed, Dec 16, 2015 at 2:32 PM, Jordi Inglada <[email protected] 
> <javascript:>> wrote: 
> > 
> > 
> >  Raul ZM <[email protected] <javascript:>> wrote: 
> >  > 
> >  > Hi there, 
> >  > 
> >  > we are trying to transform a float32 tiff image into a uint8 (so from 
> decimals to the interval 0 to 255). 
> >  > For this we have tested Convert: 
> >  > olbcli_Convert -in file1.tiff -out file2.tif uint8 -type linear (btw, 
> what would be type "none"?) 
> >  > 
> >  > and Rescale: 
> >  > otbcli_Rescale -in file1.tiff -out file2.tif uint8 -outmin 0 -outmax 
> 255 (also tried without the last three parameters as these are the default 
> values) 
> >  > 
> >  > in both cases we get blank images or an stripped image that has 
> nothing to do with the original file. 
> >  > Any idea/suggestion of what might be going on? 
> >  > 
> > 
> >  Hi, 
> > 
> >  Images with stripes can appear due to streaming (or multi-threading, I 
> >  am not sure) because the min/max values for the input image are not 
> >  computed globally. I guess that you can avoid that by using the -ram 
> >  option for streaming. 
> > 
> >  But if you know the range of your input image, the easiest is to use 
> the 
> >  BandMath application to do the operation and choose the output pixel 
> >  value: 
> > 
> >  otbcli_BandMath -il float.tif -out rescaled.tif uint8 -exp 
> "(im1b1-min)/(max-min)*255" 
> > 
> >  If you have several bands, you will have to adapt the expression. 
> > 
> >  Jordi 
> > 
> >  -- 
> >  -- 
> >  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] 
> <javascript:> 
> >  To unsubscribe from this group, send email to 
> >  [email protected] <javascript:> 
> >  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 a topic in the 
> Google Groups "otb-users" group. 
> >  To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/otb-users/E5e_QW1Oy4Y/unsubscribe. 
> >  To unsubscribe from this group and all its topics, send an email to 
> [email protected] <javascript:>. 
> >  For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
>

-- 
-- 
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