-4

Possible Duplicate:
matchTemplate opencv not working as shown in opencv document

I have posted some questions earlier also but still can not find the solution. According to my requirement I have to create a scanning paper app. In this the camera takes a picture and I have to detect the patterns(that will be predefined) if it appears in the captured image or not. I tried it with matchTemplate(opencv) but could not succeed it.

Since the image is captured from camera , so it might the case that the pattern in the captured image can be small or big from the size of the pattern image, so in this case do the matchTemplate will work properly, or if this could not be the solution so what another approach should I try now.

Community
  • 1
  • 1
Gypsa
  • 11,230
  • 6
  • 44
  • 82
  • 1
    If your earlier questions did not give you a satisfactory answer, edit them to make them clearer. Don't re-ask the same question. – Brad Larson Aug 22 '12 at 22:36

2 Answers2

1

the wrong size of the template is a standard problem of template matching. Since I don t see any example code it is not easy to understand where maybe the real problem of your question is. Did you try different thresholds in the algorithm ? For the theoretical aspect there are two big main problems for feature extraction the size (distance) and the rotation (object orientation). The general hough transformation could be a solution.

jamk
  • 836
  • 1
  • 10
  • 24
1

match template won't work for different scales(sizes). To do that you can do a multiscale search. Basically you can run the template matching in different scales of input image. Another way you can do is to train a opencv Haar cascade to detect the template. It has built in multiscale detection.

Krish
  • 1,747
  • 14
  • 19