This paper presents a novel loop closure detection method based on spatial constraints and weighted feature matching, designed to address the challenges of complex industrial environments such as substations. The proposed approach combines deep learning feature extraction, image region partitioning with spatial position constraints, and dynamic weighting strategies to enhance robustness and accuracy. By dividing images into blocks to restrict feature matching scope, integrating semantic gray maps to eliminate dynamic interference, and dynamically adjusting regional weights to suppress repetitive texture effects, the method significantly improves loop closure detection performance in scenarios with weak textures, repetitive structures, and dynamic objects. Extensive experiments on public datasets and real substation environments validate the effectiveness of the proposed algorithm.