Method and device for extracting a light knife center of a formed weld based on line structured light vision
By combining the OTSU method and the Hessian matrix, the stability and accuracy issues in the extraction of the center of the laser cutter in line structured light vision forming weld were solved, and sub-pixel-level accurate extraction of the laser cutter center was achieved.
Patent Information
- Application Number
- CN202311034331.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2043-08-16
AI Technical Summary
Existing methods for extracting the center of the light cutter in shaped weld seams based on line structured light are susceptible to uneven grayscale distribution and changes in light cutter curvature, resulting in poor stability, low accuracy, and deviations in the extraction results.
The OTSU method is used for preprocessing. The initial skeleton center is obtained by skeleton refinement, the cross-sectional normal is determined by the Hessian matrix, and the pixels in the normal direction are subjected to quadratic weighting to accurately extract the sub-pixel center of the light knife.
It effectively avoids the effects of changes in the curvature of the optical blade and uneven grayscale distribution, achieving precise extraction of the center of the optical blade and improving detection accuracy and stability.
Smart Images

Figure CN117058103B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of weld quality detection, and particularly relates to a forming weld light knife center extraction method and device based on line structured light vision. BACKGROUND
[0002] With the rapid development of industry, in the field of welding, automatic and intelligent forming weld quality detection has become a development trend. Robot automatic weld quality detection needs to introduce a vision system, and line structured light has a wide application in weld recognition and forming weld quality detection due to its simple structure, low cost, high measurement accuracy and other characteristics. Active vision detection technology based on line structured light has become a hot research direction. In the industrial quality detection of forming weld, the forming weld light knife image collected by the line structured light vision system has a certain width, and the center extraction of the weld light knife image directly affects the detection accuracy of the formed weld after welding and the quality evaluation of the formed weld. In actual industrial application, the characteristic area of the weld after welding has a certain arc, and is affected by spatter during welding, so that the forming weld has a rough surface and fluctuating contour. Therefore, when the line structured light is projected onto the surface of the forming weld, the light knife curvature will change greatly due to the shape characteristics, the gray scale distribution is not strictly symmetrical, and the saturation exists, which finally leads to a large deviation of the light knife center extraction and affects the detection quality of the forming weld. The existing light knife center extraction methods such as geometric center method, Steger method, extreme value method and gray scale barycenter method have the problems of poor stability and low precision of only reaching the pixel level. SUMMARY
[0003] The present application provides a forming weld light knife center extraction method and device based on line structured light vision, to solve the problems that the existing methods are easily affected by the uneven gray scale distribution and the change of the forming weld light knife curvature when extracting the center of the forming weld light knife image based on line structured light, resulting in poor stability, low precision and deviation of the extraction result.
[0004] According to an aspect of the present application, a forming weld light knife center extraction method based on line structured light vision is provided, comprising:
[0005] Obtaining a forming weld light knife image, pre-processing the forming weld light knife image through an OTSU method to obtain a binary image;
[0006] Skeleton thinning the binary image to obtain an initial skeleton center which retains the original light knife topological structure after thinning;
[0007] Determining a cross-section normal of the initial skeleton center by using a Hessian matrix;
[0008] Carrying out a second square weighting process on the pixel in the normal to obtain a final shaped weld light knife center extraction result.
[0009] Preferably, the method for carrying out skeleton thinning on the binary image to obtain an initial skeleton center image which retains the original light knife topological structure after thinning comprises:
[0010] Respectively constructing a 3*3 region for the surrounding eight direction neighborhoods of each pixel point in the binary image;
[0011] Judging whether the constructed region corresponding to each pixel point with a value equal to 1 in the binary image satisfies a first predetermined condition, and if yes, deleting the pixel point to obtain binary image data after one round of sub-iteration;
[0012] Judging whether the constructed region corresponding to each pixel point with a value equal to 1 in the binary image data after one round of sub-iteration satisfies a second predetermined condition, and if yes, deleting the pixel point to obtain an initial skeleton center of the shaped weld light knife image.
[0013] Preferably, the first predetermined condition comprises formulas (1)-(4):
[0014] 2≤N(P1)≤6 (1);
[0015]
[0016] P2·P4·P6=0 (3);
[0017] P2·P4·P8=0 (4);
[0018] Wherein,
[0019] In the formula, P1 is a target pixel point, wherein the other eight pixel points in the 3*3 region corresponding to the target pixel point are P2-P9 in sequence, Z(P1) represents the number of times of 0, 1 change when P2, P3, …P9 are in sequence, and N(P1)=P2+…+P9.
[0020] Preferably, the second predetermined condition comprises formulas (5)-(8):
[0021] 2≤N(P1)≤6 (5);
[0022]
[0023] P4·P6·P8=0 (7);
[0024] P2·P6·P8=0 (8);
[0025] In the formula, P1 is a target pixel point, other eight pixel points in a 3*3 region corresponding to the target pixel point are P2-P9 in turn, Z(P1) represents the number of times of 0, 1 change when P2, P3, …P9 are in order, and N(P1)=P2+…+P9.
[0026] Preferably, the method for determining the cross-sectional normal of the initial skeleton center by using the Hessian matrix comprises:
[0027] determining the second-order partial derivative of the initial skeleton center;
[0028] determining the partial derivative of the initial skeleton center according to the second-order partial derivative;
[0029] solving the Hessian matrix according to the partial derivative of the initial skeleton center to obtain an eigenvalue and a corresponding eigenvector;
[0030] In the eigenvalue, the eigenvector corresponding to the eigenvalue with the largest absolute value is the cross-sectional normal of the initial skeleton center.
[0031] Preferably, the method for determining the second-order partial derivative of the initial skeleton center comprises:
[0032] determining the second-order partial derivative of the initial skeleton center by using formula (9);
[0033]
[0034]
[0035] In the formula, G(x, y) xx , G(x, y) xy , G(x, y) yy is the second-order partial derivative of the two-dimensional Gaussian function to the initial skeleton center, x and y are coordinates of a pixel point in the initial skeleton center, and σ is a standard deviation of Gaussian distribution.
[0036] Preferably, the method for determining the partial derivative of the initial skeleton center according to the second-order partial derivative comprises:
[0037] determining the partial derivative of the initial skeleton center according to the second-order partial derivative by using formula (10);
[0038]
[0039]
[0040] wherein h xx , h xy , h yx , h yy is the initial skeleton center partial derivative, F(x, y) is the initial skeleton center, G(x, y) xx , G(x, y) xy , G(x, y) yy is the second-order partial derivative of the two-dimensional Gaussian function with respect to x and y.
[0041] Preferably, F(x, y) is the initial skeleton center, and the corresponding Hessian matrix calculation formula is:
[0042]
[0043] wherein G(x, y) is a two-dimensional Gaussian function, h xx , h xy , h yx , h yy is the partial derivative of the initial skeleton center.
[0044] According to an aspect of the present application, a forming weld light knife center extraction device based on line structured light vision is provided, comprising:
[0045] An acquisition and preprocessing unit is configured to acquire a forming weld light knife image, and preprocess the forming weld light knife image through an OTSU method to obtain a binary image.
[0046] A skeleton thinning unit is configured to perform skeleton thinning on the binary image to obtain an initial skeleton center that retains the original light knife topological structure after thinning.
[0047] A normal determination unit is configured to determine a cross-sectional normal of the initial skeleton center by using a Hessian matrix.
[0048] A forming weld light knife center extraction unit is configured to perform quadratic square weighting processing on the pixels in the normal to obtain a final forming weld light knife center extraction result.
[0049] The present application has at least the following beneficial effects:
[0050] The present application provides a forming weld light knife center extraction method and device based on line structured light vision, which can effectively avoid the influence of forming weld light knife curvature variation and non-strict gray scale distribution, and accurately extract the light knife sub-pixel center by performing skeleton thinning on the forming weld light knife image and performing normal calculation and normal pixel quadratic square weighting processing through a Hessian matrix. BRIEF DESCRIPTION OF DRAWINGS
[0051] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0052] Figure 1 A flow chart of a method for extracting a light knife center of a formed weld based on line structured light vision according to an embodiment of the present application is shown.
[0053] Figure 2 A result diagram of the extraction of the light knife center of the formed weld according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0054] Various exemplary embodiments, features, and aspects of the present application will be described herein below with reference to the accompanying drawings. The same reference numbers in different drawings represent the same or similar elements. Although various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
[0055] The term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.
[0056] The term "and / or" used herein only means an association relationship of the associated objects, and means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0057] In addition, in order to better illustrate the present application, numerous specific details are given in the following detailed description. Those skilled in the art should understand that the present application can be implemented without certain specific details. In some examples, methods, means, elements and circuits well known to those skilled in the art are not described in detail in order to highlight the main idea of the present application.
[0058] Figure 1 A flow chart of a method for extracting a light knife center of a formed weld based on line structured light vision according to an embodiment of the present application is shown. Figure 2 A result diagram of the extraction of the light knife center of the formed weld according to an embodiment of the present application is shown. As Figures 1-2As shown, a kind of forming weld light knife center extraction method based on line structured light vision, comprising: step S01: obtaining forming weld light knife image, the binary image is obtained by OTSU method to the forming weld light knife image It is preprocessed;Step S02: the skeleton thinning is carried out to the binary image, and the initial skeleton center of the topological structure of original light knife after thinning is obtained;Step S03: using Hessian matrix, the section normal of the initial skeleton center is determined;Step S04: the pixel in the normal is twice square weighted processing, and the final forming weld light knife center extraction result is obtained.
[0059] The forming weld light knife center extraction method based on line structured light vision provided in the embodiment of the application specifically includes the following steps:
[0060] Step S01: obtaining forming weld light knife image, the binary image is obtained by OTSU method to the forming weld light knife image It is preprocessed.
[0061] In the embodiment of the application, the forming weld light knife image collected by line structured light vision system is obtained, and the light knife ROI region is determined by OTSU algorithm (Otsu method) To remove the useless background information of image, the binary image of forming weld light knife is obtained.
[0062] Step S02: the skeleton thinning is carried out to the binary image, and the initial skeleton center of the topological structure of original light knife after thinning is obtained.
[0063] In the application, the method for carrying out skeleton thinning to binary image and obtaining the initial skeleton center image of the topological structure of original light knife after thinning includes: the surrounding eight direction neighborhood of each pixel point in the binary image is structured into 3*3 region respectively;It is judged whether the structured region corresponding to each pixel point with value equal to 1 in binary image satisfies the first predetermined condition, if satisfies, then the pixel point is deleted, and the binary image data after one round of iteration is obtained;It is judged whether the structured region corresponding to each pixel point with value equal to 1 in binary image data after one round of iteration satisfies the second predetermined condition, if satisfies, then the pixel point is deleted, and the initial skeleton center of forming weld light knife image is obtained.
[0064] In the application, the first predetermined condition includes formula (1)-(4):
[0065] 2≤N (P1) ≤6 (1);
[0066]
[0067] P2·P4·P6=0 (3);
[0068] P2·P4·P8=0 (4);
[0069] wherein,
[0070] wherein: P1 is a target pixel point, wherein other eight pixel points in a 3*3 region corresponding to the target pixel point are P2~P9 in turn, Z(P1) represents the number of times of 0, 1 change in the order of P2, P3, …P9, N(P1)=P2+…+P9.
[0071] In the application, the second predetermined condition comprises formula (5)~(8):
[0072] 2≤N(P1)≤6 (5);
[0073]
[0074] P4·P6·P8=0 (7);
[0075] P2·P6·P8=0 (8);
[0076] wherein: P1 is a target pixel point, wherein other eight pixel points in a 3*3 region corresponding to the target pixel point are P2~P9 in turn, Z(P1) represents the number of times of 0, 1 change in the order of P2, P3, …P9, N(P1)=P2+…+P9, represents the number of non-zero neighborhood of P1 point, in order to exclude isolated and internal points.
[0077] In the embodiment of the application, the eight direction neighborhood around any one pixel point P in the binary image is constructed into a 3*3 region, and the whole image is calculated point by point. When any one pixel point P1=1 in the binary image, it is judged whether the first predetermined condition is satisfied, if yes, the deletion operation is performed, i.e. P1=0, P1 is deleted, i.e. the first round of iteration is completed. The first round of iteration is performed on all pixel points in the binary image, and the binary image data after the first round of iteration is obtained.
[0078] After the first round of iteration is completed, the second round of iteration is performed, in the pixel point deletion condition of the second round of iteration, formula (3) and (4) in the first predetermined condition are transformed into formula (7) and (8), and other conditions remain unchanged. When any one pixel point P1=1 in the binary image after the first round of iteration, it is judged whether the second predetermined condition is satisfied, if yes, the deletion operation is performed, i.e. P1=0, P1 is deleted, i.e. the second round of iteration is completed. The second round of iteration is performed on all pixel points in the binary image after the first round of iteration, until all pixel points cannot be deleted, and the initial skeleton center retaining the original skeleton topology structure after thinning is obtained.
[0079] The first wheel iteration and the second wheel iteration are used to preliminarily determine the center position of the weld light knife, reduce the number of pixels participating in the calculation of the normal direction of the light knife center in the subsequent process, and reserve the topological structure of the original light knife to represent the weld details and improve the final calculation speed of the center of the weld light knife.
[0080] Step S03: The cross-sectional normal of the initial skeleton center is determined by using the Hessian matrix.
[0081] In the application, the method for determining the cross-sectional normal of the initial skeleton center by using the Hessian matrix comprises the following steps: determining the second-order partial derivative of the initial skeleton center; determining the partial derivative of the initial skeleton center according to the second-order partial derivative; solving the Hessian matrix according to the partial derivative of the initial skeleton center to obtain an eigenvalue and a corresponding eigenvector; and taking the eigenvector corresponding to the eigenvalue with the largest absolute value as the cross-sectional normal of the initial skeleton center.
[0082] In the embodiment of the application, after the initial skeleton center of the formed weld light knife image is obtained, the cross-sectional normal of the initial skeleton center is calculated to more accurately determine the real position of the light knife, so as to avoid the influence of the dramatic change of the normal direction caused by the change of the surface curvature of the formed weld.
[0083] The Hessian matrix is applied to the determination of the normal direction of the initial skeleton center of the light knife, and the eigenvector corresponding to the eigenvalue with the largest absolute value is obtained by decomposing the Hessian matrix to accurately determine the normal direction, thereby laying a foundation for the final accurate extraction of the weld center.
[0084] In order to improve the processing speed of the algorithm, the Hessian matrix is calculated by using the idea of Gaussian convolution recursion, and the two-dimensional Gaussian convolution of the image can be analyzed as one Gaussian row convolution and one Gaussian column convolution operation.
[0085] In the application, the method for determining the second-order partial derivative of the initial skeleton center comprises the following steps: determining the second-order partial derivative of the initial skeleton center by using formula (9).
[0086]
[0087]
[0088] In the formula, G(x, y) xx , G(x, y) xy , G(x, y) yy is the second-order partial derivative of the two-dimensional Gaussian function with respect to the initial skeleton center, x and y are the coordinates of the pixel points in the initial skeleton center, and sigma is the standard deviation of the Gaussian distribution.
[0089] In the present application, the method for determining the partial derivative of the initial skeleton center according to the second-order partial derivative comprises: determining the partial derivative of the initial skeleton center according to the second-order partial derivative by using formula (10).
[0090]
[0091]
[0092] wherein, h xx , h xy , h yx , h yy is the partial derivative of the initial skeleton center, F(x, y) is the initial skeleton center, G(x, y) xx , G(x, y) xy , G(x, y) yy is the second-order partial derivative of the two-dimensional Gaussian function with respect to x and y.
[0093] In the present application, F(x, y) is the initial skeleton center, and the corresponding Hessian matrix calculation formula is:
[0094]
[0095] wherein, G(x, y) is a two-dimensional Gaussian function, h xx , h xy , h yx , h yy is the partial derivative of the initial skeleton center.
[0096] In the embodiment of the present application, F(x, y) is the initial skeleton center of the formed weld light knife image to be processed, and the corresponding Hessian matrix calculation formula is formula (11).
[0097] According to h xx , h xy , h yx , h yy , the method for solving the Hessian matrix to obtain the eigenvalue and the corresponding eigenvector comprises:
[0098] Let |λI-H| = 0, wherein λ represents the eigenvalue of the matrix to be solved, I represents the unit matrix, H represents the Hessian matrix, and formula (11) is combined to obtain:
[0099] λ 2 -(h xx +h yy )λ+h xx ·h yy -h xy 2 = 1 (12).
[0100] Solving the above equation (12) can obtain its eigenvalue λ as:
[0101]
[0102] Let a1=h xx +h yy , a2=h xx -h yy , Then the eigenvalue λ can be expressed as:
[0103]
[0104] Then solve the corresponding eigenvector of each obtained eigenvalue λ, assuming that the eigenvector is Y, then HY=λY, that is, (λI-H)Y=0, combining equation (11) to simplify it, and combining equation (12) can obtain:
[0105]
[0106] Let the assumed matrix eigenvector And let v v =2h xv , according to equation (15), we can obtain:
[0107]
[0108] And from the above a1, a2 and b, we can obtain:
[0109]
[0110] Combining equation (16) and equation (17), when , we obtain v x =a2+b, and when , we obtain v x =a2-b. Thus, the eigenvalue of the Hessian matrix corresponding to the eigenvector can be calculated. The absolute value of the eigenvector (t x , t y ) T is the cross-sectional normal of the initial skeleton center of the shaped weld light knife image.
[0111] Step S04: performing a quadratic square weighting process on the pixels in the normal direction to obtain a final shaped weld light knife center extraction result.
[0112] In this embodiment of the invention, in order to further reduce the interference of the curvature change of the light knife during extraction, based on the obtained normal direction and combined with the idea of the centroid, the effective pixels that have a relatively large impact on the center extraction of the initial skeleton center in the normal direction and its surrounding area are selected. The gray values of the effective pixel set in the normal direction are subjected to a quadratic weighted processing to increase the gray value weight of the pixels closer to the weld center, while decreasing the gray value weight of the pixels near the boundary. Then, the centroid is calculated to extract a more realistic sub-pixel light knife center of the formed weld.
[0113] The formula for calculating the weighted quadratic sum is as follows:
[0114]
[0115] In the formula: x c y c These are the row and column coordinates of each pixel in the skeleton normal direction, g(x) c ,y c Z(x) represents the value obtained by performing a quadratic weighted average of the gray values corresponding to each pixel along the normal direction, M is the set of pixels involved in the calculation along the normal direction, and Z(x) is the value obtained by the quadratic weighted average of the gray values corresponding to each pixel along the normal direction. n ,y n The coordinates of the subpixel center point of the formed weld seam light knife are obtained by weighted calculation using the second square of grayscale.
[0116] The above are the sub-pixel center coordinates of a single cross-section of the light stripe. By using the above method, traversing all initial skeleton centers along the skeleton direction, the sub-pixel center of the entire formed weld seam light knife image can be extracted. Figure 2 To extract the center of the weld bead using a finishing knife, in Figure 2 In the figure, (a) is the original line structured light forming weld light knife image, (b) is the binary image after preprocessing by the OTSU method, and (c) is the final forming weld light knife center extraction result; in figures (a), (b), and (c), the upper figure is the fillet weld and the lower figure is the butt weld.
[0117] In this embodiment of the invention, the weld seam light-cutting image is acquired through a weld seam image acquisition system. This system mainly includes a line structured light sensor consisting of an industrial camera and a line laser, a six-degree-of-freedom robotic arm, a computer, and the target weld seam workpiece. The camera is vertical, and the line laser emits light at an angle. The robotic arm drives the end-effector camera and laser emitter to acquire the weld seam light-cutting image, which is then stored on the computer for processing.
[0118] It is understood that the various method embodiments mentioned above in this invention can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this invention will not elaborate further.
[0119] The execution subject of the formed weld light knife center extraction method based on line structured light vision can be a formed weld light knife center extraction device based on line structured light vision. For example, the formed weld light knife center extraction method based on line structured light vision can be executed by a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementation manners, the formed weld light knife center extraction method based on line structured light vision can be implemented by a processor invoking computer readable instructions stored in a memory.
[0120] Those skilled in the art can understand that, in the above method of the specific embodiment, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined according to its function and possible internal logic.
[0121] The application further provides a formed weld light knife center extraction device based on line structured light vision, comprising: an acquisition and preprocessing unit, configured to acquire a formed weld light knife image, and preprocess the formed weld light knife image by an OTSU method to obtain a binary image; a skeleton thinning unit, configured to perform skeleton thinning on the binary image to obtain an initial skeleton center of the light knife after thinning and retaining the original light knife topological structure; a normal determination unit, configured to determine a cross-sectional normal of the initial skeleton center by using a Hessian matrix; and a formed weld light knife center extraction unit, configured to perform quadratic square weighting processing on pixels in the normal to obtain a final formed weld light knife center extraction result.
[0122] In some embodiments, the device provided by the embodiments of the application has functions or includes modules and units, which can be used to execute the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and details are not described here for brevity.
[0123] The application acquires the ROI region of the weld light knife image by the OTSU method, removes useless background information of the image, determines the initial skeleton center of the light knife by skeleton thinning and retains the topological structure of the light knife, calculates the centroid based on the initial skeleton center, combines the Hessian matrix normal calculation and the normal pixel quadratic square weighting calculation, and solves the interference problem of the change of the formed weld light knife curvature and the non-strict gray scale distribution when the center is extracted.
[0124] The present application can avoid the gray scale distribution problem caused by the change of the forming weld light knife curvature, effectively eliminate the influence of the non-strictly symmetrical gray scale distribution on the extraction of the light knife center in the saturation condition, and further realize the accurate extraction of the light knife sub-pixel center of the forming weld.
[0125] Embodiments of the application have been described above, along with the explanations of the preferred embodiments thereof, given merely by way of example and not an exhaustive list of embodiments. Many modifications and variations of the described embodiments are possible in light of the above teachings. The choice of words in this document is not intended to limit the scope of embodiments to the descriptive language used. It is therefore contemplated that the use of such terms are in no way limiting, and that such terms are intended to be interpreted in the broadest possible manner consistent with the principles of the embodiments described herein.
Claims
1. A method for extracting the center of a forming weld seam using a light-cutting tool based on line structured light vision, characterized in that, include: A shaped weld bead polishing knife image is acquired, and the shaped weld bead polishing knife image is preprocessed using the OTSU method to obtain a binary image; The binary image is thinned to obtain an initial skeleton center that retains the original scalpel topology after thinning. Determining the cross-sectional normal of the initial skeleton center using the Hessian matrix includes: determining the second-order partial derivative of the initial skeleton center; determining the partial derivative of the initial skeleton center based on the second-order partial derivative; solving the Hessian matrix based on the partial derivative of the initial skeleton center to obtain eigenvalues and their corresponding eigenvectors; among the eigenvalues, the eigenvector corresponding to the eigenvalue with the largest absolute value is the cross-sectional normal of the initial skeleton center. The method for determining the second-order partial derivative of the initial skeleton center includes: using formula (9) to determine the second-order partial derivative of the initial skeleton center; , , (9); In the formula, , , It is the second-order partial derivative of the two-dimensional Gaussian function with respect to the initial skeleton center, x and y are the coordinates of the pixel in the initial skeleton center, and σ is the standard deviation of the Gaussian distribution; The pixels along the normal direction are subjected to a quadratic weighted average to obtain the final weld seam center extraction result; the calculation formula for the quadratic weighted average is: (18); In the formula: x c y c These are the row and column coordinates of each pixel in the skeleton normal direction. The value is the result of a weighted quadratic sum of the gray values corresponding to each pixel along the normal direction, where M is the set of pixels involved in the calculation along the normal direction. The coordinates of the sub-pixel center point of the formed weld seam light knife are obtained by weighting by quadratic square of grayscale.
2. The method for extracting the center of a forming weld seam using a light-knife based on line structured light vision according to claim 1, characterized in that, The method for thinning the skeleton of the binary image to obtain an initial skeleton center image that retains the original scalpel topology after thinning includes: Each pixel in the binary image is constructed into a 3x3 region by traversing its eight surrounding neighborhoods. Determine whether the constructed region corresponding to each pixel with a value of 1 in the binary image satisfies the first predetermined condition. If it does, delete the pixel to obtain the binary image data after one round of iteration. In the binary image data after one round of iteration, determine whether the construction region corresponding to each pixel with a value equal to 1 satisfies the second predetermined condition. If it does, delete the pixel to obtain the initial skeleton center of the formed weld seam polishing knife image.
3. The method for extracting the center of a forming weld seam using a light-knife based on line structured light vision according to claim 2, characterized in that, The first predetermined condition includes equations (1) to (4): (1); (2); (3); (4); in, ; In the formula: P1 is the target pixel, and the other eight pixels in the corresponding 3*3 area are P2~P9 respectively. Indicates , ,… This represents the number of times the sequence of 0 and 1 changes. .
4. The method for extracting the center of a forming weld seam using a light-knife based on line structured light vision according to claim 2, characterized in that, The second predetermined condition includes equations (5) to (8): (5); (6); (7); (8); In the formula: P1 is the target pixel, and the other eight pixels in the corresponding 3*3 area are P2~P9 respectively. Indicates , ,… This represents the number of times the sequence of 0 and 1 changes. .
5. The method for extracting the center of a forming weld seam using a light-knife based on line structured light vision according to claim 1, characterized in that, The method for determining the partial derivative of the initial skeleton center based on the second-order partial derivative includes: Based on the second-order partial derivative, the initial skeleton center partial derivative is determined using formula (10); , , (10); In the formula, h xx h xy h yx h yy Let F(x,y) be the partial derivative of the initial skeleton center, and F(x,y) be the initial skeleton center. Let x be the second-order partial derivative of the two-dimensional Gaussian function with respect to x and y.
6. The method for extracting the center of a forming weld seam using a light-knife based on line structured light vision according to any one of claims 1-5, characterized in that: Let F(x,y) be the initial skeleton center, then the formula for calculating its corresponding Hessian matrix is: (11); In the formula, h is a two-dimensional Gaussian function. xx h xy h yx h yy It is the partial derivative of the initial skeleton center.
7. A device for extracting the center of a forming weld seam using a light knife based on line structured light vision, characterized in that, include: The acquisition and preprocessing unit is used to acquire the shaped weld seam polishing knife image and preprocess the shaped weld seam polishing knife image using the OTSU method to obtain a binary image. The skeleton thinning unit is used to thin the skeleton of the binary image to obtain the initial skeleton center that retains the original light knife topology after thinning. The normal direction determination unit is used to determine the cross-sectional normal direction of the initial skeleton center using the Hessian matrix, including: determining the second-order partial derivative of the initial skeleton center; determining the partial derivative of the initial skeleton center based on the second-order partial derivative; solving the Hessian matrix based on the partial derivative of the initial skeleton center to obtain eigenvalues and their corresponding eigenvectors; among the eigenvalues, the eigenvector corresponding to the eigenvalue with the largest absolute value is the cross-sectional normal direction of the initial skeleton center. The method for determining the second-order partial derivative of the initial skeleton center includes: using formula (9) to determine the second-order partial derivative of the initial skeleton center; , , (9); In the formula, , , It is the second-order partial derivative of the two-dimensional Gaussian function with respect to the initial skeleton center, x and y are the coordinates of the pixel in the initial skeleton center, and σ is the standard deviation of the Gaussian distribution; The forming weld seam center extraction unit is used to perform a quadratic weighted average on the pixels in the normal direction to obtain the final forming weld seam center extraction result; the calculation formula for the quadratic weighted average is: (18); In the formula: x c y c These are the row and column coordinates of each pixel in the skeleton normal direction. The value is the result of a weighted quadratic sum of the gray values corresponding to each pixel along the normal direction, where M is the set of pixels involved in the calculation along the normal direction. The coordinates of the sub-pixel center point of the formed weld seam light knife are obtained by weighting by quadratic square of grayscale.
Citation Information
Patent Citations
Device and a method for detecting geometric parameters of steel bar weld joint
CN112037189A