Commit 9bfd5471 authored by Julien Michel's avatar Julien Michel

Merge branch 'localstat' into 'develop'

Improve LocalStatisticsExtraction

See merge request !540
parents 9dc09bc1 2cba33bd
Pipeline #2098 passed with stages
in 6 minutes and 2 seconds
...@@ -36,10 +36,10 @@ The application can be used like this: ...@@ -36,10 +36,10 @@ The application can be used like this:
:: ::
otbcli_LocalStatisticExtraction -in InputImage otbcli_LocalStatisticExtraction -in InputImage.tif
-channel 1 -channel 1
-radius 3 -radius 3
-out OutputImage -out OutputImage.tif
Edge extraction Edge extraction
--------------- ---------------
......
...@@ -59,7 +59,10 @@ SetName("LocalStatisticExtraction"); ...@@ -59,7 +59,10 @@ SetName("LocalStatisticExtraction");
SetDescription("Computes local statistical moments on every pixel in the selected channel of the input image"); SetDescription("Computes local statistical moments on every pixel in the selected channel of the input image");
// Documentation // Documentation
SetDocLongDescription("This application computes the 4 local statistical moments on every pixel in the selected channel of the input image, over a specified neighborhood. The output image is multi band with one statistical moment (feature) per band. Thus, the 4 output features are the Mean, the Variance, the Skewness and the Kurtosis. They are provided in this exact order in the output image."); SetDocLongDescription("This application computes the 4 local statistical moments on every pixel in the "
"selected channel of the input image, over a specified neighborhood. The output image is multi band "
"with one statistical moment (feature) per band. Thus, the 4 output features are the Mean, the "
"Variance, the Skewness and the Kurtosis. They are provided in this exact order in the output image.");
SetDocLimitations("None"); SetDocLimitations("None");
SetDocAuthors("OTB-Team"); SetDocAuthors("OTB-Team");
SetDocSeeAlso("otbRadiometricMomentsImageFunction class"); SetDocSeeAlso("otbRadiometricMomentsImageFunction class");
...@@ -74,7 +77,7 @@ AddParameter(ParameterType_OutputImage, "out", "Feature Output Image"); ...@@ -74,7 +77,7 @@ AddParameter(ParameterType_OutputImage, "out", "Feature Output Image");
SetParameterDescription("out", "Output image containing the local statistical moments."); SetParameterDescription("out", "Output image containing the local statistical moments.");
AddParameter(ParameterType_Int, "channel", "Selected Channel"); AddParameter(ParameterType_Int, "channel", "Selected Channel");
SetParameterDescription("channel", "The selected channel index"); SetParameterDescription("channel", "The selected channel index (1 based)");
SetDefaultParameterInt("channel", 1); SetDefaultParameterInt("channel", 1);
SetMinimumParameterIntValue("channel", 1); SetMinimumParameterIntValue("channel", 1);
...@@ -102,7 +105,6 @@ void DoUpdateParameters() override ...@@ -102,7 +105,6 @@ void DoUpdateParameters() override
void DoExecute() override void DoExecute() override
{ {
FloatVectorImageType::Pointer inImage = GetParameterImage("in"); FloatVectorImageType::Pointer inImage = GetParameterImage("in");
inImage->UpdateOutputInformation();
int nbChan = inImage->GetNumberOfComponentsPerPixel(); int nbChan = inImage->GetNumberOfComponentsPerPixel();
if( GetParameterInt("channel") > nbChan ) if( GetParameterInt("channel") > nbChan )
...@@ -118,12 +120,10 @@ void DoExecute() override ...@@ -118,12 +120,10 @@ void DoExecute() override
m_ExtractorFilter->SetSizeX(inImage->GetLargestPossibleRegion().GetSize(0)); m_ExtractorFilter->SetSizeX(inImage->GetLargestPossibleRegion().GetSize(0));
m_ExtractorFilter->SetSizeY(inImage->GetLargestPossibleRegion().GetSize(1)); m_ExtractorFilter->SetSizeY(inImage->GetLargestPossibleRegion().GetSize(1));
m_ExtractorFilter->SetChannel(GetParameterInt("channel")); m_ExtractorFilter->SetChannel(GetParameterInt("channel"));
m_ExtractorFilter->UpdateOutputInformation();
m_Filter = FilterType::New(); m_Filter = FilterType::New();
m_Filter->SetInput(m_ExtractorFilter->GetOutput()); m_Filter->SetInput(m_ExtractorFilter->GetOutput());
m_Filter->SetRadius(GetParameterInt("radius")); m_Filter->SetRadius(GetParameterInt("radius"));
m_Filter->UpdateOutputInformation();
SetParameterOutputImage("out", m_Filter->GetOutput()); SetParameterOutputImage("out", m_Filter->GetOutput());
......
...@@ -108,7 +108,7 @@ public: ...@@ -108,7 +108,7 @@ public:
private: private:
double m_SolarIllumination; double m_SolarIllumination;
double m_IlluminationCorrectionCoefficient; double m_IlluminationCorrectionCoefficient;
double m_UseClamp; bool m_UseClamp;
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment