Weld hardness multi-point detection method and device based on pressure transmission, and medium
By using a pressure transmission-based method, the weld coverage area is identified and detection points are set for hardness testing and analysis. This solves the error and efficiency problems in multi-point weld hardness detection and achieves efficient and accurate weld hardness detection.
Patent Information
- Application Number
- CN202610289509.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-19
- Estimated Expiration
- 2046-03-11
AI Technical Summary
Existing technologies for multi-point hardness testing of welds suffer from large errors and low efficiency when the number of testing points is large, making it difficult to achieve accurate testing.
By using a pressure transmission-based method, the weld seam coverage area is identified, multiple hardness detection points and secondary detection points are set, hardness tests are performed, and the hardness variation zones of the weld seam coverage area are analyzed, outputting the hardness variation rate.
It enables accurate and efficient detection of weld hardness, reduces detection errors, and improves detection efficiency.
Smart Images

Figure CN121830339B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of materials testing technology, specifically a method, equipment, and medium for multi-point detection of weld hardness based on pressure transmission. Background Technology
[0002] Pressure transmission, or Pascal's Law, is a fundamental law of fluid statics. Specifically, it states that pressure changes in a static fluid within a closed container are uniformly transmitted through the fluid's flow. This law does not directly apply to solids because solids have a fixed molecular structure and lack the fluidity of fluids. However, pressure transmission can be viewed as a physical mechanism used to indirectly reflect localized differences in material hardness. Hardness testing is a method of assessing the localized mechanical properties of a material by measuring its resistance to indentation by a harder object.
[0003] However, at present, when performing multi-point testing on the hardness of the weld seam of the welded part, only a few testing points can be accurately tested. When there are many testing points, the adjacent testing points will cause errors in the hardness test results, and repeated hardness tests also lead to low efficiency of hardness testing.
[0004] Therefore, this invention proposes a method, equipment, and medium for multi-point detection of weld hardness based on pressure transmission. Summary of the Invention
[0005] The purpose of this invention is to propose a method, equipment, and medium for multi-point detection of weld hardness based on pressure transmission, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A multi-point detection method for weld hardness based on pressure transmission, the method includes:
[0008] Step S1: Identify the weld coverage area based on the weld image of the workpiece to be inspected;
[0009] Step S2: Analyze the weld coverage area of the weld to be inspected and set multiple hardness detection points and secondary hardness detection points for the weld to be inspected.
[0010] Step S3: Perform hardness testing on the weldment to be inspected based on the hardness test point and the secondary hardness test point to obtain the hardness test results for each hardness test point and the secondary hardness test point.
[0011] Step S4: Analyze the hardness test results based on the hardness test points and secondary hardness test points to obtain multiple hardness variation zones in the weld coverage area of the weldment to be inspected.
[0012] Step S5: Output the hardness change rate of the weldment to be inspected corresponding to multiple hardness change zones to characterize the hardness fluctuation of the weldment to be inspected.
[0013] Further, step S1 includes the following sub-steps:
[0014] Step S11: Place the weldment to be inspected on the test platform, fix the image acquisition device above the weldment to be inspected, and take a vertical downward image of the weldment to be inspected using the image acquisition device.
[0015] Step S12: Read the pixel value of each pixel in the weldment image, and divide the pixel value of each pixel according to the three basic components of the RGB color mode to obtain the R value component, G value component and B value component.
[0016] Step S13: Calculate the pixel grayscale value of the corresponding pixel based on the R-value component, G-value component and B-value component of the pixel.
[0017] Furthermore, step S1 also includes the following sub-steps:
[0018] Step S14: Traverse all pixels, record any pixel as the selected pixel, record the pixels adjacent to the selected pixel as the neighboring pixels, and calculate the standard deviation of the gray values corresponding to the gray values of the selected pixel and the neighboring pixels.
[0019] Step S15: Compare the standard deviation of grayscale values with a preset threshold. If the standard deviation of grayscale values is greater than or equal to the preset threshold, the selected pixel is recorded as an edge pixel. If the standard deviation of grayscale values is less than the preset threshold, no operation is performed.
[0020] Step S16: Connect all adjacent edge pixels. If the edge pixels are connected to form a closed shape, the corresponding closed shape is recorded as the weld seam coverage area. If the edge pixels are connected to form a closed shape, no operation is performed.
[0021] Further, step S2 includes the following sub-steps:
[0022] Step S21: Record each pixel within the weld seam coverage area as a weld seam pixel and read the pixel grayscale value of each weld seam pixel.
[0023] Step S22: Set the size of the moving window in the weld coverage area to k×k, and make the center position of the moving window coincide with the first weld pixel in the weld coverage area. Construct the gray value matrix of the weld pixel corresponding to the center position of the moving window through the pixel gray values of all weld pixels in the moving window.
[0024] Step S23: The first gradient value of the corresponding weld pixel is obtained by performing a convolution operation between the gray value matrix and the first convolution kernel, and the second gradient value of the corresponding weld pixel is obtained by performing a convolution operation between the gray value matrix and the second convolution kernel.
[0025] Furthermore, step S2 also includes the following sub-steps:
[0026] Step S24: Combine the first gradient value and the second gradient value to calculate the total gradient magnitude and the angle between the total gradients of the corresponding weld pixel.
[0027] Step S25: Traverse all weld pixels in the weld coverage area by moving the window to obtain the total gradient magnitude and the angle between the total gradient for each weld pixel.
[0028] Step S26: Read the total gradient magnitude and the angle between the total gradient of all weld seam pixels on the same horizontal line; number all weld seam pixels on the same horizontal line as i from left to right, and number all weld seam pixels on the same horizontal line as j from right to left, where z is a positive integer.
[0029] Furthermore, step S2 also includes the following sub-steps:
[0030] Step S27: sequentially compare weld seam pixel i with weld seam pixel j. If pixel i and pixel j have approximately symmetrical total gradient directions and approximately equal total gradient magnitudes, then record the corresponding pixel i and pixel j as symmetrical pixels; otherwise, do not perform any operation.
[0031] Step S28: The weld center point of the corresponding horizontal line is obtained by identifying symmetrical pixels on the same horizontal line, and all weld center points are connected to obtain the weld center line.
[0032] Step S29: Randomly set multiple hardness testing points on the weld centerline, and set secondary hardness testing points based on the symmetrical positions of the hardness testing points on both sides of the weld centerline.
[0033] Further, step S3 includes the following sub-steps:
[0034] Step S31: Fix the weldment to be inspected on a horizontal test platform, and set the number of indenters based on the total number of hardness test points and secondary hardness test points.
[0035] Step S32: Align the top of the indenter with the hardness test point and the secondary hardness test point on the same horizontal line, apply a fixed test pressure that is perpendicular to the test platform to the indenter, and continue for a duration of T1 to end the hardness test.
[0036] Step S33: After the hardness test is completed, fix the image acquisition device above the hardness test point or the secondary hardness test point to be tested, and acquire the hardness test image of the hardness test point or the secondary hardness test point.
[0037] Step S34: Based on the rectangles identified in the hardness test image in steps S12-S16, measure the lengths of the two diagonals corresponding to the rectangle and record them as the first diagonal length and the second diagonal length, respectively.
[0038] Step S35: Record the lengths of the first and second diagonals corresponding to the hardness test point and the secondary hardness test point as the hardness test results of the hardness test point and the secondary hardness test point.
[0039] Further, step S4 includes the following sub-steps:
[0040] Step S41: Read the hardness test results of each hardness test point of the weldment to be inspected, and obtain the length of the first diagonal and the second diagonal of the rectangle corresponding to the hardness test point;
[0041] Step S42: Obtain the magnitude of the detection pressure, and calculate the Vickers hardness of the hardness detection point based on the detection pressure, the length of the first diagonal, and the length of the second diagonal.
[0042] Step S43: Obtain the hardness test results of each secondary hardness test point in the weldment to be inspected, and obtain the length of the first diagonal and the second diagonal of the rectangle corresponding to each secondary hardness test point. Calculate the Vickers hardness of the secondary hardness test point based on step S42.
[0043] Step S44: Divide the weld coverage area into multiple hardness variation zones based on the hardness detection points and secondary hardness detection points on the same horizontal line.
[0044] Step S45: Read the hardness of the left and right endpoints of any hardness change zone, measure the zone length, and calculate the hardness change rate of the corresponding hardness change zone by combining the hardness of the left endpoint, the hardness of the right endpoint, and the zone length.
[0045] An electronic device, the electronic device comprising:
[0046] A memory that stores a computer program;
[0047] The processor is communicatively connected to the memory. When the computer program is executed by the processor, it implements a multi-point detection method for weld hardness based on pressure transmission.
[0048] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multi-point detection method for weld hardness based on pressure transmission.
[0049] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0050] 1. The present invention first identifies the weld coverage area based on the weld image of the weldment to be inspected; then analyzes the weld coverage area of the weldment to be inspected and sets multiple hardness detection points and secondary hardness detection points for the weldment to be inspected; by analyzing the weld image of the weldment to be inspected, multiple hardness detection points and secondary hardness detection points for the weldment to be inspected are set based on the analysis results.
[0051] 2. This invention performs hardness testing on the weldment under inspection based on hardness detection points and secondary hardness detection points, obtaining the hardness test results for each hardness detection point and secondary hardness detection point. Then, based on the hardness test results of the hardness detection points and secondary hardness detection points, multiple hardness variation zones corresponding to the weld seam coverage area of the weldment under inspection are obtained. Finally, the hardness variation rate of the multiple hardness variation zones corresponding to the weldment under inspection is output to characterize the hardness fluctuation of the weldment under inspection. By setting multiple hardness detection points and secondary hardness detection points on the weldment under inspection and performing hardness tests, accurate and efficient detection of the weld seam hardness of the weldment under inspection is achieved. Attached Figure Description
[0052] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0053] Figure 1 This is a flowchart of the method of the present invention;
[0054] Figure 2 This is a schematic diagram of the weld centerline in this invention;
[0055] Figure 3 This is a schematic diagram of the indenter used for hardness testing in this invention;
[0056] Figure 4 This is a schematic diagram of the hardness variation zones in this invention;
[0057] Figure 5 This is a schematic diagram of the electronic device in this invention. Detailed Implementation
[0058] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. 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.
[0059] Example 1: Please refer to Figures 1-4As shown, the technical solution provided by this invention is as follows: a multi-point detection method for weld hardness based on pressure transmission. This method identifies the weld coverage area of the weldment through an image of the weldment to be inspected, confirms the weld centerline based on the weld coverage area, and then sets multiple hardness detection points and secondary hardness detection points on the weldment according to the centerline. Hardness tests are performed on the hardness detection points and secondary hardness detection points. The Vickers hardness of each hardness detection point and secondary hardness detection point is calculated based on the hardness test results. Furthermore, the hardness change rate of each hardness change zone is calculated, thereby achieving efficient and accurate detection of the corresponding weld hardness of the weldment to be inspected.
[0060] In this invention, the multi-point detection method for weld hardness is specifically as follows:
[0061] Step S1: Identify the weld coverage area based on the weld image of the workpiece to be inspected;
[0062] In this invention, step S1 includes the following sub-steps:
[0063] Step S11: Place the weldment to be inspected on the test platform, fix the image acquisition device above the weldment to be inspected, and take a vertical downward image of the weldment to be inspected using the image acquisition device.
[0064] It should be noted that the image acquisition device can be an industrial camera; when the image acquisition device is fixed above the workpiece to be inspected, it should ensure that the entire welded area of the workpiece to be inspected is included in the acquisition frame of the image acquisition device.
[0065] Step S12: Read the pixel value of each pixel in the weldment image, and divide the pixel value of each pixel according to the three basic components of the RGB color mode to obtain the R value component, G value component and B value component.
[0066] Step S13: Calculate the pixel grayscale value of the corresponding pixel based on its R, G, and B components. The specific formula for calculating the pixel grayscale value is as follows:
[0067] Pixel grayscale value = A1 × R value component + A2 × G value component + A3 × B value component; where A1, A2, and A3 are fixed scaling factors, A2 > A1 > A3. In practice, A1 = 0.299, A2 = 0.587, and A3 = 0.114.
[0068] Step S14: Traverse all pixels, record any pixel as the selected pixel, record the pixels adjacent to the selected pixel as the neighboring pixels, and calculate the standard deviation of the gray values corresponding to the gray values of the selected pixel and the neighboring pixels.
[0069] Step S15: Compare the standard deviation of grayscale values with a preset threshold. If the standard deviation of grayscale values is greater than or equal to the preset threshold, the selected pixel is recorded as an edge pixel. If the standard deviation of grayscale values is less than the preset threshold, no operation is performed.
[0070] Step S16: Connect all adjacent edge pixels. If the edge pixels are connected to form a closed shape, the corresponding closed shape is recorded as the weld seam coverage area. If the edge pixels are connected to form a closed shape, no operation is performed. Here, a closed image refers to a shape enclosed by a boundary that is completely connected end to end without interruption.
[0071] Step S2: Analyze the weld coverage area of the weld to be inspected and set multiple hardness detection points and secondary hardness detection points for the weld to be inspected.
[0072] In this invention, step S2 includes the following sub-steps:
[0073] Step S21: Record each pixel within the weld seam coverage area as a weld seam pixel and read the pixel grayscale value of each weld seam pixel.
[0074] Step S22: Set the size of the moving window in the weld coverage area to k×k, and make the center position of the moving window coincide with the first weld pixel in the weld coverage area. Construct the gray value matrix of the weld pixel corresponding to the center position of the moving window through the pixel gray values of all weld pixels in the moving window; where k is a constant, preferably k=3.
[0075] Step S23: The first gradient value YT corresponding to the weld pixel is obtained by performing a convolution operation between the grayscale value matrix and the first convolution kernel; the second gradient value ET corresponding to the weld pixel is obtained by performing a convolution operation between the grayscale value matrix and the second convolution kernel; wherein, the first convolution kernel is a gradient kernel in the horizontal direction, and the second convolution kernel is a gradient kernel in the vertical direction. Specifically, the first convolution kernel is: The second convolution kernel is: ;
[0076] Step S24: Combine the first gradient value and the second gradient value to calculate the total gradient magnitude ZF and the total gradient angle JJ of the corresponding weld pixel.
[0077] Specifically, JJ = arctan2(ET, YT); where YT is the first gradient value and ET is the second gradient value; the total gradient amplitude is a physical quantity that describes the intensity of the gray value change of the weld pixel. The larger the total gradient amplitude, the more drastic the gray value change of the weld pixel. The total gradient angle is the angle between the direction of the fastest gray value change of the weld pixel and the horizontal direction, which is used to indicate the direction of the fastest gray value change of the weld pixel.
[0078] Step S25: Traverse all weld pixels in the weld coverage area by moving the window to obtain the total gradient magnitude and the angle between the total gradient for each weld pixel.
[0079] Step S26: Read the total gradient magnitude and the angle between the total gradient of all weld seam pixels on the same horizontal line; number all weld seam pixels on the same horizontal line from left to right as i, i=1, 2, ..., z, and number all weld seam pixels on the same horizontal line from right to left as j, j=1, 2, ..., z, where z is a positive integer.
[0080] Step S27: sequentially compare weld seam pixel i with weld seam pixel j. If pixel i and pixel j have approximately symmetrical total gradient directions and approximately equal total gradient magnitudes, then record the corresponding pixel i and pixel j as symmetrical pixels; otherwise, do not perform any operation.
[0081] It should be noted that i and j are not the same pixel; the condition for approximate symmetry of the total gradient direction is: |JJi-(JJj+π)|<α; the condition for approximate equality of the total gradient magnitude is |ZFi-ZFj|<β; where JJi is the angle of the total gradient corresponding to pixel i, JJj is the angle of the total gradient corresponding to pixel j, π is pi; ZFi is the magnitude of the total gradient corresponding to pixel i, ZFj is the magnitude of the total gradient corresponding to pixel j; α is the boundary value for angle determination, β is the boundary value for magnitude determination, and both α and β are constants;
[0082] Step S28: The weld center point of the corresponding horizontal line is obtained by identifying symmetrical pixels on the same horizontal line, and all weld center points are connected to obtain the weld center line.
[0083] It should be noted that if the coordinates of symmetrical pixels are (X1, Y1) and (X2, Y2), then the coordinates of the weld center point are ((X1+X2) / 2, (Y1+Y2) / 2); if there are multiple sets of symmetrical pixels on the same horizontal line, resulting in multiple different weld center points, then the actual weld center point is: the average of the sum of the coordinates of the weld center points of multiple sets of symmetrical pixels.
[0084] Step S29, as Figure 2 As shown, multiple hardness testing points are randomly set on the center line of the weld, and secondary hardness testing points are set based on the symmetrical positions of the hardness testing points on both sides of the center line of the weld.
[0085] Step S3: Perform hardness testing on the weldment to be inspected based on the hardness test point and the secondary hardness test point to obtain the hardness test results for each hardness test point and the secondary hardness test point.
[0086] In this invention, step S3 includes the following sub-steps:
[0087] Step S31: Fix the weldment to be inspected on a horizontal test platform, and set the number of indenters based on the total number of hardness test points and secondary hardness test points; wherein, the indenter is a component for measuring the material hardness, indentation resistance and mechanical properties; the number of indenters is the same as the total number of hardness test points plus secondary hardness test points.
[0088] It should be noted that the indenter used in this invention is a standard diamond square pyramid with a square base and four congruent isosceles triangles intersecting at the vertices. The angle between any two opposite faces is 136°.
[0089] In this embodiment, the pressure head is connected to a pressure equalization device containing liquid. An initial pressure is applied to the pressure equalization device, and then the liquid in the pressure equalization device is used to distribute the initial pressure evenly to multiple pressure heads according to the pressure transmission principle, so that the pressure head obtains a vertically downward force, thereby realizing hardness detection.
[0090] Step S32, as follows Figure 3 As shown, align the top of the indenter with the hardness test point and the secondary hardness test point on the same horizontal line, apply a fixed test pressure perpendicular to the test platform to the indenter, and continue for a duration of T1 to end the hardness test; the fixed test pressure is generally between 1 gram force and 100 kilogram force, and is set according to the material type, size of the weldment to be tested and the purpose of the test; T1 is a constant, generally taken as 10-15 seconds;
[0091] Step S33: After the hardness test is completed, fix the image acquisition device above the hardness test point or the secondary hardness test point to be tested, and acquire the hardness test image of the hardness test point or the secondary hardness test point.
[0092] Step S34: Based on the rectangles identified in the hardness test image in steps S12-S16, measure the lengths of the two diagonals corresponding to the rectangle and record them as the first diagonal length and the second diagonal length, respectively.
[0093] Step S35: Record the lengths of the first and second diagonals corresponding to the hardness test point and the secondary hardness test point as the hardness test results of the hardness test point and the secondary hardness test point.
[0094] Step S4: Analyze the hardness test results based on the hardness test points and secondary hardness test points to obtain multiple hardness variation zones in the weld coverage area of the weldment to be inspected.
[0095] In this invention, step S4 includes the following sub-steps:
[0096] Step S41: Read the hardness test results of each hardness test point of the weldment to be inspected, and obtain the length of the first diagonal d1 and the length of the second diagonal d2 of the rectangle corresponding to the hardness test point;
[0097] Step S42: Obtain the magnitude of the detection pressure YL. Based on the detection pressure, the length of the first diagonal, and the length of the second diagonal, calculate the Vickers hardness WY at the hardness detection point. The specific formula for calculating Vickers hardness is as follows:
[0098] WY = G1 × YL / (d1 + d2) 2 / 4; where G1 is a constant calculated based on the shape of the indenter; specifically, G1 = 2 × sin(136° / 2) = 2 × sin68° ≈ 2 × 0.9872 = 1.8544;
[0099] Step S43: Obtain the hardness test results of each secondary hardness test point in the weldment to be inspected, and obtain the length of the first diagonal and the second diagonal of the rectangle corresponding to each secondary hardness test point. Calculate the Vickers hardness of the secondary hardness test point based on step S42.
[0100] Step S44, as follows Figure 4 As shown, the weld coverage area is divided into multiple hardness variation zones based on the hardness detection points and secondary hardness detection points on the same horizontal line.
[0101] Step S45: Read the hardness of the left and right endpoints of any hardness variation zone, measure the zone length, and calculate the hardness change rate of the corresponding hardness variation zone by combining the hardness of the left and right endpoints and the zone length; specifically:
[0102] Hardness change rate = (hardness at the right end point - hardness at the left end point) / partition length; if the hardness change rate is greater than zero, it means that the hardness increases from left to right in the corresponding hardness change partition; if the hardness change rate is less than zero, it means that the hardness decreases from left to right in the corresponding hardness change partition; if the hardness is equal to zero, it means that the hardness remains unchanged in the hardness change partition.
[0103] Step S5: Output the hardness change rate of the weldment to be inspected corresponding to multiple hardness change zones to characterize the hardness fluctuation of the weldment to be inspected.
[0104] Example 2: This embodiment of the invention also provides an electronic device for running the aforementioned multi-point weld hardness detection method; see [link to previous example]. Figure 5 The schematic diagram of an electronic device provided by the embodiment of the present invention shown below includes a memory and a processor. The memory is used to store one or more computer instructions, which are executed by the processor to realize the above-mentioned multi-point detection method for weld hardness.
[0105] Furthermore, Figure 5 The electronic device shown also includes a communication bus and a communication interface, with the processor, communication interface and memory connected via the communication bus;
[0106] The memory may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The communication bus can be an ISA bus, PCI bus, or EISA bus, etc. The communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by only one double-headed arrow, but this does not mean that there is only one communication bus or one type of communication bus.
[0107] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above methods can be completed by integrated logic circuits in the processor's hardware or by software instructions. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0108] Example 3: This embodiment of the invention also provides a computer storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-mentioned multi-point detection method for weld hardness. For specific implementation details, please refer to the method embodiment, which will not be repeated here.
[0109] The computer program product of the multi-point detection method for weld hardness provided in the embodiments of the present invention includes a computer storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system or device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0111] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0112] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-point detection method for weld hardness based on pressure transmission, characterized in that, The methods include: Step S1: Identify the weld coverage area based on the weld image of the workpiece to be inspected; Step S2: Analyze the weld coverage area of the weld to be inspected and set multiple hardness detection points and secondary hardness detection points for the weld to be inspected. Step S2 includes the following sub-steps: Step S21: Record each pixel within the weld seam coverage area as a weld seam pixel and read the pixel grayscale value of each weld seam pixel. Step S22: Set the size of the moving window in the weld coverage area to k×k, and make the center position of the moving window coincide with the first weld pixel in the weld coverage area. Construct the gray value matrix of the weld pixel corresponding to the center position of the moving window through the pixel gray values of all weld pixels in the moving window. Step S23: The first gradient value of the corresponding weld pixel is obtained by performing a convolution operation between the gray value matrix and the first convolution kernel, and the second gradient value of the corresponding weld pixel is obtained by performing a convolution operation between the gray value matrix and the second convolution kernel. Step S24: Combine the first gradient value and the second gradient value to calculate the total gradient magnitude and the angle between the total gradients of the corresponding weld pixel. Step S25: Traverse all weld pixels in the weld coverage area by moving the window to obtain the total gradient magnitude and the angle between the total gradient for each weld pixel. Step S26: Read the total gradient magnitude and the angle between the total gradient of all weld seam pixels on the same horizontal line; number all weld seam pixels on the same horizontal line as i from left to right, and number all weld seam pixels on the same horizontal line as j from right to left; Step S27: sequentially compare weld seam pixel i with weld seam pixel j. If pixel i and pixel j have approximately symmetrical total gradient directions and approximately equal total gradient magnitudes, then record the corresponding pixel i and pixel j as symmetrical pixels; otherwise, do not perform any operation. Step S28: The weld center point of the corresponding horizontal line is obtained by identifying symmetrical pixels on the same horizontal line, and all weld center points are connected to obtain the weld center line. Step S29: Randomly set multiple hardness testing points on the weld centerline, and set secondary hardness testing points based on the symmetrical positions of the hardness testing points on both sides of the weld centerline. Step S3: Perform hardness testing on the weldment to be inspected based on the hardness test point and the secondary hardness test point to obtain the hardness test results for each hardness test point and the secondary hardness test point. Step S4: Analyze the hardness test results based on the hardness test points and secondary hardness test points to obtain multiple hardness variation zones in the weld coverage area of the weldment to be inspected. Step S5: Output the hardness change rate of the weldment to be inspected corresponding to multiple hardness change zones to characterize the hardness fluctuation of the weldment to be inspected.
2. The multi-point detection method for weld hardness based on pressure transmission according to claim 1, characterized in that, Step S1 includes the following sub-steps: Step S11: Place the weldment to be inspected on the test platform, fix the image acquisition device above the weldment to be inspected, and take a vertical downward image of the weldment to be inspected using the image acquisition device. Step S12: Read the pixel value of each pixel in the weldment image, and divide the pixel value of each pixel according to the three basic components of the RGB color mode to obtain the R value component, G value component and B value component. Step S13: Calculate the pixel grayscale value of the corresponding pixel based on the R-value component, G-value component and B-value component of the pixel.
3. The multi-point detection method for weld hardness based on pressure transmission according to claim 2, characterized in that, Step S1 further includes the following sub-steps: Step S14: Traverse all pixels, record any pixel as the selected pixel, record the pixels adjacent to the selected pixel as the neighboring pixels, and calculate the standard deviation of the gray values corresponding to the gray values of the selected pixel and the neighboring pixels. Step S15: Compare the standard deviation of grayscale values with a preset threshold. If the standard deviation of grayscale values is greater than or equal to the preset threshold, the selected pixel is recorded as an edge pixel. If the standard deviation of grayscale values is less than the preset threshold, no operation is performed. Step S16: Connect all adjacent edge pixels. If the edge pixels are connected to form a closed shape, the corresponding closed shape is recorded as the weld seam coverage area. If the edge pixels are connected to form a closed shape, no operation is performed.
4. The multi-point detection method for weld hardness based on pressure transmission according to claim 1, characterized in that, Step S3 includes the following sub-steps: Step S31: Fix the weldment to be inspected on a horizontal test platform, and set the number of indenters based on the total number of hardness test points and secondary hardness test points. Step S32: Align the top of the indenter with the hardness test point and the secondary hardness test point on the same horizontal line, apply a fixed test pressure that is perpendicular to the test platform to the indenter, and continue for a duration of T1 to end the hardness test. Step S33: After the hardness test is completed, fix the image acquisition device above the hardness test point or the secondary hardness test point to be tested, and acquire the hardness test image of the hardness test point or the secondary hardness test point. Step S34: Based on the rectangles identified in the hardness test image in steps S12-S16, measure the lengths of the two diagonals corresponding to the rectangle and record them as the first diagonal length and the second diagonal length, respectively. Step S35: Record the lengths of the first and second diagonals corresponding to the hardness test point and the secondary hardness test point as the hardness test results of the hardness test point and the secondary hardness test point.
5. The multi-point detection method for weld hardness based on pressure transmission according to claim 1, characterized in that, Step S4 includes the following sub-steps: Step S41: Read the hardness test results of each hardness test point of the weldment to be inspected, and obtain the length of the first diagonal and the second diagonal of the rectangle corresponding to the hardness test point; Step S42: Obtain the magnitude of the detection pressure, and calculate the Vickers hardness of the hardness detection point based on the detection pressure, the length of the first diagonal, and the length of the second diagonal. Step S43: Obtain the hardness test results of each secondary hardness test point in the weldment to be inspected, and obtain the length of the first diagonal and the second diagonal of the rectangle corresponding to each secondary hardness test point. Calculate the Vickers hardness of the secondary hardness test point based on step S42. Step S44: Divide the weld coverage area into multiple hardness variation zones based on the hardness detection points and secondary hardness detection points on the same horizontal line. Step S45: Read the hardness of the left and right endpoints of any hardness change zone, measure the zone length, and calculate the hardness change rate of the corresponding hardness change zone by combining the hardness of the left endpoint, the hardness of the right endpoint, and the zone length.
6. An electronic device, characterized in that, The electronic device includes: A memory that stores a computer program; A processor, communicatively connected to the memory, implements the method described in any one of claims 1-5 when the computer program is executed by the processor.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Method for measuring hardness distribution of fastener
CN109507055A
Vickers hardness detection method and detection system
CN118032556A