Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with Royi's answer chosen by CommunityBot
edited tags; edited title
Link
Royi
  • 20.5k
  • 4
  • 199
  • 240

Algorithm for Scale invariant template matching. Which algorithm to use?Invariant Template Matching

Tweeted twitter.com/StackSignals/status/1409662917008519188
Notice added Draw attention by stoefln
Bounty Started worth 50 reputation by stoefln
Source Link
stoefln
  • 103
  • 1
  • 6

Scale invariant template matching. Which algorithm to use?

I am using opencv for finding template images in a video stream. The elements I am trying to find are UI elements of android apps.

Classic template matching is working quite well. But only as long as the scene and the template share the same resolution. My requirement is to have this working for different scene resolutions (different devices).

What I tried so far is:

  1. Rescaling the template at different resolutions in a loop and checking. As soon as my result increases above a certain threshold, I consider it a match. Problem: Not very robust, extremely slow
  2. AKAZE and ORB: Don't really provide the expected results. I don't know if I am missing something, but it doesn't look like those algorithms are made for what I am trying to do. I am getting results like this:

Orb

Any help or ideas are highly appreciated!

A couple of examples:

Scene: scene Template: template

Scene2: scene2 Template2: template2

Scene3: scene3 Template3: template3