Commit 3d4b262a authored by Julien Osman's avatar Julien Osman

TEST: improve tests prTvTestCreateInverseForwardSensorModel

parent 0777d9f3
Pipeline #6267 passed with stages
in 76 minutes and 11 seconds
Testing geopoint: [3.740934, 44.107956]
Testing InverseSensorModel: [3.740934, 44.107956] -> [14190.558, 13591.703]
Testing ForwardSensorModel: [14190.558, 13591.703] -> [3.7409338, 44.107956]
Testing geopoint: [1.4434869, 43.604688]
Testing InverseSensorModel: [1.4434869, 43.604688] -> [11234.662, 8124.3911]
Testing ForwardSensorModel: [11234.662, 8124.3911] -> [1.4434869, 43.604688]
......@@ -63,13 +63,25 @@ otb_add_test(NAME prTvGenericRSTransformWithSRID COMMAND otbTransformTestDriver
)
otb_add_test(NAME prTvTestCreateInverseForwardSensorModel_Cevennes COMMAND otbTransformTestDriver
--compare-ascii ${EPSILON_4}
${BASELINE_FILES}/prTvTestCreateInverseForwardSensorModel_Cevennes.txt
${TEMP}/prTvTestCreateInverseForwardSensorModel_Cevennes.txt
otbCreateInverseForwardSensorModel
LARGEINPUT{QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF}
${TEMP}/prTvTestCreateInverseForwardSensorModel_Cevennes.txt
3.740934
44.107956
)
otb_add_test(NAME prTvTestCreateInverseForwardSensorModel_Toulouse COMMAND otbTransformTestDriver
--compare-ascii ${EPSILON_4}
${BASELINE_FILES}/prTvTestCreateInverseForwardSensorModel_Toulouse.txt
${TEMP}/prTvTestCreateInverseForwardSensorModel_Toulouse.txt
otbCreateInverseForwardSensorModel
LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
${TEMP}/prTvTestCreateInverseForwardSensorModel_Toulouse.txt
1.44348693
43.60468837
)
otb_add_test(NAME prTvTestCreateProjectionWithOSSIM_Cevennes COMMAND otbTransformTestDriver
......@@ -151,7 +163,6 @@ set(FWDBWDChecking_INPUTS
#LARGEINPUT{RAPIDEYE/level3A/2008-12-25T005918_RE3_3A-NAC_752656_40091.tif}
)
otb_add_test(NAME bfTvInverseLogPolarTransform COMMAND otbTransformTestDriver
--compare-ascii ${NOTOL}
${BASELINE_FILES}/bfInverseLogPolarTransformResults.txt
......
......@@ -18,16 +18,6 @@
* limitations under the License.
*/
/*!
*
* PURPOSE:
*
* Application to rproject an image region into gepgraphical coordinates
* usinf un Interpolator+regionextractor and an Iterator.
*
*/
// iostream is used for general output
#include <iostream>
#include <iterator>
......@@ -43,9 +33,9 @@
int otbCreateInverseForwardSensorModel(int argc, char* argv[])
{
if (argc != 2)
if (argc != 5)
{
std::cout << argv[0] << " <input filename>" << std::endl;
std::cout << argv[0] << " <input filename> <output filename> <test_point_X> <test_point_Y>\n";
return EXIT_FAILURE;
}
......@@ -82,5 +72,20 @@ int otbCreateInverseForwardSensorModel(int argc, char* argv[])
return EXIT_FAILURE;
}
std::ofstream ofs(argv[2], std::ofstream::out);
ofs.precision(8);
InverseModelType::InputPointType geoPoint;
geoPoint[0] = atof(argv[3]);
geoPoint[1] = atof(argv[4]);
ofs << "Testing geopoint: " << geoPoint << "\n\n";
auto indexPoint = inverse_model->TransformPoint(geoPoint);
ofs << "Testing InverseSensorModel: " << geoPoint << " -> " << indexPoint << "\n";
auto newGeoPoint = forward_model->TransformPoint(indexPoint);
ofs << "Testing ForwardSensorModel: " << indexPoint << " -> " << newGeoPoint << "\n";
return EXIT_SUCCESS;
}
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