Spot welding curve image data extraction method and device, storage medium and computer equipment

By identifying and extracting the target curve from the spot welding curve image, the problem of being unable to export the original data in the existing technology is solved, achieving high-precision data extraction and supporting welding quality assessment and process optimization.

CN122049072APending Publication Date: 2026-05-15ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG GEELY HLDG GRP CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the closed architecture of industry-specific software makes it impossible to directly export the raw data of the spot welding process, and thus impossible to perform accurate data analysis and modeling, affecting welding quality assessment and process optimization.

Method used

By acquiring spot welding curve images, identifying target curves based on preset colors, performing connected component analysis and merging, extracting the center line, and extracting data to data coordinates based on the mapping relationship between image coordinates and data coordinates, high-precision and lossless digital reverse data extraction is achieved.

Benefits of technology

It achieves high-precision non-destructive extraction from spot weld curve images to data, providing basic data for the digital and intelligent transformation of welding processes, and supporting welding quality assessment and process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049072A_ABST
    Figure CN122049072A_ABST
Patent Text Reader

Abstract

The invention relates to a data extraction method and device for a spot welding curve image, a storage medium and computer equipment. The method comprises the steps that a target curve is recognized from the spot welding curve image based on a preset color; performing connected domain analysis on the target curve, and sorting one or more connected domains of the target curve according to the area of the connected domains from large to small; when the target curve is the curve containing the preheating section, N connected domains ranked in the front are selected to be combined, a combined image is obtained, N is a positive integer larger than or equal to 2, and N is determined based on the preheating time and the welding time of spot welding; extracting a center line of the target curve from the combined image; and based on a mapping relationship between the image coordinates of the merged image and configured data coordinates, mapping each coordinate point of the center line to the data coordinates, so as to extract data of the center line of the target curve based on the data coordinates. According to the method, the spot welding curve image can be subjected to data extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of spot welding technology, and in particular to a method, apparatus, storage medium, and computer equipment for extracting data from spot welding curve images. Background Technology

[0002] In industries such as automobile manufacturing, rail transportation, and home appliances that rely on resistance spot welding, welding quality is highly dependent on the real-time monitoring and analysis of key parameters such as process current and dynamic resistance. The curves of these parameters directly reflect the physical state during the welding process, such as changes in contact resistance, weld nugget formation, and spatter occurrence. The physical state during the welding process is an important basis for evaluating welding quality, optimizing process parameters, and diagnosing faults. Real-time monitoring and data analysis of dynamic process parameters are the core means to ensure welding quality, achieve process optimization, and diagnose faults.

[0003] However, since industry-specific software generally adopts a closed architecture, it usually only supports displaying spot welding curve images on the local interface and does not open the export interface for the original process data. As a result, after completing the welding of the test piece, although technicians can judge the general state by observing the curve shape with their eyes, they cannot directly export the original process data of the spot welding process and cannot obtain accurate data for subsequent modeling, analysis or knowledge accumulation. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, storage medium, and computer equipment for data extraction of spot welding curve images to address the above-mentioned technical problems. This method can obtain spot welding curve images from screenshots of software interfaces without relying on the original software interface. Data extraction can be performed on the spot welding curve images to achieve high-precision, non-destructive digital reverse data extraction of complex resistance spot welding curves and other curves, providing basic data for the digital and intelligent transformation of welding processes in the test piece verification stage.

[0005] A method for extracting data from a spot welding curve image includes: acquiring a spot welding curve image and identifying a target curve from the image based on a preset color; performing connected component analysis on the target curve and sorting one or more connected components of the target curve according to their area from largest to smallest; when the target curve contains a preheating section, selecting the top N connected components for merging to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time; extracting the centerline of the target curve from the merged image; and mapping each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the data of the centerline of the target curve based on the data coordinates.

[0006] Preferably, a method for extracting data from a spot welding curve image further includes: when the target curve is a curve that does not contain a preheating section, selecting the connected region with the largest area as the merged image.

[0007] Preferably, the top N connected components are selected and merged to obtain a merged image, including: based on Connected component merging is performed to obtain the merged image; where, Indicates merging images. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

[0008] Preferably, extracting the centerline of the target curve from the merged image includes: according to Extract the centerline of the target curve; where, Indicates the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

[0009] Preferably, a data extraction method for a spot welding curve image further includes: obtaining the X-axis and Y-axis coordinates of the maximum value and the minimum value of the center line in the image coordinates; obtaining the length of the center line on the X-axis, and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; determining the X-axis mapping relationship based on the length of the center line on the X-axis and the X-axis coordinates of the maximum and minimum values ​​in the image coordinates; and determining the Y-axis mapping relationship based on the maximum and minimum values ​​on the Y-axis, the Y-axis coordinates of the maximum and minimum values ​​in the image coordinates.

