We focus in this paper on the theoretical and numerical aspect os image processing. We consider a non linear boundary value problem (the p -Laplacian) from which we will derive the asymptotic expansion of the Mumford-Shah functional. We give a theoretical expression of the topological gradient as well as a numerical confirmation of the result in the restoration and segmentation of images.