Online detection of yarn roll’s margin is one of the key issues in textile automation, which is related to the speed and scheduling of bobbin (empty yarn roll) replacement. The actual industrial site is characterized by uneven lighting, restricted shooting angles, diverse yarn colors and cylinder yarn types, and complex backgrounds. Due to the above characteristics, the neural network detection error is large, and the contour detection extraction edge accuracy is low. In this paper, an improved neural network algorithm is proposed, and the improved Yolo algorithm and the contour detection algorithm are integrated. First, the image is entered in the Yolo model to detect each yarn roll and its dimensions; second, the contour and dimensions of each yarn roll are accurately detected based on Yolo; third, the diameter of the yarn rolls detected by Yolo and the contour detection algorithm are fused, and then the length of the yarn rolls and the edges of the yarn rolls are calculated as measurements; finally, in order to completely eliminate the error detection, the yarn consumption speed is used to estimate the residual yarn volume and the measured and estimated values are fused using a Kalman filter. This method overcomes the effects of complex backgrounds and illumination while being applicable to different types of yarn rolls. It is experimentally verified that the average measurement error of the cylinder yarn diameter is less than 8.6 mm, and the measurement error of the cylinder yarn length does not exceed 3 cm.