The article discusses the segmentation algorithm of digital image based on the measurement contrast of fine detail in the normalized CIELAB system. Using normalized CIELAB system allows you to segment fine detail in accordance with the contrast sensitivity. Focusing the camera is carried out on the basis of the search of function maximum that determines the dependence of the number of segmented fine detail from the focal length. Proposed software as part of an interactive digital camera control system implements this function. The results of experiments and comparative analysis with other methods focus are given. It is shown that the proposed method improves the accuracy of the focus when photographing images in low light.