Commit afee2657 authored by guillaume pernot's avatar guillaume pernot

Merge branch 'develop' into feat-test-coverage

parents 28450372 85a944e0
......@@ -136,10 +136,13 @@ legal-check:
#------------------------- prepare & build jobs --------------------------------
debian-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
image: $BUILD_IMAGE_REGISTRY/otb-debian-native:testing
allow_failure: true
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-testing-gcc
after_script:
- export CI_ALLOW_FAILURE=ON
- python3 -u CI/cdash_handler.py
dependencies: []
## Ubuntu superbuild
......
......@@ -246,6 +246,9 @@ if __name__ == "__main__":
if ( len(sys.argv) < 6 and len(sys.argv) > 1 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id project_directory token ref_name")
sys.exit(1)
allow_failure = os.environ.get('CI_ALLOW_FAILURE', False)
if ( len(sys.argv) >= 6):
sha1 = sys.argv[1]
proj = sys.argv[2]
......@@ -286,6 +289,10 @@ if __name__ == "__main__":
sys.exit(0)
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url += proj + "/statuses/" + sha1
if allow_failure:
state = 'success'
params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\
'target_url' : cdash_url , 'description' : error , 'ref' : refn })
gitlab_request = urllib.request.Request(gitlab_url)
......
......@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -96,7 +96,7 @@ int otbOssimElevManagerTest4(int argc, char* argv[])
std::ofstream file;
std::cout << outfname << std::endl;
file.open(outfname, ios::binary | ios::out);
file.open(outfname, std::ios::binary | std::ios::out);
file.write(reinterpret_cast<char*>(image), sizeof(double) * size[0] * size[1]);
file.close();
......
......@@ -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
)
......@@ -48,7 +48,7 @@ int main(int argc, char * argv[])
{
std::clog.precision(20);
string annotationXml;
std::string annotationXml;
Inverse inverse = undef;
bool verbose = false;
......
......@@ -21,13 +21,17 @@
project(OTBTinyXML)
# Check if we need to define TIXML_USE_STL
try_compile( TIXML_USE_STL
try_compile( TIXML_TEST_STL
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestTinyXMLUseSTL.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TINYXML_INCLUDE_DIRS}" "-DLINK_LIBRARIES:STRING=${TINYXML_LIBRARIES}"
COMPILE_DEFINITIONS "-DTIXML_USE_STL"
OUTPUT_VARIABLE OUTPUT)
if (NOT TIXML_TEST_STL)
message(FATAL_ERROR "TIXML must be compiled with TIXML_USE_STL=ON.")
endif()
configure_file( src/otb_tinyxml.h.in src/otb_tinyxml.h )
set(OTBTinyXML_SYSTEM_INCLUDE_DIRS
......
......@@ -21,9 +21,7 @@
#ifndef otb_tinyxml_h
#define otb_tinyxml_h
#ifndef TIXML_USE_STL
#cmakedefine TIXML_USE_STL
#endif
#define TIXML_USE_STL
#include "tinyxml.h"
......
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