Commit 3fcfa934 authored by Cédric Traizet's avatar Cédric Traizet

Merge branch 'test_extractroi' into 'develop'

Additional tests for the ExtractROI application

Closes #1931

See merge request !613
parents ffe9576a b3704626
Pipeline #2929 passed with stages
in 5 minutes and 7 seconds
PROJCS["WGS_1984_UTM_Zone_31N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
\ No newline at end of file
PROJCS["WGS 84 / UTM zone 31N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32631"]]
......@@ -411,7 +411,6 @@ private:
lrp[1] = GetParameterFloat("mode.extent.lry");
m_IsExtentInverted = (lrp[0] < ulp[0] || lrp[1] < ulp[1]);
ImageType* inImage = GetParameterImage("in");
FloatVectorImageType::IndexType raw_uli, raw_lri;
inImage->TransformPhysicalPointToIndex(ulp, raw_uli);
inImage->TransformPhysicalPointToIndex(lrp, raw_lri);
}
......@@ -572,8 +571,8 @@ private:
}
else if (GetParameterString("mode.radius.unitc") == "phy")
{
centerp[0] = GetParameterInt("mode.radius.cx");
centerp[1] = GetParameterInt("mode.radius.cy");
centerp[0] = GetParameterFloat("mode.radius.cx");
centerp[1] = GetParameterFloat("mode.radius.cy");
}
else // if ( GetParameterString( "mode.radius.unitc" ) == "lon/lat" )
{
......@@ -714,13 +713,12 @@ private:
"using mod.fit");
}
}
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputProjectionRef(inputProjectionRef);
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> ulp_in, urp_in, llp_in, lrp_in, ulp_out, urp_out, llp_out, lrp_out;
itk::Point<float, 2> ulp_in, urp_in, llp_in, lrp_in;
ulp_in[0] = ulx;
ulp_in[1] = uly;
urp_in[0] = ulx;
......
......@@ -19,6 +19,16 @@
#
otb_module_test()
set(OTBAppImageUtilsTests
otbAppImageUtilsTestDriver.cxx
otbExtractROIAppTests.cxx
)
add_executable(otbAppImageUtilsTestDriver ${OTBAppImageUtilsTests})
target_link_libraries(otbAppImageUtilsTestDriver ${OTBAppImageUtils-Test_LIBRARIES})
otb_module_target_label(otbAppImageUtilsTestDriver)
#----------- DownloadSRTMTiles TESTS ----------------
otb_test_application(NAME apTuUtDownloadSRTMTiles
APP DownloadSRTMTiles
......@@ -92,63 +102,23 @@ otb_test_application(NAME apTvUtDynamicConvertMask
${TEMP}/apTvUtDynamicConvertMaskOutput.tif)
#----------- PixelInfo TESTS ----------------
#----------- ExtractROI TESTS ----------------
otb_test_application(NAME apTvUtExtractROISizeTooBig
APP ExtractROI
OPTIONS -in ${INPUTDATA}/couleurs_extrait.png
-out ${TEMP}/apTvUtExtractROISizeTooBig.tif
-sizex 1000000
VALID --compare-image ${NOTOL}
${INPUTDATA}/couleurs_extrait.png
${TEMP}/apTvUtExtractROISizeTooBig.tif)
otb_test_application(NAME apTvUtExtractROISizeTooBigExtent
APP ExtractROI
OPTIONS -in ${INPUTDATA}/couleurs_extrait.png
-out ${TEMP}/apTvUtExtractROISizeTooBigExtent.tif
-mode extent
-mode.extent.lrx 1000000
VALID --compare-image ${NOTOL}
${INPUTDATA}/couleurs_extrait.png
${TEMP}/apTvUtExtractROISizeTooBigExtent.tif)
otb_test_application(NAME apTvUtExtractROISizeTooBigRadius
APP ExtractROI
OPTIONS -in ${INPUTDATA}/couleurs_extrait.png
-out ${TEMP}/apTvUtExtractROISizeTooBigRadius.tif
-mode radius
-mode.radius.r 1000000
VALID --compare-image ${NOTOL}
${INPUTDATA}/couleurs_extrait.png
${TEMP}/apTvUtExtractROISizeTooBigRadius.tif)
otb_test_application(NAME apTvUtExtractROISizeNULL
APP ExtractROI
OPTIONS -in ${INPUTDATA}/couleurs_extrait.png
-out ${TEMP}/apTvUtExtractROISizeNULL.tif
-sizex 0
VALID --compare-image ${NOTOL}
${INPUTDATA}/couleurs_extrait.png
${TEMP}/apTvUtExtractROISizeNULL.tif)
#----------- Extract ROI tests ----------------
otb_test_application(NAME apTvUtExtractROIRightInputFile
APP ExtractROI
OPTIONS -in ${INPUTDATA}/couleurs_extrait.png
-out ${TEMP}/apTvUtExtractROIRightInputFile.tif
VALID --compare-image ${NOTOL}
${INPUTDATA}/couleurs_extrait.png
${TEMP}/apTvUtExtractROIRightInputFile.tif)
otb_add_test(NAME apTvUtExtractROI COMMAND otbAppImageUtilsTestDriver
otbExtractROIAppTests
$<TARGET_FILE_DIR:otbapp_ExtractROI>
10 3 2 3 4
)
otb_test_application(NAME apTvUtExtractROIComplexInputFile
otb_test_application(NAME apTvUtExtractROIExtentFitVect
APP ExtractROI
OPTIONS -in ${INPUTDATA}/complexInputCfloat.tif
-out ${TEMP}/apTvUtExtractROIComplexInputFile.tif cfloat
OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
-out ${TEMP}/apTvUtExtractROIExtentFitVect.tif
-mode fit
-mode.fit.vect ${INPUTDATA}/apTvUtExtractROIExtentFitVect.shp
VALID --compare-image ${NOTOL}
${INPUTDATA}/complexInputCfloat.tif
${TEMP}/apTvUtExtractROIComplexInputFile.tif)
${OTBAPP_BASELINE}/apTvUtExtractROI.tif
${TEMP}/apTvUtExtractROIExtentFitVect.tif)
#----------- Rescale TESTS ----------------
otb_test_application(NAME apTvUtRescaleTest
......
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbTestMain.h"
void RegisterTests()
{
REGISTER_TEST(otbExtractROIAppTests);
}
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