The invention relates to a high-speed rail 
fastener defect identification method based on heterogeneous 
image fusion, and belongs to the technical field of 
machine vision detection. The method comprises the following steps: S1, synchronously and dynamically acquiring a two-dimensional gray image G(x, y) of a high-speed rail 
fastener area and a two-dimensional depth image D(x, y) of a rail; S2, registering the two-dimensional 
grayscale image G(x, y) and the two-dimensional depth image D(x, y) to enable the two-dimensional 
grayscale image G(x, y) and the two-dimensional depth image D(x, y) to accurately correspond to the same position in the scene; S3, respectively carrying out 
feature extraction on the two-dimensional 
grayscale image G(x, y) and the two-dimensional depth image D(x, y) of the 
fastener area after registration; S4, performing 
feature mapping on features extracted from the two-dimensional grayscale image G(x, y) and the two-dimensional depth 
image based on metric learning,and fusing the mapped features; S5, inputting the fused features into an 
SVM classifier to realize classification of the fasteners. According to the invention, the defect 
detection rate of the fastener is improved, the omission ratio of the defective fastener is lower, the practicability is strong, and the method is worth popularizing.