[0010] Preferably, determining the X-axis mapping relationship based on the length of the centerline on the X-axis of the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates includes: according to Determine the X-axis mapping relationship in the mapping relationship; where, This represents the X-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinates representing the minimum value of the centerline in the image coordinate system. The X-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

[0011] Preferably, determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis in the spot welding curve image, the Y-axis coordinate of the maximum value, and the Y-axis coordinate of the minimum value in the image coordinate system includes: according to Determine the Y-axis mapping relationship in the mapping relationship; where, This represents the Y-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinates representing the minimum value of the centerline in the image coordinate system. The Y-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

[0012] Preferably, a method for extracting data from a spot welding curve image further includes: performing one or more of the following processes on multiple coordinate points of the center line in the data coordinate system: removing duplicate coordinates, filtering outliers, and data interpolation, and then outputting the data of each coordinate point of the center line.

[0013] A data extraction device for spot welding curve images includes: an identification module for acquiring spot welding curve images and identifying a target curve from the spot welding curve images based on preset colors; a sorting module for performing connected component analysis on the target curve and sorting one or more connected components of the target curve according to the area of ​​the connected components from largest to smallest; a merging module for merging the top N connected components when the target curve contains a preheating section to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the welding time of the spot welding; an extraction module for extracting the centerline of the target curve from the merged image; and a mapping module for mapping each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the data of the centerline of the target curve based on the data coordinates.

[0014] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the steps of any of the methods described above.

[0015] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.

[0016] The aforementioned method, apparatus, storage medium, and computer equipment for extracting data from spot welding curve images include: acquiring a spot welding curve image and identifying a target curve from the spot welding curve image based on a preset color; performing connected component analysis on the target curve and sorting one or more connected components of the target curve according to their area from largest to smallest; when the target curve contains a preheating section, selecting the top N connected components for merging to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time; extracting the centerline of the target curve from the merged image; and mapping each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the data of the centerline of the target curve based on the data coordinates.

[0017] Therefore, without relying on the original software interface, by obtaining the spot welding curve image from the software interface screenshot and extracting data from the spot welding curve image, high-precision and non-destructive digital reverse data extraction can be performed on complex resistance spot welding curves and other curves, providing basic data for the digital and intelligent transformation of welding processes in the test piece verification stage. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a method for extracting data from a spot weld curve image in one embodiment. Figure 2 This is a schematic diagram of a spot welding curve image in one embodiment; Figure 3 This is an example diagram of the centerline of a standard curve that does not include a preheating section in one embodiment; Figure 4 This is an example diagram of the centerline of a curve that includes a preheating section in one embodiment; Figure 5 This is an example diagram of the centerline of a normal curve that does not include a preheating section after processing in one embodiment; Figure 6 This is an example diagram of the center line of the curve including the preheating section after processing in one embodiment; Figure 7 A structural block diagram of a system framework for a data extraction method for spot weld curve images, as shown in one embodiment; Figure 8 This is a flowchart illustrating the execution process of a data extraction method for spot welding curve images in practice. Figure 9 This is a structural block diagram of a data extraction device for spot welding curve images in one embodiment; Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] It should be understood that, in the description of this application, unless the context explicitly requires it, words such as "including" or "comprising" throughout the specification should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".

[0021] It should also be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0022] In a first embodiment, this application provides a method for extracting data from spot weld curve images. Wherein, as... Figure 1 As shown, this application provides a method for extracting data from spot welding curve images, including the following steps: Step S101: Obtain the spot welding curve image and identify the target curve from the spot welding curve image based on the preset color.

[0023] In this embodiment, the user captures a spot welding curve image from the interface of the spot welding monitoring system and stores the image according to a specified path. The spot welding curve image can be in PNG or JPG format. For example, the spot welding curve image is as follows: Figure 2 As shown. Specifically, the spot weld curve image is read from the specified path and loaded into memory to provide raw data for subsequent processing.

[0024] In addition, refer to Figure 2 As shown, spot welding monitoring systems commonly use different colors to represent different curves. For example, green is used to represent resistance curves, and blue is used to represent current curves. Therefore, this embodiment embeds the colors of various types of spot welding curves, identifying the corresponding curves in the spot welding curve image through different colors. Specifically, the target curve for data extraction is identified from the spot welding curve image based on a preset color. The target curve can be a resistance curve that includes a preheating section, or a regular curve that does not include a preheating section.

