Detection of irregular points by regularization in numerical differentiation and application to edge detection