A weld structure modeling method, system and welding device
By processing weld seam images using adaptive median filtering and grayscale centroid method, combined with curvature analysis and 3D reconstruction techniques, the problem of weld seam identification in complex environments is solved, achieving high-precision weld seam modeling and improved welding quality.
Patent Information
- Application Number
- CN202511341879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-19
AI Technical Summary
In existing technologies, welds are difficult to accurately identify and weld in complex environments, resulting in poor welding results.
Weld seam images are processed using adaptive median filtering and an improved gray-scale centroid method. Feature points are identified through curvature analysis to generate a three-dimensional point cloud model, and the welding current is dynamically adjusted based on this model.
It improves the accuracy of weld contour and welding quality, and increases welding efficiency.
Smart Images

Figure CN120823219B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of three-dimensional reconstruction of welds, and more particularly, the present application relates to a weld structure modeling method and system and a welding device. BACKGROUND
[0002] The existing Chinese patent with the authorization announcement number CN112958954B discloses a kind of weld tracking method and system, weld tracking method includes by at least two lasers issuing line laser scanning to be tracked weld;Image acquisition device is collected, and the image of the line laser scanning weld to be tracked of laser is obtained, and at least two scanning images are obtained;Determine one of the plurality of scanning images as target image based on preset laser straightness and actual welding groove angle value;Determine the coordinate value of the weld to be tracked based on target image;According to the coordinate value of the weld to be tracked, control the welding trolley with welding torch moves along the weld to be tracked;The present application scans weld by setting multiple lasers, and multiple lasers are redundantly arranged, solve the technical problem that welding trolley is difficult to accurately track weld when using one laser to scan weld in prior art, realize the technical effect that welding trolley can accurately track weld.
[0003] The existing technology still has the following problems:
[0004] In actual industrial scene, weld will exist in the environment difficult to shoot clearly, and weld shape and object surface are irregular, so that welding equipment is difficult to accurately weld weld, so that welding effect is affected.
[0005] In view of this, the present application provides a kind of weld structure modeling method, system and welding device to solve the above problems. SUMMARY
[0006] In order to overcome the above-mentioned defects of the prior art, in order to achieve the above-mentioned purpose, the present application provides the following technical scheme: a weld structure modeling method, comprising:
[0007] Adaptive median filtering is used to process the weld image obtained by the small line scanning technology to obtain a denoising weld image.
[0008] The denoising weld image is processed by improving the gray center method to obtain a sub-pixel level light stripe center line.
[0009] Feature points are identified on the sub-pixel level light stripe center line by curvature analysis technology, and the feature points are marked on the denoising weld image to obtain a feature weld image.
[0010] Based on the feature weld image, the sub-pixel level light stripe center line is converted into a three-dimensional point cloud to generate a weld surface model.
[0011] The welding current is dynamically adjusted based on the weld seam surface model.
[0012] Further, the feature points include edge points and inflection points.
[0013] The method for generating the weld seam surface model comprises:
[0014] Step E1, phase decoding is performed on the deformed fringe image of monocular structured light projection to obtain an absolute phase value.
[0015] Step E2, the sub-pixel coordinates of the light fringe center line are aligned with the absolute phase value, the depth of each point corresponding to the light fringe center line is calculated, and the three-dimensional point cloud coordinates of each point corresponding to the center line are obtained.
[0016] Step E3, the geometric continuity of the three-dimensional point cloud coordinates is optimized through non-uniform B-spline fitting: the method of non-uniform B-spline fitting comprises: in the inflection point and the inflection point adjacent feature point area, the points on the light fringe center line are spaced at a preset interval to obtain the point cloud coordinate sequence after fitting of the light fringe center line.
[0017] Step E4, the point cloud coordinate sequence is matched with the label corresponding to each coordinate, and input into a neural network model to output a signed distance function and build an implicit surface model; the label includes: non-feature point marked as 0, edge point marked as 1, and inflection point marked as 2; the neural network model is a multilayer perceptron.
[0018] Step E5, repeat step E4 until the root mean square error of the surface coordinates of the implicit surface model and the corresponding coordinates in the three-dimensional point cloud sequence is less than a preset root mean square error threshold, and the current implicit surface model is taken as the final output weld seam surface model.
[0019] Further, the method for obtaining the weld seam image specifically comprises:
[0020] Step A1, a narrow and high-contrast light fringe is projected onto the weld seam surface by a micro linear laser emitter;
[0021] Step A2, the exposure time is dynamically adjusted by an industrial camera;
[0022] Step A3, the micro laser emitter and the industrial camera are synchronously triggered by an encoder signal.
[0023] Further, the adaptive median filtering processing method comprises:
[0024] Step B1, a mixed noise model is established and a sliding window is defined;
[0025] Step B2, the median, mean and standard deviation of the pixel gray value in a single sliding window are calculated;
[0026] Step B3, performing a dynamic filtering decision on the weld image according to the median value of the pixel gray value, the mean value, the standard deviation and the mixed noise model, to obtain a filtered weld image;
[0027] Step B4, performing Sobel edge detection on the filtered weld image, marking the light stripe area in the weld image, to obtain a denoising weld image.
[0028] Further, the dynamic filtering decision process comprises:
[0029] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is greater than the first preset multiple of the standard deviation, the median value of the pixel gray value in the single sliding window is used to replace the gray value of the corresponding pixel;
[0030] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than or equal to the second preset multiple of the standard deviation, the median value of the pixel gray value in the single sliding window is used to replace the gray value of the corresponding pixel; the second preset multiple is less than the first preset multiple;
[0031] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than the first preset multiple of the standard deviation and greater than the second preset multiple of the standard deviation, the gray value of the corresponding pixel is maintained.
[0032] Further, the design method of the improved gray barycenter method comprises:
[0033] Step C1, performing gradient calculation on the pixels in the light stripe area of the denoising weld image to obtain a gradient direction; if the gradient direction deviates from the normal direction of the light stripe by more than a preset angle, the gradient direction is forced to be aligned with the normal direction;
[0034] Step C2, setting a search line segment along the gradient direction, calculating the brightness contrast of the local area of the pixel on the search line segment, and dynamically adjusting the weight of the pixel according to the brightness contrast; the local area is a TxT area around the pixel; the method of dynamically adjusting the weight of the pixel comprises: presetting M interval segments for the brightness contrast, each interval segment corresponding to a weight; when the brightness contrast of the local area of the pixel is within one of the interval segments, the corresponding weight is assigned to the corresponding pixel; T and M are both positive integers greater than 1;
[0035] Step C3, obtaining the gray value of the pixel on the search line segment, adding the weight corresponding to the pixel to the gray value of the pixel, and calculating the weighted barycenter position parameter of the pixel;
[0036] Step C4, constructing a discrete gray distribution curve with the gray value of the pixel as the vertical axis and the one-dimensional parameter corresponding to the pixel position as the horizontal axis; generating a continuous gray distribution curve through an interpolation algorithm; calculating the centroid position of the continuous gray distribution curve, i.e. the one-dimensional parameter at the sub-pixel level, through an integral formula; the interpolation method includes cubic spline interpolation, Gaussian fitting and polynomial interpolation;
[0037] Step C5, resetting the search line segment in the normal direction based on the current centroid position, repeating steps C2-C4 until the position change of the centroid position meets the convergence condition, and obtaining the sub-pixel level light stripe centerline.
[0038] Further, the feature weld image acquisition method comprises:
[0039] Step D1, sampling the sub-pixel level light stripe centerline into a discrete point sequence at a preset interval, and establishing a parameter equation of the centerline with the arc length as the parameter;
[0040] Step D2, for each point in the discrete point sequence, selecting k neighborhood points corresponding to the point, and fitting a local quadratic curve through the least square method;
[0041] Step D3, calculating the curvature corresponding to each point in the local quadratic curve through the curvature formula;
[0042] Step D4, presetting a curvature threshold and a curvature change rate threshold, marking the points with a curvature greater than or equal to the curvature threshold as edge points, and marking the points with a curvature change rate greater than or equal to the curvature change rate threshold as edge points; marking the points with a change in curvature sign and an extreme value of the absolute value of the curvature as inflection points;
[0043] Step D5, extracting redundancies of the edge points and the inflection points, and merging adjacent feature points into one feature point if the distance between the adjacent feature points is less than a preset distance value;
[0044] Step D6, superimposing the marked feature points on the denoised weld image to generate a feature weld image.
[0045] Further, the method for dynamically adjusting the welding current comprises:
[0046] Step F1, selecting a reference current during welding from a process library according to the material type of the welding surface;
[0047] Step F2, performing depth compensation on the reference current to obtain a dynamic current curve; the depth compensation method comprises: dividing the difference between the depth of a point on the weld surface model corresponding to the welding point and a preset reference depth by the preset reference depth, and amplifying the reference current by a preset proportion;
[0048] Step F3, controlling the welding current of the welding torch according to the dynamic current curve when the welding torch is welding along the weld.
[0049] Further, the method for dynamically adjusting the exposure time comprises:
[0050] calculating the brightness distribution of each frame of the weld image in real time, if the high light area proportion of the brightness distribution is greater than or equal to a first preset proportion, then the exposure time of the adjacent next frame is shortened by a preset amplitude, if the high light area proportion is less than a second preset proportion, then the exposure time of the adjacent next frame is extended by a preset amplitude, if the high light area proportion is less than the first preset proportion and greater than or equal to the second preset proportion, then the exposure time corresponding to the last frame of the weld image is maintained, the first preset proportion is greater than the second preset proportion, the high light area proportion is obtained by calculating the ratio of the number of high light pixels to the image resolution, and the number of high light pixels is the number of pixels with a brightness level greater than a preset brightness level.
[0051] A weld structure modeling system implements the weld structure modeling method, comprising:
[0052] A first processing module adopts adaptive median filtering to process the weld image obtained by the small line scanning technology to obtain a denoising weld image.
[0053] A second processing module processes the denoising weld image by improving the gray center method to obtain a sub-pixel level light stripe center line.
[0054] A third processing module identifies feature points of the sub-pixel level light stripe center line through curvature analysis technology, and superimposes the feature points on the denoising weld image to obtain a feature weld image.
[0055] A three-dimensional reconstruction module converts the sub-pixel level light stripe center line into a three-dimensional point cloud based on the feature weld image to generate a weld surface model.
[0056] A welding adjustment module dynamically adjusts the welding current based on the weld surface model.
[0057] The present application also includes a welding device comprising a memory, a processor, and a computer program stored in the memory and running in the processor, when the processor executes the computer program, the above-mentioned weld structure modeling method is realized.
[0058] The technical effects and advantages of the weld structure modeling method, system and welding device of the present application are:
[0059] The present application greatly improves the accuracy of the weld contour by obtaining the weld image based on the small line scanning technology and performing threefold processing on the weld image and then performing three-dimensional contour reconstruction of the weld, and finally realizes dynamic current control welding equipment according to the weld contour, effectively improving the quality and efficiency of welding.
[0060] Firstly, by small line scanning technology and HDR imaging, the exposure time is dynamically adjusted to ensure that clear weld images are obtained under complex lighting conditions, providing a good foundation for subsequent processing. Then, by using an adaptive median filtering method, salt and pepper noise and Gaussian noise in the weld image are effectively removed, improving the image quality while preserving the details, providing clear image support for subsequent processing. Secondly, by improving the gray gravity center method combined with dynamic weight adjustment, sub-pixel level light stripe center line extraction is realized, greatly improving the three-dimensional reconstruction accuracy. Next, by using curvature analysis technology, the weld edge points and inflection points are accurately identified to obtain feature weld images, reduce redundancy, and provide structured data. Subsequently, based on the feature weld image, high-precision weld surface models are generated by phase decoding and non-uniform B-spline fitting, converting the sub-pixel level light stripe center line into three-dimensional point cloud, adapting to the complex shape of the welding surface, and providing accurate geometric data. Finally, based on the weld surface model, the welding current is dynamically adjusted to optimize the welding process and effectively improve the welding effect. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 It is a weld structure modeling system schematic diagram of embodiment 1 of the present application.
[0062] Figure 2 It is a weld structure modeling method flow chart of embodiment 2 of the present application.
[0063] Figure 3 It is a scene schematic diagram of obtaining weld images of embodiment 1 of the present application.
[0064] Figure 4 It is a design method flow chart of the improved gray gravity center method of embodiment 1 of the present application. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0066] Embodiment 1
[0067] Please refer to Figure 1 The weld structure modeling system described in this embodiment includes a first processing module, a second processing module, a third processing module, a three-dimensional reconstruction module and a welding adjustment module, and each module is connected by wired and / or wireless connection.
[0068] The first processing module adopts adaptive median filtering to process the weld seam image obtained by the small line scanning technology, remove noise, and obtain a denoised weld seam image. The weld seam image includes a weld seam and a high-contrast light stripe.
[0069] It should be noted that the small line scanning technology is a technology for obtaining a three-dimensional profile of an object by projecting a line laser onto the surface of the object and capturing a light stripe by an industrial camera. Specifically, a micro line laser emitter projects a high-contrast light stripe, and the light stripe is deformed due to irregularities on the surface of the object. After the industrial camera captures the deformed light stripe, a three-dimensional profile of the object can be obtained through image processing and three-dimensional reconstruction algorithms.
[0070] Referring to Figure 3 The method for obtaining the weld seam image specifically includes the following steps.
[0071] Step A1: Projecting a narrow high-contrast light stripe onto the surface of the weld seam by a micro line laser emitter.
[0072] It should be noted that the micro line laser emitter is projected at a preset inclination angle to ensure that the light stripe completely covers the width of the weld seam. At the same time, the wavelength of the laser is selected as 650 nm red light, which has strong anti-interference ability in an industrial environment.
[0073] Step A2: Adjusting the exposure time dynamically by an industrial camera, such as a Basler ace 2 camera, to ensure clear imaging in both strong light (spatter during welding) and weak light areas.
[0074] The method for dynamically adjusting the exposure time includes the following steps.
[0075] For each frame of weld seam image, the brightness distribution is calculated in real time. If the high light area ratio is greater than or equal to a first preset ratio, the exposure time of the adjacent next frame is shortened by a preset amplitude. If the high light area ratio is less than a second preset ratio, the exposure time of the adjacent next frame is extended by a preset amplitude. If the high light area ratio is less than the first preset ratio and greater than or equal to the second preset ratio, the exposure time corresponding to the last frame of weld seam image is maintained. The first preset ratio is greater than the second preset ratio.
[0076] The method for calculating the high light area ratio includes the following steps.
[0077] ;
[0078] Wherein, is the high light area ratio; is the number of high light pixels; is the image resolution (such as 1280x1024); the number of high light pixels is the number of pixels with a brightness level greater than a preset brightness level.
[0079] It should be noted that the brightness value refers to the brightness level of each pixel in the color image, which is also from 0 to 255, but the brightness value of the color image not only includes the gray value, but also includes the color information.
[0080] The preset brightness level is a brightness threshold for determining the highlight area in the image, and the value of the preset brightness level is set according to the brightness distribution characteristics of the actual welding image and the recognition requirement of the highlight area. Generally, by analyzing the brightness histogram of a large number of sample images, the distribution range of the background brightness, the normal brightness and the highlight area brightness is determined, so as to set a distinguishing brightness threshold as the determination standard of the highlight pixel.
[0081] For example, for an 8-bit gray image, the pixel gray value range is 0-255, and it is found through statistics that the normal weld area gray value is concentrated in the [30, 180] interval, and the highlight area is mainly concentrated in the interval with a brightness greater than 220, so the preset brightness level can be set to 220, that is, when the pixel brightness value is greater than 220, it is considered that the pixel belongs to the highlight area.
[0082] Step A3, trigger the micro laser emitter and the industrial camera through the encoder signal synchronization, ensure that a frame of image is collected every time the preset distance is moved, and avoid image blur caused by equipment movement.
[0083] Through the small line scanning technology and the HDR imaging technology, the weld image and the high-contrast light stripe are obtained, which provides a high-quality data basis for subsequent image processing, three-dimensional reconstruction and path planning. The acquisition of the high-contrast light stripe is the key because it can enhance the visibility of the light stripe, reduce noise interference, improve measurement accuracy, and adapt to complex welding environments. Through dynamic scanning and synchronous triggering, the real-time and accuracy of the data are ensured, which lays a foundation for the successful implementation of the whole technical scheme.
[0084] The adaptive median filtering processing method comprises:
[0085] Step B1, establish a mixed noise model and define a sliding window; the mixed noise model comprises salt and pepper noise and Gaussian noise.
[0086] It should be noted that the noise in the welding scene is mainly divided into salt and pepper noise and Gaussian noise; the salt and pepper noise is the splashing particles; and the Gaussian noise is the environmental interference.
[0087] Step B2, calculate the median, mean and standard deviation of the pixel gray value in a single sliding window.
[0088] Step B3, perform a dynamic filtering decision on the weld image according to the median, mean and standard deviation of the pixel gray value and the mixed noise model, and obtain a filtered weld image; the dynamic filtering decision process comprises.
[0089] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is greater than the first preset multiple of the standard deviation, the corresponding pixel is identified as salt and pepper noise by the system, and the gray value of the corresponding pixel is replaced by the median value of the pixel gray values in the single sliding window.
[0090] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than or equal to the second preset multiple of the standard deviation, the corresponding pixel is identified as Gaussian noise by the system, and the gray value of the corresponding pixel is replaced by the median value of the pixel gray values in the single sliding window; the second preset multiple is less than the first preset multiple.
[0091] If the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than the first preset multiple of the standard deviation and greater than the second preset multiple of the standard deviation, the gray value of the corresponding pixel is maintained.
[0092] Step B4, performing Sobel edge detection on the filtered weld image to mark the light stripe area in the weld image and obtain a denoising weld image.
[0093] It should be noted that the Sobel edge detection is used to identify the intensity mutation area (i.e. edge) between the light stripe and the background in the weld image; by locating the light stripe contour, the boundary of the light stripe is accurately found, providing clear geometric information for subsequent center line extraction and three-dimensional reconstruction.
[0094] The second processing module processes the denoising weld image by improving the gray gravity center method to obtain a sub-pixel level light stripe center line.
[0095] Referring to Figure 4 As shown in the figure, the design method of the improved gray gravity center method includes:
[0096] Step C1, performing gradient calculation on the pixels in the light stripe area of the denoising weld image to obtain a gradient direction; if the gradient direction deviates from the normal direction of the light stripe by more than a preset angle, the gradient direction is forced to be aligned with the normal direction to ensure the correctness of the search direction and avoid direction deviation caused by noise interference.
[0097] It should be noted that the gradient direction reflects the direction of the fastest brightness change in the image, which usually points to the edge of the light stripe; in an ideal case, the gradient direction of the light stripe should be consistent with its normal direction.
[0098] Step C2, set a search line segment in the gradient direction, on the search line segment, calculate the brightness contrast of the local region of the pixel, and dynamically adjust the weight of the pixel according to the brightness contrast; the local region is a T×T region around the pixel; the method for dynamically adjusting the weight of the pixel comprises: presetting M interval segments for the brightness contrast, each interval segment corresponds to a weight; when the brightness contrast of the local region of the pixel is in one of the interval segments, the corresponding weight is assigned to the corresponding pixel; T and M are both positive integers greater than 1.
[0099] It should be noted that the length of the search line segment is a preset value, and the width is the width of the light stripe.
[0100] It should be noted that the higher the brightness contrast of the local region, the more obvious the light stripe feature of the local region, and the smaller the noise interference; the lower the brightness contrast, the greater the noise interference of the local region.
[0101] By dynamically adjusting the adaptive weight through the local contrast, the interference of the low signal-to-noise ratio region is effectively suppressed.
[0102] Step C3, obtain the gray value of the pixel on the search line segment, add the weight corresponding to the pixel to the gray value of the pixel, and calculate the weighted barycenter position parameter of the pixel; the calculation method of the weighted barycenter position comprises:
[0103] ;
[0104] In the formula, is a one-dimensional parameter corresponding to the weighted barycenter position parameter of the pixel; is a one-dimensional parameter corresponding to the coordinate of the i th pixel; The one-dimensional parameter of the weighted barycenter position parameter is obtained by coordinate mapping conversion of the two-dimensional coordinates of the pixel point; is the total number of pixels on the search line segment; is the count identifier of the total number of pixels; is the weight of the corresponding pixel in the bracket; is the gray value of the corresponding pixel in the bracket.
[0105] By converting the two-dimensional coordinates into one-dimensional parameters, the two-dimensional problem is simplified, redundant calculation is avoided, and the calculation efficiency of the system is greatly improved.
[0106] Step C4, construct a discrete gray distribution curve with the gray value of the pixel as the vertical axis and the one-dimensional parameter corresponding to the pixel position as the horizontal axis; generate a continuous gray distribution curve through an interpolation algorithm, and calculate the centroid position (i.e. the first moment of the gray distribution) of the continuous gray distribution curve through an integral formula, which is a one-dimensional parameter at the sub-pixel level; the interpolation method comprises cubic spline interpolation, Gaussian fitting and polynomial interpolation.
[0107] It should be noted that the discrete gray distribution curve cannot directly obtain the sub-pixel level centroid position, and the interpolation algorithm converts the discrete data into a continuous curve by fitting a continuous function, so that the centroid calculation result is more accurate.
[0108] Step C5, based on the current centroid position, re-set the search line segment in the normal direction, repeat steps C2-C4 until the position change of the centroid position meets the convergence condition, and obtain the sub-pixel level light stripe center line.
[0109] The third processing module identifies feature points on the sub-pixel level light stripe center line through curvature analysis technology, and superimposes the feature points on the denoised weld image to obtain a feature weld image; the feature points include edge points and inflection points.
[0110] Through curvature analysis technology, the edge points and inflection points of the weld are extracted from the sub-pixel level light stripe center line, and the key geometric features are marked to provide structured data for subsequent three-dimensional reconstruction and path planning.
[0111] The feature weld image acquisition method comprises:
[0112] Step D1, sampling the sub-pixel level light stripe center line (continuous curve) into a discrete point sequence at a predetermined interval (such as 0.1 pixels), and establishing a parameter equation of the center line with arc length as the parameter.
[0113] Step D2, for each point in the discrete point sequence, select k neighborhood points corresponding to the point, and fit a local quadratic curve through the least square method to approximately describe the curve shape between the current field points.
[0114] Step D3, calculate the curvature corresponding to each point in the local quadratic curve through the curvature formula.
[0115] Step D4, preset the curvature threshold and the curvature change rate threshold, mark the points with curvature greater than or equal to the curvature threshold as edge points, and mark the points with curvature change rate greater than or equal to the curvature change rate threshold as edge points; mark the points with sign change and extreme value of absolute value of curvature as inflection points.
[0116] Step D5, redundant extraction of edge points and inflection points, if the distance between adjacent feature points is less than a predetermined distance value, merge them into one feature point.
[0117] Step D6, superimpose the feature points on the denoised weld image to generate a feature weld image with geometric information.
[0118] The three-dimensional reconstruction module converts the sub-pixel level light stripe center line into a three-dimensional point cloud based on the feature weld image, and optimizes to generate a high-precision, low-complexity weld surface model, providing three-dimensional geometric data for welding path planning.
[0119] The method for generating the weld seam surface model comprises:
[0120] Step E1, phase decoding is performed on the deformed fringe image of monocular structured light projection to obtain an absolute phase value.
[0121] It should be noted that the absolute phase value of each pixel in the feature weld seam image uniquely corresponds to the actual height of the object surface.
[0122] Step E2, the sub-pixel coordinates of the light fringe center line are aligned with the absolute phase value, the depth of each point corresponding to the light fringe center line is calculated, and the three-dimensional point cloud coordinates of each point corresponding to the center line are obtained; the horizontal coordinate in the three-dimensional point cloud coordinates is the horizontal coordinate of the sub-pixel coordinates of the corresponding point; the vertical coordinate in the three-dimensional point cloud coordinates is the vertical coordinate of the sub-pixel coordinates of the corresponding point; and the vertical coordinate in the three-dimensional point cloud coordinates is the depth of the corresponding point.
[0123] Step E3, the geometric continuity of the three-dimensional point cloud coordinates is optimized by non-uniform B-spline fitting to avoid the occurrence of cracks or noise in the reconstructed surface: the method for non-uniform B-spline fitting comprises: in a high-curvature area (a corner point and a corner point adjacent feature point), the points on the light fringe center line are spaced at a preset interval to obtain a point cloud coordinate sequence after fitting of the light fringe center line; and the sampling density of the points on the light fringe center line in the high-curvature area is increased to effectively improve the detail restoration capability.
[0124] Step E4, the point cloud coordinate sequence is matched with a label corresponding to each coordinate, input into a neural network model, and an signed distance function (SDF) is output to build an implicit surface model, which effectively adapts to the complex geometry of the weld seam (such as an arc-shaped groove and a cross-weld seam); the label comprises: a non-feature point marked as 0, an edge point marked as 1, and a corner point marked as 2; and the neural network model is a multi-layer perceptron.
[0125] Step E5, step E4 is repeated until the root mean square error between the surface coordinates of the implicit surface model and the corresponding coordinates in the three-dimensional point cloud sequence is less than a preset root mean square error threshold, and the current implicit surface model is taken as the final output weld seam surface model.
[0126] The welding adjustment module dynamically adjusts the welding current based on the weld seam surface model.
[0127] The method for dynamically adjusting the welding current comprises:
[0128] Step F1, according to the material type of the welding surface, a reference current during welding is selected from a process library.
[0129] Step F2, the reference current is depth-compensated to obtain a dynamic current curve; and the method for obtaining the dynamic current curve comprises:
[0130] ;
[0131] In the formula, is a dynamic current; is a reference current; is a preset proportion factor; is the depth of the point on the weld seam surface model corresponding to the welding spot; is a preset reference depth.
[0132] It should be noted that, The value of is set by experts in the field according to the welding process requirements, material types (such as carbon steel, stainless steel, aluminum alloy, etc.), and the desired welding depth control accuracy. When The value is larger, indicating that the dynamic current is more sensitive to changes in welding depth, which is suitable for fine welding scenarios with high requirements for welding depth control accuracy; when The value is smaller, the dynamic current adjustment tends to be flat, which is suitable for situations where the welding depth does not change dramatically or where the welding stability is required.
[0133] Step F3, when the welding torch is welded along the weld, the welding current of the welding torch is controlled according to the dynamic current curve.
[0134] The present application also includes a welding device comprising a memory, a processor, and a computer program stored in the memory and running in the processor, wherein the processor executes the computer program to implement the above-mentioned welding seam structure modeling method.
[0135] Example 2
[0136] Please refer to Figure 2 The present embodiment provides a welding seam structure modeling method, which comprises:
[0137] Obtain a weld image through a small line scanning technology;
[0138] Adopt adaptive median filtering to process the weld image and obtain a denoised weld image;
[0139] Improve the gray center of gravity method to process the denoised weld image and obtain a sub-pixel level light stripe center line;
[0140] Through curvature analysis technology, feature point recognition is performed on the sub-pixel level light stripe center line, and the feature points are marked on the denoised weld image to obtain a feature weld image;
[0141] Based on the feature weld image, the sub-pixel level light stripe center line is converted into a three-dimensional point cloud to generate a weld seam surface model;
[0142] Based on the weld seam surface model, the welding current is dynamically adjusted.
[0143] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent replacements; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method of modeling a weld structure, characterized by, The application relates to a welding seam image processing method and device. The welding seam image obtained by the small line scanning technology is processed by using adaptive median filtering to obtain a denoising welding seam image; The denoising welding seam image is processed by improving the gray gravity center method to obtain a sub-pixel level light stripe center line; The sub-pixel level light stripe center line is subjected to feature point recognition by using the curvature analysis technology, and the feature points are marked on the denoising welding seam image to obtain a feature welding seam image; the feature points include edge points and inflection points; The sub-pixel level light stripe center line is converted into a three-dimensional point cloud based on the feature welding seam image to generate a welding seam surface model; The welding seam surface model is generated by the following method: Step E1: phase decoding is performed on the deformed stripe image projected by the monocular structured light to obtain an absolute phase value; Step E2: the sub-pixel coordinates of the light stripe center line are aligned with the absolute phase value, the depth of each point corresponding to the light stripe center line is calculated, and the three-dimensional point cloud coordinates of each point corresponding to the center line are obtained; Step E3: the geometric continuity of the three-dimensional point cloud coordinates is optimized by using non-uniform B-spline fitting; the non-uniform B-spline fitting method comprises the following steps: in the inflection point and the feature point region adjacent to the inflection point, the points on the light stripe center line are subjected to distance reduction at a preset interval to obtain a point cloud coordinate sequence of the light stripe center line after fitting; Step E4: the point cloud coordinate sequence is matched with the labels corresponding to each coordinate, and is input into a neural network model to output a signed distance function, thereby building an implicit surface model; the labels include: 0 for non-feature points, 1 for edge points, and 2 for inflection points; the neural network model is a multilayer perceptron; Step E5: step E4 is repeated until the root mean square error between the surface coordinates of the implicit surface model and the corresponding coordinates in the three-dimensional point cloud sequence is less than a preset root mean square error threshold, and the current implicit surface model is taken as the final output welding seam surface model; Based on the welding seam surface model, the welding current is dynamically adjusted; the method for dynamically adjusting the welding current comprises the following steps: Step F1: according to the material type of the welding surface, a reference current during welding is selected from a process library; Step F2: the reference current is subjected to depth compensation to obtain a dynamic current curve; the depth compensation method comprises the following steps: the difference between the depth of the point on the welding seam surface model corresponding to the welding point and a preset reference depth is divided by the preset reference depth, and the reference current is amplified at a preset proportion; Step F3: when the welding torch is welded along the welding seam, the welding current of the welding torch is controlled according to the dynamic current curve.
2. The method of modeling a weld structure of claim 1, wherein, The welding seam image acquisition method specifically comprises the following steps: Step A1: a narrow and high-contrast light stripe is projected onto the welding seam surface by using a micro laser emitter; Step A2: the exposure time is dynamically adjusted by using an industrial camera; Step A3: the micro laser emitter and the industrial camera are synchronously triggered by using an encoder signal.
3. The method of modeling a weld structure of claim 1, wherein, The adaptive median filtering processing method comprises the following steps: Step B1: a mixed noise model is established and a sliding window is defined; Step B2: the median value, the mean value and the standard deviation of the pixel gray value in a single sliding window are calculated; Step B3: a dynamic filtering decision is made on the welding seam image according to the median value, the mean value, the standard deviation of the pixel gray value and the mixed noise model to obtain a filtered welding seam image; Step B4, performing Sobel edge detection on the filtered weld image, marking the light stripe area in the weld image, and obtaining a denoised weld image.
4. The method of modeling a weld structure of claim 3, wherein, The dynamic filtering decision process comprises: if the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is greater than the first preset multiple of the standard deviation, the median value of the pixel gray value in the single sliding window is used to replace the gray value of the corresponding pixel; if the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than or equal to the second preset multiple of the standard deviation, the median value of the pixel gray value in the single sliding window is used to replace the gray value of the corresponding pixel; the second preset multiple is less than the first preset multiple; if the absolute value of the difference between the gray value corresponding to the pixel in the current window and the median value is less than the first preset multiple of the standard deviation and greater than the second preset multiple of the standard deviation, the gray value of the corresponding pixel is maintained.
5. The method of modeling a weld structure of claim 1, wherein, The design method of the improved gray barycenter method comprises: Step C1, performing gradient calculation on the pixels in the light stripe area of the denoised weld image to obtain a gradient direction; if the gradient direction deviates from the normal direction of the light stripe by more than a preset angle, the gradient direction is forced to be aligned with the normal direction; Step C2, setting a search line segment along the gradient direction, calculating the brightness contrast of the local area of the pixel on the search line segment, and dynamically adjusting the weight of the pixel according to the brightness contrast; the local area is a T×T area around the pixel; the method of dynamically adjusting the weight of the pixel comprises: presetting M interval segments for the brightness contrast, each interval segment corresponding to a weight; when the brightness contrast of the local area of the pixel is within one of the interval segments, the corresponding weight is assigned to the corresponding pixel; T and M are both positive integers greater than 1; Step C3, obtaining the gray value of the pixel on the search line segment, adding the weight corresponding to the pixel to the gray value of the pixel, and calculating the weighted barycenter position parameter of the pixel; Step C4, constructing a discrete gray distribution curve with the gray value of the pixel as the vertical axis and the one-dimensional parameter corresponding to the position of the pixel as the horizontal axis; generating a continuous gray distribution curve through an interpolation algorithm, and calculating the centroid position of the continuous gray distribution curve through an integral formula, i.e. a one-dimensional parameter at the sub-pixel level; the interpolation method comprises cubic spline interpolation, Gaussian fitting and polynomial interpolation; Step C5, setting a search line segment along the normal direction again based on the current centroid position, repeating steps C2-C4 until the position change of the centroid position meets the convergence condition, and obtaining the sub-pixel level light stripe center line.
6. The method of modeling a weld structure of claim 1, wherein, The feature weld image acquisition method comprises: Step D1, sampling the sub-pixel level light stripe center line into a discrete point sequence at a preset interval, and establishing a parameter equation of the center line with arc length as the parameter; Step D2, for each point in the discrete point sequence, selecting k neighborhood points corresponding to the point, and fitting a local quadratic curve through a least squares method; Step D3, calculating the curvature corresponding to each point in the local quadratic curve through a curvature formula; Step D4, presetting a curvature threshold and a curvature change rate threshold, marking a point as an edge point if the curvature of the point is greater than or equal to the curvature threshold, and marking a point as an edge point if the curvature change rate of the point is greater than or equal to the curvature change rate threshold; marking a point as an inflection point if the curvature sign of the point changes and the absolute value of the curvature of the point is an extreme value; Step D5, performing redundancy extraction on the edge points and the inflection points, and merging adjacent feature points into one feature point if the distance between the adjacent feature points is less than a preset distance value; Step D6, superimposing the marked feature points on the denoised weld image to generate a feature weld image.
7. The method of modeling a weld structure of claim 2, wherein, The method for dynamically adjusting the exposure time comprises: calculating the brightness distribution of each frame of weld image in real time, shortening the exposure time of the adjacent next frame by a preset amplitude if the high light area proportion of the brightness distribution is greater than or equal to a first preset proportion, lengthening the exposure time of the adjacent next frame by a preset amplitude if the high light area proportion is less than a second preset proportion, maintaining the exposure time corresponding to the last frame of weld image if the high light area proportion is less than the first preset proportion and greater than or equal to the second preset proportion, the first preset proportion being greater than the second preset proportion, the high light area proportion being obtained by calculating the ratio of the number of high light pixels to the image resolution, the number of high light pixels being the number of pixels with a brightness level greater than a preset brightness level.
8. A weld structure modeling system implementing the weld structure modeling method of any one of claims 1-7, characterized by, comprises: a first processing module, which adopts adaptive median filtering to process the weld image obtained by the small line scanning technology to obtain a denoised weld image; a second processing module, which processes the denoised weld image by improving the gray gravity center method to obtain a sub-pixel level light stripe center line; a third processing module, which identifies feature points of the sub-pixel level light stripe center line by curvature analysis technology, superimposes the marked feature points on the denoised weld image, and obtains a feature weld image; a three-dimensional reconstruction module, which converts the sub-pixel level light stripe center line into a three-dimensional point cloud based on the feature weld image to generate a weld surface model; a welding adjustment module, which dynamically adjusts the welding current based on the weld surface model.
9. A welding device comprising a memory, a processor, and a computer program stored in the memory and running in the processor, characterized in that: The processor executes the computer program to implement the weld structure modeling method according to any one of claims 1-7. The processor executes the computer program to implement the weld structure modeling method according to any one of claims 1-7.
Citation Information
Patent Citations
A weld seam tracking method and system
CN112958954B
Weld three-dimensional reconstruction method based on two-dimensional linear structured light
CN106971407A
Rotary scanning welding seam three-dimensional reconstruction method based on line structured light visual inspection
CN118135113A
Feedback control method for laser welding
CN119828584A