[0025] The specific process for acquiring the spot welding curve image and recognizing the curve color is as follows: (1) Acquisition of spot welding curve image: Assume that the input spot welding curve image is a two-dimensional matrix Its size is ,in Indicates the image height. Indicates the image width. This represents the number of channels; for color images, The position of each pixel can be represented as... The corresponding pixel value .

[0026] The process of reading the spot weld curve image can be represented as follows: ; in This is the path to the image file. If the image cannot be read, then... An exception is thrown at this point.

[0027] (2) Identification of curve colors: Spot welding monitoring systems typically use fixed colors to distinguish curve types, such as green for real-time current and red for dynamic resistance. The original spot welding curve image is converted to the HSV color space, and the target curve, such as the green curve, is identified according to a preset color range. Specifically, the processing flow includes the following: Processing flow 1: BGR to HSV color space conversion.

[0028] Let the BGR value of a certain pixel in the original spot weld curve image be... Its corresponding HSV value It can be calculated using the following formula: ; ; ; For color tone : ; For saturation : ; For brightness : .

[0029] Processing flow 2: Color mask creation.

[0030] Let the HSV threshold range of the preset color be... arrive Then the binary mask The formula for generating it is:

[0031] Among them, here This represents the corresponding pixel value.

[0032] In one example of this embodiment, after the step of identifying the target curve described above, the method further includes: enhancing the connectivity of the target curve through morphological operations.

[0033] In this example, morphological operations are used to enhance the connectivity of the target curve, fill small gaps in the target curve, and remove noise points.

[0034] First, perform a morphological dilation operation: Let the structural element be Binary image after dilation operation It can be represented as: ; in, It is a 3×3 elliptical structural element. and This represents the offset coordinates of the structuring element K relative to the target pixel. This represents the pixel value of the target pixel.

[0035] Secondly, perform morphological closure operations: The closing operation consists of expansion followed by corrosion, and can be represented as: ; in, This indicates an expansion operation. This represents the erosion operation. The mathematical definition of the erosion operation is: .

[0036] Step S102: Perform connected component analysis on the target curve and sort one or more connected components of the target curve according to the area of ​​the connected components from largest to smallest.

[0037] In this embodiment, connected component analysis is performed: Let the processed binary image be... It can be divided into 8 connected components through 8-part analysis. Connected components The area of ​​each connected component is It is possible to... Sort the connected components.

[0038] Step S103: When the target curve is a curve that includes a preheating section, select the top N connected components and merge them to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time.

[0039] In this embodiment, if the target curve is a curve that includes a preheating segment, the number N of connected regions used for merging processing is determined based on the preheating time and the spot welding time. Specifically, in the multi-pulse spot welding process, the curve that includes the preheating segment can be a resistance curve. Resistance curves often include a preheating segment, which is characterized by low amplitude and short duration. The preheating segment is displayed separately from the main welding segment.

[0040] In one example of this embodiment, the above-mentioned selection and merging of the top N connected components to obtain a merged image includes: based on Connected component merging is performed to obtain the merged image; where, Indicates merging images. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

[0041] For example, for a curve with a preheating section, select the top three largest connected components and merge them. The merging operation is as follows: ; in, It is a sorting function that makes... .

[0042] Merged binary image It can be represented as: .

[0043] Therefore, for curves with preheating segments, such as the preheating resistance curve in the spot welding process, it is possible to identify and merge scattered curve segments to ensure complete extraction of the entire curve information.

[0044] In one example of this embodiment, when the target curve is a curve that does not include the preheating section, the connected region with the largest area is selected as the merged image.

[0045] Specifically, for ordinary curves that do not include a preheating section, the connected region with the largest area is selected as the merged image for subsequent extraction of the centerline from the merged region. The connected region with the largest area is: .

[0046] in, It represents maximizing the independent variable, and its output is the variable itself, not the maximum value. Indicates output The largest variable in.

[0047] Therefore, this embodiment is particularly suitable for extracting technical curve data such as resistance curves from spot welding curve images, and can also handle ordinary curves and complex curves with preheating sections.

[0048] Step S104: Extract the center line of the target curve from the merged image.

[0049] In this embodiment, the centerline of the target curve can also be referred to as the skeleton of the target curve. The centerline of the target curve is extracted from the processed binary image to facilitate the subsequent extraction of precise coordinate points.

[0050] In one example of this embodiment, the extraction of the center line of the target curve from the merged image includes: according to Extract the centerline of the target curve; where, Indicates the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

