Patent ID: 7742659

Claim:
A method for arranging images in a stitching order, comprising: applying a gradient filter to the images; determining correlation values of each image rotated at first and second angles against other images rotated at the first and the second angles; determining correlation values of each image rotated at third and fourth angles against the other images rotated at the third and the fourth angles; creating, using a microprocessor, tree data structures having the images at the first, the second, the third, and the fourth angles as root nodes; for each tree data structure: for each node level in the tree data structure: for each image in the node level: when the image is at the first or the second angle, saving, using the microprocessor, in nodes that branch from the image in the tree data structure at most four images at the first or the second angle that match best with the image and have respective correlation values meeting a correlation threshold; when the image is at the third or the fourth angle, saving, using the microprocessor, in the nodes that branch from the image in the tree data structure at most four images at the third or the fourth angle that match best with the image and have respective correlation values meeting the correlation threshold; selecting, using the microprocessor, a path among the tree data structures that comprises a best sum of correlation values as the stitching order.