0

I have various template images and one big image with multiple ocurrence of each template in it, but are rotated.

I have tried with SIFT and SURF but only work with one ocurrence of each template and matchTemplate is not rotation invariant. I am programming in C++.

Please, could you give me any suggestions? Thanks.

  • Can you post some of your code? specially the declarations of the detectors, descriptors and matchers would be useful. – McMa Mar 11 '14 at 14:01
  • cant you detect the first occurance with SIFT/SURF, remove those features and try to detect the 2nd one etc?? edit: ok, it only works if exactly one occurance of total is in the image, because best matches will be mixed between multiple occurances. That can be fixed with some heuristic I guess – Micka Mar 11 '14 at 14:10
  • Mat plantilla = imread("PlantillaMujer.jpg", CV_LOAD_IMAGE_GRAYSCALE); OrbFeatureDetector featureDetector(400); vector tempKeypoints, imKeypoints; featureDetector.detect(plantilla,tempKeypoints); featureDetector.detect(imagen,imKeypoints); OrbDescriptorExtractor featureExtractor; Mat tempDescriptors, imDescriptors; featureExtractor.compute(plantilla, tempKeypoints, tempDescriptors); featureExtractor.compute(imagen, imKeypoints, imDescriptors); – diegoroman17 Mar 11 '14 at 16:27
  • vector matches; BFMatcher matcher(NORM_L2); matcher.match(tempDescriptors,imDescriptors,matches); Mat img_matches; drawMatches(plantilla, tempKeypoints, imagen, imKeypoints, matches, img_matches); imwrite("matches.jpg", img_matches); – diegoroman17 Mar 11 '14 at 16:27
  • I have multiple occurrences in my image. I have thought in firstly identify ROIs in my image and after use SURF/SIFT only in the ROIs detected but I don't know how I could find ROIs in my image. – diegoroman17 Mar 11 '14 at 16:31

1 Answers1

0

You can use log-polar template matching.

You can find more explanation here: http://www-cs.engr.ccny.cuny.edu/~wolberg/pub/icip00.pdf

In this paper described method for finding maximum correlated template. But with small modifications it can be used to find multiple occurrences of template.

Andrey Smorodov
  • 10,649
  • 2
  • 35
  • 42