[0051] Specifically, a skeletonization algorithm is used to refine the target region in the binary image to a center line with a width of one pixel. Let the center line be... Its mathematical definition can be expressed as: ; in: It is the nth value in the structured element sequence, usually in a 3×3 cross shape; Indicates an etching operation; express The set of boundary pixels; It represents the number of iterations until the image stops changing.

[0052] Among them, the extracted center line is as follows Figure 3 and Figure 4 As shown. Figure 3 This is an example diagram of the centerline of a standard curve that does not include the preheating section. Figure 4 This is an example diagram of the centerline of the curve that includes the preheating section.

[0053] Step S105: Based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, the coordinate points of the center line are mapped to the data coordinates so as to extract the center line data of the target curve based on the data coordinates.

[0054] In this embodiment, coordinate points are extracted from the skeleton image, and a mapping relationship between image coordinates and actual data coordinates is established based on the extracted coordinate points.

[0055] In one example of this embodiment, before step S105, a step of constructing a mapping relationship between the image coordinates of the merged image and the configured data coordinates is included. Specifically: Obtain the X-axis and Y-axis coordinates of the maximum and minimum values ​​of the centerline in the image coordinate system; obtain the length of the centerline on the X-axis and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; determine the X-axis mapping relationship based on the length of the centerline on the X-axis and the X-axis coordinates of the maximum and minimum values ​​in the image coordinate system; determine the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis, the Y-axis coordinates of the maximum and minimum values ​​in the image coordinate system.

[0056] The step of determining the X-axis mapping relationship based on the length of the X-axis of the centerline in the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates includes: according to Determine the X-axis mapping relationship in the mapping relationship; where, This represents the X-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinates representing the minimum value of the centerline in the image coordinate system. The X-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

[0057] The step of determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis of the spot welding curve image, the Y-axis coordinate of the maximum value, and the Y-axis coordinate of the minimum value in the image coordinate system includes: according to Determine the Y-axis mapping relationship in the mapping relationship; where, This represents the Y-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinates representing the minimum value of the centerline in the image coordinate system. The Y-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

[0058] Specifically, extract coordinates of coordinate points from the skeleton image: from the center line. Extract all coordinate points , and according to The coordinates are sorted in ascending order. Among them, Indicates center line The image of the first The pixel value of each pixel.

[0059] Coordinate range calculation: The minimum and maximum coordinates of the centerline are as follows: ; ; ; .

[0060] Coordinate mapping function: Let the target data range be... and Then the coordinate mapping function is: ; ; Mapping result: Image coordinates Mapping to data coordinates : ; .

[0061] in, This indicates that the center line is located at the th position in the image coordinate system. The X-axis data values ​​of each coordinate point This indicates that the center line is the th in the image coordinate system. The Y-axis data values ​​of each coordinate point Represents positive integers. Represents the first coordinate in the data coordinates There are 1 coordinate point.

[0062] In one example of this embodiment, after mapping each coordinate point of the center line to the data coordinates in step S105, the method further includes: performing one or more of the following processes on the multiple coordinate points of the center line in the data coordinates: removing duplicate coordinates, filtering outliers, and data interpolation, and then outputting the data of each coordinate point of the center line.

[0063] In this example, the mapped data is further processed, including removing duplicate coordinates, filtering outliers, and data interpolation, to ensure the accuracy and completeness of the centerline data on the data coordinates.

[0064] Processing to remove duplicate X-coordinates: For coordinates with the same X-coordinate along the centerline... Coordinates of the points Take the average value: .

[0065] Outlier filtering: Outliers are identified using the quartile method. Let... The first quartile of the data is The third and fourth quartiles are Interquartile range is The criteria for identifying outliers are: ; in, To adjust the coefficient, for the curve of the preheating section, take... .

[0066] Data interpolation processing uses linear interpolation: Let the target equally spaced points be... ,in ( ,and ).

[0067] For each target coordinate point Find two adjacent data points and satisfy Then the interpolated for: .

[0068] Missing value imputation: For missing values ​​that cannot be obtained through linear interpolation, forward imputation and backward imputation are used. ; The processed centerline is displayed in the data coordinates as follows: Figure 5 and Figure 6 As shown. Figure 5 The example plot shows the centerline of a normal curve without the preheating section. The Resistance Curve (325 Points) represents the resistance curve (325 data points). Figure 6 This is an example diagram showing the centerline of a curve that includes the preheating section. Resistance Curve represents the resistance curve, Original Points represent the original data points, Interpolation represents the interpolation calculation, Interpolated Curve represents the difference curve, and Warmup Threshold represents the preheating threshold.

