Refactor Petrack::UpdateImage
UpdateImage is one central method of Petrack. In there, tracking and recognition functionality are called.
This method has a high complexity, much repetitive code and is in general hard to understand, maintain and to change for new features.
It should be refactored step by step to ensure that nothing breaks.