In this paper, we propose a new procedure to estimate the shape of the opening and the depth profile of an arbitrary three-dimensional (3-D) defect from magnetic flux leakage (MFL) measurements. We first use the Canny edge detection algorithm to estimate the shape of the defect opening. Then we use an inversion procedure based on the space mapping (SM) methodology in order to approximate the defect depth profile efficiently. To demonstrate the accuracy of the proposed inversion technique, we reconstruct defects of arbitrary shapes from simulated MFL signals. The procedure is then tested with experimental data of two metal-loss defects. In both cases, the proposed approach shows good agreement between the actual and estimated defect parameters.