1. An anti-flicker method for determining the motion of a sensor, the method comprising: receiving a group of image frames; setting a number n equal to the number of image frames in the group which do not meet quality expectations; setting a number m equal to the number of image frames in the group which meet quality expectations; after the above steps, receiving a new image frame. classifying the new image frame as meeting quality expectations; determining that m+1>Nmax2, where Nmax2 is a pre-determined threshold; setting n=0; determining the motion of the sensor based on the new image frame.