Commit 4bac53c4 authored by Victor Poughon's avatar Victor Poughon

Merge branch 'release-6.6' into develop

parents 9501aa16 ae0a8d74
......@@ -104,7 +104,7 @@ endif ()
find_library ( QWT_LIBRARY
NAMES qwt qwt${QWT_MAJOR_VERSION}
NAMES qwt qwt${QWT_MAJOR_VERSION} qwt-qt5
HINTS ${QT_LIBRARY_DIR}
)
......
......@@ -120,7 +120,7 @@ endif()
if(SHARK_USE_CBLAS AND SHARK_USE_DYNLIB)
set(REQUIRED_CBLAS_LIB CBLAS_LIBRARY)
find_library(CBLAS_LIBRARY NAMES cblas)
find_library(CBLAS_LIBRARY NAMES cblas blas PATH_SUFFIXES blas)
else()
set(REQUIRED_CBLAS_LIB)
endif()
......
......@@ -174,6 +174,10 @@ if(NOT OTB_INSTALL_PACKAGE_DIR)
set(OTB_INSTALL_PACKAGE_DIR "${OTB_INSTALL_LIBRARY_DIR}/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
endif()
if(NOT OTB_INSTALL_DESCR_DIR)
set (OTB_INSTALL_DESCR_DIR "share/otb/description")
endif()
#convert path to native for reconfiguring otbcli.bat.in
file(TO_NATIVE_PATH "${OTB_INSTALL_APP_DIR}" OTB_INSTALL_APP_DIR_NATIVE)
......
......@@ -16,9 +16,10 @@ those values.
* ``OTB_MAX_RAM_HINT``: Default maximum memory that OTB should use for processing, in MB. If not set, default value is 128 MB.
* ``OTB_LOGGER_LEVEL``: Default level of logging for OTB. Should be one of ``DEBUG``, ``INFO``, ``WARNING``, ``CRITICAL`` or ``FATAL``, by increasing order of priority. Only messages with a higher priority than the level of logging will be displayed. If not set, default level is ``INFO``.
.. _extended-filenames:
Extended filenames
------------------
.. _extended-filenames:
Extended filenames is an interesting feature of OTB. With it, you can control
several aspects of the beahvior of the OTB in the OTB-Applications or in our
......
......@@ -116,7 +116,7 @@ FAQ
~~~
Q: Unable to import otbApplication library with Python3
+++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
......@@ -126,10 +126,9 @@ A: You need to add a symlink to libpython3.5m.so.rh-python35-1.0 to make it work
Here is the solution:
- find the libpython3.5XX on your system : find /usr/lib -iname *libpython3.5*
(on Ubuntu 14.04, it is /usr/lib/x86_64-linux-gnu/libpython3.5m.so)
- create a symlink : ln -s path/to/lib/python3.5XX
path/to/lib/libpython3.5m.so.rh-python35-1.0
- Find the libpython3.5XX on your system : ``find /usr/lib -iname *libpython3.5*``
(on Ubuntu 14.04, it is ``/usr/lib/x86_64-linux-gnu/libpython3.5m.so``)
- Create a symlink : ``ln -s path/to/lib/python3.5XX path/to/lib/libpython3.5m.so.rh-python35-1.0``
- Try to import otbApplication again
See this discussion on `OTB issue tracker <https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues/1540#note_67864>`_
Synopsis
--------
This archive provides a development kit for the ORFEO ToolBox library which
allows to easily compile OTB and facilitate the creation of programs based on
OTB.
It contains shared libraries of OTB dependencies and helper scripts for the
configuration and the compilation of the library.
Note that OTB sources are not included in the archive (see instructions below).
Prerequisites
-------------
- cmake (>= 3.2)
- gcc (>= 4.9)
- git
Extract XDK
-----------
::
cd /opt (You can use another a directory of your own choice)
chmod +x OTB-|release|-xdk-Linux64.run
./OTB-|release|-xdk-Linux64.run
**You now will have a directory named OTB-|release|-xdk-Linux64 in \'/opt\'**
Setup environment
-----------------
There is a helper script in package called **xdkenv.profile**. This script export
required environments to configure and build OTB.
::
cd /opt/OTB-|release|-xdk-Linux64
. ./xdkenv.profile
Test environment setup by checking value of CMAKE_PREFIX_PATH
::
echo $CMAKE_PREFIX_PATH
The above command will output:
/opt/OTB-|release|-xdk-Linux64
Download, Configure and build OTB
---------------------------------
::
mkdir -p /opt/OTB/build && cd /opt/OTB
git clone --depth=1 --branch=develop https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git source
cd build && cmake ../source
make -j2
Notes
~~~~~
* By default, all OTB\_USE\_\* variables in OTB are set to FALSE except for 6S and SiftFast. You can check/activate them in your cmake-gui/ccmake.
* If you need to activate Qt4 modules (Monteverdi, Ice, QtWidget, ApplicationEngine ..), you must set *QT_BINARY_DIR*.
::
cd /opt/OTB/build && cmake -DOTB_USE_QT4=TRUE -DQT_BINARY_DIR=$CMAKE_PREFIX_PATH/bin
This is because Qt tools ( moc, rcc, et al) are reported as not found by cmake due to incorrect path in "qmake -query"
......@@ -137,7 +137,6 @@ SET( Tex_SRCS
FeatureExtraction.tex
ObjectBasedImageAnalysis.tex
Hyperspectral.tex
ReleaseNotes.tex
Wrapping.tex
)
......
\chapter{Contributors Guidelines}
\label{chapter:Contribute}
This chapter is concerned with the contributor guidelines.
Here, you can find useful information about:
\begin{itemize}
\item remote modules,
\item how to submit them,
\item what are the acceptance/release policies
\item what are the licence compliances
\item ...
\end{itemize}
See
\url{https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/CONTRIBUTING.md}
in OTB sources.
A wiki page is also available here : \url{http://wiki.orfeo-toolbox.org/index.php/Contributors_guidelines}.
\section{How to Contribute}
\textbf{Caution}:
\begin{itemize}
\item This section has to be reviewed by PSC
\item Some guidelines only apply after modularization is completed
\end{itemize}
Contributions through Remote Modules is the preferred way if your contribution is about adding new classes or application to bring new features to OTB.
Please also refer to ITK guidelines for remote modules (\url{http://www.itk.org/Wiki/ITK/Policy_and_Procedures_for_Adding_Remote_Modules}).
\section{What are remote modules?}
Remote modules are just like regular modules, except they are not distributed inside OTB source code.
In the Modules/Remote folder of the OTB sources, you can add any number of directories containing valid modules. You will then be able to activate those module through CMake configuration, and build them.
But there is more. Let assume that you have a valid remote module, hosted somewhere on a Git repository. We can add a special CMake file in the Modules/Remote that will tell CMake that this remote module is available, and can be activated during CMake configuration. Upon activation, CMake will first checkout the remote module source code into Modules/Remote, and then build it as a regular module.
But there is more. Once the CMake file describing your module is added into Remote/Modules, you can benefit from OTB development services just like any other module: dashboard build, packaging, doxygen documentation ...
To make it short, by contributing a remote module:
\begin{itemize}
\item You still host the code of your contribution, which is not mixed with other parts of OTB,
\item Any user building OTB will be able to fetch and build your module,
\item Your module will be built on dashboard, packaged for official releases and documented by OTB automatic documentation processes,
\item You do not need permissions to push changesets on OTB repositories.
\end{itemize}
\section{How to get your remote module inside OTB? }
\begin{itemize}
\item Follow the instructions on writing a remote module in order to have a working remote module inside your local source code tree (\ref{sec:writemodule}).
\item Host the remote module code on a publicly available git repository. If you do not have access to a git server, bitbucket or github can provide this service for you.
\item Write a short email to the otb-developers list, detailing your contributed remote module, and providing the cmake file to add into Modules/Remote so as to get it into OTB, as well as evidence that you comply with the remote module policy (see below).
\item Remote module acceptance policy compliance will be checked by the otb-developers list,
\item Acceptance of remote module is submitted to vote on otb-developers (to be reviewed by PSC).
\end{itemize}
If accepted, your CMake file will be placed into the Modules/Remote folder inside OTB source tree.
During the OTB release process, all module complying with the remote module release policy will be packaged along with standard modules.
A remote module can be removed from Modules/Remote (this only requires to remove the CMake file describing it), if:
\begin{itemize}
\item It does no longer comply with the remote module acceptance policy (in which case the decision is submitted to vote on otb-developers),
\item The author of the remote module ask to remove it.
\end{itemize}
\section{Remote module acceptance policy }
So as to get your module accepted as an official remote module, you should comply with the following:
\begin{itemize}
\item Remote module source code should be hosted on a publicly available Git repository
\item Author of the remote module should be identified and registered to otb-developers mailing list
\item Author of the remote module accepts to be contacted by developers or users regarding issues with his module (on a best effort basis),
\item Remote module source code should comply with OTB style as much as possible,
\item Remote module source code should be documented using doxygen tags,
\item Remote module should provide a minimal set of tests to ensure build of template code and basic non-regression testing,
\item Remote module should come with a form of documentation (website, publication, readme file ...)
\item Remote module should not embed code from any third party software (unless strong arguments are given by the author, in which case an exception can be made),
\item Remote module should avoid depending on new third parties if possible,
\item Remote module author should be the copyright owner and comply with licences of any third party, which in turn should comply with terms of OTB licence (to be reviewed by PSC)
\item Author of remote module should provide a small description of the remote module to be added on OTB website.
\end{itemize}
An internal module should \textbf{never} depend on a remote module whatsoever.
\section{Remote module release policy }
During the OTB release process, a remote module will be included in source and binary packages if:
\begin{itemize}
\item Dashboard submission exist and show that the remote module:
\begin{itemize}
\item Builds on all plateform,
\item Passes all tests on the reference platform,
\item Does not have any test crashing (i.e. failing with core dump or memory issues) on remaining platform
\end{itemize}
\item The remote module complies with the remote module acceptance policy at the time of the Release Candidate
\end{itemize}
Developers will notify remote modules authors of existing issues at Release Candidate. If by 3 day to the final release dates, some issues listed above still exist, the remote module will be removed from the release source and binary packages.
Moreover, remote module bringing in new third party dependencies will not be included in binary packages.
......@@ -49,6 +49,7 @@ Patrick Imbo (CS),
Remi Cresson (Irstea),
Rik Bellens,
Romain Garrigues (CS),
Santiago Pena Luque (CNES),
Sebastiaan Couwenberg (Debian GIS),
S\'ebastien Dinot (CS),
S\'ebastien Harasse (CS),
......@@ -59,4 +60,5 @@ Tishampati Dhar,
Victor Poughon (CNES),
Vincent Poulain (CNES),
Vincent Schut (Sarvision),
Yannick Reynard
Yannick Reynard,
Yannick Tanguy (CNES)
......@@ -126,7 +126,7 @@ See table \ref{tab:otb-dependencies} for the full list of dependencies.
\hline
\textbf{OPENGL} & \url{https://www.opengl.org/} & no & - \\
\hline
\textbf{Qt} & \url{http://qt-project.org} & no & 4 \\
\textbf{Qt} & \url{https://www.qt.io/developers/} & no & 5 \\
\hline
\textbf{QWT} & \url{http://qwt.sourceforge.net} & no & 6 \\
\hline
......@@ -170,8 +170,7 @@ $ mkdir install
The OTB project uses a git branching model where \texttt{develop} is the current development version.
It contains the latest patches and represents the work in progress towards the next release.
For more information on OTB and git, including how to decide which branch to want to compile, please see the
OTB wiki page at \url{http://wiki.orfeo-toolbox.org/index.php/Git}.
For more information regarding the use of Git in the project please have a look at : \url{http://wiki.orfeo-toolbox.org/index.php/Git}. See the contributing.md (\url{https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/CONTRIBUTING.md}) to have more inforamtion on how to contribute to OTB.
Checkout the relevant branch now:
\begin{verbatim}
......@@ -294,16 +293,16 @@ want to build) :
\url{https://www.orfeo-toolbox.org/packages}
\end{center}
Qt library: Unlike other dependencies building Qt4 on all platform is not trivial task but
Qt library: Unlike other dependencies building Qt5 on all platform is not trivial task but
OTB SuperBuild makes best effort to make it easier for you. So there is still
some additional package installation, one has to do as a pre-requistie for SuperBuild
On a GNU/Linux you must have Qt X11 dependencies installed.
See Qt 4.8 documentation for list of packages that needs to be installed
before starting superbuild. http://doc.qt.io/qt-4.8/requirements-x11.html
For a debian 8.1 systeme, I installed all Qt4 dependencies with below 'apt-get install'
See Qt 5 documentation for list of packages that needs to be installed
before starting superbuild. https://doc.qt.io/qt-5/linux-requirements.html.
For a Debian 8.1 system, I installed all Qt5 dependencies with below 'apt-get install'
\texttt{apt-get install libx11-dev libxext-dev libxt-dev libxi-dev libxrandr-dev libgl-dev libglu-dev}
You can also deactivate QT4 and skip this by passing \texttt{-DOTB\_USE\_QT4=OFF} to cmake.
You can also deactivate QT5 and skip this by passing \texttt{-DOTB\_USE\_QT=OFF} to cmake.
This will give you OTB install without monteverdi, mapla and gui application launchers.
For Mac OSX you need to install XCode and Windows 7,8.1,10 requires MSVC 2015 or higher.
......@@ -410,7 +409,7 @@ $ make install
\hline
\textbf{OTB\_USE\_LIBKML} & OTBlibkml & OTBKMZWriter OTBIOKML OTBAppKMZ \\
\hline
\textbf{OTB\_USE\_QT4} & OTBQt4 & OTBQtWidget \\
\textbf{OTB\_USE\_QT} & OTBQt & OTBQtWidget \\
\hline
\textbf{OTB\_USE\_QWT} & OTBQwt & OTBMonteverdiGUI OTBMonteverdi \\
\hline
......
......@@ -264,10 +264,6 @@ colorlinks,linkcolor={blue},citecolor={blue},urlcolor={blue},
\part{Appendix}\label{part:appendix}
\chapter{Release Notes}
\label{sec:ReleaseNotes}
\input{ReleaseNotes.tex}
%Comment generation of wrapping documentation for release 3.2
\chapter{Wrappings to other languages}
\label{chap:wrappings}
......
......@@ -144,7 +144,7 @@ private:
// Software Guide : BeginLatex
// Application parameters declaration is done using \code{AddParameter()} method.
// \code{AddParameter()} requires the input parameter type
// (ParameterType_InputImage, ParameterType_Int, ParameterType_Float), its name and description.
// (ParameterType\_InputImage, ParameterType\_Int, ParameterType\_Float), its name and description.
// \subdoxygen{otb}{Wrapper}{Application} class contains methods to set parameters characteristics.
// Software Guide : EndLatex
......
......@@ -138,7 +138,7 @@ public:
* \return the point projected in the image coordinates system.
* \throw None
*/
void TransformPointToPhysicalPoint(const PointType& point) const
PointType TransformPointToPhysicalPoint(const PointType& point) const
{
// why no loop on VDimension ?
PointType physicalPoint;
......
......@@ -114,7 +114,11 @@ typedef mpl::map
*/
template
< typename T
#if GDAL_VERSION_NUM >= 2030000
, T ( OGRFeature::*ptr_to_function )(int) const
#else
, T ( OGRFeature::*ptr_to_function )(int)
#endif
, typename FinalReturnType = T
> class MemberGetterPtr
{
......@@ -190,7 +194,11 @@ template
*/
template
< typename T
#if GDAL_VERSION_NUM >= 2030000
, T const* ( OGRFeature::*ptr_to_function )(int, int*) const
#else
, T const* ( OGRFeature::*ptr_to_function )(int, int*)
#endif
, typename FinalReturnType = std::vector<T>
> class MemberContainerGetterPtr
{
......@@ -292,7 +300,11 @@ template
*/
template
< typename T
#if GDAL_VERSION_NUM >= 2030000
, void ( OGRFeature::*ptr_to_function )(int, int, const T*)
#else
, void ( OGRFeature::*ptr_to_function )(int, int, T*) // not const-correct
#endif
, typename ActualParamType = std::vector<T>
> class MemberContainerSetterPtr
{
......
......@@ -67,17 +67,17 @@ otb_add_test(NAME TvOGRExtendedFilename
otb_add_test(NAME TvOGRExtendedFilenameGDALCreate
COMMAND otbOGRTestDriver
otbOGRExtendedFileNameGDALCreate
test.shp?gdal:co:creationOption=OPTION
test_OGRExtendedFilenameGDALCreate.shp?gdal:co:creationOption=OPTION
)
otb_add_test(NAME TvOGRExtendedFilenameGDALLayer
COMMAND otbOGRTestDriver
otbOGRExtendedFileNameGDALLayer
test.shp?&gdal:lco:layeroption=OPTION
test_OGRExtendedFilenameGDALLayer.shp?&gdal:lco:layeroption=OPTION
)
otb_add_test(NAME TvOGRExtendedFilenameGDALLayerOption
COMMAND otbOGRTestDriver
otbOGRExtendedFileNameGDALLayerOption
test.shp
)
\ No newline at end of file
test_OGRExtendedFilenameGDALLayerOption.shp
)
......@@ -93,8 +93,8 @@ public:
bool WorldToLineSample(const Point3DType & inGEoPOint, Point2DType & cr) const;
/** Transform world point (lat,lon,hgt) to satellite position (x,y,z) and satellite velocity */
bool WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint, Point3DType & satelitePosition,
Point3DType & sateliteVelocity) const;
bool WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint, Point3DType & satellitePosition,
Point3DType & satelliteVelocity) const;
/** Transform world point (lat,lon,hgt) to cartesian point (x,y,z) */
static bool WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint);
......
......@@ -182,8 +182,8 @@ bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Poi
}
bool SarSensorModelAdapter::WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint,
Point3DType & satelitePosition,
Point3DType & sateliteVelocity) const
Point3DType & satellitePosition,
Point3DType & satelliteVelocity) const
{
if(m_SensorModel.get() == ITK_NULLPTR)
{
......@@ -205,13 +205,13 @@ bool SarSensorModelAdapter::WorldToSatPositionAndVelocity(const Point3DType & in
if(sensorPos.isNan() || !success)
return false;
satelitePosition[0] = sensorPos.x();
satelitePosition[1] = sensorPos.y();
satelitePosition[2] = sensorPos.z();
satellitePosition[0] = sensorPos.x();
satellitePosition[1] = sensorPos.y();
satellitePosition[2] = sensorPos.z();
sateliteVelocity[0] = sensorVel.x();
sateliteVelocity[1] = sensorVel.y();
sateliteVelocity[2] = sensorVel.z();
satelliteVelocity[0] = sensorVel.x();
satelliteVelocity[1] = sensorVel.y();
satelliteVelocity[2] = sensorVel.z();
return true;
}
......
......@@ -203,11 +203,15 @@ private:
GeometriesType::Pointer inputGeomSet;
ProjectionFilterType::Pointer geometriesProjFilter;
GeometriesType::Pointer outputGeomSet;
const OGRSpatialReference imgOGRSref =
OGRSpatialReference( imageProjectionRef.c_str() );
const OGRSpatialReference vectorOGRSref =
OGRSpatialReference( vectorProjectionRef.c_str() );
bool doReproj = true;
// don't reproject for these cases
if (vectorProjectionRef.empty() ||
(imageProjectionRef == vectorProjectionRef) ||
(imageProjectionRef.empty() && imageKwl.GetSize() == 0))
if ( vectorProjectionRef.empty()
|| ( imgOGRSref.IsSame( &vectorOGRSref ) )
|| ( imageProjectionRef.empty() && imageKwl.GetSize() == 0) )
doReproj = false;
if (doReproj)
......
......@@ -376,10 +376,14 @@ private:
ProjectionFilterType::Pointer geometriesProjFilter;
GeometriesType::Pointer outputGeomSet;
bool doReproj = true;
const OGRSpatialReference imgOGRSref =
OGRSpatialReference( imageProjectionRef.c_str() );
const OGRSpatialReference vectorOGRSref =
OGRSpatialReference( vectorProjectionRef.c_str() );
// don't reproject for these cases
if (vectorProjectionRef.empty() ||
(imageProjectionRef == vectorProjectionRef) ||
(imageProjectionRef.empty() && imageKwl.GetSize() == 0))
if ( vectorProjectionRef.empty()
|| ( imgOGRSref.IsSame( &vectorOGRSref ) )
|| ( imageProjectionRef.empty() && imageKwl.GetSize() == 0) )
doReproj = false;
if (doReproj)
......
......@@ -161,11 +161,11 @@ private:
SetDocLongDescription("This application is the implementation of the "
"histogram equalization algorithm. The idea of the algorithm is to use "
"the whole available dynamic. In order to do so it computes a histogram "
"over the image and then use the whole dynamic : meaning flattening the "
"over the image and then use the whole dynamic: meaning flattening the "
"histogram. That gives us gain for each bin that transform the original "
"histogram into the flat one. This gain is then apply on the original "
"image."
"\nThe application proposes several option to allow a finer result : "
"\nThe application proposes several options to allow a finer result: "
"\n- There is an option to limit contrast. We choose to limit the contrast "
"by modifying the original histogram. To do so we clip the histogram at a "
"given height and redistribute equally among the bins the clipped population. "
......@@ -197,7 +197,7 @@ private:
"The maximum height will be computed as hfact*eqHeight where eqHeight "
"is the height of the theoretical flat histogram. The higher hfact, the "
"higher the contrast."
"\nWhen using 'luminance mode', it is recommended to limit this factor to a small value (ex : 4)");
"\nWhen using 'luminance mode', it is recommended to limit this factor to a small value (ex: 4)");
MandatoryOff("hfact");
AddParameter(ParameterType_Float , "nodata" , "Nodata Value");
......@@ -219,27 +219,34 @@ private:
AddParameter(ParameterType_Int,"spatial.local.h" ,
"Thumbnail height in pixel");
"Thumbnail height");
SetParameterDescription("spatial.local.h","Height of the thumbnail "
"over which the histogram will be computed. The value is in pixels.");
AddParameter(ParameterType_Int,"spatial.local.w" ,
"Thumbnail width in pixel");
"Thumbnail width");
SetParameterDescription("spatial.local.w","Width of the thumbnail "
"over which the histogram will be computed. The value is in pixels.");
AddParameter(ParameterType_Choice , "minmax" , "Minimum and maximum "
"settings");
SetParameterDescription("minmax","Minimum and maximum value that will "
"bound the histogram.");
"bound the histogram and thus the dynamic of the resulting image. Values "
"over those boundaries will be clipped.");
AddChoice( "minmax.auto" , "Automatic" );
SetParameterDescription("minmax.auto" , "Minimum and maximum value will "
"be computed on the image (nodata value won't be taken "
"into account) . Each band will have a minimum and a maximum.");
AddParameter(ParameterType_Bool, "minmax.auto.global", "Global");
SetParameterDescription("minmax.auto.global" , "Automatic"
SetParameterDescription("minmax.auto.global" ,
"Min/max computation will result in the same minimum and maximum for "
"all the bands.");
AddChoice( "minmax.manual" , "Manual settings of min/max values" );
SetParameterDescription("minmax.auto","Minimum and maximum value will be "
AddChoice( "minmax.manual" , "Manual settings for min/max values" );
SetParameterDescription("minmax.manual","Minimum and maximum value will be "
"set by the user");
AddParameter(ParameterType_Float , "minmax.manual.min" , "Minimum value");
AddParameter(ParameterType_Float , "minmax.manual.max" , "Maximum value");
// SetDefaultParameterFloat("minmax.manual.min", 0 );
// SetDefaultParameterFloat("minmax.manual.max", 255 );
MandatoryOff("minmax.manual.min");
MandatoryOff("minmax.manual.max");
......@@ -249,9 +256,9 @@ private:
"Each channel is equalized independently" );
AddChoice( "mode.lum" , "Luminance" );
SetParameterDescription( "mode.lum" ,
"The relative luminance is calculated thanks to the coefficients."
"Then the histogram is equalized and then a gain is applied on each channels."
"This gain for each channels will depend on"
"The relative luminance is computed according to the coefficients."
"Then the histogram is equalized and the gain is applied to each of the "
"channels. The channel gain will depend on "
"the weight (coef) of the channel in the luminance."
"\nNote that default values come from color space theories "
"on how human eyes perceive colors)"
......
......@@ -441,10 +441,10 @@ private:
catch ( itk::ExceptionObject & /*err*/ )
{
}
SetParameterInt("rgb.r",metadataInterface->GetDefaultDisplay()[0]);
SetParameterInt("rgb.g",metadataInterface->GetDefaultDisplay()[1]);
SetParameterInt("rgb.b",metadataInterface->GetDefaultDisplay()[2]);
auto rgbVect = metadataInterface->GetDefaultDisplay();
SetParameterInt("rgb.r",rgbVect[0]);
SetParameterInt("rgb.g",rgbVect[1]);
SetParameterInt("rgb.b",rgbVect[2]);
ossOutput << std::endl << "Image default RGB composition:" << std::endl;
ossOutput << "\t[R, G, B] = [" << GetParameterInt("rgb.r") << "," << GetParameterInt("rgb.g") << "," << GetParameterInt("rgb.b") << "]" << std::endl;
......
......@@ -629,23 +629,18 @@ private:
{
case Interpolator_Linear:
{
typedef itk::LinearInterpolateImageFunction<FloatVectorImageType,
double> LinearInterpolationType;
LinearInterpolationType::Pointer interpolator = LinearInterpolationType::New();
m_ResampleFilter->SetInterpolator(interpolator);
}
break;
case Interpolator_NNeighbor:
{
typedef itk::NearestNeighborInterpolateImageFunction<FloatVectorImageType,
double> NearestNeighborInterpolationType;
NearestNeighborInterpolationType::Pointer interpolator = NearestNeighborInterpolationType::New();
m_ResampleFilter->SetInterpolator(interpolator);
}
break;
case Interpolator_BCO:
{
typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> BCOInterpolationType;
BCOInterpolationType::Pointer interpolator = BCOInterpolationType::New();
interpolator->SetRadius(GetParameterInt("interpolator.bco.radius"));
m_ResampleFilter->SetInterpolator(interpolator);
......
......@@ -937,19 +937,48 @@ PleiadesImageMetadataInterface
itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
}
std::vector<unsigned int> rgb(3);
rgb[0] = 0;
rgb[1] = 1;
rgb[2] = 2;
ImageKeywordlistType imageKeywordlist;
if (! dict.HasKey(MetaDataKey::OSSIMKeywordlistKey))
{
return rgb;
}
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
if (dict.HasKey(MetaDataKey::OSSIMKeywordlistKey))
if ( !imageKeywordlist.HasKey( "support_data.band_name_list" ) )
{
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
return rgb;
}
const std::string & rgbOrder =
imageKeywordlist.GetMetadataByKey( "support_data.band_name_list" );
std::vector<unsigned int> rgb(3);
std::vector<std::string> bandList;
boost::split(bandList, rgbOrder, boost::is_any_of(" "));
rgb[0] = 0;
rgb[1] = 1;
rgb[2] = 2;
if (bandList[0] == "P")
{
rgb[1] = 0;
rgb[2] = 0;
return rgb;
}
if (bandList.size() >= 3)
{
for (int i = 0 ; i < 3 ; i++ )
{
std::string band = bandList[i];
if (band[0] == 'B')
{
rgb[i] = lexical_cast<unsigned int>(band.c_str() + 1);
}
}
}
return rgb;
}
......