Abstract. Differential operators are essential in many image processing applications. Previous work has shown how to compute derivatives more accurately by examining the image locally, and by applying a difference operator which is optimal for each pixel neighborhood. The proposed technique avoids the explicit computation of fitting functions, and replaces the function fitting process by a function classification process. This paper introduces a new criterion to select the best function class and the best template size so that the optimal difference operator is applied to a given digitized function. An evaluation of the performance of the selection criterion for the computation of the Laplacian for digitized functions shows better results when compared to our previous method and the widely used Laplacian operator.