Dynamic auto focus algorithm based on improved Sobel operator