Rod and wire steel splitting tracking counting method and device and storage medium

By using frame-by-frame image detection and dynamic spatial coordinate change model on the rod wire production line, the inaccurate counting problem caused by overlap and crossing of rod wires is solved, and efficient automatic counting is achieved under complex working conditions.

CN120297310APending Publication Date: 2025-07-11JIANGSU JINHENG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510221124.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

There are overlap and crossover phenomena in the production process of rod wires, resulting in inaccurate sensor counting. Especially on production lines with low automation and complex operating conditions, manual counting efficiency is low and error-prone.

Method used

A method of steel-dividing rod wire tracking and counting is adopted to obtain end face images frame by frame, combine the yolov8n lightweight detection model to detect the number and position of rod wires, establish a dynamic spatial coordinate change model of upper and lower frames, judge the running status of the chain bed, and perform forward, reverse or stationary tracking counts, automatically detect the motion state of the production line, and adaptively adjust the count.

Benefits of technology

It improves the accuracy and robustness of rod wire counting, and can effectively improve counting efficiency, reduce manual intervention, and reduce labor intensity under complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297310A_ABST
    Figure CN120297310A_ABST
Patent Text Reader

Abstract

The invention discloses a bar and wire steel splitting tracking and counting method and device and a storage medium, and belongs to the field of motor control, and the method comprises the following steps: bar and wire existence detection, bar and wire tracking and counting, continuous tracking of steel splitting wires of tail steel, and steel splitting result detection. According to the bar and wire steel splitting tracking counting method, forward rotation, reverse rotation or static tracking counting is included, tracking counting under complex working conditions can be coped, and the tracking counting accuracy of a production line under frequent manual operation is effectively improved; according to the method, the motion state of the production line can be automatically detected, the operation state can be judged by establishing dynamic space coordinate change models of upper and lower frames without depending on external physical signals, meanwhile, the steel slipping state can be judged, and the self-adaptive performance is good; the problem of inaccurate counting caused by fluctuation deviation of upper and lower frame detection due to rod and wire positioning can be well solved, and the robustness is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of motor control, and particularly relates to a method for separating and tracking and counting bars and wires. Background Art

[0002] During the production of bar and wire production lines, in the bundling and collecting area of bars and wires after fixed-length cutting, according to the order requirements of different customers, bundling and warehousing are carried out according to the number of fixed branches per bundle. Therefore, it is necessary to count bars and wires of different specifications. However, when the bars and wires move onto the counting chain bench, there are inevitably overlapping and crossing phenomena, especially in the production of small specifications, which makes it difficult to separate the bars and wires, and the sensor counting is inaccurate. Moreover, the automation level of some production lines is low, the working conditions are complex, and manual intervention operations are frequent, which increases the counting difficulty. At present, many bar and wire production enterprises at home and abroad adopt the method of manual counting, which has a high labor intensity for workers, a slow beat, and counting errors are likely to cause quality objections.

[0003] In recent years, in response to the above problems, some steel enterprises have begun to adopt a non-contact visual image counting method to solve the problem that sensor counting cannot handle the overlapping and crossing of bars and wires. However, in the face of production lines with low automation, harsh working conditions, and frequent manual operations, the accuracy of visual image counting of bars and wires faces severe challenges. Therefore, there is an urgent need for a method for separating and counting bars and wires under complex working conditions to better improve the counting efficiency and accuracy of bars and wires. Summary of the Invention

[0004] In order to better adapt to the counting of bars and wires under complex working conditions, the present application provides a method for separating and tracking and counting bars and wires, which can handle the frequent forward and reverse operations of the production line and the stacking of bars and wires, so that the counting of bars and wires has better accuracy and robustness under complex working conditions.

[0005] The embodiments of the present application first provide a method for separating and tracking and counting bars and wires, which is characterized by including the following steps: Step S1, Detection of the presence or absence of bars and wires: After the chain bed is started, the current round of bar separation and counting begins. The end-face image of the bars and wires is obtained frame by frame, and the function of detecting the presence or absence of bars and wires is enabled. When bars and wires are detected in the current frame image, the function of detecting the presence or absence of bars and wires is turned off, and the function of tracking and counting bars and wires is enabled from the next frame; Step S2, Tracking and counting of bars and wires: The end-face image of the bars and wires is obtained frame by frame, and the function of tracking and counting bars and wires is enabled. When the number of bars and wires counted reaches the set rated number, continuous tracking of the tail steel separation line is started from the next frame. At the same time, the signal indicating that the rated number has been reached is transmitted to the steel separation control system to control the chain bed to stop; Step S3: Continuously track the steel splitting line of the trailing steel: Obtain the end face image of the bar and wire rod frame by frame, enable the function of continuously tracking the steel splitting line of the trailing steel. When the chain bed stop signal is received and the chain bed completely stops, send the final tracked steel splitting line to the steel splitting control system and end the tracking of the trailing steel splitting line. Step S4: Detect the steel splitting result: After the steel splitting control system receives the final steel splitting line and performs the steel splitting action, enable the function of detecting the steel splitting result. When it is detected that the steel splitting is successful, end the current round of steel splitting counting. At the same time, start the chain bed to begin the next round of steel splitting counting.