[0069] Furthermore, the data for each coordinate point of the output centerline is specifically as follows: the processed data is formatted and saved as a CSV file for easy subsequent analysis and use. The processing method specifically includes: Data matrix construction: Construct a data matrix containing sequence number, program number, timer name, and curve value. Its form is: ; in, For program number, For timer name, This is the interpolated value.

[0070] File output: Data matrix Save the values ​​in comma-separated (CSV) format to the specified path.

[0071] Furthermore, the original image, the processed image, and the extracted centerline are visualized, allowing users to intuitively view the processing results, especially enabling the marking of the preheating area.

[0072] Mathematical model description: The visualization process mainly involves coordinate transformation and graphic rendering. For the visualization of curve data, the data coordinates are transformed... and Map to the display coordinate system and draw the corresponding points, lines, and markers.

[0073] For the preheating section marking, assuming the preheating section accounts for 20% of the total length, the preheating section threshold is: .

[0074] in, Indicates the threshold value of the preheating section. This indicates the total length of the centerline.

[0075] The above embodiment of a spot welding curve image data extraction method achieves automated extraction of key process curves that cannot be exported through a technical path of "screenshot → image processing → data restoration". It features color-adaptive segmentation for industrial scenarios: utilizing the fixed curve color matching rules of the spot welding monitoring system to achieve highly robust target extraction; and an intelligent merging mechanism for the preheating section: ensuring the integrity of data throughout the entire process cycle for the complex curve shapes of multi-pulse welding.

[0076] Engineering-oriented data post-processing: By dynamically adjusting the anomaly detection threshold based on the characteristics of the preheating section, effective low-amplitude data is prevented from being falsely filtered out. Therefore, this method does not require modification of the original software; it only relies on ordinary screenshots to transform "visual information" into "computable data." This provides a feasible data acquisition channel for welding process digitization, quality closed-loop control, and AI model training, demonstrating significant engineering application value.

[0077] The following describes the system architecture and execution flow of a specific implementation of the spot weld curve image data extraction method of this application: A system framework for a method of data extraction from spot weld curve images is as follows: Figure 7As shown, it mainly consists of an image reading module, a color recognition module, a morphological processing module, a skeleton extraction module, a coordinate mapping module, a data interpolation module, a special curve processing module, and a data output module. The execution flow of a data extraction method for spot welding curve images is as follows: Figure 8 As shown.

[0078] Combination Figure 7 and Figure 8 As shown, the data extraction method for spot welding curve images of this application can achieve the following: (1) The HSV threshold range of commonly used curve colors in spot welding monitoring systems can be directly used without user adjustment. For example, green represents resistance and blue represents current. In addition, the coordinate mapping range is calculated based on the image content, using the curve endpoints instead of user-calibrated axes. The processing is done without manual intervention, realizing one-click processing of "input screenshot → output CSV".

[0079] Therefore, by embedding prior knowledge of the color, coordinates, and shape of the spot welding curve, and by setting a default calibration threshold, the processing time for a single image can be shortened to within 5 seconds, supporting batch processing of hundreds of screenshots, which is suitable for data backtracking in the test piece verification stage.

[0080] (2) Intelligent merging mechanism for multiple connected domains of the preheating section curve: For the preheating section curve, the first 3 connected domains are automatically merged to ensure that the preheating section, main section and maintenance section are completely preserved. Through the intelligent merging mechanism of multiple connected domains, the system can automatically identify and merge scattered line segments such as the preheating section and the main welding section, and the data integrity reaches 100%, providing a reliable basis for multi-pulse process optimization.

[0081] (3) Curve type adaptive outlier filtering strategy: For ordinary curves, the standard α=1.5 is used for outlier detection; for preheating curves, the threshold is relaxed to α=2.0 to retain low-amplitude valid data. The threshold is dynamically adjusted according to the characteristics of the preheating section. While ensuring the data quality of the main section, the retention rate of valid data in the preheating section is above 95%, avoiding the loss of key process features.

[0082] (4) Enhanced engineering semantics in the data output structure: The output CSV contains four fields: serial number, program number, timer name, and curve value, and supports direct interface with MES / SPC systems. Because the output contains engineering metadata such as program number and timer name, the data can be directly exported, eliminating the need for manual identification, reducing human error, and improving data flow efficiency.

