[otb-users] Re: DLL load fails

2018-08-10 Thread Hendrik Bernert
Shall I then delete the otb-path from the PYTHONPATH variable?

Am Montag, 16. Juli 2018 14:37:47 UTC+2 schrieb Hendrik Bernert:
>
>
> Hi there,
>
> I have the same problem as described (but not solved) here 
> .
>  
> I can run the GUI and python obviously can locate the path to 
> otbApplciation.py, but I get this error message:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Program Files\JetBrains\PyCharm Community Edition 
> 2018.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in 
> do_import
> module = self._system_import(name, *args, **kwargs)
>   File "C:\Program 
> Files\OrfeoToolbox\OTB-6.6.0-Win64\lib\python\otbApplication.py", line 21, 
> in 
> _otbApplication = swig_import_helper()
>   File "C:\Program 
> Files\OrfeoToolbox\OTB-6.6.0-Win64\lib\python\otbApplication.py", line 20, 
> in swig_import_helper
> return importlib.import_module('_otbApplication')
>   File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
> __import__(name)
>   File "C:\Program Files\JetBrains\PyCharm Community Edition 
> 2018.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in 
> do_import
> module = self._system_import(name, *args, **kwargs)
> ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden
> .
>
> I tried everything, from removing and setting all the environment 
> variables as described in the post or listed in the otbenv.bat to 
> restarting the computer for the changes to take place, but nothing worked. 
> Is there anything I'm missing? Where do I have to point to the dll's, which 
> for me are located here:
>
> c:\Program Files\OrfeoToolbox\OTB-6.6.0-Win64\bin\
>
> I'm running on a machine with Windows 10, 64bit, have the OTB installed 
> with 64bit and Python 2.7 with 64bit architecture (yes, I'm sure about 
> that). I also have GDAL installed under 
>
> C:\Program Files\GDAL\
>
> Any help is much appreciated, thanks in advance!
>

-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[otb-users] Definition of Texture metrics

2018-08-10 Thread Agustin Lobo
Not all metrics potentially output by
otbcli_HaralickTextureExtraction

are actually defined in the reference by Haralick. Could you point to
the appropriate reference(s)?
(or perhaps they are defined somewhere else in in the doc?)

Thanks
Agus

-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [otb-users] Zonal stats: updating polygons of a vector file by adding fields computed from a raster

2018-08-10 Thread Guillaume Pasero

  
  
Hi,

I don't see anything in OTB that does exactly what you need.

The approach you propose seems the right one. I see two other ways :


  Build a new filter using the Sampling framework. You may
re-implement the ThreadedGenerateData() to use your thread pool.
ImageSampleExtractorFilter is a good starting point. 
  
  Using existing OTB filters. Iterate over polygons, for each
one :
  
copy it alone in a in-memory OGRDataSource
extract an ROI of the image over the polygon extent
rasterize the polygon in a binary mask over the input image
  ROI
with ManageNoData, apply the binary mask as a no-data on the
  input image ROI

use ComputeImagesStatistics with the background value
  corresponding to no-data
store the results in the current polygon.

  

My 2 cents,

Guillaume

On 08/03/2018 05:34 PM, Jordi Inglada
  wrote:


  
Hi,

Given an image (raster) and a vector file containing polygons, I need to
compute a series of values for each polygon like the mean of a
particular band of the raster, etc. and then produce a new (or update
the) vector file with new fields. I think these are called zonal
statistics.

It looks like the LSMSVectorization application does that, but it uses a
raster segmentation instead of an input vector file. Given that my
polygons cover only a small fraction of the input raster, I don't think
than rasterizing the vector file to use this application will be
efficient. An besides, I would have to link back the attributes to the
original polygons, which is an additional step.

Is there any other way to do that with existing OTB applications? Maybe
gdal command line tools can do that? I have been looking around and it
seems that this is usually done the way LSMSVectorization does it (burn
the vector to raster, then compute using rasters only).

Do you have any advice on how to proceed if I need to write my own
application for that? I guess I will have to if I want to be able to
compute other features than mean and variance of the raster bands.

By the way, my images and vector data are huge, so streaming and
multi-threading will be needed.

I was thinking about the following approach:

1. Read in a set of polygons until a total surface is reached (so that
   we can associate that with the RAM needed for the total number of raster
   pixels to keep in memory).
2. Project the polygons onto the raster geometry and read in the pixels
3. Parallel computation of the stats (either with an OpenMP loop or a
   simple thread pool [1])
4. Write the geometries and the stats to the output file
5. Release the memory and go back to 1

Any comments on that?

Thanks.

Jordi

[1] https://jordiinglada.net/wp/2015/05/13/a-simple-thread-pool-to-run-parallel-prosail-simulations/




-- 
  

  
  
  Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation -
  Département Payload Data & 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 - guillaume.pas...@c-s.fr
  
  

  

  




-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.