[0006] The embodiment of the present application also provides an electronic device, including a processor and a memory. The memory stores a program that can run on the processor. It is characterized in that when the program is executed by the processor, the steps of the above-mentioned bar and wire rod steel splitting tracking and counting method are realized.

[0007] In addition, a computer-readable storage medium is provided, storing at least one program. It is characterized in that the at least one program can be executed by at least one processor to realize the steps of the above-mentioned bar and wire rod steel splitting tracking and counting method.

[0008] The present invention has the following beneficial effects: (1) The bar and wire rod steel splitting tracking and counting method of the present invention includes forward rotation, reverse rotation or static tracking and counting, which can cope with the tracking and counting under complex working conditions and effectively improve the accuracy of tracking and counting of the production line under frequent manual operations.

[0009] (2) The bar and wire rod steel splitting tracking and counting method of the present invention can automatically detect the motion state of the production line without relying on external physical signals. By establishing a dynamic spatial coordinate change model of upper and lower frames, the running state can be judged. At the same time, the steel slipping state can also be judged, and the adaptability is better.

[0010] (3) The bar and wire rod steel splitting tracking and counting method of the present invention can well cope with the problem of inaccurate counting caused by the detection fluctuation deviation of upper and lower frames brought by the positioning of bar and wire rods, and has good robustness. Description of the Drawings

[0011] Figure 1 is the flowchart of the bar and wire rod steel splitting tracking and counting method in Embodiment 1 of the present application; Figure 2 is the example diagram of detecting the presence or absence of bar and wire rods in Embodiment 1 of the present application; Figure 3 is the flowchart of the bar and wire rod tracking and counting method in Embodiment 1 of the present application; Figure 4 is the example diagram of initialization detection in Embodiment 1 of the present application; Figure 5It is an exemplary diagram for judging the chain state in Embodiment 1 of the present application; Figure 6 It is a flowchart of the method for forward rotation and static bar and wire tracking and counting in Embodiment 1 of the present application; Figure 7 It is a flowchart of the method for reverse rotation bar and wire tracking and counting in Embodiment 1 of the present application; Figure 8 It is the effect diagram of bar and wire tracking and counting in Embodiment 1 of the present application; Figure 9 It is a flowchart of the method for continuous tracking of separating steel wires in Embodiment 1 of the present invention; Figure 10 It is the effect diagram of continuous tracking of separating steel wires in Embodiment 1 of the present invention; Figure 11 It is the block diagram of the electronic device in Embodiment 2 of the present invention. Detailed implementation manners

[0012] To make the technical solutions of the present invention easier to be clearly understood, the technical solutions of the present invention will be further described in detail below according to specific embodiments and in combination with the accompanying drawings. Obviously, the following embodiments are only a part of the embodiments of the present invention and do not constitute a limitation to the technical solutions of the present invention. For those of ordinary skill in the art, other embodiments can be obtained according to the embodiments of the present application without creative efforts.

[0013] It should be noted that the order of the steps described in the method embodiments in the following embodiments does not constitute a limitation to the technical solutions of the present invention. For those of ordinary skill in the art, the order of some steps can be reasonably adjusted according to the embodiments of the present application without creative efforts.

[0014] Embodiment 1

[0015] This embodiment provides a method for bar and wire separating and tracking and counting. As Figure 1 shown, it includes the following steps: Step S1, detecting whether there are bar and wire.

[0016] After the chain bed is started, the current round of steel separating and counting begins. The end face image of the bar and wire is obtained frame by frame, and the function of detecting whether there are bar and wire is enabled. When bar and wire are detected in the current frame image, the function of detecting whether there are bar and wire is turned off, and the function of bar and wire tracking and counting is enabled from the next frame.

[0017] Specifically, this embodiment uses the yolov8n lightweight detection model to detect the quantity and position of the bar and wire. As Figure 2 shown, the detection model sets an effective area in the image. When bar and wire are detected on the right side of the dividing line in the effective area, the function of bar and wire tracking and counting is enabled.

[0018] Step S2. Rod and wire tracking and counting.

[0019] Frame by frame, obtain the end face image of the rod and wire, and enable the rod and wire tracking and counting function. When the rod and wire count reaches the set rated number of pieces, starting from the next frame, continuously track the separating wire of the tail steel. At the same time, transmit the signal indicating that the rated number of pieces has been reached to the steel separating control system to control the chain bed to stop.

