1. An imaging method based on a magnetic flux leakage testing, comprising: selecting an imaging region having a corrosion defect on a pipeline to be tested; dividing the imaging region into a plurality of grid areas; scanning by a three-dimensional sensor array the pipeline to be tested so as to obtain magnetic flux leakage testing data; creating a three-dimensional orthogonal coordinate system in the imaging region, defining a first two-dimensional matrix of defect images according to the plurality of grid areas based on the three-dimensional orthogonal coordinate system, and creating a second two-dimensional matrix of magnetic flux leakage signals according to the magnetic flux leakage testing data based on the three-dimensional orthogonal coordinate system; and mapping the second two-dimensional matrix to the first two-dimensional matrix using a pre-trained wavelet neural network so as to image the corrosion defect.