[0083] In summary, this application presents a data extraction method for spot welding curve images, which is particularly suitable for extracting technical curve data such as resistance curves from images. It can simultaneously process ordinary curves and complex curves with preheating sections. This method, through computer vision technology and digital image processing algorithms, can automatically identify, extract, and convert usable numerical data from images containing technical curves, solving the problems of low efficiency and large errors associated with traditional manual data reading.

[0084] It should be understood that although the steps in the flowchart are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0085] In a second embodiment, this application also provides a data extraction device for spot weld curve images. For example... Figure 9 As shown, a data extraction device for spot welding curve images includes an identification module 901, a sorting module 902, a merging module 903, an extraction module 904, and a mapping module 905. The identification module 901 acquires spot welding curve images and identifies the target curve from the image based on a preset color. The sorting module 902 performs connected component analysis on the target curve, sorting one or more connected components of the target curve according to their area from largest to smallest. The merging module 903, when the target curve contains a preheating section, selects the top N connected components from the sorted list and merges them to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time. The extraction module 904 extracts the centerline of the target curve from the merged image. The mapping module 905 maps the coordinates of the centerline to data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, thereby extracting the centerline data of the target curve based on the data coordinates.

[0086] Preferably, a data extraction device for spot welding curve images further includes a selection module, used to select the connected region with the largest area as the merged image when the target curve is a curve that does not contain a preheating section.

[0087] Preferably, the top N connected components are selected and merged to obtain a merged image, including: based on Connected component merging is performed to obtain the merged image; where, Indicates merging images. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

[0088] Preferably, extracting the centerline of the target curve from the merged image includes: according to Extract the centerline of the target curve; where, Indicates the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

[0089] Preferably, a data extraction device for spot welding curve images further includes a mapping relationship construction module, used to obtain the X-axis coordinates and Y-axis coordinates of the maximum value and the minimum value of the center line in the image coordinates; obtain the length of the center line on the X-axis, and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; determine the X-axis mapping relationship based on the length of the center line on the X-axis and the X-axis coordinates of the maximum and minimum values ​​in the image coordinates; and determine the Y-axis mapping relationship based on the maximum and minimum values ​​of the center line on the Y-axis, the Y-axis coordinates of the maximum value and the Y-axis coordinates of the minimum value in the image coordinates.

[0090] Preferably, determining the X-axis mapping relationship based on the length of the centerline on the X-axis of the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates includes: according to Determine the X-axis mapping relationship in the mapping relationship; where, This represents the X-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinates representing the minimum value of the centerline in the image coordinate system. The X-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

[0091] Preferably, determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis in the spot welding curve image, the Y-axis coordinate of the maximum value, and the Y-axis coordinate of the minimum value in the image coordinate system includes: according to Determine the Y-axis mapping relationship in the mapping relationship; where, This represents the Y-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinates representing the minimum value of the centerline in the image coordinate system. The Y-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

[0092] Preferably, a data extraction device for spot welding curve images further includes an output module, which is used to perform one or more of the following processes on the center line in the data coordinate system: removing duplicate coordinates, filtering outliers, and data interpolation, and then outputting the data of each coordinate point of the center line.

[0093] For specific limitations regarding the data extraction device for spot welding curve images, please refer to the limitations of the data extraction method for spot welding curve images described above, which will not be repeated here. Each module in the aforementioned data extraction device for spot welding curve images can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the vehicle controller in hardware form or independently of it, or stored in the memory of the vehicle controller in software form, so that the processor can call and execute the operations corresponding to each module.

[0094] In the third embodiment, a computer device is provided, which can be a terminal device for implementing the spot welding curve image data extraction method of this application. Its internal structure diagram can be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for extracting data from spot welding curve images. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0095] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0096] In a fourth embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: acquiring a spot welding curve image and identifying a target curve from the spot welding curve image based on a preset color; performing connected component analysis on the target curve and sorting one or more connected components of the target curve according to their area from largest to smallest; when the target curve is a curve containing a preheating section, selecting the top N connected components for merging to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time; extracting the centerline of the target curve from the merged image; and mapping each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the data of the centerline of the target curve based on the data coordinates.

[0097] Preferably, when the processor executes the computer program, it further implements the following steps: when the target curve is a curve that does not contain a preheating section, the connected region with the largest area is selected as the merged image.

[0098] Preferably, when the processor executes the computer program to implement the above-mentioned step of selecting and merging the top N connected components to obtain the merged image, the following steps are specifically implemented: based on Connected component merging is performed to obtain the merged image; where, Indicates merging images. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

[0099] Preferably, when the processor executes the computer program to implement the above-described step of extracting the center line of the target curve from the merged image, it specifically implements the following steps: according to Extract the centerline of the target curve; where, Indicates the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