[0020] Step S3. Continuously track the separating wire of the tail steel.

[0021] Frame by frame, obtain the end face image of the rod and wire, and enable the function of continuously tracking the separating wire of the tail steel. When receiving the chain bed stop signal and after the chain bed completely stops, send the finally tracked separating wire to the steel separating control system and end the tracking of the separating wire of the tail steel.

[0022] Step S4. Detection of steel separating result.

[0023] After the steel separating control system receives the finally tracked separating wire, perform the steel separating action. After the steel separating action ends, enable the function of detecting the steel separating result. When it is detected that the steel separating is successful, end the current round of steel separating counting. At the same time, start the chain bed to begin the next round of steel separating counting.

[0024] In this embodiment, the rod and wire tracking and counting in step S2, as Figure 3 shown, specifically includes: Step S2.1. Initial parameter setting, mainly including setting the position of the separating wire, the dynamic count value, and the rated number of pieces value; In a specific embodiment, as Figure 3 shown in the initialization detection example diagram, set the horizontal coordinate of the separating wire position to 300, the dynamic count value to 0, and the rated number of pieces to 30.

[0025] Step S2.2. Detect the number and position coordinates of the rod and wire in the current frame image; Step S2.3. Taking the set separating wire as the boundary, filter out the rod and wire in the left and right regions respectively, and record the number and position coordinates of the rod and wire in the left and right regions respectively; In a specific embodiment, as Figure 4 shown, the red vertical line is the set separating wire, and the number of rod and wire in the left region of the set separating wire is 1, and the number of rod and wire in the right region is 0.

[0026] Step S2.4. Adopt the nearest neighbor search strategy to establish the spatial coordinate change model of the rod and wire between the upper and lower frames, calculate the offset fitting value, and determine the running state of the chain bed according to the size of the offset fitting value. The running states include three states: forward rotation state, reverse rotation state, and stationary state; Step S2.5, according to the running state of the chain bed, select to perform forward rotation, stationary tracking counting of the rods and wires or reverse rotation tracking counting of the rods and wires.

[0027] In this embodiment, the calculation of the offset fitting value in step S2.4 specifically includes: Step S2.4.1, respectively record the coordinate point sets of all rods and wires in the previous frame and the current frame in the horizontal direction.

[0028] Assume that the number of rods and wires detected in the previous frame is m, and the number of rods and wires in the current frame is n. The coordinate points of all rods and wires in the previous frame and the current frame in the horizontal direction are recorded as α∈(α1, α2, ..., α m-1 , α m ), β∈(β1, β2,…,β n-1 , β n ).

[0029] Step S2.4.2, traverse and calculate the distance from each rod and wire coordinate point in the previous frame to each rod and wire coordinate point in the current frame in the horizontal direction, adopt the nearest neighbor search strategy, and select the two closest points as matching points without replacement until there are no points in the previous frame or the current frame.

[0030] Step S2.4.3, arrange the matching points in the order of matching, and obtain a total of s (the smaller value of m and n is the number of matches): (α1, β1), (α2, β2), ..., (α s-1 , β s-1 ), α s , β s ), and set the matching distance threshold to filter out the matching points with large deviation values, and there are P matching points left: (α1, β1), (α2, β2), …, (α p-1 , β p-1 ), α p , β p ), where P≤S. The remaining unmatched coordinate point set in set α is α1, and the remaining unmatched coordinate point set in set β is β1.

[0031] Step S2.4.4: For the remaining matching points, calculate the offset fitting value by taking the average difference method. , which can also be transformed into a least squares fitting problem by solving , calculate the offset fit value.

[0032] Step S2.4.5: Determine the motion state of the chain bed as forward, reverse or stationary according to the offset fitting value.

[0033] Assume that the forward rotation is from left to right. If the offset fitting value b is a positive number, then it is determined that the running state of the chain bed is forward rotation. If b is a negative number, then it is judged that the running state of the chain bed is reverse rotation. If b is 0, then it is determined that the motion state of the chain bed is stationary. On the contrary, assume that the reverse rotation is from left to right. If the offset fitting value b is a negative number, then it is determined that the running state of the chain bed is forward rotation. If b is a positive number, then it is judged that the running state of the chain bed is reverse rotation.

[0034] Assume that the forward rotation is from left to right. As Figure 5 shown, the left side is the detection result of the bar and wire in the previous frame image, and the right side is the detection result of the bar and wire in the current frame image. According to the above method, the bar and wire in the right area of the set splitting wire is used as the matching object. The number of bars and wires in the previous frame is m = 5, and the number of bars and wires in the current frame is n = 6. The calculation result of the offset fitting value is b = 25, which is a positive number. It is judged that the motion state of the chain bed is forward rotation.

