Projection feature based welding voltage and welding current detection method
By identifying welding voltage and current based on projection features and tilt correction, the problem of inaccurate identification in existing technologies is solved, welding efficiency and quality are improved, and welding automation is enhanced.
Patent Information
- Application Number
- CN202311028350.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-15
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-08-15
AI Technical Summary
Existing technologies struggle to accurately identify welding voltage and current, impacting welding quality and automation levels, resulting in low welding efficiency and potential safety hazards.
A projection feature-based method is used to identify the digits of the digital tube. Combined with tilt digit adaptive correction technology, the welding voltage and current are accurately detected through image processing and feature matching.
It improves the accuracy of welding current and voltage recognition, helps welding robots adjust parameters in a timely manner, improves welding quality and automation, and reduces the risk of accidents.
Smart Images

Figure CN117226220B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic image feature recognition, specifically a method for detecting welding voltage and welding current based on projection features. Background Technology
[0002] With the continuous acceleration of my country's industrialization, people's requirements for welding quality are constantly increasing. Welding automation is the trend of welding technology development. To ensure welding efficiency and improve welding quality, automatic adjustment of various welding parameters is of paramount importance. Welding voltage and current are key factors affecting welding quality. Therefore, to achieve intelligent control of welding, it is necessary to accurately identify the current welding voltage and current magnitude. Accurate identification technology helps welding robots adjust parameter values in a timely manner, improving work efficiency and welding quality, and enhancing the degree of automation in welding. Summary of the Invention
[0003] The purpose of this invention is to address the aforementioned problems by providing a method for detecting welding voltage and welding current based on projection features. This method can automatically identify the magnitude of welding current and voltage, and can correct tilted digital images to ensure recognition accuracy. This invention can improve the accuracy of welding current and voltage recognition, and help welding robots adjust welding parameters in a timely manner, thereby improving work efficiency and welding quality, increasing the degree of automation in welding, and reducing the occurrence of accidents.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] The method of the present invention includes: a method for recognizing digits on a digital tube based on the principle of projection method, a method for recognizing digits displayed on a digital tube, and an adaptive correction method for tilted digits;
[0006] The principle of recognizing digital tube numbers based on projection method is to accumulate the horizontal and vertical pixels of the binary image containing the number and project it onto the waveform. The horizontal projection is divided into three segments and the vertical projection is divided into two segments. Based on the peak level determination principle, the presence and level of peaks in each segment are statistically analyzed to indirectly reflect which segments of the digital tube are lit, thereby inferring the currently displayed number.
[0007] The method for recognizing numbers displayed on a digital tube is based on the waveform diagram of digital projection, recording the peak characteristics, storing them in a peak characteristic array, and comparing and matching them with a digital library. There are 10 sets of recognition rules, corresponding to the numbers 0-9 respectively.
[0008] The aforementioned tilt digital adaptive correction method involves performing image morphological processing on the captured tilted digital image, selecting the two independent connected regions with the largest pixel area in the image, calculating the centroid coordinates to obtain the slope, and thus determining the image tilt angle to achieve correction.
[0009] Furthermore, the principle of recognizing digital tube numbers based on the projection method is as follows: The binary image of the number is accumulated horizontally and vertically, and projected onto the waveform. The horizontal projection is divided into three intervals, and the vertical projection is divided into two intervals. By statistically summing the pixels in each column, the obtained data is projected onto the coordinate axis, where the horizontal axis is the column number of the image and the vertical axis is the sum of the bright pixels in that column.
[0010] The vertical projection has 60 columns, meaning the effective range of the horizontal coordinate Of is [0, 60]. The interval is divided into two segments for independent calculation, with the origin at O and the center point at c.
[0011] Calculate the sum of bright pixels in the first segment, i.e., the area enclosed by the projection map function f(x) in [0,30] and the x-axis. The length of the first segment is L1. The method for calculating the average value of bright pixels in the first segment is as follows:
[0012]
[0013] Next, two sets of ratios are defined: the peak-to-mean ratio Kp and the area-to-mean ratio Ks, which are used to determine the projected peak and its level.
[0014]
[0015]
[0016] In equation (2), M1 is the peak value of the first column pixel, and Kp means the ratio of the maximum value of the column pixel to the average value; in equation (3), s1 is the area enclosed by the function interval above the mean line and the x-axis, and a and b are the horizontal coordinate values above the mean line. Therefore, Ks means the ratio of the sum of the function integrals of the interval above the average value to the average value.
[0017] In the second segment, M2 is the maximum pixel value of the second column of the projection, L2 is the length of the second segment interval, and d and e are the x-coordinate values greater than the mean line. The corresponding mean Mean2, peak-to-mean ratio Kp, and area-to-mean ratio Ks are as follows:
[0018]
[0019]
[0020]
[0021] The principle for determining peaks is the same for horizontal and vertical projections. Since there is only one segment of digital tube, the peak of the projection curve is at most level I, so there is no need to determine the peak level, as long as the existence of a peak is confirmed. Horizontal projection is divided into three segments, and the method for calculating the mean, peak-to-mean ratio, and area-to-mean ratio of each segment is the same as in vertical projection.
[0022] Furthermore, the method for recognizing numbers displayed on the digital tube is as follows:
[0023] Set a threshold P for Kp, and a level I threshold S1 and a level II threshold S2 for Ks. Compare Kp, Ks, and the thresholds. If Kp or Ks is greater than P, it is determined that the projection exists in that peak segment, and the peak level is determined: greater than S1 indicates a level I peak, and greater than S2 indicates a level II peak. Then, store this peak characteristic in a string array. In the string array, the first three digits of the horizontal projection represent whether there is a peak in the three segments of the horizontal projection (1 for a peak, 0 for no peak); the last four digits of the vertical projection represent the peaks, with the first digit being... In the first segment of the vertical projection, the peak identifiers are: 0 for no peak and 1 for a peak. The second identifier is the peak level identifier: 1 for a Class I peak and 2 for a Class II peak. The third identifier is the peak identifier in the second segment of the vertical projection: 0 for no peak and 1 for a peak. The fourth identifier is the peak level identifier in the second segment of the vertical projection: 1 for a Class I peak and 2 for a Class II peak. The peak characteristic array is then matched and compared with a digital database to achieve accurate identification. The specific identification method is as follows:
[0024] (1) The height-to-width ratio of the cropped digit image is greater than 1.5, which indicates that the digit is 1. The ratios of the other digit images are all less than 1.5, which are obvious characteristics.
[0025] (2) The first and third segments of the horizontal projection have peaks, while the second segment does not have a peak. The first and second segments of the vertical projection both have Class II peaks. Therefore, it is determined to be the number 0, and the peak characteristic array is [101 1212].
[0026] (3) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class I peaks, which are the numbers 2 or 5. The peak characteristic array is [111 1111]. Draw a horizontal tangent line in the upper left interval of the image. The number 2 is the one that does not intersect.
[0027] (4) The first, second and third segments of the horizontal projection have peaks, while the first segment of the vertical projection has no peaks and the second segment has a Class II peak, which is the number 3. The peak characteristic array is [111 0012].
[0028] (5) The first and third segments of the horizontal projection have no peaks, while the second segment has a peak. The first segment of the vertical projection is a Class I peak, and the second segment is a Class II peak. Therefore, the number 4 is the peak characteristic array [010 1112].
[0029] (6) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class I peaks. The corresponding numbers are 2 or 5. The peak characteristic array is [111 1111]. Draw a horizontal tangent line in the upper left interval of the image. The number that intersects with the line is 5.
[0030] (7) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection is a Class II peak, and the second segment is a Class I peak, which is the number 6. The peak characteristic array is [111 1211].
[0031] (8) The first segment of the horizontal projection has a peak, while the second and third segments do not have peaks. The first segment of the vertical projection does not have a peak, while the second segment has a Class II peak. Therefore, the number is 7, and the peak characteristic array is [100 0012].
[0032] (9) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class II peaks, which is the number 8. The peak characteristic array is [111 1212].
[0033] (10) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection has a Class I peak, and the second segment has a Class II peak, which is the number 9. The peak characteristic array is [111 1112].
[0034] Furthermore, the tilt digital adaptive correction method is as follows:
[0035] After converting the acquired image to grayscale, edge detection is performed using the Canny operator, followed by dilation using morphological structuring elements. The centroids of connected components in the image are then calculated using the regionprops() function. The specific algorithm is as follows:
[0036] Calculate the area and centroid coordinates of all connected regions in the image, and sort them according to their area, resulting in S1(x1,y1)>S2(x2,y2)>S3(x3,y3)>…>S n (x n ,y n ), S n Let x be the area of the connected region. n ,y n Let be the centroid coordinates. Taking the centroid coordinates of the two connected regions with the largest areas, we obtain the tilt angle as .
[0037]
[0038] Based on the identified tilt angle, the MATLAB function `imrotate()` is called to rotate the image, resulting in an image where the voltage and current values are level, which helps in the segmentation and recognition of numbers in the image.
[0039] The beneficial effects of this invention are:
[0040] The welding voltage and welding current detection method based on projection features described in this invention has good anti-interference ability, improves the accuracy of welding current and voltage identification, and helps welding robots to adjust parameter values in a timely manner, thereby improving work efficiency and welding quality. It can also improve the degree of automation in welding and help improve the reliability of machine welding. Attached Figure Description
[0041] Figure 1 A schematic diagram of the vertical projection of the number 4; (a) the binary image of the number 4; (b) the waveform of the vertical projection of the number 4;
[0042] Figure 2 Here is a schematic diagram of the horizontal projection of the number 4; (a) the binary image of the number 4; (b) the waveform of the horizontal projection of the number 4;
[0043] Figure 3 This is a diagram illustrating the tangent line drawn in the upper left corner of the image's numbers;
[0044] Figure 4 This is a diagram illustrating the steps for tilt correction.
[0045] Figure 5 For each digital projection peak characteristic map and peak characteristic identification rules;
[0046] Figure 6 The images show the identification results when the welding current was 130A and the welding voltage was 13.6V during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention.
[0047] Figure 7 The images show the identification results when the welding current was 198A and the welding voltage was 16.0V during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention.
[0048] Figure 8 The images show the identification results when the welding current was 208A and the welding voltage was 20.2V during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention.
[0049] Figure 9 The images show the identification results when the welding current was 212A, the welding voltage was 15.8V, and the reading was tilted to the right by about 40 degrees during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention.
[0050] Figure 10The images show the identification results when the welding current was 212A, the welding voltage was 15.8V, and the reading was tilted to the left by about 40 degrees during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention.
[0051] Figure 11 The images show the identification results when the welding current was 230A, the welding voltage was 15.8V, and the reading was tilted to the right by about 30 degrees during the experiment of this invention; (a) is the original image; (b) is the segmented digital image; and (c) is the identification result using the method of this invention. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] A method for detecting welding voltage and welding current based on projection features includes: the principle of recognizing digital tube numbers based on projection method, a method for recognizing digital tube display numbers, and an adaptive correction method for tilted numbers.
[0054] The principle of recognizing digital tube numbers based on projection method is to accumulate the horizontal and vertical pixels of the binary image containing the number and project it onto the waveform diagram. The horizontal projection is divided into three segments and the vertical projection is divided into two segments. From the waveform diagram, it is determined whether each segment has a peak and its peak level, which indirectly reflects which segments of the digital tube are lit, thereby inferring the currently displayed number.
[0055] The method for recognizing numbers displayed on a digital tube is based on the waveform diagram of digital projection, recording the peak characteristics, storing them in a peak characteristic array, and comparing and matching them with a library. There are 10 sets of recognition rules, corresponding to each number from 0 to 9.
[0056] The tilt digital adaptive correction method performs image morphological processing on the captured tilted digital image, selects the two independent connected regions with the largest pixel area in the image (the digital tube displaying voltage and the digital tube displaying current), calculates the centroid coordinates to obtain the slope, and then calculates the image tilt angle for correction.
[0057] 1. The principle of recognizing digital tube digits based on projection method
[0058] The binary image of the digit is accumulated horizontally and vertically, and then projected onto the waveform. The horizontal projection is divided into three intervals, and the vertical projection is divided into two intervals. Taking the digit 4 as an example, the entire image is divided into two parts, as shown in the attached diagram. Figure 1 As shown in (a), by statistically summing the pixels in each column, the obtained data is projected onto the coordinate axes, with the horizontal axis representing the total number of columns in the image and the vertical axis representing the sum of bright pixels in that column. The resulting waveform is shown in the attached figure. Figure 1 As shown in (b).
[0059] From the vertical projection waveform of the binary image, it can be seen that the OP segment projection of the digit 4 resembles a pulse wave, with a peak much higher than the surrounding pixels, representing a group of bright pixels, which is defined as a peak. Similarly, the QS segment projection composed of QR and RS is a pulse with an even larger peak, twice that of the OP segment, which can distinguish whether the digit column arrangement is a single segment or two segments. Therefore, some formulas are established to determine the presence of peaks and to determine the peak level.
[0060] First, the vertical projection has 60 columns, meaning the effective range of the horizontal coordinate is [0, 60]. The range is divided into two segments (the first segment [0, 30] and the second segment [30, 60]) and calculated independently.
[0061] Calculate the sum of bright pixels in the first segment, which is the area enclosed by the projection function f(x) in [0,30] and the x-axis. f(x) is 0 in segment oa, and the remaining area is the area of regions s1 and s2. In the diagram, O is the origin, c is the center point, and the length of the first segment is L1. The method for calculating the average value of bright pixels in the first segment is as follows:
[0062]
[0063] Next, two sets of ratios are defined: the peak-to-mean ratio Kp and the area-to-mean ratio Ks.
[0064]
[0065]
[0066] In equation (2), M1 corresponds to the peak value of the first column pixel in the figure, and Kp means the ratio of the maximum value of the column pixel to the average value. In equation (3), s1 is the area enclosed by the function interval above the mean line and the x-axis, and a and b are the horizontal coordinate values above the mean line. Therefore, Ks means the ratio of the sum of the function integrals of the interval above the average value to the average value.
[0067] The same calculation principle is applied to the second segment. M2 corresponds to the maximum pixel value of the second column in the projected image, L2 is the length of the second segment interval, and d and e are the x-coordinate values greater than the mean line. The corresponding mean Mean2, peak-to-mean ratio Kp, and area-to-mean ratio Ks are shown in the following formulas.
[0068]
[0069]
[0070]
[0071] The principle for determining peaks is the same for horizontal and vertical projections. Because there is only one segment of the digital tube, the peak of the projected curve is at most level I, so it is not necessary to determine the peak level, but only to confirm that the peak exists. Figure 2 As shown, the horizontal projection is divided into three segments, and the calculation of the mean, peak-to-mean ratio, and area-to-mean ratio for each segment is the same as in the vertical projection.
[0072] For both vertical and horizontal projections, the presence or absence of peaks is recorded (a peak is represented by 1, and no peak by 0). Only vertical projection establishes peak levels. The peak level for two vertically arranged digital tubes is level 2 (represented by II), and the peak level for a single digital tube is level 1 (represented by I). The projection results for the digits 0-9 (excluding 1) are shown in the table below.
[0073] Table 1 Projection results of digits 0-9 (excluding 1)
[0074]
[0075] The following table shows the calculated peak-to-mean ratio Kp and area-to-mean ratio Ks of the digits 0-9 (excluding 1) under ideal conditions, obtained by horizontal and vertical projections.
[0076] Table 2: Peak mean ratio and area mean ratio for numbers 0-9 (excluding 1)
[0077]
[0078] The data in the table shows that the peak-to-average ratio Kp and the area-to-average ratio Ks can reflect whether there are pixel peaks in the projection image within that segment, indirectly indicating whether the digital tube is lit in a certain segment. Based on this characteristic, by combining the projections of all segments, it is possible to determine which number the digital tube is currently displaying.
[0079] The table shows five bolded data segments in the horizontal projection, indicating that the values differ significantly from similar data and are all below the average level. This means that no digital tube is lit in that segment; specifically, the second segment of 0, the first and third segments of 4, and the second and third segments of 7 are all empty. In the vertical projection, the first segment of 3 and the first segment of 7 are not lit. Compared to the horizontal projection, the vertical projection has two segments of digital tubes on the same vertical line, resulting in two distinct levels of Kp and Ks values with peaks. The average peak value of two segments in the vertical direction is slightly larger than Kp, but the difference is not significant. Therefore, the area average value compared to Ks is used to highlight the characteristics of the projection with larger peaks. The Ks value changes significantly with the addition of a vertical digital tube, with the difference nearly doubling, making the characteristic clear.
[0080] 2. Methods for recognizing numbers displayed on a digital tube
[0081] Based on experimental data from multiple tests, a threshold P is set for Kp, and the level I threshold S1 and level II threshold S2 for Ks are set. Kp and Ks are compared with the thresholds. If Kp or Ks is greater than P, it is determined that the projection exists in that segment of the peak. The peak level is also determined: greater than S1 indicates a level I peak, and greater than S2 indicates a level II peak. This peak characteristic is then stored in a string array, for example, [101 1212]. For horizontal projection, the first three digits represent whether there is a peak in the three segments of the horizontal projection (1 for a peak, 0 for no peak). For vertical projection, the last four digits represent the peak in the first segment of the vertical projection (0 for no peak, 1 for a peak), the level of the peak in the first segment of the vertical projection (1 for level I, 2 for level II), and the last two digits are the same as the first two, representing the peak and level in the second segment of the vertical projection. The peak characteristic array is then matched and compared with a digital database to achieve accurate identification. Figure 5 As shown, the recognition rules are as follows: (1) If the height-to-width ratio of the cropped digital image is greater than 1.5, it is the digital 1. The ratio of other digital images is less than 1.5, and the features are obvious.
[0082] (2) The first and third segments of the horizontal projection have peaks, while the second segment does not. The first and second segments of the vertical projection both have Class II peaks, so it is determined to be the number 0, and the peak characteristic array is [101 1212].
[0083] (3) The first, second, and third segments of the horizontal projection all have peaks, while the first and second segments of the vertical projection both have Class I peaks, which are represented by the numbers 2 or 5, and the peak characteristic array is [111 1111]. (See attached image) Figure 3 As shown, draw a horizontal tangent line in the upper left section of the image; the number 2 is the line that does not intersect with the line.
[0084] (4) The first, second and third segments of the horizontal projection have peaks, while the first segment of the vertical projection has no peaks and the second segment has a Class II peak, which is the number 3. The peak characteristic array is [111 0012].
[0085] (5) The first and third segments of the horizontal projection have no peaks, while the second segment has a peak. The first segment of the vertical projection has a Class I peak and the second segment has a Class II peak. Therefore, the number is 4 and the peak characteristic array is [010 1112].
[0086] (6) The first, second, and third segments of the horizontal projection all have peaks, and the first and second segments of the vertical projection both have Class I peaks, which corresponds to the number 2 or 5. The peak characteristic array is [111 1111]. Draw a horizontal tangent line in the upper left interval of the image; the number that intersects with it is 5.
[0087] (7) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection has a Class II peak, and the second segment has a Class I peak, which is the number 6. The peak characteristic array is [111 1211].
[0088] (8) The first segment of the horizontal projection has a peak, while the second and third segments do not have peaks. The first segment of the vertical projection does not have a peak, while the second segment has a Class II peak. Therefore, the number is 7, and the peak characteristic array is [100 0012].
[0089] (9) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class II peaks, which is the number 8. The peak characteristic array is [111 1212].
[0090] (10) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection has a Class I peak, and the second segment has a Class II peak, which is the number 9. The peak characteristic array is [111 1112].
[0091] 3. Tilting Digital Adaptive Correction Method
[0092] To ensure accurate recognition, the segmented digital images should be kept as vertical as possible. However, in actual welding sites, most of the images collected are not horizontal. Therefore, horizontal correction of voltage and current value images tilted at any angle is the key to ensuring accurate recognition.
[0093] After converting the acquired image to grayscale, edge processing is performed using the Canny operator, followed by dilation using morphological structuring elements of appropriate size. The centroids of connected components in the image are then calculated using the regionprops() function. The specific algorithm is as follows:
[0094] First, calculate the area of all connected regions in the image and their centroid coordinates. Then, sort them according to their areas, resulting in S1(x1,y1)>S2(x2,y2)>S3(x3,y3)>…>S n (x n ,y n ), S n The area of the connected region, (x n ,y n Let be the centroid coordinates. Taking the centroid coordinates of the two connected regions with the largest areas, we obtain the tilt angle as:
[0095]
[0096] The image can be rotated (positive or negative) by calling the MATLAB function imrotate() based on a known angle, resulting in an image that makes the voltage and current values horizontal, which helps in the segmentation and recognition of numbers in the image.
[0097] During actual welding, the welding power supply digital display shows the current welding voltage and current values in real time. A camera captures images in real time, which are then transmitted to a computer. MATLAB software is used to first process the image grayscale, extract image edges, and then perform image dilation using appropriately sized morphological structuring elements, as shown in the attached diagram. Figure 4 As shown, according to the tilt digital adaptive correction method of the present invention, the pixel area of the connected region in the statistical image is calculated, the two largest regions (the two major regions of voltage and current displayed by the digital tube in the image) are selected, the centroid coordinates are calculated, the tilt angle is obtained, and after tilt correction, the digital target region is extracted, and each digital tube number is segmented separately.
[0098] Individual digital images are projected horizontally and vertically. The horizontal projection is divided into three segments, and the vertical projection into two segments. Based on the principle of peak level determination in this invention, each segment is judged, and the results are stored in a waveform characteristic array. Then, digital matching is performed according to 10 recognition rules to obtain an accurate recognition result. Figures 6 to 8 This is the identification result when the welding current and welding voltage readings are in a horizontal state. Figures 9 to 11 It is the identification result when the welding current and welding voltage readings are in an inclined state. The identification is accurate in multiple sets of test data, and it has good anti-interference ability with an accuracy rate of up to 99%.
[0099] The method for identifying welding current and voltage based on projection features has good anti-interference ability, improves the accuracy of welding current and voltage identification, and helps welding robots to adjust parameters in a timely manner to improve work efficiency and welding quality. It also improves the level of automation in welding, reduces the frequency of on-site human operation, helps improve the reliability of machine welding, and brings convenience to industrial production.
[0100] The above examples are merely one specific embodiment of the present invention. Obviously, the present invention is not limited to the above embodiments, and many similar modifications are possible. All modifications directly derived or conceived by those skilled in the art from the disclosure of this invention should be considered within the scope of protection of this invention.
Claims
1. A method for detecting welding voltage and welding current based on projection features, characterized in that, The method includes: a method for recognizing digits on a digital tube based on the principle of projection method, a method for recognizing digits displayed on a digital tube, and a method for adaptive correction of tilted digits; The principle of recognizing digital tube numbers based on projection method is to accumulate the bright pixels of the binary image containing the number in both horizontal and vertical directions, and project them onto the waveform diagram. The horizontal projection is divided into three segments and the vertical projection is divided into two segments. Based on the peak level determination principle, the presence of peaks and their peak levels in each segment are statistically analyzed from the waveform diagram, which indirectly reflects which segments of the digital tube are bright, thereby inferring the currently displayed number. The method for recognizing numbers displayed on a digital tube is based on the waveform diagram of digital projection, recording the peak characteristics, storing them in a peak characteristic array, and comparing and matching them with a digital library. There are 10 sets of recognition rules, corresponding to the numbers 0-9 respectively. The tilt digital adaptive correction method involves performing image morphological processing on the captured tilted digital image, taking the two independent connected regions with the largest pixel area in the image, calculating the centroid coordinates to obtain the slope, and thus obtaining the image tilt angle to achieve correction. The principle of recognizing digital tube numbers based on projection method is as follows: The binary image of the number is accumulated horizontally and vertically, and projected onto the waveform. The horizontal projection is divided into three intervals, and the vertical projection is divided into two intervals. By statistically summing the bright pixels in each column, the obtained data is projected onto the coordinate axis, where the horizontal axis is the column number of the image and the vertical axis is the sum of the bright pixels in that column. The vertical projection has 60 columns, meaning the effective range of the horizontal coordinate Of is [0, 60]. The interval is divided into two segments for independent calculation, with the origin at O and the center point at c. Calculate the sum of bright pixels in the first segment, i.e., the projection map function. Given the area enclosed by [0,30] and the x-axis, and the length of the first segment being L1, the average value of the bright pixels in the first segment is calculated as follows: (1) Next, two sets of ratios are defined: the peak-to-mean ratio Kp and the area-to-mean ratio Ks, which are used to determine the projected peak and its level. (2) (3) In equation (2), M1 is the peak value of the first column pixel, and Kp means the ratio of the maximum value of the column pixel to the average value; in equation (3), s1 is the area enclosed by the function interval above the mean line and the x-axis, and a and b are the horizontal coordinate values above the mean line. Therefore, Ks means the ratio of the sum of the function integrals of the interval above the average value to the average value. In the second segment, M2 is the maximum pixel value of the second segment column, L2 is the length of the second segment interval, d and e are the x-coordinate values greater than the mean line, and s4 is the area enclosed by the function interval of the second segment above the mean line value and the x-axis. The corresponding mean Mean2, peak-to-mean ratio Kp, and area-to-mean ratio Ks are as follows: (4) (5) (6) The principle for determining peaks is the same for horizontal and vertical projections. Since there is only one segment of digital tube, the peak of the projection curve is at most level I, so there is no need to determine the peak level, only to confirm that a peak exists. Horizontal projection is divided into three segments, and the method for calculating the mean, peak-to-mean ratio, and area-to-mean ratio of each segment is the same as in vertical projection. The method for recognizing numbers displayed on a digital tube is as follows: Set a threshold P for Kp, and a level I threshold S1 and a level II threshold S2 for Ks. Compare Kp, Ks, and the thresholds. If Kp or Ks is greater than P, it is determined that there is a peak in the projection segment, and the peak level is determined: greater than S1 indicates a level I peak, and greater than S2 indicates a level II peak. Then, store this peak characteristic in a string array. In the string array, the first three digits of the horizontal projection represent whether there is a peak in the three segments of the horizontal projection, with 1 indicating a peak and 0 indicating no peak. The last four digits of the vertical projection represent the vertical projection segment. In the first segment of the vertical projection, the peak identifiers are 0 (no peak) and 1 (peak). The second identifier is the peak level identifier in the first segment of the vertical projection, with 1 indicating a Class I peak and 2 indicating a Class II peak. The third identifier is the peak identifier in the second segment of the vertical projection, with 0 indicating no peak and 1 indicating a peak. The fourth identifier is the peak level identifier in the second segment of the vertical projection, with 1 indicating a Class I peak and 2 indicating a Class II peak. The peak characteristic array is then matched and compared with a digital database to achieve accurate identification. The specific identification method is as follows: (1) The height-to-width ratio of the cropped digit image is greater than 1.5, which is the digit 1. The ratio of the other digit images is less than 1.5, and the characteristics are obvious. (2) The first and third segments of the horizontal projection have peaks, while the second segment does not have a peak. The first and second segments of the vertical projection both have Class II peaks. Therefore, it is determined to be the number 0, and the peak characteristic array is [101 1212]. (3) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class I peaks, which are the numbers 2 or 5. The peak characteristic array is [111 1111]. Draw a horizontal tangent line in the upper left interval of the image. The number 2 is the one that does not intersect. (4) The first, second and third segments of the horizontal projection have peaks, while the first segment of the vertical projection has no peaks and the second segment has a Class II peak, which is the number 3. The peak characteristic array is [111 0012]. (5) The first and third segments of the horizontal projection have no peaks, while the second segment has a peak. The first segment of the vertical projection is a Class I peak, and the second segment is a Class II peak. Therefore, the number 4 is the peak characteristic array [010 1112]. (6) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class I peaks. The corresponding numbers are 2 or 5. The peak characteristic array is [111 1111]. Draw a horizontal tangent line in the upper left interval of the image. The number that intersects with the line is 5. (7) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection is a Class II peak, and the second segment is a Class I peak, which is the number 6. The peak characteristic array is [111 1211]. (8) The first segment of the horizontal projection has a peak, while the second and third segments do not have peaks. The first segment of the vertical projection does not have a peak, while the second segment has a Class II peak. Therefore, the number is 7, and the peak characteristic array is [100 0012]. (9) The first, second and third segments of the horizontal projection have peaks, and the first and second segments of the vertical projection have Class II peaks, which is the number 8. The peak characteristic array is [111 1212]. (10) The first, second and third segments of the horizontal projection have peaks. The first segment of the vertical projection has a Class I peak, and the second segment has a Class II peak, which is the number 9. The peak characteristic array is [111 1112].
2. The method for detecting welding voltage and welding current based on projection features according to claim 1, characterized in that, The tilt digital adaptive correction method is as follows: After converting the acquired image to grayscale, edge detection is performed using the Canny operator, followed by dilation using morphological structuring elements. The centroids of connected components in the image are then calculated using the regionprops() function. The specific algorithm is as follows: Calculate the area and centroid coordinates of all connected regions in the image, and sort them according to their area, resulting in S1(x1,y1)>S2(x2,y2)>S3(x3,y3)>…>S n (x n ,y n ), S n Let x be the area of the connected region. n ,y n Let be the centroid coordinates. Taking the centroid coordinates of the two connected regions with the largest areas, we obtain the tilt angle as . , Based on the identified tilt angle, the MATLAB function `imrotate()` is called to rotate the image, resulting in an image where the voltage and current values are level, which helps in the segmentation and recognition of numbers in the image.
Citation Information
Patent Citations
Night signal light detection and identification method based on color space and selective voting mechanism
CN103020603A
Method and apparatus for recognizing characters
CN106599889A