The invention discloses a
dynamic range compression method and device for
magnetic flux leakage
signal visualization, and the method comprises the steps: obtaining an original
magnetic flux leakage
signal data matrix obtained through part of collection data, and obtaining a gradient
signal matrix after preprocessing and gradient enhancement; obtaining an initial value of a controllable percentile parameter p; calculating a dynamic threshold
group based on the current parameter p and the statistical distribution of the gradient signal matrix; carrying out nonlinear compression transformation on the gradient signal matrix by adopting an S-shaped nonlinear compression function and taking a dynamic threshold group as a scale factor to obtain a normalized
feature matrix; visual mapping is carried out in combination with the dynamic threshold group, and a pseudo-
color image is output; and when the preset requirement is not met, adjusting the parameter p,
processing again until the preset requirement is met, and applying the parameter p to all the collected data to obtain a final pseudo-
color image. According to the method, the problem of
visual range imbalance caused by the great
dynamic range of the
magnetic flux leakage signal is solved, the parameter adjustment robustness and efficiency can be improved, and slight defect detail reservation and serious defect signal tolerance are both considered.