[0100] Preferably, when the processor executes the computer program, it further implements the following steps: obtaining the X-axis coordinates and Y-axis coordinates of the maximum value and the minimum value of the centerline in the image coordinates; obtaining the length of the centerline on the X-axis, and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; determining the X-axis mapping relationship based on the length of the centerline on the X-axis in the spot welding curve image and the X-axis coordinates of the maximum and minimum values ​​in the image coordinates; determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis in the spot welding curve image, the Y-axis coordinates of the maximum value and the Y-axis coordinates of the minimum value in the image coordinates.

[0101] Preferably, when the processor executes the computer program to implement the above-mentioned step of determining the X-axis mapping relationship based on the length of the X-axis of the centerline in the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates, the specific steps are as follows: According to Determine the X-axis mapping relationship in the mapping relationship; in, This represents the X-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinates representing the minimum value of the centerline in the image coordinate system. The X-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

[0102] Preferably, when the processor executes the computer program to implement the above-mentioned steps of determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis in the spot welding curve image, the Y-axis coordinates of the maximum value and the Y-axis coordinates of the minimum value in the image coordinates, the specific steps are as follows: According to Determine the Y-axis mapping relationship in the mapping relationship; where, This represents the Y-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinates representing the minimum value of the centerline in the image coordinate system. The Y-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

[0103] Preferably, when the processor executes the computer program, it also performs the following steps: after performing one or more of the following processes on the multiple coordinate points of the center line in the data coordinate system, such as removing duplicate coordinates, filtering outliers, and data interpolation, the data of each coordinate point of the center line is output.

[0104] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: acquiring a spot welding curve image and identifying a target curve from the spot welding curve image based on a preset color; performing connected component analysis on the target curve and sorting one or more connected components of the target curve according to their area from largest to smallest; when the target curve is a curve containing a preheating section, selecting the top N connected components in the sorting and merging them to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time; extracting the centerline of the target curve from the merged image; and mapping each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the data of the centerline of the target curve based on the data coordinates.

[0105] Preferably, when the computer program is executed by the processor, it further implements the following steps: when the target curve is a curve that does not contain a preheating section, the connected region with the largest area is selected as the merged image.

[0106] Preferably, when the computer program is executed by the processor to implement the above-mentioned step of selecting and merging the top N connected components to obtain a merged image, the following steps are specifically implemented: based on Connected component merging is performed to obtain the merged image; where, Indicates merging images. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

[0107] Preferably, when the computer program is executed by the processor to perform the above-described step of extracting the center line of the target curve from the merged image, the following steps are specifically implemented: according to Extract the centerline of the target curve; where, Indicates the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

[0108] Preferably, when the computer program is executed by the processor, it further implements the following steps: obtaining the X-axis coordinates and Y-axis coordinates of the maximum value and the minimum value of the centerline in the image coordinates; obtaining the length of the centerline on the X-axis, and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; determining the X-axis mapping relationship based on the length of the centerline on the X-axis in the spot welding curve image and the X-axis coordinates of the maximum and minimum values ​​in the image coordinates; determining the Y-axis mapping relationship based on the maximum and minimum values ​​on the Y-axis of the centerline in the spot welding curve image, the Y-axis coordinates of the maximum value and the Y-axis coordinates of the minimum value in the image coordinates.

[0109] Preferably, when the computer program is executed by the processor to implement the above-mentioned step of determining the X-axis mapping relationship based on the length of the X-axis of the centerline in the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates, the specific steps are as follows: According to Determine the X-axis mapping relationship in the mapping relationship; in, This represents the X-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinates representing the minimum value of the centerline in the image coordinate system. The X-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

[0110] Preferably, when the computer program is executed by the processor to implement the above-mentioned steps of determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis of the spot welding curve image, the Y-axis coordinates of the maximum value and the Y-axis coordinates of the minimum value in the image coordinates, the specific steps are as follows: According to Determine the Y-axis mapping relationship in the mapping relationship; where, This represents the Y-axis value of the centerline at any coordinate point in the data coordinate system. This indicates the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinates representing the minimum value of the centerline in the image coordinate system. The Y-axis coordinate represents the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

[0111] Preferably, when the computer program is executed by the processor, it further performs the following steps: after performing one or more of the following processes on the multiple coordinate points of the center line in the data coordinate system, such as removing duplicate coordinates, filtering outliers, and data interpolation, the data of each coordinate point of the center line is output.

[0112] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application.