[0035] In this embodiment, step S2.4 further includes: Step S2.4.6: Judge whether there is a situation of steel slipping.

[0036] The method for judging the steel slipping state is specifically as follows: According to the remaining P pairs of matching points: (α1, β1), (α2, β2), ……, (α p-1 , β p-1 ), (α p , β p ), α2 ∈ (α1, α2, ……, α p-1 , α p ), β2 ∈ (β1, β2, ……, β p-1 , β p ), find the maximum value xmax1 and the minimum value xmin1 of the coordinate points in the α2 set, and find the maximum value xmax2 and the minimum value xmin2 of the coordinate points in the β2 set; if there are coordinate points in the set α of the remaining unmatched coordinate points in the set α1 within [xmin1, xmax1], and there are coordinate points in the set β of the remaining unmatched coordinate points in the set β1 within [xmin2, xmax2], then it is judged that there is a situation of steel slipping in the bar and wire of the chain bed.

[0037] Assume that the forward rotation is from left to right. As Figure 5 shown, according to the above method for judging the steel slipping state, it is judged that there is no situation of steel slipping in the bar and wire.

[0038] In this embodiment, the forward rotation and stationary tracking counting of the bar and wire in step S2.5 specifically include: Assume that the forward rotation is from left to right. Under this prerequisite, as Figure 6 shown, the following method is used for the forward rotation and stationary tracking counting of the bar and wire: Step S2.5.1: When the dynamic count value of the previous frame is 0, under this condition: The number of bar and wire materials in the right region is the current dynamic count value. If the current dynamic count value is not less than the rated number of pieces, find the bar and wire material that reaches the rated number of pieces in the right region as the tail steel, and end the tracking count; otherwise, take the bar and wire material closest to the steel dividing line in the right region as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame.

[0039] Step S2.5.2: When the dynamic count value of the previous frame is not 0, under this condition: Filter the bar and wire materials between the set steel dividing line and the tracking target. Then, the sum of the number of bar and wire materials between the set steel dividing line and the tracking target and the dynamic count value of the previous frame is the current dynamic count value. If the current dynamic count value is not less than the rated number of pieces, find the bar and wire material that reaches the rated number of pieces in the region between the set steel dividing line and the tracking target as the tail steel, and end the tracking count; otherwise, take the bar and wire material closest to the steel dividing line in the right region as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame.

[0040] Assume that from left to right is reverse. Under this precondition, after performing a left - right flipping process on the detection image of the current frame, the methods of steps S2.5.1 and S2.5.2 above can be used for the forward rotation and static tracking count of bar and wire materials.

[0041] In this embodiment, the method for reverse tracking count of bar and wire materials in step S2.5 specifically includes: Assume that from left to right is forward rotation. Under this precondition, as Figure 7 shown, the following method is used for the reverse tracking count of bar and wire materials: Step S2.5.3: When the dynamic count value of the previous frame is 0, under this condition, there are the following situations: (1) If the number of bar and wire materials in both the left region and the right region is 0, then the current dynamic count value is 0. Take the set steel dividing line as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame; (2) If the number of bar and wire materials in the left region is 0 and the number of bar and wire materials in the right region is not 0, then the current dynamic count value is equal to the rated number of pieces. Take the first bar and wire material close to the steel dividing line in the right region as the tracking target, record the position coordinates and the dynamic count value, and wait for the next frame of tracking count; (3) If the number of bar and wire materials in the left region is not 0, filter the bar and wire materials between the set steel dividing line and the tracking target. If the number of bar and wire materials between the set steel dividing line and the tracking target is 0, then the dynamic count value of the previous frame minus 1 is the current dynamic count value. Take the bar and wire material closest to the steel dividing line as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame; (4) If the number of bars and wires in the left area is not 0, and it is set that the number of bars and wires between the steel dividing wire and the tracking target is not 0, then the current dynamic count value is equal to the rated number of pieces, the bar and wire closest to the steel dividing wire is used as the tracking target, the position coordinates and the dynamic count value are recorded, and wait for the tracking count of the next frame.

