Abstract:The corrosion behavior of AZ40 magnesium alloy is studied based on image recognition technique. The corrosion images of AZ40 magnesium alloy in simulated sea water are pre processed by median filter and histogram equilibrium methods. The mathematical morphology and wavelet transformation are used to analyze the pre processed images. Three parameters, the grayscale distribution variance, foreground area of binary image and energy feature are extracted to describe the corrosion behavior of AZ40 magnesium alloy comprehensively and exactly. Results indicate that the natural oxide film on the magnesium alloy’s surface is destroyed by corrosive medium, which makes the corrosion resistance decrease. The corrosion starts from local area, spreads rapidly and develops into general corrosion. Insolvable corrosion products precipitate slowly and provide little protection to the alloy in short period. However, after long time precipitation, the insolvable corrosion products can increase the corrosion resistance and provide protection.