Request for Changes-80: Compute sub-sampled Haralick textures

From OTBWiki
Jump to: navigation, search

[Request for Changes - 80] Compute sub-sampled Haralick textures


  • Author: Guillaume
  • Additional Contributors (if different than authors)
  • Submitted on 12.01.2017
  • Proposed target release : 5.10
  • Adopted : +3 from Julien, Victor, Guillaume
  • Merged : 3320d4360922ea5b23bd1d74fb0988624c4d0092


Allow to compute Haralick textures on a sub-sampled output grid.


The Haralick filters require heavy computation and can be slow on large images. Users feedback has shown the need of a sub-sampled version of Haralick filters : compute textures every 'n' pixels (but still using the full input grid).

Implementation details

Classes and files

M       Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.h
M       Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.txx
M       Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.h
M       Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.txx
M       Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.h
M       Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.txx

The texture filters for Haralick textures, Advanced textures, and HigherOrder textures have been modified in a very similar way:

  • New attributes : m_SubsampleFactor and m_SubsampleOffset (they define the spacing and position of the output grid)
  • Getters and setters for these two attributes
  • The output image origin is set according to offset and factor
  • Computation of textures is done every 'factor' pixels (can be different in row and column)


M       Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx

The application HaralickTextureExtraction now offers a "step" parameter to compute textures every 'step' pixels. The corresponding factor and offset are given to the underlying filters :

  • m_SubsampleFactor[0] = step
  • m_SubsampleFactor[1] = step
  • m_SubsampleOffset[0] = (step-1)/2
  • m_SubsampleOffset[1] = (step-1)/2

It is a simple way to sub-sample the output with only 1 setting.


No specific test added, the existing tests are unchanged. I manually checked that the sub-sampled texture values can be found at the right place in the full-grid output.


Additional notes