11. Rémi Cresson
Exemple du pipeline précédent : détection de l'eau sur une image SPOT5
// Déclaration des types des data objects
typedef OTBVectorImage<unsigned int> SPOTImageType ;
typedef OTBImage<double> NDVIImageType ;
typedef OTBImage<bool> MaskImageType ;
// Déclaration des process objects
OTBImageReader<SPOTImageType> reader
OTBBandMathFilter<SPOTImageType, NDVIImageType > bandMathFilter
ITKBinaryThresholdFilter<NDVIImageType , MaskImageType > thresholdFilter
OTBImageWriter<MaskImageType> writer
// Paramétrage des process objects
reader>SetFileName('image_spot_ms.tif') ;
bandMathFilter>SetExpression('(b1b2)/(b1+b2)') ;
thresholdFilter>SetLowerThreshold(1) ;
thresholdFilter>SetUpperThreshold(0) ;
thresholdFilter>SetInsideValue(true) ;
thresholdFilter>SetOutsideValue(false) ;
writer>SetFileName('detection_eau.tif') ;
// Chainage des process objects
writer>SetInput(thresholdFilter>GetOutput()) ;
thresholdFilter>SetInput(bandMathFilter>GetOutput()) ;
bandmathFilter>SetInput(reader>GetInput()) ;
// Déclenchement du pipeline
writer>Update() ;
Pour le développeur : avant
12. Rémi Cresson
Exemple du pipeline précédent : détection de l'eau sur une image SPOT5
// Déclaration des types des data objects
typedef OTBVectorImage<unsigned int> SPOTImageType ;
typedef OTBImage<double> NDVIImageType ;
typedef OTBImage<bool> MaskImageType ;
// Déclaration des process objects
OTBImageReader<SPOTImageType> reader
OTBBandMathFilter<SPOTImageType, NDVIImageType > bandMathFilter
ITKBinaryThresholdFilter<NDVIImageType , MaskImageType > thresholdFilter
OTBWithMPIImageWriter<MaskImageType> writer
// Paramétrage des process objects
reader>SetFileName('image_spot_ms.tif') ;
bandMathFilter>SetExpression('(b1b2)/(b1+b2)') ;
thresholdFilter>SetLowerThreshold(1) ;
thresholdFilter>SetUpperThreshold(0) ;
thresholdFilter>SetInsideValue(true) ;
thresholdFilter>SetOutsideValue(false) ;
writer>SetFileName('detection_eau.tif') ;
// Chainage des process objects
writer>SetInput(thresholdFilter>GetOutput()) ;
thresholdFilter>SetInput(bandMathFilter>GetOutput()) ;
bandmathFilter>SetInput(reader>GetInput()) ;
// Déclenchement du pipeline
writer>SetNumberOfMPIProcesses(MPI_NPROC) ;
writer>SetCurrentMPIProcessId(MPI_RANK) ;
writer>Update() ;
Pour le développeur : après*
13. Rémi Cresson
Autres composants à
« paralléliser »
● Utilisés actuellement : Composants de calcul de
statistiques (moy, std, min, max) sur une image:
communication des sommes, des sommes des
carrés, min, max de chaque instance
– gtb::StatisticsImageFilter
– gtb::StatisticalRegressionImageFilter
– gtb::StreamingStatisticsMosaicFilter - Fait
● Autres composants utilisés dans le futur ? (e.g.
chaînes de traitement pas encore développées :
segmentation, ...)
16. Rémi Cresson
Pour le développeur : avant
...
mosaicImageStatisticsFilter>SetInput(bandMathFilter>GetOutput()) ;
writer>SetInput(mosaicImageStatisticsFilter>GetOutput()) ;
writer>Update() ;