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 | .. _kernel-orfeotoolbox-main.cfg: |
---|
60 | |
---|
61 | Main configuration file |
---|
62 | ************************* |
---|
63 | |
---|
64 | Add the following content to your ``/usr/lib/cgi-bin/main.cfg`` file |
---|
65 | in the ``[env]`` section: |
---|
66 | |
---|
67 | .. code-block:: guess |
---|
68 | |
---|
69 | ITK_AUTOLOAD_PATH=/usr/local/lib/otb/applications |
---|
70 | |
---|
71 | Services configuration file |
---|
72 | **************************** |
---|
73 | |
---|
74 | 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: |
---|
75 | |
---|
76 | .. code-block:: guess |
---|
77 | |
---|
78 | mkdir build |
---|
79 | cd build |
---|
80 | ccmake .. |
---|
81 | make |
---|
82 | |
---|
83 | Run the following command to generate all the needed zcfg files for the available OTB Application: |
---|
84 | |
---|
85 | .. code-block:: guess |
---|
86 | |
---|
87 | mkdir zcfgs |
---|
88 | cd zcfgs |
---|
89 | export ITK_AUTOLOAD_PATH=/your/path/to/otb/applications |
---|
90 | ../build/otb2zcfg |
---|
91 | mkdir /location/to/your/cgi-bin/OTB |
---|
92 | cp *zcfg /location/to/your/cgi-bin/OTB |
---|
93 | |
---|
94 | .. warning |
---|
95 | |
---|
96 | The ITK_AUTOLOAD_PATH environment variable is required in the [env] section of your main.cfg. |
---|
97 | |
---|
98 | Test requests |
---|
99 | **************************** |
---|
100 | |
---|
101 | Once done, OTB Applications should be listed as available WPS Services when runing a GetCapabilities request |
---|
102 | |
---|
103 | .. code-block:: guess |
---|
104 | |
---|
105 | http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS |
---|
106 | |
---|
107 | Each OTB Service can then be described individually using the DescribeProcess request, as for example: |
---|
108 | |
---|
109 | .. code-block:: guess |
---|
110 | |
---|
111 | http://localhost/cgi-bin/zoo_loader.cgi?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=OTB.BandMath |
---|
112 | |
---|
113 | 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 |
---|
114 | |
---|
115 | .. code-block:: guess |
---|
116 | |
---|
117 | 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 |
---|
118 | |
---|
119 | |
---|
120 | .. note:: |
---|
121 | |
---|
122 | The usual ZOO GetStatus requests also work when using the OTB Applications as WPS Services. |
---|
123 | |
---|
124 | |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|