# End Face Attitude Detection of Special Steel Bars Based on Improved DBSCAN
## 1 Introduction
It is understood that different enterprises have different treatment processes for the steel bars' end faces. Some companies mark the bar ID by spraying the code [18; 19; 20] on the end of the bar while others mark the bar ID by spraying or sticking a two-dimensional code on it. According to Figure 2, the end face features of the three cases are mainly numbers, text, two-dimensional codes, and some regular shapes. For the purpose of representing the rotation attitude of a bar's end face in a way that is more intuitive and making the angle of the steel bar's end face correspond to the rotation angle of the bar, we selected the center of the circumscribed circle of the bar's end face and a feature point outside the center to determine the angle of the rotation attitude. Additionally, another feature point can be the end point of a number, text, or QR code, which can be selected based on the actual situation on site. The feature in Figure 2c is  
Figure 1: Layout of the flaw detection workshop and grinding station in the special steel bar production line. selected for investigation, which is the steel bar's end face feature on the production line of the HBIS GROUP SHISTEEL COMPANY, so it is more practical to study such a feature. In Figure 2c, the end face of the special steel bar has two obvious characteristics, one is the QR code feature, and the other is its round shape. Generation and recognition of QR codes [21,22] is widely used in a variety of fields, making them ubiquitous in everyday life. And the QR code recognition algorithm is generally considered to be stable. As for circle detection, it is now extensively used in spacecraft [23], industrial component measurement [24], iris localization [25], nanoparticle research in medicine [26], traffic signs [27], automated bar statistics [28], and in other fields. Currently, the most used circle detection methods are Hough transform (HT) [29], random circle detection (RCD) [30], etc. As pointed out in the literature, these methods have poor detection results in complex scenes, occlusions, and minimax circles. Therefore, it is necessary to improve circle detection methods to calculate steel bars' end face attitude. According to circle parameter characteristics, intelligent clustering algorithms can be applied to circle detection. DBSCAN [31,32] is an intelligent clustering algorithm with a noise removal function, which can be used for better circle parameter clustering. Therefore, a circle detection method based on improved DBSCAN is proposed in this paper to solve the instability problems caused by occlusion, noise, and random point selection in the traditional circle detection algorithm. Combined with the position information of the QR code, the resolution of the end face attitude angle reaches 0.2 degrees. And the calculation time at the resolution of 2048 \(\times\) 1536 does not exceed 2.3 s on average, which complies with the bar production line's timing requirements. The major contributions of this paper are as follows:  
1. A circle detection algorithm based on improved DBSCAN is proposed, which overcomes the problem that the current circle detection algorithm does not detect circles accurately in complex scenes. 2. A method is proposed to represent the circumferential position of the current steel bar using the end face attitude angle, which provides a theoretical foundation for automatic surface defect location. 3. An end face attitude detection system is proposed to solve the problem that surface defects of special steel bars cannot be located during automatic grinding.