We propose a new pattern-matching algorithm for matching CCD images to a stellar catalogue based statistical method in this paper. The method of constructing star pairs can greatly reduce the computational complexity compared with the triangle method. We use a subsample of the brightest objects from the image and reference catalogue, and then find a coordinate transformation between the image and reference catalogue based on the statistical information of star pairs. Then all the objects are matched based on the initial plate solution. The matching process can be accomplished in several milliseconds for the observed images taken by Yunnan observatory 1-m telescope.