The Minkowski content L.(G) of a body $G\subset {\Bbb R}^{d}$ represents the boundary length (for d = 2) or the surface area (for d = 3) of G. A method for estimating L.(G) is proposed. It relies on a nonparametric estimator based on the information provided by a random sample (taken on a rectangle containing G) in which we are able to identify whether every point is inside or outside G. Some theoretical properties concerning strong consistency, L.-error and convergence rates are obtained. A practical application to a problem of image analysis in cardiology is discussed in some detail. A brief simulation study is provided.