Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
otb
otb
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 292
    • Issues 292
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 15
    • Merge Requests 15
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Issues
  • #2150

Closed
Open
Opened Feb 19, 2021 by Cédric Traizet@ctraizetDeveloper

Implement a factory for sensor transforms

This issue is part of the SAR sensor models refactoring story (#2142)

Rationale

RPCForwardTransform and RPCInverseTransform are the only implementations of SensorTransformBase currently implemented, but other transforms will be implemented in the future, including SARForwardTransform and SARInverseTransform. A factory should be implemented to automatically instantiate a valid SensorTransform from image metadata. The factory will be used in GenericRSTransform and its applications (e.g. Orthorectification).

Analysis

There are other examples of factory in OTB, including the MachineLearningModelFactory and the ImageMetadataInterfaceFactory, and SensorTransformFactory can be implemented in the same fashion.

In this issue we propose to implement this factory and use it when creating RPC transform in GenericRSTransform, following these steps:

  • Implements RPCForwardTransformFactory and RPCInverseTransformFactory, deriving from itk::ObjectFactory to instantiate RPCForwardTransform and RPCInverseTransform respectively.
  • Implements SensorTransformFactory using RPCForwardTransformFactory and RPCInverseTransformFactory to instantiate transform objects in client code
  • Use SensorTransformFactory in GenericTransform, instead of using RPCTransform.

classDiagram
  Object <|.. SensorTransformBase : skipping classes in the dependency tree for clarity
  SensorTransformBase <|.. RPCTransformBase
  RPCTransformBase <|.. RPCForwardTransform
  RPCTransformBase <|.. RPCInverseTransform
  
  ObjectFactoryBase  <|.. RPCForwardTransformFactory
  ObjectFactoryBase  <|.. RPCInverseTransformFactory

  RPCForwardTransformFactory ..> RPCForwardTransform : CreateInstance
  RPCInverseTransformFactory ..> RPCInverseTransform : CreateInstance

  SensorTransformFactory ..>  RPCForwardTransformFactory : RegisterFactory
  SensorTransformFactory ..>  RPCInverseTransformFactory : RegisterFactory

  GenericRSTransform ..> SensorTransformFactory

  SensorTransformBase : +IsValidSensorModel() = 0
  SensorTransformBase : +TransformPoint() = 0

  RPCTransformBase : -GDALRPCTransformer transformer
  RPCTransformBase : +IsValidSensorModel()

  RPCForwardTransform : +TransformPoint()
  RPCInverseTransform : +TransformPoint()

  SensorTransformFactory : +DirectionType direction {Forward,Inverse}
  SensorTransformFactory : +CreateMachineLearningModel
  SensorTransformFactory : +CleanFactories
  SensorTransformFactory : -RegisterBuiltInFactories()
  SensorTransformFactory : -RegisterFactory()

  ObjectFactoryBase : +CreateObject()

Acceptance criterions

There is no additional test to implement in this issue, as the GenericRSTransform tests can be sue to validate the changes. If the GenericRSTransform is still able to use the RPC models after the changes, the work is validated.

Risk management

Risk Likelihood Impact Action
Edited Feb 25, 2021 by Julien Osman
Assignee
Assign to
8.0.0
Milestone
8.0.0
Assign milestone
Time tracking
None
Due date
None
Reference: orfeotoolbox/otb#2150