A method of determining a movement vector between two images is disclosed. The
two images are sequentially taken by an optical mouse. The method comprises first
calculating a directional correlation value for a plurality of directional shifts
between the first image and the second image. The minimum directional correlation
value is chosen and compared to a threshold value. If the minimum directional correlation
value calculated is less than the threshold, identifying a movement vector associated
with the minimum directional correlation value. However, if the minimum directional
correlation value is not less than the threshold, the first and second images are
compressed and the calculations are redone. The compression continues until a qualifying
movement vector is identified.