Abstract:A detection method based on shape recognition is proposed for dealing with the cigarette bracing wires dislocation problem, which widely exits in cigarette production. Firstly, image correction, smoothing filtering, iterative threshold segmentation and edge extraction are utilized to preprocess the image of cigarette bracing wires. Secondly, the random Hough transform is used to recognize two U-type incisions of bracing wires and fit a circle to each one, then the distance of two circle centers in the vertical direction is obtained as the offset of bracing wires. A scanning line edge extraction(SLEE) algorithm is put forward for the issue that the edge has more redundant information acquired by Sobel and Canny. Experimental results show that the proposed method can detect the extent of the packaged cigarette bracing wires dislocation effectively, the errors are less than 0.3mm and has a better robustness.