diff --git a/Testing/Code/BasicFilters/CMakeLists.txt b/Testing/Code/BasicFilters/CMakeLists.txt index 985664145757c86d8017df06c1084845bddf7efe..92d3827991685758bfc27c72c40d0f1611051b7b 100644 --- a/Testing/Code/BasicFilters/CMakeLists.txt +++ b/Testing/Code/BasicFilters/CMakeLists.txt @@ -1135,14 +1135,60 @@ ADD_TEST(bfTvMeanShiftImageFilterValid ${BASICFILTERS_TESTS9} 9 50 10 1.0 ) + ADD_TEST(bfTvMeanShiftImageFilter2 ${BASICFILTERS_TESTS9} otbMeanShiftImageFilter2 ${INPUTDATA}/QB_Suburb.png ${TEMP}/bfMeanShiftImageSpatialOutput.tif ${TEMP}/bfMeanShiftImageFilterSpectralOutput.tif ${TEMP}/bfMeanShiftImageFilterMetricOutput.tif - 9 9 50 + 9 9 50 10 0.001 ) + +ADD_TEST(bfTvMeanShiftImageFilterValidMul ${BASICFILTERS_TESTS9} + otbMeanShiftImageFilter + ${INPUTDATA}/QB_MUL_ROI_1000_100.tif + ${TEMP}/bfMeanShiftImageFilterOutputValidMul.tif + ${TEMP}/bfMeanShiftImageFilterClusteredOutputValidMul.tif + ${TEMP}/bfMeanShiftImageFilterLabeledClusteredOutputValidMul.tif + ${TEMP}/bfMeanShiftImageFilterClusterBoundariesOutputValidMul.tif + 9 50 10 1.0 + ) + +ADD_TEST(bfTvMeanShiftImageFilter2Mul ${BASICFILTERS_TESTS9} + otbMeanShiftImageFilter2 + ${INPUTDATA}/ROI_QB_MUL_4.tif + ${TEMP}/bfMeanShiftImageSpatialOutputMul.tif + ${TEMP}/bfMeanShiftImageFilterSpectralOutputMul.tif + ${TEMP}/bfMeanShiftImageFilterMetricOutputMul.tif + 9 9 50 10 0.001 + ) + + + +#IF(OTB_DATA_USE_LARGEINPUT) +# +#ADD_TEST(bfTvMeanShiftImageFilterValidLargeInput ${BASICFILTERS_TESTS9} +# otbMeanShiftImageFilter +# ${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF +# ${TEMP}/bfMeanShiftImageFilterOutputValidLargeInput.tif +# ${TEMP}/bfMeanShiftImageFilterClusteredOutputValidLargeInput.tif +# ${TEMP}/bfMeanShiftImageFilterLabeledClusteredOutputValidLargeInput.tif +# ${TEMP}/bfMeanShiftImageFilterClusterBoundariesOutputValidLargeInput.tif +# 9 50 10 1.0 +# ) + +#ADD_TEST(bfTvMeanShiftImageFilter2LargeInput ${BASICFILTERS_TESTS9} +# otbMeanShiftImageFilter2 +# ${LARGEINPUT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF +# ${TEMP}/bfMeanShiftImageSpatialOutputLargeInput.tif +# ${TEMP}/bfMeanShiftImageFilterSpectralOutputLargeInput.tif +# ${TEMP}/bfMeanShiftImageFilterMetricOutputLargeInput.tif +# 9 9 50 10 0.001 +# ) +# +#ENDIF(OTB_DATA_USE_LARGEINPUT) + ADD_TEST(bfTuMeanShiftVectorImageFilterNew ${BASICFILTERS_TESTS9} otbMeanShiftVectorImageFilterNew ) diff --git a/Testing/Code/BasicFilters/otbMeanShiftImageFilter2.cxx b/Testing/Code/BasicFilters/otbMeanShiftImageFilter2.cxx index 44c504572eb5486910b81b4d1db37c789182e391..369fe1f7d492333dad18e865b7663beabc7f1ce6 100644 --- a/Testing/Code/BasicFilters/otbMeanShiftImageFilter2.cxx +++ b/Testing/Code/BasicFilters/otbMeanShiftImageFilter2.cxx @@ -24,10 +24,10 @@ int otbMeanShiftImageFilter2(int argc, char * argv[]) { - if (argc != 8) + if (argc != 10) { std::cerr << "Usage: " << argv[0] << - " infname spatialfname spectralfname metricfname spatialRadius spectralRadius spectralbandwidth" + " infname spatialfname spectralfname metricfname spatialRadius spectralRadius spectralbandwidth spatialBandwidth threshold" << std::endl; return EXIT_FAILURE; } @@ -39,6 +39,8 @@ int otbMeanShiftImageFilter2(int argc, char * argv[]) const unsigned int spatialRadius = atoi(argv[5]); const unsigned int spectralRadius = atoi(argv[6]); const double spectralbandwidth = atof(argv[7]); + const double spatialbandwidth = atof(argv[8]); + const double threshold = atof(argv[9]); /* maxit - threshold */ @@ -67,6 +69,8 @@ int otbMeanShiftImageFilter2(int argc, char * argv[]) radius[1]=spectralRadius; filter->SetRangeRadius(radius); filter->SetSpectralBandwidth(spectralbandwidth); + filter->SetSpatialBandwidth(spatialbandwidth); + filter->SetThreshold(threshold); filter->SetInput(reader->GetOutput()); //filter->SetNumberOfThreads(1);