A method for focusing an electronic imaging system comprising the steps of; - receiving a pixel image, - generating at least two histograms representing the distribution of pixels of a region of the received image with pixel values on horizontal axis and count on vertical axis by using high frequency components and low frequency components of the received image, wherein the histograms with lower frequency component are found by subtracting the higher frequency component from the original image, - finding widths of generated histograms which are the scatter of the distribution around mean value of generated histograms and storing them as focus measures, - finding the difference between last received frame's high frequency component histogram width and at least one previously received frame's histogram width corresponding to the same frequency component, - if the difference between the two high frequency histogram widths is other than zero, determining the last received frame's high frequency component histogram width as a determined focus measure; if the difference between the two high frequency histogram widths is zero, finding the difference between the last received frame's low frequency component histogram width and the previously received frame's histogram width corresponding to the same frequency component and if the difference between the two low frequency histogram widths is other than zero, determining the last received frame's low frequency component histogram width as a determined focus measure, if the difference between the two low frequency histogram widths is zero, a stop signal is generated; - determining the focus direction signal corresponding to determined focus measure. - receiving a pixel image, - generating at least two histograms representing the distribution of pixels of a region of the received image with pixel values on horizontal axis and count on vertical axis by using high frequency components and low frequency components of the received image, wherein the histograms with lower frequency component are found by subtracting the higher frequency component from the original image, - finding widths of generated histograms which are the scatter of the distribution around mean value of generated histograms and storing them as focus measures, - finding the difference between last received frame's high frequency component histogram width and at least one previously received frame's histogram width corresponding to the same frequency component, - if the difference between the two high frequency histogram widths is other than zero, determining the last received frame's high frequency component histogram width as a determined focus measure; if the difference between the two high frequency histogram widths is zero, finding the difference between the last received frame's low frequency component histogram width and the previously received frame's histogram width corresponding to the same frequency component and if the difference between the two low frequency histogram widths is other than zero, determining the last received frame's low frequency component histogram width as a determined focus measure, if the difference between the two low frequency histogram widths is zero, a stop signal is generated; - determining the focus direction signal corresponding to determined focus measure.