Skip to content
Snippets Groups Projects
Commit 99bf6ca1 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Remove useless method parameter

parent e470a53b
No related branches found
No related tags found
No related merge requests found
......@@ -291,17 +291,9 @@ GCPsToRPCSensorModelImageFilter<TImage>
// First, retrieve the image pointer
typename TImage::Pointer imagePtr = this->GetOutput();
typename TImage::PointType ul = this->GetInput()->GetOrigin();
typename TImage::SizeType size = this->GetInput()->GetLargestPossibleRegion().GetSize();
typename TImage::SpacingType spacing = this->GetInput()->GetSpacing();
typename TImage::PointType lr;
lr[0] = ul[0] + size[0]*spacing[0];
lr[1] = ul[1] + size[1]*spacing[1];
double rmsError;
ImageKeywordlist otb_kwl;
otb::RPCSolverAdapter::Solve(m_GCPsContainer, ul, lr, rmsError, otb_kwl);
otb::RPCSolverAdapter::Solve(m_GCPsContainer, rmsError, otb_kwl);
// Retrieve the residual ground error
m_RMSGroundError = rmsError;
......
......@@ -35,8 +35,6 @@ RPCSolverAdapter::~RPCSolverAdapter()
void
RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
const Point2DType& ulImagePoint,
const Point2DType& lrImagePoint,
double& rmsError,
ImageKeywordlist& otb_kwl)
{
......@@ -56,21 +54,17 @@ RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
for (gcpIt = gcpContainer.begin(); gcpIt != gcpContainer.end(); ++gcpIt)
{
// Check if point is inside bounds
if(gcpIt->first[0] >= ulImagePoint[0] && gcpIt->first[1] >= ulImagePoint[1]
&& gcpIt->first[0] <= lrImagePoint[0] && gcpIt->first[1] <= lrImagePoint[1])
{
// Fill sensor point
sensorPoint = ossimDpt(gcpIt->first[0], gcpIt->first[1]);
// Fill geo point (lat, lon, elev)
geoPoint = ossimGpt(gcpIt->second[1], gcpIt->second[0], gcpIt->second[2]);
// Add the sensor point to the list
sensorPoints.push_back(sensorPoint);
// Add the geo point to the list
geoPoints.push_back(geoPoint);
}
// Fill sensor point
sensorPoint = ossimDpt(gcpIt->first[0], gcpIt->first[1]);
// Fill geo point (lat, lon, elev)
geoPoint = ossimGpt(gcpIt->second[1], gcpIt->second[0], gcpIt->second[2]);
// Add the sensor point to the list
sensorPoints.push_back(sensorPoint);
// Add the geo point to the list
geoPoints.push_back(geoPoint);
}
// Check for enough points
......@@ -99,8 +93,6 @@ RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
}
bool RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
const Point2DType& ulImagePoint,
const Point2DType& lrImagePoint,
double& rmsError,
const std::string & outgeom)
{
......@@ -108,7 +100,7 @@ bool RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,
ImageKeywordlist otb_kwl;
// Call the Solve method that actually does the solving
Solve(gcpContainer,ulImagePoint,lrImagePoint,rmsError,otb_kwl);
Solve(gcpContainer,rmsError,otb_kwl);
// Write the keywordlist to disk
ossimKeywordlist kwl;
......
......@@ -56,8 +56,6 @@ public:
* by other OTB and classes (like GenericRSTransform for instance).
*/
static void Solve(const GCPsContainerType& gcpContainer,
const Point2DType& ulImagePoint,
const Point2DType& lrImagePoint,
double& rmsError,
ImageKeywordlist& otb_kwl);
......@@ -65,8 +63,6 @@ public:
* estimated RPC model is written to a geom file
*/
static bool Solve(const GCPsContainerType& gcpContainer,
const Point2DType& ulImagePoint,
const Point2DType& lrImagePoint,
double& rmsError,
const std::string & outgeom);
......
......@@ -102,23 +102,18 @@ int otbRPCSolverAdapterTest(int argc, char* argv[])
otb::ImageKeywordlist rpcKwl;
double rmse;
Point2DType ul = reader->GetOutput()->GetOrigin();
Point2DType lr;
lr[0] = ul[0] + size[0]*reader->GetOutput()->GetSpacing()[0];
lr[1] = ul[1] + size[1]*reader->GetOutput()->GetSpacing()[1];
// Call solver: either write geom and exit, or evaluate model precision
// Call solver: either write geom and exit, or evaluate model precision
if(argc==8)
{
const std::string outgeom = argv[7];
bool success = otb::RPCSolverAdapter::Solve(gcps,ul,lr,rmse,outgeom);
bool success = otb::RPCSolverAdapter::Solve(gcps,rmse,outgeom);
if(success)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
}
otb::RPCSolverAdapter::Solve(gcps,ul,lr,rmse,rpcKwl);
otb::RPCSolverAdapter::Solve(gcps,rmse,rpcKwl);
std::cout<<"Optimization done, RMSE="<<rmse<<std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment