1. A computer-based method for matching images, the method comprising: selecting a template image and a target image from a batch of images to be analyzed, and determining parameters for the template image and the target image, wherein the parameters comprises a current correlation coefficient Cn between the template image and the target image, and initial coordinates of an optimal offset point p 1 in the target image; determining a sample interval of the template image and the target image; sampling the template image so as to obtain a template-sampled image, and sampling the target image so as to obtain a target-sampled image, wherein the sampling of both the template image and the target image is according to the sample interval; matching the template-sampled image and the target-sampled image, the matching step comprising steps (a)-(d): (a) calculating an average gray level cmGA and a gray variance cmGD of the template-sampled image, and calculating an average gray level ctGA and a gray variance ctGD of a sub-image of the target-sampled image, wherein the target-sampled image has an offset point at an origin of a coordinate axis system; (b) determining a standard value for a relative error between the average gray level cmGA and the average gray level ctGA and for a relative error between the gray variance cmGD and the gray variance ctGD, and calculating a correlation coefficient C between the template-sampled image and the sub-image of the target-sampled image, if the relative error between cmGA and ctGA and the relative error between cmGD and ctGD are both less than the standard value; (c) replacing Cn with C and replacing the coordinates of p 1 with coordinates of an offset point corresponding to C, if C is greater than Cn; and (d) calculating an average gray level ctGA and a gray variance ctGD of a sub-image of the target-sampled image whose offset point is the next one, and repeating block (b) to block (d) until the offset point is the last point of the target-sampled image, if either of the relative error between cmGA and ctGA and the relative error between cmGD and ctGD is not less than the standard value; and matching the template image and the target image, if the template-sampled image and the target-sampled image are matched successfully.