Optical lens assemblies are used more and more widely, and assembly and alignment processes are key to affecting lens accuracy. Considering that the common way of assembling lenses was manual, the coaxial alignment for intermediate-scale parts was considered to be a good alternative, which could improve the accuracy of assembly effectively. But it was difficult to capture the full edge of the lens in one image because of the limit of the CCD camera field of view. To solve this problem, a rim points stitching algorithm was proposed, and the barrel and lens were imaged by the camera at three different position. After the rim points were extracted from the three images, all the rim points were stitched according to the position of the camera at three locations. The rim points stitched were fitted to two circles by using the least squares method. Finally, according to the adjustment algorithm, the adjustment amount of the lens with respect to the lens barrel was calculated. Experimental results showed that this method could align lenses with the diameter greater than 60mm. The technique has the potential to be applied in automated alignment of lens assemblies.