[0042] Step S2.5.4: When the dynamic count value of the previous frame is not 0, under this condition, there are the following several situations: (1) If the dynamic count value of the previous frame is equal to the rated number of pieces, filter the bars and wires between the set steel dividing wire and the tracking target. If the number of bars and wires between the set steel dividing wire and the tracking target is 0, then the current dynamic count value is equal to the rated number of pieces minus 1; (2) If the dynamic count value of the previous frame is equal to the rated number of pieces, and it is set that the number of bars and wires between the steel dividing wire and the tracking target is not 0, then the current dynamic count value is equal to the rated number of pieces; (3) If the dynamic count value of the previous frame is not equal to the rated number of pieces, filter the bars and wires between the set steel dividing wire and the tracking target. If the number of bars and wires between the set steel dividing wire and the tracking target is 0, then the current dynamic count value is equal to the dynamic count value of the previous frame minus 1; (4) If the dynamic count value of the previous frame is not equal to the rated number of pieces, and it is set that the number of bars and wires between the steel dividing wire and the tracking target is not 0, then the current dynamic count value is equal to the dynamic count value of the previous frame; In the above 4 situations, the bar and wire closest to the steel dividing wire is used as the tracking target, the position coordinates and the dynamic count value are recorded, and wait for the tracking count of the next frame.

[0043] Assume that the reversal is from left to right. Under this precondition, after the left - right flipping process is performed on the detection image of the current frame, the methods of steps S2.5.3 and S2.5.4 above can be used for the reversal tracking count of the bars and wires.

[0044] As Figure 8 shown, the position coordinate (horizontal direction) of the set steel dividing wire is 300, the rated number of pieces is 30, and the initial dynamic count value is 0, showing the effect diagram of the bar and wire tracking count.

[0045] In this embodiment, step S3 of continuously tracking the steel dividing wire of the trailing steel specifically includes: Assume that the forward rotation is from left to right. Under this precondition, as Figure 9 shown, the following method is used for the continuous tracking of the steel dividing wire of the bars and wires: Step S3.1: Filter the bars and wires on the right side of the tracking target, set the fluctuation deviation threshold piancha_thresh of the positioning detection of the bars and wires in the x - direction, and calculate the difference piancha between the tracking target and the set steel dividing wire in the x - direction; Step S3.2: When the difference piancha between the tracking target and the set steel dividing line in the x-direction is not greater than the fluctuation deviation threshold piancha_thresh and the number of bar and wire materials in the left region is not zero, calculate the absolute values of the differences in the horizontal direction between the bar and wire materials closest to the set steel dividing line in the left region and the tracking target coordinates, which are left_near_piancha_x and right_near_piancha_x respectively. If the number of bar and wire materials in the right region is not zero, under this condition: calculate the difference right_near_piancha_fengang_x in the horizontal direction between the bar and wire material closest to the set steel dividing line in the right region and the set steel dividing line coordinates, and let thresh1 = left_near_piancha_x - right_near_piancha_x, thresh2 = right_near_piancha_fengang_x - piancha_thresh. If thresh1 > 0 and thresh2 > 0 are satisfied, the current dynamic count value is equal to the rated number of pieces minus 1; otherwise, the current dynamic count value is equal to the rated number of pieces. The bar and wire material closest to the steel dividing line in the right region is used as the tracking target, record the position coordinates and the dynamic count value, and wait for the steel dividing line tracking count in the next frame.

[0046] Step S3.3: When the difference piancha between the tracking target and the set steel dividing line in the x-direction is not greater than the fluctuation deviation threshold piancha_thresh and the number of bar and wire materials in the left region is not zero, calculate the absolute values of the differences in the horizontal direction between the bar and wire materials closest to the set steel dividing line in the reverse side region and the forward side region and the tracking target coordinates, which are left_near_piancha_x and right_near_piancha_x respectively. If the number of bar and wire materials in the right region is zero, under this condition: let thresh3 = left_near_piancha_x - piancha_thresh; if thresh3 < 0 is satisfied, the current dynamic count value is equal to the rated number of pieces minus 1; otherwise, the current dynamic count value is equal to the rated number of pieces. There is no tracking target, take the maximum value of the image width in the horizontal direction as the tracking target, record the dynamic count value, and wait for the steel dividing line tracking count in the next frame.

[0047] Step S3.4: When the difference piancha between the tracking target and the set steel splitting line in the x - direction is not greater than the fluctuation deviation threshold piancha_thresh and the number of bar and wire materials in the left - hand area is 0, under this condition: If the number of bar and wire materials in the right - hand area is not 0, then the current dynamic count value is equal to the rated number of pieces, the bar and wire material closest to the steel splitting line in the right - hand area is used as the tracking target, record the position coordinates and the dynamic count value, and wait for the steel splitting line tracking count in the next frame; otherwise, the current dynamic count value is equal to the dynamic count value of the previous frame, the tracking target remains unchanged, record the position coordinates and the dynamic count value of the previous tracking target, and wait for the steel splitting line tracking count in the next frame.

