This paper proposes a novel edge-based stitching method to detect moving objects and construct mosaics from images. The method is a coarse-to-fine scheme which first estimates a good initialization of camera parameters with two complementary methods and then refines the solution through an optimization process. The two complementary methods are the edge alignment and correspondence-based approaches, respectively. The edge alignment method estimates desired image translations by checking the consistencies of edge positions between images. This method has better capabilities to overcome larger displacements and lighting variations between images. The correspondence-based approach estimates desired parameters from a set of correspondences by using a new feature extraction scheme and a new correspondence building method. The method can solve more general camera motions than the edge alignment method. Since these two methods are complementary to each other, the desired initial estimate can be obtained more robustly. After that, a Monte-Carlo style method is then proposed for integrating these two methods together. In this approach, a grid partition scheme is proposed to increase the accuracy of each try for finding the correct parameters. After that, an optimization process is then applied to refine the above initial parameters. Different from other optimization methods minimizing errors on the whole images, the proposed scheme minimizes errors only on positions of features points. Since the found initialization is very close to the exact solution and only errors on feature positions are considered, the optimization process can be achieved very quickly. Experimental results are provided to verify the superiority of the proposed method.