diff --git a/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx b/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx index 1693322743508d869f31ad8e5019a5b95650ee30..8a4e307febe1e6f93a7d00a694d951ab848157b8 100644 --- a/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx @@ -18,9 +18,6 @@ * limitations under the License. */ - -#include <time.h> - #include "otbWrapperApplication.h" #include "otbWrapperApplicationFactory.h" @@ -28,6 +25,8 @@ #include "otbLabelImageSmallRegionMergingFilter.h" #include "itkChangeLabelImageFilter.h" +#include "otbStopwatch.h" + namespace otb { namespace Wrapper @@ -77,7 +76,9 @@ private: " pixel will be merged with adjacent segments, then" " all segments of area equal to 2 pixels will be" " processed, until segments of area minsize."); - + + SetDocLimitations( "None") ; + SetDocAuthors("OTB-Team"); SetDocSeeAlso("Segmentation"); AddDocTag(Tags::Segmentation); @@ -121,8 +122,9 @@ private: void DoExecute() override { - clock_t tic = clock(); - + // Start Timer for the application + auto Timer = Stopwatch::StartNew(); + unsigned int minSize = GetParameterInt("minsize"); //Acquisition of the input image dimensions @@ -180,9 +182,10 @@ private: } SetParameterOutputImage("out", changeLabelFilter->GetOutput()); RegisterPipeline(); - clock_t toc = clock(); - otbAppLogINFO(<<"Elapsed time: "<<(double)(toc - tic) / CLOCKS_PER_SEC<< - " seconds"); + + Timer.Stop(); + otbAppLogINFO( "Total elapsed time: "<< float(Timer.GetElapsedMilliseconds())/1000 <<" seconds."); + } };