A method for registering two image frames captured by a scanning device, the scanning device comprising an image capturing unit and a plurality of position sensors that supply position data indicating the relative position of the image capturing device when the image capturing device captures each of the two image frames, comprising:
- reading position data from each of the plurality of position sensors when a first image frame i is captured and when a second image frame i+1 is captured;
- estimating transformation parameters from the sensor position data that relate an image center of image frame i+1 to image frame i;
- extracting an overlapping area between image frame i+1 and image frame i using the estimated transformation parameters from the sensor position data;
- and
- refining the transformation parameters by minimizing a cost function integrating a registration error ES from sensor position data and a registration error EI from image data of the overlapping area to register image frame i+1 with image frame i.