diff --git a/Testing/Code/FeatureExtraction/otbImageFittingPolygonPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbImageFittingPolygonPathListFilter.cxx index b976f2c72a17c3480533e1a765bf32df37b5ab1b..7035a45f68db7ef6c489023f29f4189f9c6e0237 100644 --- a/Testing/Code/FeatureExtraction/otbImageFittingPolygonPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbImageFittingPolygonPathListFilter.cxx @@ -26,32 +26,41 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[]) { const char * imageFileName = argv[1]; - const char * outfname = argv[1]; - const double threshold = atof(argv[2]); + const char * polyFileName = argv[2]; + const char * outFileName = argv[3]; + const int fittingRadius = ato(argv[4]); + const int fittingIters = ato(argv[5]); const unsigned int Dimension =2; typedef otb::Polygon<double> PolygonType; typedef otb::Image<double,Dimension> ImageType; + //Read the reference image and extract its contours typedef otb::ImageFileReader<ImageType> ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(imageFileName); typedef itk::CannyEdgeDetectionImageFilter<ImageType,ImageType> CannyFilterType; CannyFilterType::Pointer canny = CannyFilterType::New(); - canny->SetInput(reader->GetOutput()); - + + //Read the original polygon list (kml file) + + + //Fit the polygons on the image typedef otb::ImageFittingPolygonListFilter<PolygonType,ImageType> FittingPolygonType; FittingPolygonType::Pointer fittingPolygon = FittingPolygonType::New(); - fittingPolygon->SetInput(simplifyPolygonFilter->GetOutput()); + fittingPolygon->SetInput(polygonList); fittingPolygon->SetInputImage(canny->GetOutput()); fittingPolygon->SetRadius(fittingRadius); fittingPolygon->SetNumberOfIterations(fittingIters); - fittingPolygon->Update(); +// fittingPolygon->Update(); + //Read the improved polygon list (kml file) + + return EXIT_SUCCESS; }