An optimized scheme to extract the depth information in the 4D light field data is proposed with the advantage of conciseness. The depth information of a light field scene is estimated according to the disparity of edge pixels. Depths of smooth regions are interpolated after region segmentation. A computer generated light field scene is used as an example to test the validity of our algorithm. We restrict the time complexity of our algorithm to logarithmic linearity, which is available in practical use and is promising in parallel computing.