Skip to content
Snippets Groups Projects
Commit 86285386 authored by OTB Bot's avatar OTB Bot
Browse files

STYLE

parent b184bddd
No related branches found
No related tags found
No related merge requests found
......@@ -82,12 +82,11 @@ BandMathImageFilterX<TImage>
m_VVarName.clear();
m_VAllowedVarNameAuto.clear();
m_VAllowedVarNameAddedByUser.clear();
m_VFinalAllowedVarName.clear();
m_VFinalAllowedVarName.clear();
m_VNotAllowedVarName.clear();
m_outputsDimensions.clear();
}
......@@ -200,7 +199,7 @@ void BandMathImageFilterX<TImage>
for(int i=0; i < expression.size(); ++i)
if (expression[i] == ';')
oss << ",";
else
else
oss << expression[i];
oss << ")";
......
......@@ -49,7 +49,6 @@ void bands::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_
}
void conv::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -92,7 +91,6 @@ void conv::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
}
void ElementWiseDivision::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int)
{
const mup::matrix_type a = a_pArg[0]->GetArray();
......@@ -117,7 +115,6 @@ void ElementWiseDivision::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *
}
void ElementWiseMultiplication::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int)
{
const mup::matrix_type a = a_pArg[0]->GetArray();
......@@ -137,7 +134,6 @@ void ElementWiseMultiplication::Eval(mup::ptr_val_type &ret, const mup::ptr_val_
}
void ndvi::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -154,7 +150,6 @@ void ndvi::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
}
void cat::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
......@@ -184,7 +179,7 @@ void cat::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA
case 'i':
vect.push_back( (double) a_pArg[k]->GetInteger());
break;
break;
case 'f':
vect.push_back( (double) a_pArg[k]->GetFloat());
......@@ -200,7 +195,6 @@ void cat::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA
}
void mean::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
......@@ -210,7 +204,7 @@ void mean::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
double sum;
for (int k=0; k<a_iArgc; ++k)
{
{
// Get the argument from the argument input vector
switch (a_pArg[k]->GetType())
......@@ -226,7 +220,7 @@ void mean::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
for (int i=0; i<nbrows; i++)
for (int j=0; j<nbcols; j++)
sum += m1.At(i,j).GetFloat();
sum += m1.At(i,j).GetFloat();
vect.push_back( sum / (double) (nbrows*nbcols) );
......@@ -235,7 +229,7 @@ void mean::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
case 'i':
vect.push_back( (double) a_pArg[k]->GetInteger());
break;
break;
case 'f':
vect.push_back( (double) a_pArg[k]->GetFloat());
......@@ -260,7 +254,7 @@ void var::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA
double sum,mean;
for (int k=0; k<a_iArgc; ++k)
{
{
// Get the argument from the argument input vector
switch (a_pArg[k]->GetType())
......@@ -292,7 +286,7 @@ void var::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA
case 'i':
vect.push_back( 0.0 );
break;
break;
case 'f':
vect.push_back( 0.0 );
......@@ -308,7 +302,6 @@ void var::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA
}
void median::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
......@@ -318,7 +311,7 @@ void median::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a
for (int k=0; k<a_iArgc; ++k)
{
{
tempvect.clear();
// Get the argument from the argument input vector
switch (a_pArg[k]->GetType())
......@@ -342,7 +335,7 @@ void median::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a
case 'i':
vect.push_back( (double) a_pArg[k]->GetInteger());
break;
break;
case 'f':
vect.push_back( (double) a_pArg[k]->GetFloat());
......@@ -400,7 +393,6 @@ void vsin::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
}
void vtan::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -481,7 +473,6 @@ void vcosh::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_
}
void vlog::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -502,7 +493,6 @@ void vlog::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
}
void vlog10::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -523,7 +513,6 @@ void vlog10::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a
}
void vabs::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......@@ -544,7 +533,6 @@ void vabs::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i
}
void vexp::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iArgc)
{
// Get the argument from the argument input vector
......
......@@ -271,7 +271,7 @@ int otbBandMathImageFilterXConv( int itkNotUsed(argc), char* itkNotUsed(argv) []
filter->SetNthInput(1, image2);
filter->SetNthInput(2, image3, "canal3");
filter->SetMatrix("kernel1","{ 0.1 , 0.2 , 0.3; 0.4 , 0.5 , 0.6; 0.7 , 0.8 , 0.9; 1.0 , 1.1 , 1.2; 1.3 , 1.4 , 1.5 }");
filter->SetExpression("conv(kernel1,imageAb1N3x5,imageAb2N3x5) ; im2b1^1.1 ; vcos(canal3) ; mean(imageAb2N3x3) ; var(imageAb2N3x3) ; median(imageAb2N3x3)");
filter->SetExpression("conv(kernel1,imageAb1N3x5,imageAb2N3x5); im2b1^1.1; vcos(canal3); mean(imageAb2N3x3); var(imageAb2N3x3); median(imageAb2N3x3)");
filter->Update();
if (filter->GetNumberOfOutputs() != 1)
......@@ -314,18 +314,18 @@ int otbBandMathImageFilterXConv( int itkNotUsed(argc), char* itkNotUsed(argv) []
px1[3]= vcl_cos(it3.GetCenterPixel()[0]);
// mean var median
std::vector<double> vect;
std::vector<double> vect;
for (int i=3; i<=11; i++)
vect.push_back(it1.GetPixel(i)[1]);
vect.push_back(it1.GetPixel(i)[1]);
px1[4] = 0.0;
for (int i=0; i<vect.size(); i++)
px1[4] += vect[i];
px1[4] += vect[i];
px1[4] /= ((double) vect.size()); //mean
px1[5] = 0.0;
for (int i=0; i<vect.size(); i++)
px1[5] += (vect[i]-px1[4])*(vect[i]-px1[4]);
px1[5] += (vect[i]-px1[4])*(vect[i]-px1[4]);
px1[5] /= ((double) vect.size()); //var
std::sort(vect.begin(),vect.end());
......
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