Claims

1. A method for extracting data from spot welding curve images, characterized in that, The method includes: Acquire a spot welding curve image, and identify the target curve from the spot welding curve image based on a preset color; Perform connected component analysis on the target curve, and sort one or more connected components of the target curve according to the area of ​​the connected components from largest to smallest; When the target curve is a curve that includes a preheating section, the top N connected components are selected and merged to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time. Extract the centerline of the target curve from the merged image; Based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, the coordinate points of the center line are mapped to the data coordinates, so as to extract the center line data of the target curve based on the data coordinates.

2. The method according to claim 1, characterized in that, The method further includes: When the target curve is a curve that does not include the preheating section, the connected region with the largest area is selected as the merged image.

3. The method according to claim 1, characterized in that, The process of selecting and merging the top N connected components to obtain a merged image includes: based on Merge connected components to obtain a merged image; in, This refers to the merged image. Represents the pixels of the merged image. Represents the pixel values ​​in a connected component image. Represents any connected component among N connected components. This indicates that it does not belong to any of the N connected components.

4. The method according to claim 3, characterized in that, Extracting the center line of the target curve from the merged image includes: according to Extract the centerline of the target curve; in, This represents the centerline of the target curve. This represents the nth value in the structured element sequence. This indicates a corrosion operation. express The set of boundary pixels, Indicates intersection.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the X-axis and Y-axis coordinates of the maximum value of the center line in the image coordinates, and the X-axis and Y-axis coordinates of the minimum value; Obtain the length of the centerline on the X-axis and the maximum and minimum values ​​on the Y-axis in the spot welding curve image; The X-axis mapping relationship in the mapping relationship is determined based on the length of the center line on the X-axis of the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates. The Y-axis mapping relationship in the mapping relationship is determined based on the maximum and minimum values ​​of the center line on the Y-axis of the spot welding curve image, the Y-axis coordinate of the maximum value and the Y-axis coordinate of the minimum value in the image coordinates.

6. The method according to claim 5, characterized in that, The step of determining the X-axis mapping relationship based on the length of the centerline on the X-axis of the spot welding curve image and the coordinates of the X-axis of the maximum and minimum values ​​in the image coordinates includes: according to Determine the X-axis mapping relationship in the aforementioned mapping relationship; in, This represents the X-axis data value of the centerline at any coordinate point in the data coordinate system. This represents the length of the centerline along the X-axis in the spot welding curve image. The X-axis coordinate representing the minimum value of the centerline in the image coordinate system. This represents the X-axis coordinate of the maximum value of the centerline in the image coordinate system. This represents the X-axis data value of the centerline at any coordinate point in the image coordinate system.

7. The method according to claim 5, characterized in that, The step of determining the Y-axis mapping relationship based on the maximum and minimum values ​​of the centerline on the Y-axis of the spot welding curve image, the Y-axis coordinate of the maximum value, and the Y-axis coordinate of the minimum value in the image coordinates, includes: according to Determine the Y-axis mapping relationship in the mapping relationship; in, This represents the Y-axis data value of the centerline at any coordinate point in the data coordinate system. This represents the maximum value of the centerline on the Y-axis in the spot welding curve image. This represents the minimum value of the centerline on the Y-axis in the spot weld curve image. The Y-axis coordinate representing the minimum value of the centerline in the image coordinate system. This represents the Y-axis coordinate of the maximum value of the centerline in the image coordinate system. This represents the Y-axis data value of the centerline at any coordinate point in the image coordinate system.

8. The method according to claim 1, characterized in that, The method further includes: After performing one or more of the following processes on the centerline at multiple coordinate points in the data coordinate system, such as removing duplicate coordinates, filtering outliers, and data interpolation, the data of each coordinate point of the centerline is output.

9. A data extraction device for spot welding curve images, characterized in that, The device includes: The recognition module is used to acquire a spot welding curve image and identify the target curve from the spot welding curve image based on a preset color. The sorting module is used to perform connected component analysis on the target curve and sort one or more connected components of the target curve according to the area of ​​the connected components from largest to smallest. The merging module is used to select the top N connected components for merging when the target curve is a curve containing a preheating section, to obtain a merged image, where N is a positive integer greater than or equal to 2, and N is determined based on the preheating time and the spot welding time. An extraction module is used to extract the centerline of the target curve from the merged image; The mapping module is used to map each coordinate point of the centerline to the data coordinates based on the mapping relationship between the image coordinates of the merged image and the configured data coordinates, so as to extract the centerline data of the target curve based on the data coordinates.

10. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.