In this paper, a dynamic threshold edge-preserving smoothing (DTEPS) segmentation algorithm based on histogram is presented for anterior chamber OCT images the algorithm defines two thresholds, one threshold is used to determine a region of interest (ROI) as the region of interest discrimination threshold (ROIDT). Another threshold defined as the noise threshold (NT) is to detect noise from the region of interest which is gotten by the ROIDT. The algorithm first selects ROIDT and NT using first-order difference and second-order difference of the smoothed histogram. Then, use them to segment the image. To test the segmentation effect basic mathematical morphology [4] and median filtering have been used to do further denoising on the segmented image and kirsch edge detection operator is selected to detect the edge of anterior chamber OCT image which has been denoised. To evaluate this proposed algorithm, experiments are performed on the anterior chamber OCT images. The results are compared with the segmentation algorithm of using global maximum variance threshold. Experimental results show that the algorithm proposed not only removed more noise but also preserved the edge of ROI better than the global maximum variance threshold (GMVT) segmentation algorithm.