At present, there are a lot of auto-focusing algorithms based on gradient both in domestic and oversea. However, when they calculate the gradient, they get the gradient value only in appointed fixed directions, but the real gradient direction may not be the appointed direction, so there is some error. In addition, when the images are polluted by noise, the stability of the auto-focusing algorithm is reduced. In order to solve these problems, an auto-focusing algorithm based on the most gradient and threshol...