如果将来有人来了,这里有一个用openCV做这个的小例子。它基于opencv sample,但是(在我看来),这有点清楚,所以我也包括它。
用openCV 2.4.4测试#!/usr/bin/env python
'''
Uses SURF to match two images.
Finds common features between two images and draws them
Based on the sample code from opencv:
samples/python2/find_obj.py
USAGE
find_obj.py
'''
import sys
import numpy
import cv2
###############################################################################
# Image Matching
###############################################################################
def match_images(img1, img2, img1_features=None, img2_features=None):
"""Given two images, returns the matches"""
detector = cv2.SURF(3200)
matcher = cv2.BFMatcher(cv2.NORM_L2)
if img1_features