A laser-based wire visual leveling method and terminal
Through the laser-based visual leveling method, the reduction of laser pictures and center of gravity calculations are used to solve the problems of low wire leveling accuracy and efficiency in the online material industry, and efficient flatness detection of multi-line scenarios is achieved.
Patent Information
- Application Number
- CN202210600969.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the online material industry, traditional artificial leveling methods are inefficient and low in accuracy, and can only be used in two-line scenarios, which cannot effectively solve the flatness detection problem of multi-line scenarios.
The laser-based visual leveling method is used to obtain flatness detection signals, take laser pictures, restore the laser area, and calculate the center of gravity of the wire to judge the flatness, improving the accuracy and efficiency of wire leveling.
It solves the problems of excessive laser area caused by white powder on the wire, laser loss and unsmooth imaging caused by black wire light absorption, improves the accuracy and efficiency of wire leveling, and is suitable for flatness detection in multi-line scenes.
Smart Images

Figure CN115096216B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a laser-based wire visual leveling method and terminal. Background Art
[0002] In the wire industry, the traditional method is to manually distinguish the zero, live, and ground wires, lay them flat, and then press the terminals. This method has disadvantages such as low efficiency and high labor consumption. The result is human fatigue and the accuracy is affected by the human state.
[0003] In the prior art, the line width is usually judged to perform leveling. This method can only be applied to the scene of two lines and has the disadvantages of low detection accuracy and limited application scenarios. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a laser-based wire visual leveling method and terminal, which can improve the accuracy of wire leveling.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A laser-based wire visual leveling method comprises the following steps:
[0007] receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image;
[0008] The laser area of the wire in the laser image is restored, and the center of gravity of the wire is calculated according to the restored laser area, and the flatness between the wires is determined according to the center of gravity.
[0009] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0010] A laser-based wire visual leveling terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0011] receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image;
[0012] The laser area of the wire in the laser image is restored, and the center of gravity of the wire is calculated according to the restored laser area, and the flatness between the wires is determined according to the center of gravity.
[0013] The beneficial effects of the present invention are as follows: after receiving the flatness detection signal, a laser image of the laser irradiated wire is obtained, and the laser area of the wire in the laser image is restored, which can solve the problem that the laser area is too large when there is white powder on the wire, the problem that the black wire seriously absorbs light and causes the laser to be missing, and the problem that the laser imaging is not smooth, thereby improving the accuracy of wire leveling. The center of gravity of the wire is calculated based on the restored laser area, and the flatness between the wires is judged based on the center of gravity, thereby improving the efficiency and accuracy of wire leveling. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a flow chart of a laser-based wire visual leveling method according to an embodiment of the present invention;
[0015] Figure 2 A schematic diagram of a laser-based wire visual leveling terminal according to an embodiment of the present invention;
[0016] Figure 3 A schematic diagram of laser irradiation of a laser-based wire visual leveling method according to an embodiment of the present invention;
[0017] Figure 4 A fitting schematic diagram of a laser-based wire visual leveling method according to an embodiment of the present invention;
[0018] Description of labels:
[0019] 1. A laser-based wire visual leveling terminal; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0020] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0021] Please refer to Figure 1 The embodiment of the present invention provides a laser-based wire visual leveling method, comprising the steps of:
[0022] receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image;
[0023] The laser area of the wire in the laser image is restored, and the center of gravity of the wire is calculated according to the restored laser area, and the flatness between the wires is determined according to the center of gravity.
[0024] From the above description, it can be seen that the beneficial effects of the present invention are: after receiving the flatness detection signal, a laser image of the laser irradiated wire is obtained, and the laser area of the wire in the laser image is restored, which can solve the problem that the laser area is too large when there is white powder on the wire, the black wire seriously absorbs light and causes the laser to be missing, and the laser imaging is not smooth, thereby improving the accuracy of wire leveling. The center of gravity of the wire is calculated based on the restored laser area, and the flatness between the wires is judged based on the center of gravity, thereby improving the efficiency and accuracy of wire leveling.
[0025] Furthermore, restoring the laser area of the wire in the laser image includes:
[0026] Acquire a laser region of the wire in the laser image, and fit a first circle and a second circle according to an upper boundary and a lower boundary of the laser region respectively;
[0027] The portion of the second circle that does not overlap with the first circle is used as the restored laser area.
[0028] From the above description, it can be seen that according to the laser area on the laser-marked wire and the circular cross-section of the wire itself, the upper and lower boundaries of the laser area are respectively fitted as circles, so as to facilitate accurate restoration of the laser area.
[0029] Further, fitting a first circle and a second circle according to the upper boundary and the lower boundary of the laser area respectively comprises:
[0030] In combination with the least square method, the upper boundary and the lower boundary are fitted by omitting the center of the circle, and the first radius and the second radius are calculated respectively;
[0031] A first circle is obtained according to the first radius and the upper boundary, and a second circle is obtained according to the second radius and the lower boundary.
[0032] From the above description, it can be seen that by combining the least squares method for fitting, the center of the circle is omitted during the fitting process, and the radius of the circle can be calculated; and the fitted circle can be obtained based on the radius and the upper and lower boundaries, which improves the fitting calculation speed.
[0033] Further, the calculating the center of gravity of the wire according to the restored laser area includes:
[0034] Calculating the intersection point of the first circle and the second circle, and obtaining the lower arc of the restored laser area based on the intersection point;
[0035] The average values of the horizontal coordinates and the average values of the vertical coordinates of all the points in the lower arc are calculated respectively, and the center of gravity of the wire is obtained according to the average values of the horizontal coordinates and the average values of the vertical coordinates.
[0036] From the above description, it can be seen that by obtaining the lower arc of the restored laser area according to the intersection of the first circle and the second circle, the center of gravity of the wire can be obtained according to the average value of the horizontal coordinate and the vertical coordinate in the lower arc, which is convenient for the subsequent determination of the flatness of the wire.
[0037] Further, judging the flatness between the wires according to the center of gravity includes:
[0038] The slope is calculated according to the center of gravity of adjacent wires to determine whether the slope is within a preset slope range. If so, the wire is determined to be flat; otherwise, the wire is determined to be uneven.
[0039] From the above description, it can be seen that by calculating the slope according to the center of gravity of adjacent wires and judging whether the surface between the wires is flat by the slope, the efficiency of wire leveling can be improved.
[0040] Please refer to Figure 2 Another embodiment of the present invention provides a laser-based wire visual leveling terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0041] receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image;
[0042] The laser area of the wire in the laser image is restored, and the center of gravity of the wire is calculated according to the restored laser area, and the flatness between the wires is determined according to the center of gravity.
[0043] As can be seen from the above description, after receiving the flatness detection signal, a laser image of the laser irradiated wire is obtained, and the laser area of the wire in the laser image is restored. This can solve the problem of the laser area being too large when there is white powder on the wire, the problem of the black wire absorbing light seriously causing the laser to be missing, and the problem of uneven laser imaging, thereby improving the accuracy of wire leveling. The center of gravity of the wire is calculated based on the restored laser area, and the flatness between the wires is judged based on the center of gravity, thereby improving the efficiency and accuracy of wire leveling.
[0044] Furthermore, restoring the laser area of the wire in the laser image includes:
[0045] Acquire a laser region of the wire in the laser image, and fit a first circle and a second circle according to an upper boundary and a lower boundary of the laser region respectively;
[0046] The portion of the second circle that does not overlap with the first circle is used as the restored laser area.
[0047] From the above description, it can be seen that according to the laser area on the laser-marked wire and the circular cross-section of the wire itself, the upper and lower boundaries of the laser area are respectively fitted as circles, so as to facilitate accurate restoration of the laser area.
[0048] Further, fitting a first circle and a second circle according to the upper boundary and the lower boundary of the laser area respectively comprises:
[0049] In combination with the least square method, the upper boundary and the lower boundary are fitted by omitting the center of the circle, and the first radius and the second radius are calculated respectively;
[0050] A first circle is obtained according to the first radius and the upper boundary, and a second circle is obtained according to the second radius and the lower boundary.
[0051] From the above description, it can be seen that by combining the least squares method for fitting, the center of the circle is omitted during the fitting process, and the radius of the circle can be calculated; and the fitted circle can be obtained based on the radius and the upper and lower boundaries, which improves the fitting calculation speed.
[0052] Further, the calculating the center of gravity of the wire according to the restored laser area includes:
[0053] Calculating the intersection point of the first circle and the second circle, and obtaining the lower arc of the restored laser area based on the intersection point;
[0054] The average values of the horizontal coordinates and the average values of the vertical coordinates of all the points in the lower arc are calculated respectively, and the center of gravity of the wire is obtained according to the average values of the horizontal coordinates and the average values of the vertical coordinates.
[0055] From the above description, it can be seen that by obtaining the lower arc of the restored laser area according to the intersection of the first circle and the second circle, the center of gravity of the wire can be obtained according to the average value of the horizontal coordinate and the vertical coordinate in the lower arc, which is convenient for the subsequent determination of the flatness of the wire.
[0056] Further, judging the flatness between the wires according to the center of gravity includes:
[0057] The slope is calculated according to the center of gravity of adjacent wires to determine whether the slope is within a preset slope range. If so, the wire is determined to be flat; otherwise, the wire is determined to be uneven.
[0058] From the above description, it can be seen that by calculating the slope according to the center of gravity of adjacent wires and judging whether the surface between the wires is flat by the slope, the efficiency of wire leveling can be improved.
[0059] The above-mentioned laser-based wire visual leveling method and terminal of the present invention are suitable for industries such as wire processing, where it is necessary to detect the balance of the zero-fire ground and the line sequence of the wire. The flatness detection based on laser flatness can quickly and efficiently determine the balance in the wire industry, reduce manual intervention, reduce labor costs, and have high visual detection accuracy and stable detection results. The following is an explanation through specific implementation methods:
[0060] Embodiment 1
[0061] Please refer to Figure 1 , a laser-based wire visual leveling method, comprising the steps of:
[0062] S1. Receive a flatness detection signal, and take a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser photo.
[0063] Specifically, in this embodiment, a flatness detection signal is received, the laser is turned on, a mechanical device is used to rotate the adjacent wires, and a laser image is obtained by taking a photo with a camera. The laser is used to determine whether a wire exists, that is, the laser area filtering method is used to determine whether a wire exists. If there is no laser display in the image taken by the camera or the laser area is less than a preset value, there is no wire in the image. If the laser area in the image taken by the camera is greater than a preset value, step S2 is executed. In this way, images without lasers and images with only a few scattered laser points can be filtered out.
[0064] S2. Restoring the laser area of the wire in the laser image, calculating the center of gravity of the wire according to the restored laser area, and determining the flatness between the wires according to the center of gravity.
[0065] S21, obtaining a laser region of the wire in the laser image, and fitting a first circle and a second circle according to an upper boundary and a lower boundary of the laser region, respectively.
[0066] Step S21 is specifically as follows:
[0067] In combination with the least square method, the upper boundary and the lower boundary are fitted by omitting the center of the circle, and the first radius and the second radius are calculated respectively;
[0068] A first circle is obtained according to the first radius and the upper boundary, and a second circle is obtained according to the second radius and the lower boundary.
[0069] Please refer to Figure 3 In this embodiment, fitting is performed according to the equation of the circle, and the fitting requires that the sum of the squares of the distances is minimized, that is:
[0070] In the formula, x i ,yi Respectively represent the horizontal and vertical coordinates of the circle, x c ,y c Respectively represent the horizontal and vertical coordinates of the center of the circle.
[0071] Transforming the above formula, we can obtain: f = ∑((x i -x c ) 2 +(y i -y c ) 2 -R 2 ) 2 ;
[0072] Define an auxiliary function: g(x i ,y i )=(x i -x c ) 2 +(y i -y c ) 2 -R 2 , we can get f = ∑ g (x i ,y i ) 2 .
[0073] According to the least squares method, when f takes an extreme value, the following conditions are met:
[0074]
[0075]
[0076]
[0077] Simplifying the above conditions, we can get:
[0078]
[0079]
[0080]
[0081] Since the radius R is not 0, ∑g(xi,yi)=0, ∑xig(xi,yi)=0, ∑yig(xi,yi)=0.
[0082] set up: in Where N is the number of all points.
[0083] So we can get ∑u i g(u i , v i )=0,∑vi g(u i , v i )=0;
[0084] Expand to get∑((u i -u c ) 2 +(v i -v c ) 2 -R 2 ) i =0,∑((u i -u c ) 2 +(v i -v c ) 2 -R2)vi=0;
[0085] Further expansion yields:
[0086]
[0087]
[0088] To simplify the formula, set the following definition:
[0089]
[0090]
[0091]
[0092]
[0093] Suv=∑uivi;
[0094]
[0095]
[0096] So we can solve u c and v c have to:
[0097]
[0098]
[0099] Then the horizontal and vertical coordinates of the center of the circle can be calculated:
[0100] From the above formula, we can get:
[0101] ∑g(x i ,yi )=0;
[0102] ∑((x i -x c ) 2 +(y i -y c ) 2 -R 2 )=0;
[0103] Therefore, the radius R of the circle can be calculated:
[0104] R 2 =∑((x i -x c ) 2 +(y i -y c ) 2 ).
[0105] S22, taking the portion of the second circle that does not overlap with the first circle as the restored laser area.
[0106] S23, calculating the intersection point of the first circle and the second circle, and obtaining the lower arc of the restored laser area based on the intersection point.
[0107] For details, please refer to Figure 4 In this embodiment, the coordinate points of the first circle and the second circle are traversed to obtain the left and right intersection points, and it is determined whether the horizontal coordinate of the coordinate point on the second circle is between the horizontal coordinates of the left and right intersection points, and whether the vertical coordinate of the coordinate point on the second circle is smaller than the vertical coordinate of the left and right intersection points. If so, the coordinate point is stored and the stored point set is marked as the lower arc.
[0108] S24, respectively calculating the average values of the horizontal coordinates and the average values of the vertical coordinates of all the points in the lower arc, and obtaining the center of gravity of the wire according to the average values of the horizontal coordinates and the average values of the vertical coordinates.
[0109] S25, calculating the slope according to the centroid points of adjacent wires, and determining whether the slope is within a preset slope range, if so, determining that the wires are flat, otherwise, determining that the wires are uneven.
[0110] Specifically, in this embodiment, the center of gravity points of adjacent wires are (x1, y1) and (x2, y2), and the slope c = (y1-y2) / (x1-x2) is calculated; if the slope c is within the preset slope range, it is judged to be flat, otherwise, it is judged to be uneven.
[0111] Embodiment 2
[0112] Please refer to Figure 2A laser-based wire visual leveling terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a laser-based wire visual leveling method of embodiment 1 is implemented.
[0113] In summary, the present invention provides a laser-based visual leveling method and terminal for wires. After receiving the flatness detection signal, the laser image of the laser-irradiated wire is obtained, and the laser area of the wire in the laser image is restored. This can solve the problem that the laser area is too large when there is white powder on the wire, the black wire seriously absorbs light and causes the laser to be missing, and the laser imaging is not smooth, thereby improving the accuracy of wire leveling. Among them, according to the characteristics of the laser area on the laser-irradiated wire and the circular cross-section of the wire itself, the upper and lower boundaries of the laser area are respectively fitted as circles, so as to facilitate accurate restoration of the laser area. The center of gravity of the wire is calculated based on the restored laser area, and the flatness between the wires is judged based on the center of gravity, thereby improving the efficiency and accuracy of wire leveling.
[0114] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A laser-based wire visual leveling method, It is characterized in that Includes steps: receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image; Restoring the laser area of the wire in the laser image, calculating the center of gravity of the wire according to the restored laser area, and judging the flatness between the wires according to the center of gravity; Restoring the laser area of the wire in the laser image includes: Acquire a laser region of the wire in the laser image, and fit a first circle and a second circle according to an upper boundary and a lower boundary of the laser region respectively; The portion of the second circle that does not overlap with the first circle is used as the restored laser area.
2. A laser-based wire visual leveling method according to claim 1, It is characterized in that Fitting a first circle and a second circle according to the upper boundary and the lower boundary of the laser area respectively comprises: In combination with the least square method, the upper boundary and the lower boundary are fitted by omitting the center of the circle, and the first radius and the second radius are calculated respectively; A first circle is obtained according to the first radius and the upper boundary, and a second circle is obtained according to the second radius and the lower boundary.
3. A laser-based wire visual leveling method according to claim 1, It is characterized in that The method of calculating the center of gravity of the wire according to the restored laser area includes: Calculating the intersection point of the first circle and the second circle, and obtaining the lower arc of the restored laser area based on the intersection point; The average values of the horizontal coordinates and the average values of the vertical coordinates of all the points in the lower arc are calculated respectively, and the center of gravity of the wire is obtained according to the average values of the horizontal coordinates and the average values of the vertical coordinates.
4. A laser-based wire visual leveling method according to claim 1, It is characterized in that Judging the flatness between the wires according to the center of gravity includes: The slope is calculated according to the center of gravity of adjacent wires to determine whether the slope is within a preset slope range. If so, the wire is determined to be flat; otherwise, the wire is determined to be uneven.
5. A laser-based wire visual leveling terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the following steps are implemented: receiving a flatness detection signal, and taking a photo of the wire irradiated by the laser according to the flatness detection signal to obtain a laser image; Restoring the laser area of the wire in the laser image, calculating the center of gravity of the wire according to the restored laser area, and judging the flatness between the wires according to the center of gravity; Restoring the laser area of the wire in the laser image includes: Acquire a laser region of the wire in the laser image, and fit a first circle and a second circle according to an upper boundary and a lower boundary of the laser region respectively; The portion of the second circle that does not overlap with the first circle is used as the restored laser area.
6. A laser-based wire visual leveling terminal according to claim 5, It is characterized in that Fitting a first circle and a second circle according to the upper boundary and the lower boundary of the laser area respectively comprises: In combination with the least square method, the upper boundary and the lower boundary are fitted by omitting the center of the circle, and the first radius and the second radius are calculated respectively; A first circle is obtained according to the first radius and the upper boundary, and a second circle is obtained according to the second radius and the lower boundary.
7. A laser-based wire visual leveling terminal according to claim 5, It is characterized in that The method of calculating the center of gravity of the wire according to the restored laser area includes: Calculating the intersection point of the first circle and the second circle, and obtaining the lower arc of the restored laser area based on the intersection point; The average values of the horizontal coordinates and the average values of the vertical coordinates of all the points in the lower arc are calculated respectively, and the center of gravity of the wire is obtained according to the average values of the horizontal coordinates and the average values of the vertical coordinates.
8. The laser-based wire visual leveling terminal according to claim 5, It is characterized in that Judging the flatness between the wires according to the center of gravity includes: The slope is calculated according to the center of gravity of adjacent wires to determine whether the slope is within a preset slope range. If so, the wire is determined to be flat; otherwise, the wire is determined to be uneven.
