Request for Changes-99: Refactor ExtractROI application

From OTBWiki
Jump to: navigation, search



This is a refactoring of the ExctractROI application in order to use new type of input to define the ROI.


The changes come from a brainstorming made with the users [1].

Implementation details


M       Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
M       Modules/Applications/AppImageUtils/otb-module.cmake
M       Modules/Applications/AppImageUtils/test/CMakeLists.txt

The only files that have been changed are the one concerning the application, the module's cmake file and the test's CMakeLists.

What has changed is that now you can put your data in different formats :

  • Set coordinates of the upper left corner and the lower right one in latitude longitude, in physical coordinates or in pixel
  • Give a point of interest (in pixel, physical measure or latitude longitude) and a radius (in pixel or in physical measure)
  • Use a reference vector file

The default mode (standard mode) has been kept in order to keep the computation method. The values will be actualized if you use an other kind of input (except for the reference vector file). Here is a screen capture of the cli interface [[2]]


Two new tests have been added :

  • apTvUtExtractROISizeTooBigRadius
  • apTvUtExtractROISizeTooBigExtent


This application extracts a Region Of Interest with user parameters. There are four modes of extraction. The standard mode allows the user to enter one point (upper left corner of the region to extract) and a size. The extent mode needs two points (upper left corner and lower right) and the radius mode need the center of the region and the radius : it will extract the rectangle containing the circle defined and limited by the image dimension. The fit mode needs a reference image or vector and the dimension of the extracted region will be the same as the extent of the reference. Different are available such as pixel, image physical space or longitude and latitude.