1

I have a template image and target image as follows:enter image description here

  1. The target has scale change
  2. The target has rotation change
  3. The target mix with noise,Partial Occlusion(the color is same-black)

So, how can i use the template image to detect the target,and use a ellipse to show the target,like this enter image description here

I have tried matchTemplate function and surf function in opencv,but the result is not good.How can i solve this problem.Can you give me some advices.Thanks in advance!

GKG DTH
  • 117
  • 1
  • 10
  • 2
    I counted three question you asked exactly on this topic, also [here](http://stackoverflow.com/questions/31583520/scale-and-rotation-template-matching-in-opencv) and [here](http://stackoverflow.com/questions/31490234/is-there-an-algorithm-where-i-can-match-scale-and-rotation-rotaterect-in-opencv). You should really avoid asking duplicate questions. Instead, edit your questions with the advice given you by the community. If this is another question, make clear what you've done so far, and why the answer to your other questions don't work. – Miki Aug 08 '15 at 12:09

1 Answers1

2

Template matching generally refers to translation invariant matching.
It is not invariant to scale nor rotation.

Beside using other methods, you might be able to try different scales and rotations of your template though this gets quite expensive for many such combinations.

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137