Matching images using a random sample consensus