SURFmex is a MATLAB interface for the Speeded Up Robust Features interest point detector, written by Petter Strandmark. It is a simple interface which just calls OpenCV.
- first calls createTargetModel with a target image and an image with the contour of the target in the same image as input.
- createTargetModel then gathers the information needed for object matching and output it as targetModel.
- matchTarget is then called with the targetModel and the test image as input. The contour of the target in the test image will then be shown.
The algorithm works as follows.
- First the SURF points of the target image is extracted and stored.
- In matchTarget.m the SURF points of the test image is also calculated and each of them is matched to the most similar SURF point in the model.
- By using the scale and orientation of the SURF point descriptor, each matched SURF point pair has a translation from the target image to the test image.
Therefore 1 pair of correctly matched SURF points can decide the position, scale and orientation of the target in the test image. However most of the matched pairs aren’t correct, therefore we use all of the pairs to cast votes on what are the correct position, scale and orientation of the target in the test image.
The result that has the highest votes are then refined. A rotation matrix and a transition vector is then calculated based on the SURF point pairs in the result.