[0048] Step S3.5: When the difference piancha between the tracking target and the set steel splitting line in the x - direction is greater than the fluctuation deviation threshold piancha_thresh, under this condition: If the number of filtered bar and wire materials in the right - hand area is not 0, then the current dynamic count value is equal to the rated number of pieces, the bar and wire material closest to the steel splitting line in the right - hand area is used as the tracking target, record the position coordinates and the dynamic count value, and wait for the steel splitting line tracking count in the next frame; otherwise, the current dynamic count value is 0, there is no tracking target, take the maximum value of the image width in the horizontal direction as the tracking target, record the dynamic count value, and wait for the steel splitting line tracking count in the next frame.

[0049] Assume that from left to right is reverse. Under this prerequisite, after performing left - right flipping processing on the detection image of the current frame, the methods of the above - mentioned steps S3.1, S3.2, S3.3, S3.4, and S3.5 can be used for tracking the steel splitting line.

[0050] As Figure 10 shown, set the position coordinates (horizontal direction) of the steel splitting line to 300, the rated number of pieces to 30, and initialize the dynamic count value to 0, showing the effect diagram of continuous tracking of the bar and wire material steel splitting line.

[0051] In this embodiment, the steel splitting result detection in step S4 specifically includes: Before and after the steel splitting action, using the tracked steel splitting line as the demarcation line, respectively count the number of bar and wire materials in the left - hand and right - hand areas of the steel splitting line. By comparing the change in the number of bar and wire materials in the left - hand and right - hand areas before and after steel splitting, if the number does not change, it indicates that the steel splitting is successful; otherwise, the steel splitting fails.

[0052] Assume that from left to right is forward rotation. After steel splitting, if the number of bar and wire materials in the right - hand area of the steel splitting line is greater than the number of bar and wire materials in the right - hand area of the steel splitting line before steel splitting, then there is too much steel splitting; if the number of bar and wire materials in the right - hand area of the steel splitting line after steel splitting is less than the number of bar and wire materials in the right - hand area of the steel splitting line before steel splitting, then there is too little steel splitting.

[0053] Embodiment 2 This embodiment provides an electronic device, as Figure 11As shown in the figure, it includes a processor 31 and a memory 32 communicatively connected to the processor 31. A program that can run on the processor 31 is stored on the memory 32, and when the program is executed by the processor 31, it implements the steps of the data comparison method provided in the above embodiments.

[0054] The above program can be written in one or more programming languages or combinations thereof, including object-oriented programming languages - such as Java, Smalltalk, C++, and also including conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.

[0055] Embodiment 3 This embodiment provides a computer-readable storage medium that stores at least one program, and the at least one program can be executed by at least one processor to implement the steps of the data comparison method provided in the above embodiments.

[0056] The above storage medium includes: various media that can store program code, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs, and combinations thereof. With the development of science and technology, the meaning of storage media may become more and more extensive and is not limited to tangible media.

[0057] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present invention. In addition to the above embodiments, the present invention may have other implementation manners; all technical solutions formed by equivalent replacement or equivalent transformation fall within the protection scope required by the present invention.

Claims

1. A method for tracking and counting steel bars in bar and wire rod production, characterized in that, include: Step S1, rod and wire presence detection: after the chain bed is started, the current round of steel counting begins, the end face images of the rods and wires are acquired frame by frame, and the rod and wire presence detection function is enabled. When it is detected that there are rods and wires in the current frame image, the rod and wire presence detection function is turned off, and the rod and wire tracking and counting function is enabled from the next frame; Step S2, tracking and counting of rods and wires: acquiring the end face images of rods and wires frame by frame, enabling the tracking and counting function of rods and wires, and when the rod and wire count reaches the set rated count, continuous tracking of the tail steel dividing wire is performed from the next frame, and at the same time, a signal of reaching the rated count is transmitted to the steel dividing control system to control the chain bed to stop; Step S3, continuously tracking the steel dividing line of the tail steel: acquiring the end face image of the rod and wire frame by frame, enabling the function of continuously tracking the steel dividing line of the tail steel, and when receiving the chain bed stop signal and the chain bed stops completely, sending the tracked final steel dividing line to the steel dividing control system, and ending the tracking of the steel dividing line of the tail steel; Step S4, steel separation result detection: the steel separation control system receives the final steel separation line and performs the steel separation action. After the steel separation action is completed, the steel separation result detection function is enabled. When it is detected that the steel separation is successful, the current round of steel separation counting is ended. At the same time, the chain bed is started and the next round of steel separation counting begins.

2. The bar and wire rod steel separation tracking and counting method according to claim 1, characterized in that The step S1 includes: setting a valid area in the image, and when rods and wires are detected in the valid area, enabling a rod and wire tracking and counting function.

