Commit c48d2766 authored by guillaume pernot's avatar guillaume pernot

Merge branch 'develop' into 1993-VectorClassifier-update-mode

parents 65256cb8 85a944e0
......@@ -21,7 +21,7 @@
# Configuration options for debian-unstable-gcc
set(site_option
"opencv_INCLUDE_DIR:PATH=/usr/include
"OpenCV_DIR:PATH=/usr
OTB_USE_MPI:BOOL=OFF
OTB_USE_SHARK:BOOL=OFF
")
......@@ -21,9 +21,9 @@
set(OPENCV_SEARCH_PATH)
if(OpenCV_DIR)
get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" REALPATH)
if(OPENCV_SEARCH_PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" REALPATH)
endif()
if(OPENCV_SEARCH_PATH)
find_path(
......
RESOLUTION: 0; DESC: Resolution: 0 (Image [w x h]: 2592x1944)
RESOLUTION: 1; DESC: Resolution: 1 (Image [w x h]: 1296x972)
RESOLUTION: 2; DESC: Resolution: 2 (Image [w x h]: 648x486)
RESOLUTION: 3; DESC: Resolution: 3 (Image [w x h]: 324x243)
RESOLUTION: 4; DESC: Resolution: 4 (Image [w x h]: 162x122)
RESOLUTION: 5; DESC: Resolution: 5 (Image [w x h]: 81x61)
......@@ -8,7 +8,7 @@ With QGIS < 3.8 you will need to manually install the plugin.
You can follow the instruction here: https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin#otb-provider-for-qgis-processing
With QGIS > 3.8, the plugin is in the QGIS core. So you just need install OTB and set the plugin up.
With QGIS > 3.8, the plugin is already in the QGIS core. So you just need to install OTB and activate the plugin: https://www.orfeo-toolbox.org/CookBook/QGISInterface.html#open-processing-settings
Download and Install OTB
^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -325,36 +325,30 @@ void PCAImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation>::Gene
vnl_vector<double> vectValP;
vnl_symmetric_eigensystem_compute(m_CovarianceMatrix.GetVnlMatrix(), transf, vectValP);
InternalMatrixType valP(vectValP.size(), vectValP.size(), vnl_matrix_null);
for (unsigned int i = 0; i < vectValP.size(); ++i)
valP(i, i) = vectValP[i];
m_EigenValues.SetSize(m_NumberOfPrincipalComponentsRequired);
for (unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i)
m_EigenValues[m_NumberOfPrincipalComponentsRequired - 1 - i] = static_cast<RealType>(vectValP[i]);
/* We used normalized PCA */
for (unsigned int i = 0; i < valP.rows(); ++i)
if (m_Whitening)
{
if (valP(i, i) > 0.)
{
if (m_Whitening)
valP(i, i) = 1. / std::sqrt(valP(i, i));
}
else if (valP(i, i) < 0.)
InternalMatrixType valP(vectValP.size(), vectValP.size(), vnl_matrix_null);
for (unsigned int i = 0; i < vectValP.size(); ++i)
valP(i, i) = vectValP[i];
for (unsigned int i = 0; i < valP.rows(); ++i)
{
otbMsgDebugMacro(<< "ValP(" << i << ") neg : " << valP(i, i) << " taking abs value");
if (m_Whitening)
valP(i, i) = 1. / std::sqrt(std::abs(valP(i, i)));
if (valP(i,i) != 0.0)
valP(i,i) = 1.0 / std::sqrt(std::abs(valP(i,i)));
else
valP(i, i) = std::abs(valP(i, i));
}
else
{
throw itk::ExceptionObject(__FILE__, __LINE__, "Null Eigen value !!", ITK_LOCATION);
throw itk::ExceptionObject(__FILE__, __LINE__, "Null Eigen value !!", ITK_LOCATION);
}
transf = valP * transf.transpose();
}
transf = valP * transf.transpose();
else {
transf = transf.transpose();
}
transf.flipud();
if (m_NumberOfPrincipalComponentsRequired != this->GetInput()->GetNumberOfComponentsPerPixel())
......
......@@ -301,7 +301,8 @@ otb_add_test(NAME bfTvPCAImageFilter2 COMMAND otbDimensionalityReductionTestDriv
${TEMP}/bfTvPCAImageFilter2.tif
${TEMP}/bfTvPCAImageFilter2Inv.tif
true
0)
0
true)
otb_add_test(NAME bfTvPCAImageFilter4 COMMAND otbDimensionalityReductionTestDriver
--compare-n-images ${EPSILON_7} 2
......@@ -314,7 +315,8 @@ otb_add_test(NAME bfTvPCAImageFilter4 COMMAND otbDimensionalityReductionTestDriv
${TEMP}/bfTvPCAImageFilter4.tif
${TEMP}/bfTvPCAImageFilter4Inv.tif
false
4)
4
true)
otb_add_test(NAME bfTvPCAImageFilter4Norm COMMAND otbDimensionalityReductionTestDriver
--compare-n-images ${EPSILON_7} 2
......@@ -327,7 +329,8 @@ otb_add_test(NAME bfTvPCAImageFilter4Norm COMMAND otbDimensionalityReductionTest
${TEMP}/bfTvPCAImageFilter4Norm.tif
${TEMP}/bfTvPCAImageFilter4InvNorm.tif
true
4)
4
true)
otb_add_test(NAME bfTvPCAImageFilter3 COMMAND otbDimensionalityReductionTestDriver
--compare-n-images ${EPSILON_7} 2
......@@ -340,7 +343,22 @@ otb_add_test(NAME bfTvPCAImageFilter3 COMMAND otbDimensionalityReductionTestDriv
${TEMP}/bfTvPCAImageFilter3.tif
${TEMP}/bfTvPCAImageFilter3Inv.tif
false
0)
0
true)
otb_add_test(NAME bfTvPCAImageFilter5 COMMAND otbDimensionalityReductionTestDriver
--compare-n-images ${EPSILON_7} 2
${BASELINE}/bfTvPCAImageFilter5.tif
${TEMP}/bfTvPCAImageFilter5.tif
${BASELINE}/bfTvPCAImageFilter5Inv.tif
${TEMP}/bfTvPCAImageFilter5Inv.tif
otbPCAImageFilterTest
${INPUTDATA}/cupriteSubHsi.tif
${TEMP}/bfTvPCAImageFilter5.tif
${TEMP}/bfTvPCAImageFilter5Inv.tif
false
0
false)
otb_add_test(NAME bfTvPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriver
--compare-image ${EPSILON_7}
......@@ -351,7 +369,8 @@ otb_add_test(NAME bfTvPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriv
${TEMP}/bfTvPCAImageFilter1.tif
${TEMP}/bfTvPCAImageFilter1Inv.tif
false
0)
0
true)
otb_add_test(NAME bfTvPCAImageFilter3Norm COMMAND otbDimensionalityReductionTestDriver
......@@ -365,7 +384,8 @@ otb_add_test(NAME bfTvPCAImageFilter3Norm COMMAND otbDimensionalityReductionTest
${TEMP}/bfTvPCAImageFilter3Norm.tif
${TEMP}/bfTvPCAImageFilter3InvNorm.tif
true
0)
0
true)
otb_add_test(NAME bfTvNAPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriver
--compare-image ${EPSILON_7}
......
......@@ -33,6 +33,10 @@ int otbPCAImageFilterTest(int, char* argv[])
bool normalization = false;
if (std::string(argv[4]).compare("true") == 0)
normalization = true;
bool whitening = false;
if (std::string(argv[6]).compare("true") == 0)
whitening = true;
// Main type definition
const unsigned int Dimension = 2;
......@@ -50,6 +54,7 @@ int otbPCAImageFilterTest(int, char* argv[])
filter->SetInput(reader->GetOutput());
filter->SetNumberOfPrincipalComponentsRequired(nbComponents);
filter->SetUseNormalization(normalization);
filter->SetWhitening(whitening);
typedef otb::CommandProgressUpdate<FilterType> CommandType;
CommandType::Pointer observer = CommandType::New();
......
......@@ -245,7 +245,7 @@ void OGRLayerStreamStitchingFilter<TInputImage>::ProcessStreamingLine(bool line,
{
FeatureStruct upper = upperStreamFeatureList[u];
FeatureStruct lower = lowerStreamFeatureList[l];
if (!(upper.feat == lower.feat))
if (!(upper.feat == lower.feat) && upper.feat.GetGeometry()->IsValid() && lower.feat.GetGeometry()->IsValid())
{
if (ogr::Intersects(*upper.feat.GetGeometry(), *lower.feat.GetGeometry()))
{
......
......@@ -29,3 +29,8 @@ set(OTBOpenCV_INCLUDE_DIRS
)
otb_module_impl()
install(FILES ${OTBOpenCV_BINARY_DIR}/src/otb_opencv_api.h
DESTINATION ${OTBOpenCV_INSTALL_INCLUDE_DIR}
COMPONENT Development
)
diff --git a/SuperBuild/patches/ITK/itk-3-gcc9-all.diff b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff
new file mode 100644
index 0000000000..7ff9131d9d
--- /dev/null
+++ b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff
@@ -0,0 +1,20 @@
+--- InsightToolkit-4.13.1.orig/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2018-08-09 00:55:23.000000000 +0200
++++ InsightToolkit-4.13.1/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2019-11-12 15:49:33.893603688 +0100
+@@ -97,6 +97,17 @@
+ # else
+ # define VCL_GCC_80
+ # endif
++# elif (__GNUC__==9)
++# define VCL_GCC_9
++# if (__GNUC_MINOR__ > 2 )
++# define VCL_GCC_92
++# elif (__GNUC_MINOR__ > 1 )
++# define VCL_GCC_92
++# elif (__GNUC_MINOR__ > 0 )
++# define VCL_GCC_91
++# else
++# define VCL_GCC_90
++# endif
+ # else
+ # error "Dunno about this gcc"
+ # endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment