Commit e29e967c authored by Rashad Kanavath's avatar Rashad Kanavath

Merge remote-tracking branch 'origin/develop' into msvc_support

parents 78fedeae 69c7abfc
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/sh
export LD_LIBRARY_PATH=@OTB_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
export PYTHONPATH=@OTB_INSTALL_PREFIX@/lib:@OTB_INSTALL_PREFIX@/lib/otb/python:$PYTHONPATH
export OTB_APPLICATION_PATH=@OTB_INSTALL_PREFIX@/lib/otb/applications
@PYTHON_EXECUTABLE@ @CMAKE_SOURCE_DIR@/Scripts/otbGenerateWrappersRstDoc.py
set(OUT_OF_SOURCE_BUILD FALSE)
if(NOT PROJECT_NAME)
cmake_minimum_required(VERSION 2.8)
project(OTBCookBook)
set(OUT_OF_SOURCE_BUILD TRUE)
endif()
#find OTB
find_package(OTB REQUIRED)
#find Python
find_package(PythonInterp REQUIRED)
find_program(SH_INTERP sh)
if(NOT SH_INTERP)
message(FATAL_ERROR "'sh' program not found")
endif()
find_program(SPHINX_BUILD sphinx-build)
if(NOT SPHINX_BUILD)
message(FATAL_ERROR "The 'sphinx-build' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the 'sphinx-build' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org")
endif()
string(TIMESTAMP OTB_COPYRIGHT_YEAR "%Y")
set(OTB_COPYRIGHT_TEXT "${OTB_COPYRIGHT_YEAR}, OTB Team")
set(RST_GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/rst)
set(RST_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
set(RST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/rst)
#make some directories
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/Applications)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/recipes)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/Art)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/Art/MonteverdiImages)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/Art/QtImages)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/_static)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${RST_GENERATED_SOURCE_DIR}/_templates)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/RunApplicationsRstGenerator.sh.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/RunApplicationsRstGenerator.sh
@ONLY)
file(GLOB images ${CMAKE_CURRENT_SOURCE_DIR}/Art/*.*)
foreach(image ${images})
get_filename_component(out_file ${image} NAME)
configure_file(${image} ${RST_GENERATED_SOURCE_DIR}/Art/${out_file} COPYONLY)
endforeach()
file(GLOB mvd_images ${CMAKE_CURRENT_SOURCE_DIR}/Art/MonteverdiImages/*.*)
foreach(mvd_image ${mvd_images})
get_filename_component(out_file ${mvd_image} NAME)
configure_file(${mvd_image} ${RST_GENERATED_SOURCE_DIR}/Art/MonteverdiImages/${out_file} COPYONLY)
endforeach()
file(GLOB qt_images ${CMAKE_CURRENT_SOURCE_DIR}/Art/QtImages/*.png)
foreach(qt_image ${qt_images})
get_filename_component(out_file ${qt_image} NAME)
configure_file(${qt_image} ${RST_GENERATED_SOURCE_DIR}/Art/QtImages/${out_file} COPYONLY)
endforeach()
file(GLOB sar_images ${CMAKE_CURRENT_SOURCE_DIR}/Art/SARImages/*.png)
foreach(sar_image ${sar_images})
get_filename_component(out_file ${sar_image} NAME)
configure_file(${sar_image} ${RST_GENERATED_SOURCE_DIR}/Art/SARImages/${out_file} COPYONLY)
endforeach()
file(GLOB rst_sources1 ${RST_SOURCES}/*.rst)
foreach(rst_file ${rst_sources1})
get_filename_component(out_file ${rst_file} NAME)
configure_file(${rst_file} ${RST_GENERATED_SOURCE_DIR}/${out_file} COPYONLY)
endforeach()
file(GLOB rst_sources2 ${RST_SOURCES}/recipes/*.rst)
foreach(rst_file ${rst_sources2})
get_filename_component(out_file ${rst_file} NAME)
configure_file(${rst_file} ${RST_GENERATED_SOURCE_DIR}/recipes/${out_file} COPYONLY)
endforeach()
file(GLOB rst_sources3 ${RST_SOURCES}/Applications/*.rst)
foreach(rst_file ${rst_sources3})
get_filename_component(out_file ${rst_file} NAME)
configure_file(${rst_file} ${RST_GENERATED_SOURCE_DIR}/Applications/${out_file} COPYONLY)
endforeach()
configure_file(${RST_SOURCES}/conf.py.in ${RST_GENERATED_SOURCE_DIR}/conf.py @ONLY)
configure_file(${RST_SOURCES}/Makefile.in ${RST_GENERATED_SOURCE_DIR}/Makefile @ONLY)
add_custom_target(generate_otbapps_rst
ALL
COMMAND ${SH_INTERP} ${CMAKE_CURRENT_BINARY_DIR}/RunApplicationsRstGenerator.sh
WORKING_DIRECTORY ${RST_GENERATED_SOURCE_DIR}
COMMENT "Auto-generating Application Reference Documentation in RST"
)
add_custom_target(CookBookHTMLFromRST
ALL
COMMAND ${CMAKE_MAKE_PROGRAM} html
WORKING_DIRECTORY ${RST_GENERATED_SOURCE_DIR}
DEPENDS generate_otbapps_rst
COMMENT "Building RST documentation in html")
# add_custom_target(CookBookHTMLFromPDF
# ALL
# COMMAND ${CMAKE_MAKE_PROGRAM} pdf
# WORKING_DIRECTORY ${RST_GENERATED_SOURCE_DIR}
# COMMENT "Building RST documentation in pdf")
# add_dependencies(CookBookHTMLFromPDF CookBookHTMLFromRST)
RST docs for Orfeo Toolbox CookBook
Introduction
============
This is a replacement of old OTB Cookbook which was written in Latex. This version is completely deviate from existing Latex format to reStructured format (rst).
Converting existing latex to rst is not that straightforward. All rst files for OTB applications are generated using python script otbGenerateWrappersRstDoc.py.
For others in recipes, we used a tool called pandoc to get an inital rst and then edited out errors manually. You do not have to generate them again.
The old Cookbook in otb-documents is deprecated.
Requirements
============
install OTB, sphnix, sphinx-rtd-theme
aptitude install python-sphinx python-sphinx-rtd-theme
How to build the Cookbook:
==========================
mkdir ~/build-cookbook
cd ~/build-cookbook
cmake ~/sources/otb/Documentation/CookBook -DOTB_DIR=/path/where/you/installed/otb/lib/cmake/OTB-X.Y
make
View results
============
Open the cookbook documentation in a firefox tab!
firefox ~/build-cookbook/rst/_build/html/index.html
This diff is collapsed.
Applications
============
This chapter is the reference documentation for applications delivered
with . It provides detailed description of the application behaviour and
parameters, as well as python and bash snippets to use them
applications. For a general introduction on applications delivered with
, please read chapter[chap:otb-applications], page .
.. toctree::
:maxdepth: 3
Applications/Image_Manipulation.rst
Applications/Vector_Data_Manipulation.rst
Applications/Calibration.rst
Applications/Geometry.rst
Applications/Image_Filtering.rst
Applications/Feature_Extraction.rst
Applications/Stereo.rst
Applications/Learning.rst
Applications/Segmentation.rst
Applications/Miscellaneous.rst
Calibration
===========
.. toctree::
:maxdepth: 1
app_OpticalCalibration
app_SARCalibration
app_SarRadiometricCalibration
app_SARDecompositions
app_SARPolarMatrixConvert
app_SARPolarSynth
Feature Extraction
==================
.. toctree::
:maxdepth: 1
app_BinaryMorphologicalOperation
app_ComputePolylineFeatureFromImage
app_DSFuzzyModelEstimation
app_EdgeExtraction
app_GrayScaleMorphologicalOperation
app_HaralickTextureExtraction
app_HomologousPointsExtraction
app_LineSegmentDetection
app_LocalStatisticExtraction
app_MultivariateAlterationDetector
app_RadiometricIndices
app_SFSTextureExtraction
app_VectorDataDSValidation
Geometry
========
.. toctree::
:maxdepth: 1
app_BundleToPerfectSensor
app_ConvertCartoToGeoPoint
app_ConvertSensorToGeoPoint
app_GeneratePlyFile
app_GenerateRPCSensorModel
app_GridBasedImageResampling
app_ImageEnvelope
app_OrthoRectification
app_Pansharpening
app_RefineSensorModel
app_RigidTransformResample
app_Superimpose
Image Filtering
===============
.. toctree::
:maxdepth: 1
app_Despeckle
app_DimensionalityReduction
app_MeanShiftSmoothing
app_Smoothing
Image Manipulation
==================
.. toctree::
:maxdepth: 1
app_ColorMapping
app_ConcatenateImages
app_Convert
app_DownloadSRTMTiles
app_ExtractROI
app_MultiResolutionPyramid
app_Quicklook
app_ReadImageInfo
app_Rescale
app_SplitImage
app_TileFusion
app_ManageNoData
app_DEMConvert
Learning
========
.. toctree::
:maxdepth: 1
app_ClassificationMapRegularization
app_ComputeConfusionMatrix
app_ComputeImagesStatistics
app_FusionOfClassifications
app_PolygonClassStatistics
app_SampleExtraction
app_SampleSelection
app_ImageClassifier
app_KMeansClassification
app_SOMClassification
app_TrainImagesClassifier
app_TrainVectorClassifier
app_PredictRegression
app_TrainRegression
Miscellaneous
=============
.. toctree::
:maxdepth: 1
app_BandMath
app_BandMathX
app_CompareImages
app_HyperspectralUnmixing
app_KmzExport
app_OSMDownloader
app_ObtainUTMZoneFromGeoPoint
app_PixelValue
app_VertexComponentAnalysis
Segmentation
============
.. toctree::
:maxdepth: 1
app_ComputeOGRLayersFeaturesStatistics
app_ConnectedComponentSegmentation
app_HooverCompareSegmentation
app_LSMSSegmentation
app_LSMSSmallRegionsMerging
app_LSMSVectorization
app_OGRLayerClassifier
app_Segmentation
app_TrainOGRLayersClassifier
Stereo
======
.. toctree::
:maxdepth: 1
app_BlockMatching
app_DisparityMapToElevationMap
app_FineRegistration
app_StereoFramework
app_StereoRectificationGridGenerator
Vector Data Manipulation
========================
.. toctree::
:maxdepth: 1
app_ConcatenateVectorData
app_Rasterization
app_VectorDataExtractROI
app_VectorDataReprojection
app_VectorDataSetField
app_VectorDataTransform
Installation
============
We provide different standalone binary packages for OTB-Applications:
- for Windows platform (7 or higher)
- for 64bit Linux distribution
- for MacOS X
Other binaries can be available as packages (OSGeo packages,
Debian/Ubuntu packages, OpenSuse packages), however be advised that they
may not be up-to-date nor delivered with full features. If you want to
build from source or if we don’t provide packages for your system,
information is available in the `Software Guide <http://orfeo-toolbox.org/SoftwareGuide/>`_,
in the section "Building from Source".
Windows
-------
We provide for Windows Seven and later through standalone packages. They
are cross-compiled with MinGW, for 32 bits and 64 bits platforms. They
contain all applications and their launchers (both command line and graphical
launchers are provided).
Check the `Download page <https://www.orfeo-toolbox.org/download>`__
There is a 32 bits and a 64 bits version. They contain the same directory
structure:
- ``monteverdi.bat`` : A launcher script for Monteverdi
- ``mapla.bat`` : A launcher script for Mapla
- ``otbenv.bat`` : A script to initialize the environment for OTB
executables
- ``bin`` : A folder containing application launchers (otbcli.bat,
otbgui.bat) and the DLLs.
- ``lib`` : A folder containing application DLLs.
The applications can be launched from the Mapla launcher. If you want to
use the otbcli and otbgui launchers, you can initialize a command prompt
with ``otbenv.bat``.
Linux 64bit
-----------
We provide for Linux 64 bits OS through standalone packages. They contain
all OTB Applications and their launchers (both command line and
graphical launchers are provided). Check the `Download page <https://www.orfeo-toolbox.org/download>`__
This package is a self-extractible archive. You may uncompress it with a
double-click on the file, or with the command line :
::
chmod +x OTB-X.Y.Z-Linux64.run
./OTB-X.Y.Z-Linux64.run
Please note that the resulting installation is not meant to be moved,
you should uncompress the archive in its final location. Once the
archive is extracted, the directory structure is made of:
- ``monteverdi.sh`` : A launcher script for Monteverdi
- ``mapla.sh`` : A launcher script for Mapla
- ``otbenv.profile`` : A script to initialize the environment for OTB
executables
- ``bin`` : A folder containing application launchers (otbcli.sh,
otbgui.sh), Monteverdi and Mapla.
- ``lib`` : A folder containing all shared libraries and OTB
applications.
- ``share`` : A folder containing common resources and copyright
mentions.
In order to run the command line launchers, this package doesn’t require
any special library that is not present in most modern Linux
distributions. The graphical executable (otbgui launchers, Monteverdi
and Mapla) use the X11 libraries, which are widely used in a lot of
distributions :
::
libx11-6 libxext6 libxau6 libxxf86vm1 libxdmcp6 libdrm2
Monteverdi also requires the standard graphics libraries libgl1 and
libglu1. Make sure you have at least one version of them installed
in your system.
The applications can be launched from the Mapla launcher. If you want to
use the otbcli and otbgui launchers, you can initialize your environment
with ``source otbenv.profile``.
Notes:
- You must use monteverdi and mapla through ``mapla.sh`` and ``monteverdi.sh`` helper scripts in extracted directory.
- The helper scripts for monteverdi and mapla set required environment variables
- You might be tempted to move ``OTB-X.Y-Linux64`` into another location say /usr/local/ after extraction. But avoid this action!
- To have ``OTB-X.Y-Linux64`` installed in /usr/local or /opt execute OTB-X.Y-Linux64.run in that directory.
- Multiple installation of OTB can exists in same system without one conflicting the other!
MacOS X
-------
We provide for MacOS X through a standalone package. This package is a
self-extractible archive, quite similar to the Linux one. You may
uncompress it with the command line :
::
chmod +x OTB-X.Y.Z-Darwin64.run
./OTB-X.Y.Z-Darwin64.run
Once the archive is extracted, you can see OTB-X.Y.Z-Darwin64 directory in
the same direcrtory along with OTB-X.Y.Z-Darwin64.run
Contents of OTB-X.Y.Z-Darwin64 is briefly listed below:
- ``Monteverdi.app`` : A Mac OSX .app for Monteverdi
- ``Mapla.app`` : A Mac OSX .app for Mapla.
- ``bin`` : A folder containing application launchers (otbcli.sh,
otbgui.sh), monteverdi and mapla binaries.
- ``lib`` : A folder containing all shared libraries and OTB
applications.
- ``share`` : A folder containing common resources and copyright
mentions.
Notes:
- If you want to use the otbcli and otbgui launchers, you must access
them via a terminal prompt.
- The OSX .app are provided for monteverdi (viewer) and mapla
(application browser).
- You must use monteverdi and mapla through their .app files only.
- You are allowed to move these .app files and refrain from moving or
deleting OTB-X.Y.Z-Darwin64 after extraction. In case you need to have OTB
installed in some other directory. Extract the .run file there.
Other packages
--------------
Warning! These packages may not be up-to-date with latest OTB
releases. In addition, some features of the library may not be available
on every platform. Some of these are not maintained by OTB-team. If you
want to get involved in the packaging of OTB for your favourite
platform, please contact us through the developer’s mailing list:
otb-developers@googlegroups.com.
Debian
~~~~~~
There are OTB packages for Debian (unstable) since version 5.2.0. OTB
Applications packages may be available as Debian packages through APT
repositories:
- otb-bin for command line applications
- otb-bin-qt for Qt applications
- python-otb for python applications
Due to license issues, the OTB package built in Debian doesn’t contain
6S. As a consequence, the package does not contain the
OpticalCalibration application.
Ubuntu 12.04 and higher
~~~~~~~~~~~~~~~~~~~~~~~
For Ubuntu 12.04 and higher, OTB Applications packages may be available
as Debian packages through APT repositories:
- otb-bin for command line applications
- otb-bin-qt for Qt applications
- python-otb for python applications
Since release 3.14.1, OTB Applications packages are available in the
`ubuntugis-unstable <https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable>`__
repository.
Since release 5.2.0, the Ubuntu packages derive from the Debian
packages.
You can add it by using these command-lines:
::
sudo aptitude install add-apt-repository
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
After you can run:
::
sudo aptitude install otb-bin otb-bin-qt python-otb
If you are using *Synaptic*, you can add the repositories, update and
install the packages through the graphical interface.
For further informations about Ubuntu packages go to
`ubuntugis-unstable <https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable>`__
launchpad page and click on Read about installing.
apt-add-repository will try to retrieve the GPG keys of the
repositories to certify the origin of the packages. If you are behind a
http proxy, this step won’t work and apt-add-repository will stall and
eventually quit. You can temporarily ignore this error and proceed with
the update step. Following this, aptitude update will issue a warning
about a signature problem. This warning won’t prevent you from
installing the packages.
OpenSuse 12.X and higher
~~~~~~~~~~~~~~~~~~~~~~~~
For OpenSuse 12.X and higher, OTB Applications packages are available
through *zypper*.
First, you need to add the appropriate repositories with these
command-lines (please replace :math:`11.4` by your OpenSuse version):
::
sudo zypper ar
http://download.opensuse.org/repositories/games/openSUSE_11.4/ Games
sudo zypper ar
http://download.opensuse.org/repositories/Application:/Geo/openSUSE_11.4/ GEO
sudo zypper ar
http://download.opensuse.org/repositories/home:/tzotsos/openSUSE_11.4/ tzotsos
Now run:
::