3. The bar and wire rod steel separation tracking and counting method according to claim 1, characterized in that, The step S2 comprises: Step S2.1, initializing parameter settings, including setting the position of the steel wire, dynamic count value, and rated count value; Step S2.2, detecting the number and position coordinates of the rods and wires in the current frame image; Step S2.3, using the set dividing wire as the boundary, filtering out the rods and wires in the left and right areas, and recording the number and position coordinates of the rods and wires in the left and right areas respectively; Step S2.4, using the nearest neighbor search strategy, establishing the spatial coordinate change model of the bars and wires in the upper and lower frames, calculating the offset fitting value, and judging whether the running state of the chain bed is the forward state, the reverse state or the stationary state according to the size of the offset fitting value; Step S2.5, according to the running state of the chain bed, select the forward rotation, stationary tracking counting or reverse rotation tracking counting of the rods and wires.

4. The bar and wire rod steel separation tracking and counting method according to claim 3, characterized in that, The step S2.4 comprises: Step S2.4.1, respectively record the coordinate point sets of all rods and wires in the previous frame and the current frame in the horizontal direction; Step S2.4.2, traverse and calculate the distance from each rod and wire coordinate point in the previous frame to each rod and wire coordinate point in the current frame in the horizontal direction, adopt the nearest neighbor search strategy, select the two points with the closest distance as matching points without replacement, and obtain all matching points and the remaining unmatched coordinate points in the previous frame and the current frame; Step S2.4.3, arrange the matching points in order of matching, set the matching distance threshold, filter out the matching points with large deviation values, and obtain the remaining matching points; Step S2.4.4, for the remaining matching points, calculate the offset fitting value by taking the average difference or converting it into a least square fitting problem; Step S2.4.5: Determine the motion state of the chain bed as forward, reverse or stationary according to the offset fitting value.

5. The bar and wire rod steel separation tracking and counting method according to claim 4, characterized in that, Also includes: Step S2.4.

6. Determine whether there is steel slipping, and the specific method is as follows: Determine the horizontal coordinate value range of the coordinate points corresponding to the previous frame and the current frame among the remaining matching points. If there are remaining unmatched coordinate points in the previous frame within the horizontal coordinate value range corresponding to the previous frame, and there are remaining unmatched coordinate points in the current frame within the horizontal coordinate value range corresponding to the current frame, it is determined that there is steel slipping in the bar and wire on the chain bed.

6. The bar and wire steel splitting tracking and counting method according to claim 3, characterized in that, In the said Step S2.5, the forward rotation and static tracking counting of the bar and wire include: Step S2.5.

1. When the dynamic count value of the previous frame is 0, the number of bar and wire in the forward side area in the forward rotation direction is the current dynamic count value; if the current dynamic count value is not less than the rated number of pieces, find the bar and wire reaching the rated number of pieces in the forward side area as the tail steel, and end the tracking counting. Otherwise, take the bar and wire closest to the steel dividing line in the forward side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking counting of the next frame; Step S2.5.

2. When the dynamic count value of the previous frame is not 0, set the sum of the number of bar and wire between the steel dividing line and the tracking target and the dynamic count value of the previous frame as the current dynamic count value; if the current dynamic count value is not less than the rated number of pieces, find the bar and wire reaching the rated number of pieces in the area between the set steel dividing line and the tracking target as the tail steel, and end the tracking counting. Otherwise, take the bar and wire closest to the steel dividing line in the forward side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking counting of the next frame.

7. The bar and wire splitting steel tracking and counting method according to claim 3, characterized in that, In the said Step S2.5, the reverse rotation tracking counting of the bar and wire includes: Step S2.5.

3. When the dynamic count value of the previous frame is 0: (1) If the number of bar and wire in both the reverse side area and the forward side area is 0, then the current dynamic count value is 0. Take the set steel dividing line as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking counting of the next frame; (2) If the number of bar and wire in the reverse side area is 0 and the number of bar and wire in the forward side area is not 0, then the current dynamic count value is equal to the rated number of pieces. Take the first bar and wire close to the steel dividing line in the forward side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the next frame of tracking counting; (3) If the number of bar and wire in the reverse side area is not 0 and the number of bar and wire between the set steel dividing line and the tracking target is 0, then subtract 1 from the dynamic count value of the previous frame as the current dynamic count value. Take the bar and wire closest to the steel dividing line as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking counting of the next frame; (4) If the number of bar and wire in the reverse side area is not 0 and the number of bar and wire between the set steel dividing line and the tracking target is not 0, then the current dynamic count value is equal to the rated number of pieces. Take the bar and wire closest to the steel dividing line as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking counting of the next frame; Step S2.5.

