From f00ba4cdb470d3c2a321bcac10e7754b79b6f268 Mon Sep 17 00:00:00 2001 From: Manuel Grizonnet <manuel.grizonnet@orfeo-toolbox.org> Date: Thu, 27 Sep 2012 10:26:42 +0200 Subject: [PATCH] ENH: remove adjacency effects in OpticalCalibration application --- .../Radiometry/otbOpticalCalibration.cxx | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/Applications/Radiometry/otbOpticalCalibration.cxx b/Applications/Radiometry/otbOpticalCalibration.cxx index fc168bc730..58c80acc5a 100644 --- a/Applications/Radiometry/otbOpticalCalibration.cxx +++ b/Applications/Radiometry/otbOpticalCalibration.cxx @@ -287,43 +287,44 @@ private: //GetLogger()->Info("Atmospheric correction parameters : " + oss.str()); //Compute adjacency effect - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter - = SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::New(); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter + // = SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::New(); - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetInput(m_ReflectanceToSurfaceReflectanceFilter->GetOutput()); - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter-> - SetAtmosphericRadiativeTerms( - m_ReflectanceToSurfaceReflectanceFilter->GetAtmosphericRadiativeTerms()); - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetZenithalViewingAngle( - m_AtmosphericParam->GetViewingZenithalAngle()); - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetWindowRadius(GetParameterInt("radius")); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetInput(m_ReflectanceToSurfaceReflectanceFilter->GetOutput()); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter-> + // SetAtmosphericRadiativeTerms( + // m_ReflectanceToSurfaceReflectanceFilter->GetAtmosphericRadiativeTerms()); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetZenithalViewingAngle( + // m_AtmosphericParam->GetViewingZenithalAngle()); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetWindowRadius(GetParameterInt("radius")); - //estimate ground spacing in kilometers - GroundSpacingImageType::Pointer groundSpacing = GroundSpacingImageType::New(); + // //estimate ground spacing in kilometers + // GroundSpacingImageType::Pointer groundSpacing = GroundSpacingImageType::New(); - groundSpacing->SetInputImage(inImage); - IndexType index; + // groundSpacing->SetInputImage(inImage); + // IndexType index; - vnl_random rand; + // vnl_random rand; - index[0] = static_cast<IndexValueType>(rand.lrand32(0, inImage->GetLargestPossibleRegion().GetSize()[0])); - index[1] = static_cast<IndexValueType>(rand.lrand32(0, inImage->GetLargestPossibleRegion().GetSize()[1])); - FloatType tmpSpacing = groundSpacing->EvaluateAtIndex(index); + // index[0] = static_cast<IndexValueType>(rand.lrand32(0, inImage->GetLargestPossibleRegion().GetSize()[0])); + // index[1] = static_cast<IndexValueType>(rand.lrand32(0, inImage->GetLargestPossibleRegion().GetSize()[1])); + // FloatType tmpSpacing = groundSpacing->EvaluateAtIndex(index); - const float spacingInKilometers = (std::max(tmpSpacing[0], tmpSpacing[1])) / 1000.; + // const float spacingInKilometers = (std::max(tmpSpacing[0], tmpSpacing[1])) / 1000.; - // std::ostringstream oss2; - // oss2.str(""); - // oss2 << spacingInKilometers; + // // std::ostringstream oss2; + // // oss2.str(""); + // // oss2 << spacingInKilometers; - // GetLogger()->Info("Spacing in kilometers " + oss2.str()); - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter-> - SetPixelSpacingInKilometers(spacingInKilometers); + // // GetLogger()->Info("Spacing in kilometers " + oss2.str()); + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter-> + // SetPixelSpacingInKilometers(spacingInKilometers); - //rescale the surface reflectance in milli-reflectance - m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->UpdateOutputInformation(); - //m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->Update(); - m_ScaleFilter->SetInput(m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->GetOutput()); + // //rescale the surface reflectance in milli-reflectance + // m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->UpdateOutputInformation(); + // //m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->Update(); + // m_ScaleFilter->SetInput(m_SurfaceAdjacencyEffect6SCorrectionSchemeFilter->GetOutput()); + m_ScaleFilter->SetInput(m_ReflectanceToSurfaceReflectanceFilter->GetOutput()); } break; } -- GitLab