Skip to content
Snippets Groups Projects
Commit 124cfe33 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

Ajout de l'exemple de radiometrie pour le Software guide.

parent 2ca681ab
No related branches found
No related tags found
No related merge requests found
......@@ -151,10 +151,10 @@ public:
/** Give the solar illumination value. */
itkGetConstReferenceMacro(SolarIllumination, VectorType);
/** Set the zenithal solar radius. */
itkSetMacro(ZenithalSolarRadius, double);
/** Give the zenithal solar radius. */
itkGetConstReferenceMacro(ZenithalSolarRadius, double);
/** Set the zenithal solar angle. */
itkSetMacro(ZenithalSolarAngle, double);
/** Give the zenithal solar angle. */
itkGetConstReferenceMacro(ZenithalSolarAngle, double);
/** Set the flux normalization coefficient. */
void SetFluxNormalizationCoefficient(double coef)
......@@ -181,7 +181,7 @@ public:
m_Alpha.Fill(0);
m_Beta.SetSize(1);
m_Beta.Fill(0);
m_ZenithalSolarRadius = 1.;
m_ZenithalSolarAngle = 1.;
m_FluxNormalizationCoefficient = 1.;
m_SolarIllumination.Fill(1.);
m_IsSetFluxNormalizationCoefficient = false;
......@@ -207,7 +207,7 @@ public:
otb_6s_integer mounth = static_cast<otb_6s_integer>(m_Month);
int cr(0);
cr = otb_6s_varsol_(&day, &mounth, &dsol);
coefTemp = vcl_cos(m_ZenithalSolarRadius*M_PI/180)*static_cast<double>(dsol);
coefTemp = vcl_cos(m_ZenithalSolarAngle*M_PI/180)*static_cast<double>(dsol);
}
else
{
......@@ -216,7 +216,7 @@ public:
}
else
{
coefTemp = vcl_cos(m_ZenithalSolarRadius*M_PI/180)*m_FluxNormalizationCoefficient*m_FluxNormalizationCoefficient;
coefTemp = vcl_cos(m_ZenithalSolarAngle*M_PI/180)*m_FluxNormalizationCoefficient*m_FluxNormalizationCoefficient;
}
functor.SetIlluminationCorrectionCoefficient(1. / coefTemp);
functor.SetAlpha(m_Alpha[i]);
......@@ -231,8 +231,8 @@ private:
/** Ponderation declaration*/
VectorType m_Alpha;
VectorType m_Beta;
/** Set the zenithal soalr radius. */
double m_ZenithalSolarRadius;
/** Set the zenithal soalr angle. */
double m_ZenithalSolarAngle;
/** Flux normalization coefficient. */
double m_FluxNormalizationCoefficient;
/** Solar illumination value. */
......
......@@ -130,10 +130,10 @@ public:
/** Give the solar illumination value. */
itkGetConstReferenceMacro(SolarIllumination, VectorType);
/** Set the zenithal solar radius. */
itkSetMacro(ZenithalSolarRadius, double);
/** Give the zenithal solar radius. */
itkGetConstReferenceMacro(ZenithalSolarRadius, double);
/** Set the zenithal solar angle. */
itkSetMacro(ZenithalSolarAngle, double);
/** Give the zenithal solar angle. */
itkGetConstReferenceMacro(ZenithalSolarAngle, double);
/** Set the day. */
itkSetClampMacro(Day, int, 1, 31);
......@@ -164,7 +164,7 @@ public:
/** Constructor */
LuminanceToReflectanceImageFilter()
{
m_ZenithalSolarRadius = 1.;
m_ZenithalSolarAngle = 1.;
m_FluxNormalizationCoefficient = 1.;
m_SolarIllumination.SetSize(1);
m_SolarIllumination.Fill(1.);
......@@ -193,7 +193,7 @@ public:
otb_6s_integer month = static_cast<otb_6s_integer>(m_Month);
int cr(0);
cr = otb_6s_varsol_(&day, &month, &dsol);
coefTemp = vcl_cos(m_ZenithalSolarRadius*M_PI/180)*static_cast<double>(dsol);
coefTemp = vcl_cos(m_ZenithalSolarAngle*M_PI/180)*static_cast<double>(dsol);
}
else
{
......@@ -202,7 +202,7 @@ public:
}
else
{
coefTemp = vcl_cos(m_ZenithalSolarRadius*M_PI/180)*m_FluxNormalizationCoefficient*m_FluxNormalizationCoefficient;
coefTemp = vcl_cos(m_ZenithalSolarAngle*M_PI/180)*m_FluxNormalizationCoefficient*m_FluxNormalizationCoefficient;
}
functor.SetIlluminationCorrectionCoefficient(1. / coefTemp);
functor.SetSolarIllumination(static_cast<double>(m_SolarIllumination[i]));
......@@ -213,8 +213,8 @@ public:
private:
/** Set the zenithal soalr radius. */
double m_ZenithalSolarRadius;
/** Set the zenithal soalr angle. */
double m_ZenithalSolarAngle;
/** Flux normalization coefficient. */
double m_FluxNormalizationCoefficient;
/* Acquisition day. */
......
This diff is collapsed.
......@@ -217,7 +217,7 @@ ADD_TEST(raTvLuminanceToReflectanceImageFilter ${RADIOMETRY_TESTS}
0.9923885328 #d/d0 corresponding to the date 03/05
)
ADD_TEST(raTvLuminanceToReflectanceImageFilterDayMounth ${RADIOMETRY_TESTS}
ADD_TEST(raTvLuminanceToReflectanceImageFilterDayMonth ${RADIOMETRY_TESTS}
--compare-image ${EPSILON} ${BASELINE}/raTvLuminanceToReflectanceImageFilter.tif
${TEMP}/raTvLuminanceToReflectanceImageFilterDayMounth.tif
otbLuminanceToReflectanceImageFilter
......
......@@ -30,7 +30,7 @@ int otbImageToReflectanceImageFilter(int argc, char * argv[])
{
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
const double radius = static_cast<double>(atof(argv[3]));
const double angle = static_cast<double>(atof(argv[3]));
double flux = 0.;
int day = 1;
int month = 1;
......@@ -82,7 +82,7 @@ int otbImageToReflectanceImageFilter(int argc, char * argv[])
filter->SetAlpha(alpha);
filter->SetBeta(beta);
filter->SetZenithalSolarRadius(radius);
filter->SetZenithalSolarAngle(angle);
filter->SetSolarIllumination(solarIllumination);
if (argc==17)
......
......@@ -30,7 +30,7 @@ int otbLuminanceToReflectanceImageFilter(int argc, char * argv[])
{
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
const double radius = static_cast<double>(atof(argv[3]));
const double angle = static_cast<double>(atof(argv[3]));
double flux = 0.;
int day = 1;
int month = 1;
......@@ -73,7 +73,7 @@ int otbLuminanceToReflectanceImageFilter(int argc, char * argv[])
// Instantiating object
LuminanceToReflectanceImageFilterType::Pointer filter = LuminanceToReflectanceImageFilterType::New();
filter->SetZenithalSolarRadius(radius);
filter->SetZenithalSolarAngle(angle);
filter->SetSolarIllumination(solarIllumination);
if (argc==9)
{
......@@ -84,7 +84,7 @@ int otbLuminanceToReflectanceImageFilter(int argc, char * argv[])
filter->SetDay(day);
filter->SetMonth(month);
}
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->Update();
......
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