4. When the dynamic count value of the previous frame is not 0: (1) If the dynamic count value of the previous frame is equal to the rated number of strands, set the number of bar and wire materials between the dividing wire and the tracking target to 0, then the current dynamic count value is equal to the rated number of strands minus 1; take the bar and wire material closest to the dividing wire as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame; (2) If the dynamic count value of the previous frame is equal to the rated number of strands, and the number of bar and wire materials between the dividing wire and the tracking target is not 0, then the current dynamic count value is equal to the rated number of strands; take the bar and wire material closest to the dividing wire as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame; (3) If the dynamic count value of the previous frame is not equal to the rated number of strands, and the number of bar and wire materials between the dividing wire and the tracking target is 0, then the current dynamic count value is equal to the dynamic count value of the previous frame minus 1; take the bar and wire material closest to the dividing wire as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame; (4) If the dynamic count value of the previous frame is not equal to the rated number of strands, and the number of bar and wire materials between the dividing wire and the tracking target is not 0, then the current dynamic count value is equal to the dynamic count value of the previous frame; take the bar and wire material closest to the dividing wire as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the next frame.

8. The bar and wire rod steel separation tracking and counting method according to claim 1, characterized in that The step S3 includes: Step S3.1: Filter the bar and wire materials on the positive side of the tracking target, set the fluctuation deviation threshold piancha_thresh of the positioning detection of the bar and wire materials in the x direction, and calculate the difference piancha between the tracking target and the set dividing wire in the x direction; Step S3.2: When the difference between the tracking target and the set dividing wire in the x direction is not greater than the fluctuation deviation threshold and the number of bar and wire materials in the reverse side area is not 0, calculate the absolute values left_near_piancha_x and right_near_piancha_x of the differences between the coordinates of the bar and wire materials closest to the set dividing wire in the horizontal direction in the reverse side area and the tracking target respectively. If the number of bar and wire materials in the positive side area is not 0, calculate the difference right_near_piancha_fengang_x between the coordinates of the bar and wire material closest to the set dividing wire in the horizontal direction in the positive side area and the set dividing wire. Let thresh1 = left_near_piancha_x - right_near_piancha_x, thresh2 = right_near_piancha_fengang_x - piancha_thresh; if thresh1 > 0 and thresh2 > 0 are satisfied, then the current dynamic count value is equal to the rated number of strands minus 1, otherwise, the current dynamic count value is equal to the rated number of strands. Take the bar and wire material closest to the dividing wire in the positive side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the tracking count of the dividing wire in the next frame; S3.

3. When the difference between the tracking target and the steel splitting line in the x-direction is not greater than the fluctuation deviation threshold and the number of bar and wire materials in the reverse area is not zero, calculate the absolute values left_near_piancha_x and right_near_piancha_x of the differences between the bar and wire materials closest to the set steel splitting line in the horizontal direction and the tracking target coordinates in the reverse side area and the forward side area respectively. If the number of bar and wire materials in the forward side area is zero, let thresh3 = left_near_piancha_x - piancha_thresh; if thresh3 < 0 is satisfied, the current dynamic count value is equal to the rated number of branches minus 1, otherwise, the current dynamic count value is equal to the rated number of branches. Without a tracking target, take the maximum value of the image width in the horizontal direction as the tracking target, record the dynamic count value, and wait for the steel splitting line tracking count of the next frame. S3.

4. When the difference between the tracking target and the steel splitting line in the x-direction is not greater than the fluctuation deviation threshold and the number of bar and wire materials in the reverse area is zero, if the number of bar and wire materials in the forward side area is not zero, then the current dynamic count value is equal to the rated number of branches. Take the bar and wire material closest to the steel splitting line in the forward side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the steel splitting line tracking count of the next frame; otherwise, the current dynamic count value is equal to the dynamic count value of the previous frame, the tracking target remains unchanged, record the position coordinates and the dynamic count value of the previous tracking target, and wait for the steel splitting line tracking count of the next frame. S3.

5. When the difference between the tracking target and the steel splitting line in the x-direction is greater than the fluctuation deviation threshold, if the number of filtered bar and wire materials in the forward side area is not zero, then the current dynamic count value is equal to the rated number of branches. Take the bar and wire material closest to the steel splitting line in the forward side area as the tracking target, record the position coordinates and the dynamic count value, and wait for the steel splitting line tracking count of the next frame; otherwise, the current dynamic count value is 0, without a tracking target, take the maximum value of the image width in the horizontal direction as the tracking target, record the dynamic count value, and wait for the steel splitting line tracking count of the next frame.

9. An electronic device, comprising a processor and a memory, the memory storing a program that can run on the processor, characterized in that, When the program is executed by the processor, it implements the steps of the bar and wire material steel splitting tracking and counting method according to any one of claims 1-8.

10. A computer-readable storage medium storing at least one program, characterized in that, The at least one program can be executed by at least one processor to implement the steps of the bar and wire material steel splitting tracking and counting method according to any one of claims 1-8.