Strain clamps of transmission lines are the main part of transmission lines, which play the role of bearing tensile force and transmitting current in the transmission line. In this paper, we focus on the distance between the end of steel anchor and strand in the strain clamps. We propose a method using YOLOv4 and classic image processing methods to measure the distance referred to above, according to which we can judge whether the strain clamps have defects about distance. We first got the bounding boxes of the end of steel anchor and strand in the strain clamps by YOLOv4, thus calculating the distance between the two bounding boxes. Meanwhile, we used classic image processing methods to get the diameter of the steel anchor. Finally, we calculated the ratio of the two distances mentioned above to determine whether the defect exists. We achieve good performance in the detection of distance defects in strain clamps with high accuracy through the research in this paper.