Introduction: Bolt loosening detection plays a crucial role in ensuring structural safety. Existing research using deep learning methods has the drawback of being applicable to limited scenarios and typically requires at least two frames of images for comparison in subsequent angle detection, with a limited range of detectable angles. Method: In this study, a color segmentation method was first used to separate the red square gasket placed between the bolt and the base, thereby locating the bolt area; then, the image was perspective-corrected using the four corners of the red square gasket; finally, the red mark bars on the bolt and base were separated using the same color segmentation method, and the geometric moments of the connected domains of the mark bars were processed, combined with vector processing techniques, to achieve quantified detection of bolt loosening angles within 0~360 degrees using a single frame image. In the verification experiments, 150 images were collected from different shooting angles and distances, and the bolt areas to be tested were located using the color segmentation method, all with an IOU (Intersection over Union) greater than 0.9317. Subsequent experiments set different variables, including different shooting distances, bolt loosening angles, perspective angles, lighting conditions, bolt types, and image rotation angles. Result: The results demonstrated that the method presented in this study could accurately detect bolt loosening angles in multiple scenarios. Conclusion: Hence, it is capable of measuring loosening angles within the range of 0~360 degrees using only a single frame image. result: In the verification experiments, 150 images were collected from different shooting angles and distances, and the bolt areas to be tested were located using the color segmentation method, all with an IOU(Intersection over Union) greater than 0.9317. Subsequent experiments set different variables, including different shooting distances, bolt loosening angles, perspective angles, lighting conditions, bolt types, and image rotation angles.