Skip to content
Snippets Groups Projects
Commit 25c6e340 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ADD: Orthorectification test in python

parent 33147549
Branches
Tags
No related merge requests found
......@@ -4,6 +4,10 @@ SET(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
SET(INPUTDATA ${OTB_DATA_ROOT}/Input)
SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary)
IF(OTB_DATA_USE_LARGEINPUT)
SET(LARGEINPUT ${OTB_DATA_LARGEINPUT_ROOT} )
ENDIF(OTB_DATA_USE_LARGEINPUT)
set(TEST_DRIVER otbTestDriver
--add-before-env PYTHONPATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
......@@ -40,4 +44,25 @@ add_test( NAME pyTvHyperspectralUnmixingFCLS
5
fcls
)
\ No newline at end of file
IF(OTB_DATA_USE_LARGEINPUT)
add_test( NAME pyTvOrthoRectification_UTM
COMMAND ${TEST_DRIVER}
--compare-image 0.0
${BASELINE}/owTvOrthorectifTest_UTM.tif
${TEMP}/pyTvOrthorectifTest_UTM.tif
Execute
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/PythonOrthoRectification.py
${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
${TEMP}/pyTvOrthorectifTest_UTM.tif
374100.8
4829184.8
500
500
0.5
-0.5
utm
4
${INPUTDATA}/DEM/srtm_directory/
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
\ No newline at end of file
# -*- coding: utf-8 -*-
#
# Example on the use of the Rescale
#
from sys import argv
import otbApplication as otb
app = otb.Registry.CreateApplication("OrthoRectification")
app.SetParameterString("in", argv[1])
app.SetParameterString("out", argv[2] + ".tif")
app.SetParameterFloat("outputs.ulx",float(argv[3]))
app.SetParameterFloat("outputs.uly",float(argv[4]))
app.SetParameterInt("outputs.sizex",int(argv[5]))
app.SetParameterInt("outputs.sizey",int(argv[6]))
app.SetParameterFloat("outputs.spacingx",float(argv[7]))
app.SetParameterFloat("outputs.spacingy",float(argv[8]))
app.SetParameterString("map", argv[9])
app.SetParameterString("dem", argv[10])
app.ExecuteAndWriteOutput()
print dir(app)
# print some values
print app.GetParameterRole()
print app.GetDocName()
print app.GetDocLongDescription()
print app.DocCLExample()
print app.DocAuthors()
print app.DocLimitations()
print app.DocSeeAlso()
print app.GetParameterOutputImagePixelType("out")
print app.GetParameterOutputImagePixelType("int") # dummy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment