1 | .. _kernel-orfeotoolbox: |
---|
2 | |
---|
3 | Optional Orfeo Toolbox support |
---|
4 | ====================== |
---|
5 | |
---|
6 | `Orfeo Toolbox <http://orfeo-toolbox.org/otb/>`_ provides simple to advanced algorithms for processing imagery available from remote sensors. |
---|
7 | The optional Orfeo Toolbox support is available since `ZOO-Project 1.5 <http://zoo-project.org>`__. It allows to execute the `OTB Applications <http://orfeo-toolbox.org/otb/otb-applications.html>`_ directly as ZOO WPS Services thanks to a :ref:`kernel_index` specific internal mechanism which is detailed in this section. |
---|
8 | |
---|
9 | .. note:: |
---|
10 | |
---|
11 | |otb| `Orfeo Toolbox <https://www.orfeo-toolbox.org>`__ is an open source image processing library. Learn more by reading its `documentation <https://www.orfeo-toolbox.org/documentation/>`__. |
---|
12 | |
---|
13 | |
---|
14 | .. |otb| image:: ../_static/orfeotoolbox.png |
---|
15 | :height: 115px |
---|
16 | :width: 150px |
---|
17 | :scale: 30% |
---|
18 | :alt: Orfeo Toolbox logo |
---|
19 | |
---|
20 | |
---|
21 | Installation and configuration |
---|
22 | ------------------------------ |
---|
23 | |
---|
24 | Follow the step described bellow in order to activate the ZOO-Project optional Orfeo Toolbox support. |
---|
25 | |
---|
26 | Prerequisites |
---|
27 | ..................... |
---|
28 | |
---|
29 | * latest `ZOO-Kernel <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel>`_ trunk version |
---|
30 | * Orfeo Toolbox (`OTB 4.2.1 <http://orfeo-toolbox.org/otb/>`_) |
---|
31 | * Insight Segmentation and Registration Toolkit (`ITK-4.7 <http://itk.org/ITK/resources/software.html/>`_) |
---|
32 | |
---|
33 | Installation steps |
---|
34 | ........................... |
---|
35 | |
---|
36 | .. Note:: These installation steps were successfully tested on Ubuntu 14.4 LTS |
---|
37 | |
---|
38 | .. Note:: For OTB and ITK, the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS must first be set to ``-fPIC`` |
---|
39 | |
---|
40 | Download lastest ZOO-Kernel code from SVN. |
---|
41 | |
---|
42 | .. code-block:: guess |
---|
43 | |
---|
44 | svn checkout http://svn.zoo-project.org/svn/trunk/zoo-kernel zoo-kernel |
---|
45 | |
---|
46 | Then compile ZOO-Kernel using the needed configuration options as shown bellow: |
---|
47 | |
---|
48 | .. code-block:: guess |
---|
49 | |
---|
50 | cd zoo-kernel |
---|
51 | autoconf |
---|
52 | ./configure --with-otb=/usr/local --with-itk=/usr/local --with-itk-version=4.7 |
---|
53 | make |
---|
54 | cp zoo_loader.cgi /usr/lib/cgi-bin |
---|
55 | |
---|
56 | Configuration steps |
---|
57 | .................................... |
---|
58 | |
---|
59 | Main configuration file |
---|
60 | ************************* |
---|
61 | |
---|
62 | Add the following content to your ``/usr/lib/cgi-bin/main.cfg`` file |
---|
63 | in the ``[env]`` section: |
---|
64 | |
---|
65 | .. code-block:: guess |
---|
66 | |
---|
67 | ITK_AUTOLOAD_PATH=/usr/local/lib/otb/applications |
---|
68 | |
---|
69 | Services configuration file |
---|
70 | **************************** |
---|
71 | |
---|
72 | The build of the `otb2zcfg <http://zoo-project.org/trac/browser/trunk/thirds/otb2zcfg>`_ utility is required to activate the available OTB Applications as WPS services. This can be done using the following command: |
---|
73 | |
---|
74 | .. code-block:: guess |
---|
75 | |
---|
76 | mkdir build |
---|
77 | cd build |
---|
78 | ccmake .. |
---|
79 | make |
---|
80 | |
---|
81 | Run the following command to generate all the needed zcfg files for the available OTB Application: |
---|
82 | |
---|
83 | .. code-block:: guess |
---|
84 | |
---|
85 | mkdir zcfgs |
---|
86 | cd zcfgs |
---|
87 | export ITK_AUTOLOAD_PATH=/your/path/to/otb/applications |
---|
88 | ../build/otb2zcfg |
---|
89 | mkdir /location/to/your/cgi-bin/OTB |
---|
90 | cp *zcfg /location/to/your/cgi-bin/OTB |
---|
91 | |
---|
92 | .. warning |
---|
93 | |
---|
94 | The ITK_AUTOLOAD_PATH environment variable is required in the [env] section of your main.cfg. |
---|
95 | |
---|
96 | Test requests |
---|
97 | **************************** |
---|
98 | |
---|
99 | Once done, OTB Applications should be listed as available WPS Services when runing a GetCapabilities request |
---|
100 | |
---|
101 | .. code-block:: guess |
---|
102 | |
---|
103 | http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS |
---|
104 | |
---|
105 | Each OTB Service can then be described individually using the DescribeProcess request, as for example: |
---|
106 | |
---|
107 | .. code-block:: guess |
---|
108 | |
---|
109 | http://localhost/cgi-bin/zoo_loader.cgi?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=OTB.BandMath |
---|
110 | |
---|
111 | Here is an example request executing the *OTB.BandMath* Application with the `OTB Cookbook <https://www.orfeo-toolbox.org/CookBook/CookBook.html>`_ sample data as input |
---|
112 | |
---|
113 | .. code-block:: guess |
---|
114 | |
---|
115 | http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=OTB.BandMath&DataInputs=il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW.tif;il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW_nir.tif;out=float;exp=im1b3*cos%28im1b1%29,im1b2*cos%28im1b1%29,im1b1*cos%28im1b1%29&RawDataOutput=out@mimeType=image/png |
---|
116 | |
---|
117 | |
---|
118 | .. note:: |
---|
119 | |
---|
120 | The usual ZOO GetStatus requests also work when using the OTB Applications as WPS Services. |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|