Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
aca8a524
Commit
aca8a524
authored
14 years ago
by
Cyrille Valladeau
Browse files
Options
Downloads
Patches
Plain Diff
TEST
parent
7f62e561
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Radiometry/otbSarParametricMapFunction.txx
+9
-14
9 additions, 14 deletions
Code/Radiometry/otbSarParametricMapFunction.txx
Code/Radiometry/otbSarRadiometricCalibrationToImageFilter.txx
+10
-7
10 additions, 7 deletions
.../Radiometry/otbSarRadiometricCalibrationToImageFilter.txx
with
19 additions
and
21 deletions
Code/Radiometry/otbSarParametricMapFunction.txx
+
9
−
14
View file @
aca8a524
...
...
@@ -122,19 +122,16 @@ SarParametricMapFunction<TInputImage, TCoordRep>
}
else if (pointSet->GetNumberOfPoints() == 1)
{
std::cout<<"EvaluateParam lol1"<<std::endl;
pointSet->GetPointData(0, &pointValue);
m_Coeff(0, 0) = pointValue;
}
else
{
std::cout<<"EvaluateParam lol2"<<std::endl;
// Get input region for normalization of coordinates
const itk::MetaDataDictionary& dict = this->GetInputImage()->GetMetaDataDictionary();
ImageKeywordlist imageKeywordlist;
if (dict.HasKey(MetaDataKey::OSSIMKeywordlistKey))
{
std::cout<<"EvaluateParam lol2.1"<<std::endl;
itk::ExposeMetaData<ImageKeywordlist>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
ossimKeywordlist kwl;
imageKeywordlist.convertToOSSIMKeywordlist(kwl);
...
...
@@ -145,12 +142,11 @@ SarParametricMapFunction<TInputImage, TCoordRep>
}
else
{
std::cout<<"EvaluateParam lol2.2"<<std::endl;
m_ProductHeight = this->GetInputImage()->GetLargestPossibleRegion().GetSize()[0] ;
m_ProductWidth = this->GetInputImage()->GetLargestPossibleRegion().GetSize()[1];
}
std::cout<<"EvaluateParam loli"<<std::endl;
// Perform the plane least square estimation
// Perform the plane least square estimation
unsigned int nbRecords = pointSet->GetNumberOfPoints();
const unsigned int coeffRows = m_Coeff.Rows();
const unsigned int coeffCols = m_Coeff.Cols();
...
...
@@ -162,8 +158,8 @@ std::cout<<"EvaluateParam loli"<<std::endl;
vnl_vector<double> b(nbRecords), bestParams(nbCoef);
b.fill(0);
bestParams.fill(0);
std::cout<<"EvaluateParam lolo"<<std::endl;
// Fill the linear system
// Fill the linear system
for (unsigned int i = 0; i < nbRecords; ++i)
{
this->GetPointSet()->GetPoint(i, &point);
...
...
@@ -183,23 +179,22 @@ std::cout<<"EvaluateParam lolo"<<std::endl;
}
}
}
std::cout<<"EvaluateParam lol"<<std::endl;
// Create the linear system
// Create the linear system
std::cout<<a.cols()<<","<<a.rows()<<" === "<<b.size()<<" === "<<bestParams.size()<<std::endl;
vnl_sparse_matrix_linear_system<double> linearSystem(a, b);
std::cout << "EvaluateParam lol =" << std::endl;
// And solve it
// And solve it
vnl_lsqr linearSystemSolver(linearSystem);
std::cout << "EvaluateParam bestParams: " <<bestParams<< std::endl;
linearSystemSolver.minimize(bestParams);
std::cout << "m_Coeff bis: " << coeffCols<< " , " << m_Coeff.Rows() << std::endl;
for (unsigned int xcoeff = 0; xcoeff < coeffCols; ++xcoeff)
{
for (unsigned int ycoeff = 0; ycoeff < coeffRows; ++ycoeff)
{
m_Coeff(ycoeff, xcoeff) = bestParams(xcoeff * coeffRows + ycoeff);
std::cout << "m_Coeff(" << ycoeff << "," << xcoeff << ") = " << m_Coeff(ycoeff, xcoeff) << std::endl;
//
std::cout << "m_Coeff(" << ycoeff << "," << xcoeff << ") = " << m_Coeff(ycoeff, xcoeff) << std::endl;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Code/Radiometry/otbSarRadiometricCalibrationToImageFilter.txx
+
10
−
7
View file @
aca8a524
...
...
@@ -43,7 +43,6 @@ void
SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>
::BeforeThreadedGenerateData()
{
std::cout<<"Before Starts"<<std::endl;
// will SetInputImage on the function
Superclass::BeforeThreadedGenerateData();
...
...
@@ -53,7 +52,7 @@ SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>
FunctionPointer function = this->GetFunction();
function->SetScale(imageMetadataInterface->GetRadiometricCalibrationScale());
std::cout<<"Before Starts 1"<<std::endl;
ParametricFunctionPointer noise;
ParametricFunctionPointer antennaPatternNewGain;
ParametricFunctionPointer antennaPatternOldGain;
...
...
@@ -64,7 +63,7 @@ SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>
noise->SetPointSet(imageMetadataInterface->GetRadiometricCalibrationNoise());
noise->SetPolynomalSize(imageMetadataInterface->GetRadiometricCalibrationNoisePolynomialDegree());
noise->EvaluateParametricCoefficient();
std::cout<<"Before Starts 2"<<std::endl;
antennaPatternNewGain = function->GetAntennaPatternNewGain();
antennaPatternNewGain->SetPointSet(imageMetadataInterface->GetRadiometricCalibrationAntennaPatternNewGain());
antennaPatternNewGain->SetPolynomalSize(imageMetadataInterface->GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree());
...
...
@@ -74,21 +73,25 @@ SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>
antennaPatternOldGain->SetPointSet(imageMetadataInterface->GetRadiometricCalibrationAntennaPatternOldGain());
antennaPatternOldGain->SetPolynomalSize(imageMetadataInterface->GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree());
antennaPatternOldGain->EvaluateParametricCoefficient();
std::cout<<"Before Starts 3"<<std::endl;
std::cout<<"SarRadiometricCalibrationToImageFilter starts trouble"<<std::endl;
incidenceAngle = function->GetIncidenceAngle();
std::cout<<"function->GetIncidenceAngle():"<<std::endl;
std::cout<<function->GetIncidenceAngle()<<std::endl;
incidenceAngle->SetPointSet(imageMetadataInterface->GetRadiometricCalibrationIncidenceAngle());
std::cout<<"imageMetadataInterface->GetRadiometricCalibrationIncidenceAngle():"<<std::endl;
std::cout<<imageMetadataInterface->GetRadiometricCalibrationIncidenceAngle()<<std::endl;
incidenceAngle->SetPolynomalSize(imageMetadataInterface->GetRadiometricCalibrationIncidenceAnglePolynomialDegree());
std::cout<<"================================ Before Starts 3.5"<<std::endl;
std::cout<<"imageMetadataInterface->GetRadiometricCalibrationIncidenceAnglePolynomialDegree():"<<std::endl;
std::cout<<imageMetadataInterface->GetRadiometricCalibrationIncidenceAnglePolynomialDegree()<<std::endl;
std::cout<<"SarRadiometricCalibrationToImageFilter trouble passed !!!"<<std::endl;
incidenceAngle->EvaluateParametricCoefficient();
std::cout<<"Before Starts 4"<<std::endl;
rangeSpreadLoss = function->GetRangeSpreadLoss();
rangeSpreadLoss->SetPointSet(imageMetadataInterface->GetRadiometricCalibrationRangeSpreadLoss());
rangeSpreadLoss->SetPolynomalSize(imageMetadataInterface->GetRadiometricCalibrationRangeSpreadLossPolynomialDegree());
rangeSpreadLoss->EvaluateParametricCoefficient();
std::cout<<"Before Done"<<std::endl;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment