Textures
From OTBWiki
Classes for textures change since OTB 3.4. OTB 3.4 contains both interfaces to enable a smooth migration. The following releases of OTB will use only the new code.
Here is an example of how to use the new classes:
Replace the old code
typedef otb::Functor::ContrastTextureFunctor<PixelType, PixelType> FunctorType;
typedef otb::UnaryFunctorNeighborhoodWithOffsetImageFilter<ImageType,
ImageType, FunctorType> TexturesFilterType;
TexturesFilterType::Pointer texturesFilter = TexturesFilterType::New();
texturesFilter->SetRadius(radius);
typedef ImageType::OffsetType OffsetType;
OffsetType offset;
offset[0] = xOffset;
offset[1] = yOffset;
texturesFilter->SetOffset(offset);
texturesFilter->SetInput(reader->GetOutput());
writer->SetInput(texturesFilter->GetOutput());
by the equivalent new code:
typedef otb::ScalarImageToTexturesFilter<ImageType, ImageType> TexturesFilterType; //or typedef otb::ScalarImageToAdvancedTexturesFilter<ImageType, ImageType> TexturesFilterType; TexturesFilterType::Pointer texturesFilter = TexturesFilterType::New(); typedef ImageType::SizeType SizeType; SizeType sradius; sradius.Fill(radius); texturesFilter->SetRadius(sradius); typedef ImageType::OffsetType OffsetType; OffsetType offset; offset[0] = xOffset; offset[1] = yOffset; texturesFilter->SetOffset(offset); texturesFilter->SetInputImageMinimum(0); texturesFilter->SetInputImageMaximum(255); texturesFilter->SetInput(reader->GetOutput()); writer->SetInput(texturesFilter->GetContrastOutput());
Back to Migration guide
