Commit 4de7ecf4 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

Merge branch 'develop' into app_multi_writer_take3

parents 1e124e55 e472b712
Pipeline #3297 failed with stages
in 8 minutes and 47 seconds
......@@ -10,6 +10,8 @@ Aurélie Emilien <aurelie.emilien@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr> Aurelie Emilien <aurelie.emilien@c-s.fr>
Bas Couwenberg <sebastic@debian.org>
Bas Couwenberg <sebastic@debian.org> Bas Couwenberg <sebastic@xs4all.nl>
Carole Amiot <carole.amiot@cnes.fr>
Carole Amiot <carole.amiot@cnes.fr> Carole Amiot <carole.amiot@thales-services.fr>
Caroline Ruffel <caroline.ruffel@c-s.fr>
Charles Peyrega <charles.peyrega@c-s.fr>
Chia Aik Song <crscas@nus.edu.sg>
......
......@@ -216,20 +216,20 @@ parameters:
-``-structype`` the choice of the structuring element type
(ball/cross) (default value is ball)
-``(-structype.ball.xradius)`` the ball structuring element X Radius
(only if structype==ball) (default value is 5 pixels)
-``(-xradius)`` the ball structuring element X Radius
(default value is 5 pixels)
-``(-structype.ball.yradius)`` the ball structuring element Y Radius
(only if structype==ball) (default value is 5 pixels)
-``(-yradius)`` the ball structuring element Y Radius
(default value is 5 pixels)
-``-filter`` the choice of the morphological operation
(dilate/erode/opening/closing) (default value is dilate)
-``(-filter.dilate.foreval)`` the foreground value for the dilation
(idem for filter.erode/opening/closing) (default value is 1)
-``(-foreval)`` the foreground value
(Used for dilate/erode/opening/closing morphological operations) (default value is 1)
-``(-filter.dilate.backval)`` the background value for the dilation
(idem for filter.erode/opening/closing) (default value is 0)
-``(-backval)`` the background value
(Used for dilate/erode/opening morphological operations) (default value is 0)
-``-out`` the output filtered image
......@@ -243,8 +243,8 @@ The application can be used as follows:
-structype.ball.xradius 10
-structype.ball.yradius 5
-filter opening
-filter.opening.foreval 1.0
-filter.opening.backval 0.0
-foreval 1.0
-backval 0.0
-out OutputImage
Gray scale morphological operations
......
......@@ -32,6 +32,10 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Waddress"
#if defined(__GNUC__) && (__GNUC__ > 5)
#pragma GCC diagnostic ignored "-Wnonnull-compare"
#endif
#include "ossim/base/ossimKeywordlist.h"
#include "ossim/base/ossimString.h"
#include "ossim/ossimPluginProjectionFactory.h"
......
......@@ -30,6 +30,10 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Waddress"
#if defined(__GNUC__) && (__GNUC__ > 5)
#pragma GCC diagnostic ignored "-Wnonnull-compare"
#endif
#include "ossim/projection/ossimRpcSolver.h"
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimRpcProjection.h"
......
......@@ -31,6 +31,10 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Waddress"
#if defined(__GNUC__) && (__GNUC__ > 5)
#pragma GCC diagnostic ignored "-Wnonnull-compare"
#endif
#include "ossim/ossimSarSensorModel.h"
#include "ossim/ossimPluginProjectionFactory.h"
#pragma GCC diagnostic pop
......
......@@ -31,6 +31,10 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Waddress"
#if defined(__GNUC__) && (__GNUC__ > 5)
#pragma GCC diagnostic ignored "-Wnonnull-compare"
#endif
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimSensorModelFactory.h"
#include "ossim/projection/ossimSensorModel.h"
......
......@@ -106,7 +106,7 @@ public:
{
ShareParameter("ram", "polystats.ram");
ShareParameter("sampler", "select.sampler");
ShareParameter("centroids.out", "training.classifier.sharkkm.centroids.out");
ShareParameter("centroids.out", "training.classifier.sharkkm.outcentroids");
ShareParameter("vm", "polystats.mask", "Validity Mask", "Validity mask, only non-zero pixels will be used to estimate KMeans modes.");
}
......@@ -248,10 +248,10 @@ public:
GetInternalApplication("training")->SetParameterInt("classifier.sharkkm.k", GetParameterInt("nc"));
if (IsParameterEnabled("centroids.in") && HasValue("centroids.in"))
{
GetInternalApplication("training")->SetParameterString("classifier.sharkkm.centroids.in", GetParameterString("centroids.in"));
GetInternalApplication("training")->SetParameterString("classifier.sharkkm.incentroids", GetParameterString("centroids.in"));
GetInternalApplication("training")
->SetParameterString("classifier.sharkkm.centroids.stats", GetInternalApplication("imgstats")->GetParameterString("out"));
->SetParameterString("classifier.sharkkm.cstats", GetInternalApplication("imgstats")->GetParameterString("out"));
}
......
......@@ -46,30 +46,26 @@ void LearningApplicationBase<TInputValue, TOutputValue>::InitSharkKMeansParams()
SetParameterDescription("classifier.sharkkm.k", "The number of classes used for the kmeans algorithm. Default set to 2 class");
SetMinimumParameterIntValue("classifier.sharkkm.k", 2);
// Centroid IO
AddParameter(ParameterType_Group, "classifier.sharkkm.centroids", "Centroids IO parameters");
SetParameterDescription("classifier.sharkkm.centroids", "Group of parameters for centroids IO.");
// Input centroids
AddParameter(ParameterType_InputFilename, "classifier.sharkkm.centroids.in", "User definied input centroids");
SetParameterDescription("classifier.sharkkm.centroids.in",
AddParameter(ParameterType_InputFilename, "classifier.sharkkm.incentroids", "User defined input centroids");
SetParameterDescription("classifier.sharkkm.incentroids",
"Input text file containing centroid posistions used to initialize the algorithm. "
"Each centroid must be described by p parameters, p being the number of features in "
"the input vector data, and the number of centroids must be equal to the number of classes "
"(one centroid per line with values separated by spaces).");
MandatoryOff("classifier.sharkkm.centroids");
MandatoryOff("classifier.sharkkm.incentroids");
// Centroid statistics
AddParameter(ParameterType_InputFilename, "classifier.sharkkm.centroids.stats", "Statistics file");
SetParameterDescription("classifier.sharkkm.centroids.stats",
AddParameter(ParameterType_InputFilename, "classifier.sharkkm.cstats", "Statistics file");
SetParameterDescription("classifier.sharkkm.cstats",
"A XML file containing mean and standard deviation to center"
"and reduce the centroids before the KMeans algorithm, produced by ComputeImagesStatistics application.");
MandatoryOff("classifier.sharkkm.centroids.stats");
"and reduce the input centroids before the KMeans algorithm, produced by ComputeImagesStatistics application.");
MandatoryOff("classifier.sharkkm.cstats");
// Output centroids
AddParameter(ParameterType_OutputFilename, "classifier.sharkkm.centroids.out", "Output centroids text file");
SetParameterDescription("classifier.sharkkm.centroids.out", "Output text file containing centroids after the kmean algorithm.");
MandatoryOff("classifier.sharkkm.centroids.out");
AddParameter(ParameterType_OutputFilename, "classifier.sharkkm.outcentroids", "Output centroids text file");
SetParameterDescription("classifier.sharkkm.outcentroids", "Output text file containing centroids after the kmean algorithm.");
MandatoryOff("classifier.sharkkm.outcentroids");
}
template <class TInputValue, class TOutputValue>
......@@ -88,14 +84,14 @@ void LearningApplicationBase<TInputValue, TOutputValue>::TrainSharkKMeans(typena
classifier->SetK(k);
// Initialize centroids from file
if (IsParameterEnabled("classifier.sharkkm.centroids.in") && HasValue("classifier.sharkkm.centroids.in"))
if (IsParameterEnabled("classifier.sharkkm.incentroids") && HasValue("classifier.sharkkm.incentroids"))
{
shark::Data<shark::RealVector> centroidData;
shark::importCSV(centroidData, GetParameterString("classifier.sharkkm.centroids.in"), ' ');
if (HasValue("classifier.sharkkm.centroids.stats"))
shark::importCSV(centroidData, GetParameterString("classifier.sharkkm.incentroids"), ' ');
if (HasValue("classifier.sharkkm.cstats"))
{
auto statisticsReader = otb::StatisticsXMLFileReader<itk::VariableLengthVector<float>>::New();
statisticsReader->SetFileName(GetParameterString("classifier.sharkkm.centroids.stats"));
statisticsReader->SetFileName(GetParameterString("classifier.sharkkm.cstats"));
auto meanMeasurementVector = statisticsReader->GetStatisticVectorByName("mean");
auto stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev");
......@@ -126,8 +122,8 @@ void LearningApplicationBase<TInputValue, TOutputValue>::TrainSharkKMeans(typena
classifier->Train();
classifier->Save(modelPath);
if (HasValue("classifier.sharkkm.centroids.out"))
classifier->ExportCentroids(GetParameterString("classifier.sharkkm.centroids.out"));
if (HasValue("classifier.sharkkm.outcentroids"))
classifier->ExportCentroids(GetParameterString("classifier.sharkkm.outcentroids"));
}
} // end namespace wrapper
......
......@@ -109,7 +109,7 @@ private:
ogr::DataSource::Pointer buffer);
/** Create the output DataSource. */
otb::ogr::DataSource::Pointer CreateOutputDataSource(ogr::DataSource::Pointer source, ogr::Layer& layer);
otb::ogr::DataSource::Pointer CreateOutputDataSource(ogr::Layer& layer);
/** Add a prediction field in the output layer if it does not exist.
* If computeConfidenceMap evaluates to true a confidence field will be
......
......@@ -164,7 +164,7 @@ otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::ReopenDataSource
}
template <bool RegressionMode>
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::CreateOutputDataSource(ogr::DataSource::Pointer source, ogr::Layer& layer)
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::CreateOutputDataSource(ogr::Layer& layer)
{
ogr::DataSource::Pointer output;
// Create new OGRDataSource
......@@ -316,7 +316,7 @@ void VectorPrediction<RegressionMode>::DoExecute()
}
else
{
output = CreateOutputDataSource(source, layer);
output = CreateOutputDataSource(layer);
}
otb::ogr::Layer outLayer = output->GetLayer(0);
......
......@@ -27,3 +27,8 @@ otb_create_application(
NAME ContrastEnhancement
SOURCES otbContrastEnhancement.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application(
NAME FastNLMeans
SOURCES otbFastNLMeans.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES})
/*
* Copyright (C) 2005-2018 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h"
#include "otbFastNLMeansImageFilter.h"
namespace otb
{
namespace Wrapper
{
class FastNLMeans : public Application
{
public:
typedef FastNLMeans Self;
typedef Application Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkNewMacro(Self);
itkTypeMacro(FastNLMeans, otb::Wrapper::Application);
// Define image types
typedef float PixelType;
typedef FloatImageType ImageType;
// Define filter
typedef NLMeansFilter<ImageType, ImageType> NLMeansFilterType;
private:
void DoInit() override
{
SetName("FastNLMeans");
SetDescription("Apply NL Means filter to an image.");
SetDocLongDescription("Implementation is an approximation of NL Means, which is faster.");
// Optional descriptors
SetDocLimitations(
"This filter relies on integral images. Overflow may happen though the risk is limited "
" by OTB mechanism which process data by chunks.");
SetDocAuthors("OTB-Team");
SetDocSeeAlso(" ");
AddDocTag(Tags::Filter);
// Parameter declarations
AddParameter(ParameterType_InputImage, "in", "Input image");
SetParameterDescription("in", "Input image to denoise");
AddParameter(ParameterType_OutputImage, "out", "Output Image");
SetParameterDescription("out", "Output image.");
AddParameter(ParameterType_Int, "patchradius", "Patch radius (patch is a square)");
SetParameterDescription("patchradius", "Full patch will have a size of 2*patchradius +1.");
SetDefaultParameterInt("patchradius", 2);
SetMinimumParameterIntValue("patchradius", 0);
MandatoryOff("patchradius");
AddParameter(ParameterType_Int, "searchradius", "Search window radius (search window is a square)");
SetParameterDescription("searchradius", "Search window is used to find similar patches. Its size will be 2*searchradius+1.");
SetDefaultParameterInt("searchradius", 7);
SetMinimumParameterIntValue("searchradius", 0);
MandatoryOff("searchradius");
AddParameter(ParameterType_Float, "sig", "Standard deviation in image");
SetParameterDescription("sig",
"Noise standard deviation estimated in image. This parameter is used to correct for the expected difference between two patches. "
"This filter works fine without using this tuning.");
SetDefaultParameterFloat("sig", 0);
SetMinimumParameterFloatValue("sig", 0);
MandatoryOff("sig");
AddParameter(ParameterType_Float, "thresh", "Similarity threshold");
SetParameterDescription("thresh",
"Factor influencing similarity score of two patches. The higher the threshold, the more permissive the filter. It is common to set "
"this threshold slightly below the standard deviation (for Gaussian noise), at about 0.8*sigma.");
SetDefaultParameterFloat("thresh", 1.0);
SetMinimumParameterFloatValue("thresh", 0.);
MandatoryOff("thresh");
AddRAMParameter();
SetDocExampleParameterValue("in", "GomaAvant.tif");
SetDocExampleParameterValue("out", "denoisedImage_NLMeans.tif");
}
void DoUpdateParameters() override
{
// Nothing to do here : all parameters are independent
}
void DoExecute() override
{
// Get the input image
ImageType::Pointer imIn = this->GetParameterFloatImage("in");
float sigma = this->GetParameterFloat("sig");
float cutoffDistance = this->GetParameterFloat("thresh");
int halfPatchSize = this->GetParameterInt("patchradius");
int halfSearchSize = this->GetParameterInt("searchradius");
NLMeansFilterType::Pointer nlMeansFilter = NLMeansFilterType::New();
nlMeansFilter->SetInput(imIn);
nlMeansFilter->SetSigma(sigma);
nlMeansFilter->SetHalfWindowSize(halfPatchSize);
nlMeansFilter->SetHalfSearchSize(halfSearchSize);
nlMeansFilter->SetCutOffDistance(cutoffDistance);
m_FilterRef = nlMeansFilter;
SetParameterOutputImage("out", nlMeansFilter->GetOutput());
RegisterPipeline();
}
itk::LightObject::Pointer m_FilterRef;
}; // end class
} // namespace Wrapper
} // namespace otb
OTB_APPLICATION_EXPORT(otb::Wrapper::FastNLMeans)
......@@ -30,6 +30,7 @@ otb_module(OTBAppFiltering
OTBStatistics
OTBStreaming
OTBFunctor
OTBSmoothing
TEST_DEPENDS
OTBTestKernel
......
......@@ -101,6 +101,19 @@ otb_test_application(NAME apTvUtContrastTest_lum
VALID --compare-image ${NOTOL}
${BASELINE}/apTvUtContrastTest_lum.tif
${TEMP}/apTvUtContrastTest_lum.tif)
#----------- NL Means TESTS ----------------
otb_test_application(NAME nlMeansTest_base
APP FastNLMeans
OPTIONS -in ${INPUTDATA}/GomaAvant.tif
-out ${TEMP}/GomaAvant_NLMeans.tif
-patchradius 2
-searchradius 11
-thresh 30
VALID --compare-image ${EPSILON_7}
${BASELINE}/GomaAvant_NLMeans.tif
${TEMP}/GomaAvant_NLMeans.tif)
......
......@@ -206,7 +206,7 @@ private:
return outputFile;
}
void DoInit()
void DoInit() override
{
SetName("Mosaic");
SetDescription("Perform a mosaic of input images");
......@@ -382,7 +382,7 @@ private:
SetDocExampleParameterValue("out", "mosaicImage.tif");
}
void DoUpdateParameters()
void DoUpdateParameters() override
{
// TODO: update parameters
}
......@@ -1028,7 +1028,7 @@ private:
}
}
void DoExecute()
void DoExecute() override
{
GDALAllRegister();
m_TemporaryFiles.clear();
......@@ -1055,7 +1055,7 @@ private:
} // DoExecute()
void AfterExecuteAndWriteOutputs()
void AfterExecuteAndWriteOutputs() override
{
if (m_TemporaryFiles.size() > 0)
{
......
......@@ -143,7 +143,7 @@ otb_test_application(NAME apTvUtTileFusion
-rows 2
-out ${TEMP}/apTvUtTileFusion.png uint8
VALID --compare-image ${NOTOL}
${INPUTDATA}/Scene.png
${INPUTDATA}/scene.png
${TEMP}/apTvUtTileFusion.png)
......@@ -203,6 +203,20 @@ otb_test_application(NAME apTvUtQuicklookROI1Channel
${TEMP}/apTvUtQuicklookROI1Channel.tif
)
otb_test_application(NAME apTvUtQuicklookWithGCP
APP Quicklook
OPTIONS -in ${INPUTDATA}/spot5SubWithGcps.tif
-out ${TEMP}/apTvUtQuicklookWithGCP.tif uint8
-sr 4
-rox 100
-roy 100
-rsx 200
-rsy 200
VALID --compare-metadata ${NOTOL}
${BASELINE}/apTvUtQuicklookWithGCP.tif
${TEMP}/apTvUtQuicklookWithGCP.tif
)
otb_test_application(NAME apTvUtQuicklookSpot5
APP Quicklook
OPTIONS -in LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF}
......
......@@ -96,8 +96,14 @@ private:
SetDefaultParameterInt("channel", 1);
SetMinimumParameterIntValue("channel", 1);
// Structuring element type
AddParameter(ParameterType_Choice, "structype", "Type of structuring element");
SetParameterDescription("structype", "Choice of the structuring element type");
AddChoice("structype.box", "Box");
AddChoice("structype.ball", "Ball");
AddChoice("structype.cross", "Cross");
// Radius
AddParameter(ParameterType_Int, "xradius", "Structuring element X radius");
SetParameterDescription("xradius", "The structuring element radius along the X axis.");
SetDefaultParameterInt("xradius", 5);
......@@ -105,43 +111,21 @@ private:
SetParameterDescription("yradius", "The structuring element radius along the Y axis.");
SetDefaultParameterInt("yradius", 5);
AddChoice("structype.box", "Box");
AddChoice("structype.ball", "Ball");
AddChoice("structype.cross", "Cross");
// Foreground and background values
AddParameter(ParameterType_Float, "foreval", "Foreground value");
SetParameterDescription("foreval", "Set the foreground value, default is 1.0.");
SetDefaultParameterFloat("foreval", 1.0);
AddParameter(ParameterType_Float, "backval", "Background value");
SetParameterDescription("backval", "Set the background value, default is 0.0.");
SetDefaultParameterFloat("backval", 0.0);
// Morphological operations
AddParameter(ParameterType_Choice, "filter", "Morphological Operation");
SetParameterDescription("filter", "Choice of the morphological operation");
// Dilate
AddChoice("filter.dilate", "Dilate");
AddParameter(ParameterType_Float, "filter.dilate.foreval", "Foreground value");
SetParameterDescription("filter.dilate.foreval", "Set the foreground value, default is 1.0.");
SetDefaultParameterFloat("filter.dilate.foreval", 1.0);
AddParameter(ParameterType_Float, "filter.dilate.backval", "Background value");
SetParameterDescription("filter.dilate.backval", "Set the background value, default is 0.0.");
SetDefaultParameterFloat("filter.dilate.backval", 0.0);
// Erode
AddChoice("filter.erode", "Erode");
AddParameter(ParameterType_Float, "filter.erode.foreval", "Foreground value");
SetParameterDescription("filter.erode.foreval", "Set the foreground value, default is 1.0.");
SetDefaultParameterFloat("filter.erode.foreval", 1.0);
AddParameter(ParameterType_Float, "filter.erode.backval", "Background value");
SetParameterDescription("filter.erode.backval", "Set the background value, default is 0.0.");
SetDefaultParameterFloat("filter.erode.backval", 0.0);
// Opening
AddChoice("filter.opening", "Opening");
AddParameter(ParameterType_Float, "filter.opening.foreval", "Foreground value");
SetParameterDescription("filter.opening.foreval", "Set the foreground value, default is 1.0.");
SetDefaultParameterFloat("filter.opening.foreval", 1.0);
AddParameter(ParameterType_Float, "filter.opening.backval", "Background value");
SetParameterDescription("filter.opening.backval", "Set the background value, default is 0.0.");
SetDefaultParameterFloat("filter.opening.backval", 0.0);
// Closing
AddChoice("filter.closing", "Closing");
AddParameter(ParameterType_Float, "filter.closing.foreval", "Foreground value");
SetParameterDescription("filter.closing.foreval", "Set the foreground value, default is 1.0.");
SetDefaultParameterFloat("filter.closing.foreval", 1.0);
AddRAMParameter();
......@@ -204,8 +188,8 @@ private:
m_DilFilter = DilateFilterType::New();
m_DilFilter->SetKernel(se);
m_DilFilter->SetInput(m_ExtractorFilter->GetOutput());
m_DilFilter->SetForegroundValue(GetParameterFloat("filter.dilate.foreval"));
m_DilFilter->SetBackgroundValue(GetParameterFloat("filter.dilate.backval"));
m_DilFilter->SetForegroundValue(GetParameterFloat("foreval"));
m_DilFilter->SetBackgroundValue(GetParameterFloat("backval"));
SetParameterOutputImage("out", m_DilFilter->GetOutput());
}
else if (GetParameterString("filter") == "erode")
......@@ -213,8 +197,8 @@ private:
m_EroFilter = ErodeFilterType::New();
m_EroFilter->SetKernel(se);
m_EroFilter->SetInput(m_ExtractorFilter->GetOutput());
m_EroFilter->SetForegroundValue(GetParameterFloat("filter.erode.foreval"));
m_EroFilter->SetBackgroundValue(GetParameterFloat("filter.erode.backval"));
m_EroFilter->SetForegroundValue(GetParameterFloat("foreval"));
m_EroFilter->SetBackgroundValue(GetParameterFloat("backval"));
SetParameterOutputImage("out", m_EroFilter->GetOutput());
}
else if (GetParameterString("filter") == "opening")
......@@ -222,8 +206,8 @@ private:
m_OpeFilter = OpeningFilterType::New();
m_OpeFilter->SetKernel(se);
m_OpeFilter->SetInput(m_ExtractorFilter->GetOutput());
m_OpeFilter->SetForegroundValue(GetParameterFloat("filter.opening.foreval"));
m_OpeFilter->SetBackgroundValue(GetParameterFloat("filter.opening.backval"));
m_OpeFilter->SetForegroundValue(GetParameterFloat("foreval"));
m_OpeFilter->SetBackgroundValue(GetParameterFloat("backval"));
SetParameterOutputImage("out", m_OpeFilter->GetOutput());
}
else if (GetParameterString("filter") == "closing")
......@@ -231,7 +215,7 @@ private:
m_CloFilter = ClosingFilterType::New();
m_CloFilter->SetKernel(se);
m_CloFilter->SetInput(m_ExtractorFilter->GetOutput());
m_CloFilter->SetForegroundValue(GetParameterFloat("filter.closing.foreval"));
m_CloFilter->SetForegroundValue(GetParameterFloat("foreval"));
SetParameterOutputImage("out", m_CloFilter->GetOutput());
}
}
......
......@@ -27,8 +27,8 @@ otb_test_application(NAME apTvFEBinaryMorphologicalOperation
-structype ball
-xradius 10
-filter opening
-filter.opening.foreval 1.0
-filter.opening.backval 0.0
-foreval 1.0
-backval 0.0
-out ${TEMP}/apTvFEBinaryMorphologicalOperation.tif
VALID --compare-image ${NOTOL}
${BASELINE}/apTvFEBinaryMorphologicalOperation.tif
......