A method includes receiving a first image and a second image from an X-ray imaging device and determining a template window in the first image and a plurality of search windows in the second image. The method further includes generating a template vector corresponding to the template window and a plurality of search vectors corresponding to the plurality of search windows. The method also includes calculating a plurality of similarity scores based on the template vector and the plurality of search vectors. Additionally, the method includes determining a matching window from the plurality of search windows based on the plurality of similarity scores. Finally, the method includes generating a final image using the first image and the second image based on the template window and the matching window.