  Based on a nonlocal Laplacian operator, a novel edge detection method of the
grayscale image is proposed in this paper. This operator utilizes the
information of neighbor pixels for a given pixel to obtain effective and
delicate edge detection. The nonlocal edge detection method is used as an
initialization for solving the Allen-Cahn equation to achieve two-phase
segmentation of the grayscale image. Efficient exponential time differencing
(ETD) solvers are employed in the time integration, and finite difference
method is adopted in space discretization. The maximum bound principle and
energy stability of the proposed numerical schemes are proved. The capability
of our segmentation method has been verified in numerical experiments for
different types of grayscale images.
