Weld joint detection method, device and system

By preprocessing images of weld metallographic samples and upgrading detection algorithms, the problem of insufficient weld detection accuracy has been solved, achieving high-precision automated detection and reducing costs.

CN121837221APending Publication Date: 2026-04-10CRRC YANGTZE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies lack sufficient precision in weld parameter and defect detection, and reliance on manual measurement and observation leads to inconsistent results.

Method used

By acquiring the metallographic image of the weld seam sample to be inspected, preprocessing it, and using image processing algorithms to identify the weld seam area, and combining it with a preset detection strategy for accurate detection, including image preprocessing, weld seam area identification, and detection algorithm upgrade.

Benefits of technology

It enables precise detection of weld parameters and defects, reduces reliance on human experience, improves the accuracy of detection results, and lowers detection costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837221A_ABST
    Figure CN121837221A_ABST
Patent Text Reader

Abstract

The invention provides a welding seam detection method, device and system, and the method comprises the steps: obtaining a to-be-detected image of a welding seam metallographic sample when the prefabricated welding seam metallographic sample is placed on a detection platform; preprocessing the to-be-detected image to obtain a preprocessed image, determining a welding seam area from the preprocessed image, and detecting the welding seam area based on a preset detection strategy to obtain a welding seam detection result; thus, the weld joint is prepared into the metallographic sample, the image of the metallographic sample is collected to obtain the to-be-detected image, the to-be-detected image is preprocessed, noise interference is removed, and the recognition precision of the weld joint area is improved; when the welding seam area is detected by using the preset detection strategy, the detection result can be accurately quantified, and the whole detection process does not need to depend on artificial experience judgment, so that the precision of the welding seam detection result is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of weld detection, and in particular to a weld detection method, device and system. BACKGROUND

[0002] As a core process of connecting metal components in industrial manufacturing, the mechanical properties and integrity of the welded joint directly determine the quality of the entire product, and weld detection is a key means to identify welding defects and verify welding quality. Therefore, whether the weld parameters (such as penetration and width) can be accurately measured and whether the weld defects (such as pores and cracks) can be accurately identified are crucial.

[0003] In related technologies, the weld area is generally measured and read by manual operation through the scale of a microscope, and the size measurement relies on manual operation, and the precision is affected by the experience level and visual judgment of the operator. When observing the weld defects, different operators may have different observation results, and the consistency is poor.

[0004] Therefore, there is an urgent need for a weld detection method to improve the detection accuracy of weld parameters and weld defects. SUMMARY

[0005] To solve or partially solve the technical problem that the detection accuracy of weld parameters and weld defects cannot be ensured when detecting the weld in the prior art, the embodiments of the present application provide a weld detection method, device and system.

[0006] In a first aspect, the present application provides a weld detection method, which comprises: placing a pre-prepared weld metallographic sample on a detection platform, and obtaining a to-be-detected image of the weld metallographic sample; preprocessing the to-be-detected image to obtain a preprocessed image, and determining a weld area from the preprocessed image; detecting the weld area based on a preset detection strategy to obtain a weld detection result.

[0007] In the above-mentioned solution, before obtaining the to-be-detected image of the weld metallographic sample, the method further comprises: obtaining a weld cross-section sample, and polishing the weld cross-section sample using sandpaper; polishing the polished weld cross-section sample using an alumina polishing liquid; corrosion of the polished weld cross-section sample using a nitric acid alcohol solution of a preset concentration to obtain the weld metallographic sample.

[0008] In the above-mentioned solution, the preprocessing of the to-be-detected image comprises: convert the image to be detected into a first gray-scale image; perform noise reduction processing on the first gray-scale image using a Gaussian filter to obtain a second gray-scale image; perform filtering processing on the second gray-scale image using a median filtering algorithm to obtain a third gray-scale image; perform adaptive brightness equalization processing on the third gray-scale image to obtain a fourth gray-scale image; perform morphological opening operation on the fourth gray-scale image to obtain the preprocessed image.

[0009] In the above scheme, the adaptive brightness equalization processing on the third gray-scale image includes: divide the third gray-scale image into a plurality of image blocks of a preset size, and determine a total number of block pixels according to the size of the image blocks; for each image block, determine a first gray-scale histogram of the image block, the first gray-scale histogram including actual pixel numbers corresponding to each gray level; determine a target pixel number of each gray level according to the total number of block pixels, a total number of gray levels, and a preset contrast gain; determine an over-limit pixel number of each gray level according to the actual pixel number corresponding to each gray level and the target pixel number corresponding to each gray level, determine a total over-limit pixel number of the image block according to the over-limit pixel number corresponding to each gray level, and sequentially distribute the total over-limit pixel number to target gray levels based on a round-robin distribution mechanism; determine a second gray-scale histogram of the image block after pixel distribution, determine a cumulative distribution function value corresponding to each key gray value based on the second gray-scale histogram, and determine a cumulative distribution function value corresponding to a remaining gray value according to the cumulative distribution function value corresponding to each key gray value; determine a new gray value corresponding to each gray value according to the cumulative distribution function value corresponding to each gray value, update the gray value of the corresponding image block according to the new gray value, and obtain an updated image block.

[0010] In the above scheme, the determination of the target pixel number of each gray level according to the total number of block pixels, the total number of gray levels, and the preset contrast gain includes: determine the target pixel number n of each gray level according to the formula the total number of block pixels is N, the total number of gray levels is L, and the contrast gain is G. the total number of block pixels is N, the total number of gray levels is L, and the contrast gain is G. the total number of block pixels is N, the total number of gray levels is L, and the contrast gain is G. the total number of block pixels is N, the total number of gray levels is L, and the contrast gain is G.

[0011] ​In the above scheme, determining the number of over-limit pixels corresponding to each gray level based on the actual number of pixels corresponding to each gray level and the target number of pixels corresponding to each gray level includes: For each gray level, the difference between the actual number of pixels and the target number of pixels is determined as the number of pixels exceeding the limit corresponding to that gray level.

[0012] In the above scheme, determining the cumulative distribution function value corresponding to the remaining gray values ​​based on the cumulative distribution function value corresponding to each key gray value includes: For any remaining grayscale value, determine the target key grayscale value corresponding to the remaining grayscale value; The cumulative distribution function of the remaining gray values ​​is interpolated based on the cumulative distribution function value of the target key gray value to obtain the cumulative distribution function value corresponding to the remaining gray values.

[0013] In the above scheme, determining the weld area from the preprocessed image includes: The preset edge region of the preprocessed image is determined as the reference region of the base material; The brightness threshold is determined based on the average grayscale value of all pixels in the reference area of ​​the parent material; The preprocessed image is converted into a binary image according to the brightness threshold, and multiple consecutive bright pixel clusters are extracted from the binary image. The multiple consecutive bright pixel clusters are determined as candidate regions. The candidate regions are selected based on preset area thresholds and shape features to obtain the weld region.

[0014] In the above scheme, the weld inspection result includes: whether there are inclusion defects in the weld area; the inspection of the weld area based on a preset inspection strategy to obtain the weld inspection result includes: The weld area is then filled with color. Determine whether there are color difference areas in the weld area; if so, determine that the weld has inclusion defects.

[0015] In the above scheme, the weld inspection result includes whether there is porosity in the weld area; after the color filling operation is performed on the weld area, the method further includes: Determine whether there are any blank areas in the weld area; if so, determine that there are pores inside the weld.

[0016] In the above scheme, the weld inspection result includes: weld penetration; the inspection of the weld area based on a preset inspection strategy includes: A first reference line extends from the cross-sectional edge of the base material region toward the weld region; Determine the edge contour of the weld area; Find the reference point that is furthest from the baseline in the edge contour, determine the vertical distance between the reference point and the first baseline, and determine the vertical distance as the weld depth of the weld area.

[0017] In the above scheme, finding the reference point with the largest distance from the first reference line in the edge contour includes: Multiple sampling points are obtained by sampling along the edge contour at preset intervals; Determine the vertical distance between each pixel and the first baseline in sequence; The sampling point corresponding to the maximum vertical distance is determined as the reference point.

[0018] In the above scheme, when the weld is a fillet weld, the weld inspection result further includes: weld wheezing; the inspection of the weld area based on a preset inspection strategy includes: A second reference line is defined on the edge profile of the weld surface; Using the second reference line as a reference, an auxiliary line parallel to the second reference line is determined at the fusion line position in the weld area; The vertical distance between the second baseline and the auxiliary line is defined as the weld head of the weld area.

[0019] A second aspect of the present invention provides a weld inspection device, the device comprising: The acquisition unit is used to acquire the image to be inspected of the prefabricated weld metallographic sample when it is placed on the inspection platform. The processing unit is used to preprocess the image to be detected to obtain a preprocessed image, and to determine the weld area from the preprocessed image; The detection unit is used to detect the weld area based on a preset detection strategy and obtain the weld detection result.

[0020] A third aspect of the present invention provides a weld inspection system, the system comprising: an image acquisition device and the weld inspection apparatus described in the second aspect; wherein, The image acquisition device is used to acquire the image to be inspected of the prefabricated weld metallographic sample when it is placed on the inspection platform, and to send the image to be inspected to the weld inspection device. The weld inspection device is used to preprocess the image to be inspected to obtain a preprocessed image; determine the weld area from the preprocessed image; and inspect the weld area based on a preset inspection strategy to obtain a weld inspection result.

[0021] This invention provides a weld inspection method, apparatus, and system. The method includes: placing a pre-fabricated weld metallographic sample on an inspection platform and acquiring an image of the weld metallographic sample to be inspected; preprocessing the image to be inspected to obtain a preprocessed image; determining the weld region from the preprocessed image and inspecting the weld region based on a preset inspection strategy to obtain a weld inspection result. Thus, by preparing the weld as a metallographic sample, acquiring an image of the metallographic sample to obtain the image to be inspected, preprocessing the image to be inspected to remove noise interference, and improving the accuracy of weld region identification; and then using the preset inspection strategy to inspect the weld region, the inspection result can be accurately quantified, and the entire inspection process does not rely on human experience judgment, thereby ensuring the accuracy of the weld inspection result. Attached Figure Description

[0022] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A schematic diagram of a weld inspection system according to an embodiment of the present invention is shown; Figure 2 A schematic flowchart of a weld inspection method according to an embodiment of the present invention is shown; Figure 3 A schematic diagram of a weld area according to an embodiment of the present invention is shown; Figure 4 A schematic diagram of weld penetration depth according to an embodiment of the present invention is shown; Figure 5 A schematic diagram of a weld inspection device according to an embodiment of the present invention is shown. Detailed Implementation

[0023] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0024] To better understand the technical solution of this invention, a weld inspection system will be introduced first, such as... Figure 1 As shown, the weld inspection system includes: an image acquisition device 1 and a weld inspection device 2; wherein, Image acquisition device 1 is used to acquire the image to be inspected of the pre-made weld metallographic sample when it is placed on the inspection platform, and send the image to be inspected to the weld inspection device. The inspection platform can be the platform of a metallographic microscope. At a preset magnification, image acquisition device 1 can acquire the image to be inspected of the weld metallographic sample. The preset magnification can be set according to actual needs, such as 10x or 100x.

[0025] The weld inspection device 2 is used to preprocess the image to be inspected to obtain a preprocessed image; determine the weld area from the preprocessed image; inspect the weld area based on a preset inspection strategy to obtain the weld inspection result.

[0026] To reduce testing costs, this invention utilizes the company's existing hardness indentation testing system to perform weld inspection. The image acquisition device can be a CCD scanning device, and the weld inspection device can be a computer device with an image recognition algorithm.

[0027] Since there are differences between the weld inspection scenario and the indentation measurement scenario of ordinary materials, the main differences are as follows: (1) The weld surface has a metal cladding layer with strong reflection; (2) The weld morphology is irregular; (3) There may be high temperature residue (some online inspection scenarios); (4) A larger scanning range needs to be covered (indentation measurement is a single point, while welds need to be scanned in a region).

[0028] Therefore, for weld inspection scenarios, this invention first requires upgrading the CCD scanning equipment and the image recognition algorithm in the computer equipment, as follows: For CCD scanning equipment, upgrade methods include: First, adjust the resolution of the CCD scanning device to 5 megapixels or higher.

[0029] Second, adjust the exposure and gain settings of the CCD scanning equipment, using a short exposure and low gain combination mode to avoid overexposure.

[0030] Third, adjust the scanning mode of the CCD scanning device to area scanning mode and set the scanning step size to 0.1mm.

[0031] Fourth, add ring-shaped polarized light sources on both sides of the CCD scanning equipment to eliminate metal reflections. Directional light sources eliminate surface reflections on the weld, enhancing the contrast between the weld and the base material.

[0032] Upgrade methods for weld inspection devices include: The image recognition algorithm of the weld inspection device is upgraded to include an image preprocessing algorithm, a weld area recognition algorithm, and a weld area detection algorithm. The image preprocessing algorithm is used to preprocess the image to be inspected to obtain a preprocessed image. The weld area recognition algorithm is used to determine the weld area from the preprocessed image. The weld area detection algorithm (with a preset detection strategy) is used to detect the weld area to obtain the weld inspection result.

[0033] In this way, upgrading the company's existing hardness indentation testing system for weld inspection can not only reduce testing costs, but also improve the accuracy of weld inspection by specifically upgrading the image recognition algorithm for the weld area.

[0034] The specific implementation logic of image recognition in the weld seam inspection device will be described in detail in the subsequent embodiments of the weld seam inspection device, so it will not be repeated here.

[0035] Based on the same inventive concept as the foregoing embodiments, the present invention provides a weld inspection method, which is applied in a weld inspection device, such as... Figure 2 As shown, the method mainly includes the following steps: S210, when the pre-made weld metallographic sample is placed on the inspection platform, the image to be inspected of the weld metallographic sample is obtained.

[0036] Before obtaining metallographic samples of the weld, it is necessary to prepare metallographic samples from the weld cross-section, including: Obtain a weld section sample and polish the weld section sample with sandpaper; The weld section sample after grinding was polished using alumina polishing liquid; The polished weld section sample was etched using a nitric acid alcohol solution of a preset concentration to obtain the weld metallographic sample.

[0037] Specifically, a weld section sample (10mm x 10mm) can be taken and fixed on a metallographic fixture, ensuring the surface to be treated is level. The sample is then polished with sandpaper of different grits until the surface is smooth and free of obvious scratches.

[0038] Press the weld section lightly onto the polishing cloth of the metallographic polishing machine (with 0.5μm alumina suspension polishing liquid added to the polishing cloth), and control the metallographic polishing machine (speed 1500-2000r / min) to rotate at a uniform speed for 5-10 minutes until the sample surface is bright; after polishing, rinse the weld section sample with anhydrous ethanol and dry it with cold air.

[0039] Immerse the surface of the weld section specimen to be observed in the etchant for 5-10 seconds, rinse with anhydrous ethanol, and dry with cold air to complete the preparation of the weld metallographic specimen.

[0040] The metallographic sample of the weld is placed on the inspection platform of a metallographic microscope. At a preset magnification, the image acquisition device acquires the image of the weld metallographic sample to be inspected. The image acquisition device sends the image to be inspected to the weld inspection device, which then obtains the image of the weld metallographic sample to be inspected.

[0041] S211, preprocess the image to be detected to obtain a preprocessed image, and determine the weld area from the preprocessed image.

[0042] To improve the accuracy of weld inspection results, it is also necessary to preprocess the images to be inspected to obtain preprocessed images, which can retain the brightness difference characteristics between the weld and the base material, while eliminating irrelevant interference.

[0043] In one embodiment, the image to be detected is preprocessed, including: Convert the image to be detected into a first grayscale image; The first grayscale image is denoised using a Gaussian filter to obtain the second grayscale image; The second grayscale image is filtered using a median filtering algorithm to obtain the third grayscale image; The third grayscale image is subjected to adaptive brightness equalization processing to obtain the fourth grayscale image; A morphological opening operation is performed on the fourth grayscale image to obtain a preprocessed image.

[0044] Specifically, the image to be tested is first converted into a first grayscale image to remove interference from color information, while greatly simplifying the subsequent calculations.

[0045] A Gaussian filter (Gaussian convolution kernel) is used to perform a convolution operation on the first grayscale image to remove random early points, resulting in a second grayscale image.

[0046] To eliminate the fine scratches left by grinding or polishing, the second grayscale image obtained after Gaussian filtering is subjected to median filtering, and the grayscale value of each pixel is replaced with the median grayscale value in its 3×3 neighborhood.

[0047] To improve the uniformity of illumination in the image, adaptive brightness equalization processing is also required on the third grayscale image to obtain the fourth grayscale image.

[0048] In one implementation, adaptive brightness equalization processing is performed on the third grayscale image, including: The third grayscale image is divided into multiple image blocks of a preset size, and the total number of pixels in each block is determined based on the size of the image block. For each image block, determine the first gray-level histogram of the image block. The first gray-level histogram contains the actual number of pixels corresponding to each gray level. The target number of pixels for each gray level is determined based on the total number of pixels in the block, the total number of gray levels, and the preset contrast gain. The number of over-limit pixels corresponding to each gray level is determined based on the actual number of pixels corresponding to each gray level and the target number of pixels corresponding to each gray level. The total number of over-limit pixels in the image block is determined based on the number of over-limit pixels corresponding to each gray level. The total number of over-limit pixels is then allocated to the target gray level in sequence based on a round-robin allocation mechanism. A second gray-level histogram of the image block after pixel allocation is determined, and the cumulative distribution function value corresponding to each key gray-level value is determined based on the second gray-level histogram; the cumulative distribution function value corresponding to the remaining gray-level values ​​is determined based on the cumulative distribution function value corresponding to each key gray-level value. Determine the key gray values, and based on the cumulative distribution function value corresponding to each key gray value, determine the new gray value corresponding to each key gray value. Update the gray values ​​of the corresponding image blocks based on the new gray values ​​to obtain the updated image blocks.

[0049] Specifically, to avoid damaging the weld features, the third grayscale image can be divided into multiple 16×16 image blocks, and adaptive brightness equalization can be performed on each image block individually. For each image block, the actual number of pixels at each grayscale level (0~255) in the image block is first counted to generate the first grayscale histogram of the image block.

[0050] For example, take a 16×16 image block as an example: This image block has a total of 256 pixels. There are 3 pixels with a gray value of 100, 5 pixels with a gray value of 120, and so on. Based on these gray value statistics, the first gray histogram can be generated.

[0051] To avoid excessive brightness in certain grayscale levels due to an excessive number of pixels, the target pixel count for each grayscale level needs to be determined based on the total number of pixels in the block, the total number of grayscale levels, and the preset contrast gain. This includes: According to the formula Determine the target pixel count n for each gray level; This represents the total number of pixels in the block. This represents the total number of gray levels. This is for contrast gain.

[0052] Continuing with the example of the image block mentioned above, a 16×16 image block contains 256 pixels, therefore the total number of pixels in the block is 256, and the total number of gray levels is 0~255. The value is 256, and the contrast gain is a preset value, which can be 2. Therefore, the number of target pixels for each grayscale level is n=2.

[0053] For each gray level, the difference between the actual number of pixels and the target number of pixels is determined as the number of pixels exceeding the limit for that gray level.

[0054] If the actual number of pixels with a gray level of 150 in a certain image block is 5, it means that the limit is exceeded. The number of pixels exceeding the limit is 5-2=3.

[0055] Add up the number of pixels exceeding the limit at all gray levels to get the total number of pixels exceeding the limit for the image block. Distribute the total number of pixels exceeding the limit evenly across 256 gray levels to ensure a more uniform pixel distribution.

[0056] For example, assuming the total number of pixels exceeding the limit is 6, the number of pixels allocated to each gray level is 6 / 256=0.023. After rounding, the number of pixels allocated to each gray level is 1.

[0057] Then, starting from gray level 0, the system iterates through the gray levels and performs round-robin allocation. Assuming that there are still no over-limit pixels after allocating gray levels 0 to 149, these 6 pixels can be allocated to gray levels 0, 1, 2, 3, 4, and 5 in turn.

[0058] Then, the second gray-level histogram of the image block after pixel allocation is determined, and the cumulative distribution function value corresponding to each key gray-level value is determined based on the second gray-level histogram.

[0059] Before this, in order to reduce computational load and improve detection efficiency, it is also necessary to determine the key grayscale values, including: Obtain the minimum grayscale range in the first grayscale histogram; Determine the upper and lower limits of the grayscale value of the minimum grayscale range, and determine the target grayscale value that is adjacent to and greater than the upper limit of the grayscale value; The upper limit of grayscale, the lower limit of grayscale, the target grayscale value, and the maximum grayscale value are determined as key grayscale values.

[0060] For example, suppose the first grayscale histogram is as shown in Table 1: Table 1

[0061] Since 0~149 represents the dark area of ​​the base material, it is the background benchmark for weld identification; 150~152: Represents the bright area of ​​the weld, which is the core target area of ​​excessive brightness and the key to weld identification; 255: Represents the maximum grayscale value, corresponding to the brightest pixel in the image (such as the reflective point of a weld).

[0062] Therefore, when determining the key grayscale values, the upper limit of the minimum grayscale range 0~149, with a value of 149, can define the boundary between the base material and the weld, while the lower limit of 0 can anchor the dark area. The grayscale value of 150 is the starting point of the bright area, and the grayscale value of 255 anchors the ending point of the bright area. Thus, the upper limit of 149, the lower limit of 0, the grayscale value of 150, and the grayscale value of 255 can be determined as the key grayscale values.

[0063] After over-allocation of pixels, the second grayscale histogram is shown in Table 2: Table 2

[0064] Therefore, the lower limit of 0 corresponds to a cumulative pixel count of 2, the upper limit of 149 corresponds to a cumulative pixel count of 240 (pixels less than or equal to 149), a grayscale value of 150 corresponds to a pixel count of 242 (pixels less than or equal to 150), and a grayscale value of 255 corresponds to a pixel count of 256 (pixels less than or equal to 255). Thus, the cumulative distribution function (CDF) value for each key grayscale value can be calculated using the formula... Sure.

[0065] For example, the cumulative distribution function value CDF(0) corresponding to the gray value 0 is 2 / 256 = 0.0078; The cumulative distribution function value CDF(149) corresponding to the gray value 149 is 240 / 256 = 0.9375; The cumulative distribution function value CDF(149) corresponding to a grayscale value of 150 is 242 / 256 = 0.9453; The cumulative distribution function value CDF(255) corresponding to the gray value 255 is 256 / 256 = 1.

[0066] Since the cumulative distribution function (CDF) is a monotonically increasing function, linear interpolation can be performed based on the cumulative distribution function of the key gray values ​​to obtain the cumulative distribution function value of the remaining gray values.

[0067] In one implementation, determining the cumulative distribution function value corresponding to the remaining gray values ​​based on the cumulative distribution function value corresponding to each key gray value includes: Iterate through the remaining gray values ​​and, for any given remaining gray value, determine the target key gray value corresponding to that remaining gray value. The cumulative distribution function of the remaining gray values ​​is interpolated based on the cumulative distribution function of the target key gray values ​​to obtain the cumulative distribution function value corresponding to the remaining gray values. The target gray key values ​​can be understood as the two key gray values ​​that differ the least from the remaining gray values, and the remaining gray values ​​are within the gray range formed by the two target key gray values.

[0068] For example, when the remaining grayscale value is 1, the target key values ​​corresponding to the remaining grayscale value are 0 and 149. Therefore, linear interpolation can be performed based on the cumulative distribution function value of the target key value. .

[0069] When the remaining gray value is 2, the target key values ​​corresponding to the remaining gray value are 1 and 149. Then, linear interpolation is performed based on the cumulative distribution function values ​​of the target key values ​​of 1 and 149 to obtain the cumulative distribution function value of the remaining gray value of 2.

[0070] Continue using the above method until the cumulative distribution function value of the last remaining gray value is determined.

[0071] For each grayscale value, it can be calculated using the formula. Determine the new grayscale value for each grayscale value. Wherein, grayscale value gray The corresponding cumulative distribution function value, It is the minimum cumulative distribution function value.

[0072] Once the new grayscale value is determined, the grayscale value of the corresponding image block is updated based on the new grayscale value to obtain the updated image block.

[0073] In addition, in order to preserve the core feature that the brightness of the weld area is higher than that of the base material area, if an updated image block is located in a suspected weld area, all gray values ​​in the updated image block located in the suspected weld area will be enhanced in brightness, while the gray values ​​in the updated image block located in the suspected base material area will be reduced in brightness.

[0074] For example, all gray values ​​in the updated image block located in the suspected weld area can be multiplied by a first gain coefficient (e.g., the first gain coefficient can be 1.1), and all gray values ​​in the updated image block located in the suspected base material area can be multiplied by a second gain coefficient (e.g., the second gain coefficient can be 0.95).

[0075] After preprocessing the image to be detected according to the above method, the preprocessed image is as follows: Figure 3 As shown.

[0076] The weld area is then determined from the preprocessed image, including: The preset edge region of the preprocessed image is determined as the reference region of the base material; The brightness threshold is determined based on the average grayscale value of all pixels in the reference area of ​​the base material; The preprocessed image is converted into a binary image based on a brightness threshold. Multiple bright pixel clusters are extracted from the binary image, and these bright pixel clusters are identified as candidate regions. Based on the preset area range and shape characteristics, each candidate region is screened to obtain the weld region.

[0077] Specifically, the weld section sample is usually rectangular, and the edge area is the unwelded base material. Therefore, 10% of the edge area in the preprocessed image can be used as the base material reference area, and the average gray value of all pixels in the base material reference area is determined. Based on the characteristic that the brightness of the weld area is higher than that of the base material area, the brightness threshold is determined according to the average gray value and the preset brightness offset.

[0078] For example, the brightness offset can be 15%~20%, then the brightness threshold It can be: ; The average grayscale value. This is the preset brightness offset.

[0079] Then, gray values ​​in the preprocessed image that are less than the brightness threshold are set to 0, and gray values ​​that are greater than the brightness threshold are set to 255, resulting in a binary image.

[0080] All continuous bright pixel clusters are extracted from the binary image as candidate regions. Candidate regions with an area greater than a threshold are retained, and then the retained candidate regions are filtered by shape features. Since the weld seam region has the characteristics of being elongated, continuously distributed, and having an aspect ratio greater than a certain proportion, the candidate regions that meet the above characteristics are determined as weld seam regions.

[0081] like Figure 3 As shown, mark 31 represents the weld area, and marks 32 and 33 represent the base material area. It can be seen that the brightness of the weld area is higher than that of the base material area.

[0082] S212, the weld area is inspected based on a preset inspection strategy to obtain weld inspection results.

[0083] When inspecting welds, it is necessary to check the penetration depth, weld gills, and the presence of inclusion defects and porosity defects.

[0084] In one embodiment, when the weld inspection result includes: whether there are inclusion defects in the weld area; and the weld area is inspected based on a preset inspection strategy to obtain the weld inspection result, the result includes: Apply color filling to the weld area; Determine if there are areas of color difference in the weld area; if so, the weld is confirmed to have inclusion defects.

[0085] Because the weld area with inclusion defects is different from the weld metal, color difference will occur. Therefore, if there are areas with color difference during the color filling process, it indicates that there is a loading defect in the weld.

[0086] In one embodiment, the weld inspection results include whether porosity exists in the weld area; after applying a color-filling operation to the weld area, the method further includes: Determine if there are any blank areas in the weld area; if so, then it is determined that there are pores inside the weld.

[0087] Since pores are voids inside the weld, without solid metal, they cannot be colored. Therefore, if there are blank areas that cannot be colored, it indicates that there are pores in that location.

[0088] In one embodiment, the weld inspection results include: weld penetration depth; and the weld area is inspected based on a preset inspection strategy, including: A first reference line extends from the cross-sectional edge of the base material region toward the weld region; Determine the edge contour of the weld area; Find the reference point that is furthest from the baseline in the edge contour, determine the vertical distance between the reference point and the first baseline, and determine the vertical distance as the weld depth of the weld area.

[0089] In one implementation, finding the reference point with the largest distance from the first reference line in the edge contour includes: Multiple sampling points are obtained by sampling along the edge contour at preset intervals; Determine the vertical distance between each pixel and the first baseline in sequence; The sampling point corresponding to the maximum vertical distance is determined as the reference point.

[0090] Penetration depth is the distance from the surface line of the base metal to the deepest point where the weld has penetrated into the base metal (it can be understood as the depth to which the weld drills into the base metal). (See reference...) Figure 4 , Figure 4 The weld penetration depth is measured using the base material 31 as a reference. Therefore, a first reference line L1 can be extended from the edge of the base material 31 section towards the weld area. The contour edge line of the weld area is then determined, and the point A furthest from the first reference line is identified on this contour line. The vertical distance L2 between the first reference line L1 and point A is defined as the weld penetration depth of the weld area. Since the unit of weld penetration depth is generally mm, the measured weld penetration depth needs to be converted to mm according to the calibration ratio.

[0091] It should be noted that since the penetration depth is measured based on the base material 31, the contour edge line of the weld area needs to be determined in the area close to the base material 32 when determining the contour edge line of the weld area.

[0092] In addition, when the weld is a fillet weld (right-angle weld or T-weld), the weld inspection results also include weld grommets; the weld area is inspected based on a preset inspection strategy, including: Determine a second reference line on the edge profile of the weld surface; Using the second baseline as a reference, determine an auxiliary line parallel to the second baseline at the fusion line position in the weld area; The vertical distance between the second baseline and the auxiliary line is defined as the weld head of the weld area.

[0093] Specifically, the weld girth is the effective load-bearing thickness of the fillet weld. Therefore, two points are arbitrarily selected on the edge contour of the weld surface to determine the second reference line. Then, using the second reference line as a reference, an auxiliary line parallel to the second reference line is determined at the fusion line position in the weld area. The fusion line position is the junction between the weld and the base material.

[0094] The vertical distance between the second baseline and the auxiliary line is then determined as the weld head of the weld area.

[0095] In this way, the present invention prepares the weld into a metallographic sample, acquires images of the metallographic sample to obtain the image to be tested, preprocesses the image to be tested to remove noise interference, and improves the recognition accuracy of the weld area; when the weld area is tested using a preset detection strategy, the detection results can be accurately quantified, and the entire detection process does not rely on human experience judgment, thus ensuring the accuracy of the weld detection results; and there is no need to reconfigure the corresponding weld detection equipment, only the existing hardness indentation detection system needs to be upgraded, thus reducing the detection cost.

[0096] Based on the same inventive concept as in the foregoing embodiments, this embodiment also provides a weld inspection device, such as... Figure 5 As shown, the device includes: The acquisition unit 51 is used to acquire the image to be inspected of the prefabricated weld metallographic sample when the weld metallographic sample is placed on the inspection platform. Processing unit 52 is used to preprocess the image to be detected to obtain a preprocessed image and determine the weld area from the preprocessed image; The detection unit 53 is used to detect the weld area based on a preset detection strategy and obtain the weld detection result.

[0097] Since the apparatus described in the embodiments of this invention is used to implement the weld inspection method of the embodiments of this invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in the embodiments of this invention, and therefore will not be described in detail here. All apparatuses used in the methods of the embodiments of this invention fall within the scope of protection of this invention.

[0098] Through one or more embodiments of the present invention, the present invention has the following beneficial effects or advantages: This invention provides a weld inspection method, apparatus, and system. The method includes: placing a pre-fabricated weld metallographic sample on an inspection platform and acquiring an image of the weld metallographic sample to be inspected; preprocessing the image to be inspected to obtain a preprocessed image; determining the weld region from the preprocessed image and inspecting the weld region based on a preset inspection strategy to obtain a weld inspection result. Thus, by preparing the weld as a metallographic sample and acquiring an image of the metallographic sample to obtain the image to be inspected, and by first preprocessing the image to be inspected to remove noise interference and improve the accuracy of weld region identification; and then using the preset inspection strategy to inspect the weld region, the inspection result can be accurately quantified, and the entire inspection process does not rely on human experience judgment, thereby ensuring the accuracy of the weld inspection result; and there is no need to reconfigure the corresponding weld inspection equipment, only an upgrade of the existing hardness indentation testing system is required, thus reducing inspection costs.

[0099] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0100] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0101] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A weld inspection method, characterized in that, The method includes: When the pre-made weld metallographic sample is placed on the testing platform, the image of the weld metallographic sample to be tested is obtained. The image to be detected is preprocessed to obtain a preprocessed image, and the weld area is determined from the preprocessed image; The weld area is inspected based on a preset inspection strategy to obtain weld inspection results.

2. The method as described in claim 1, characterized in that, Before acquiring the image to be inspected from the metallographic sample of the weld, the method further includes: Obtain a weld section sample and polish the weld section sample with sandpaper; The weld section sample after grinding was polished using alumina polishing liquid; The polished weld section sample was etched using a nitric acid alcohol solution of a preset concentration to obtain the weld metallographic sample.

3. The method as described in claim 1, characterized in that, The preprocessing of the image to be detected includes: Convert the image to be detected into a first grayscale image; The first grayscale image is denoised using a Gaussian filter to obtain the second grayscale image; The second grayscale image is filtered using a median filtering algorithm to obtain the third grayscale image; The third grayscale image is subjected to adaptive brightness equalization processing to obtain the fourth grayscale image; A morphological opening operation is performed on the fourth grayscale image to obtain the preprocessed image.

4. The method as described in claim 3, characterized in that, The adaptive brightness equalization processing of the third grayscale image includes: The third grayscale image is divided into multiple image blocks of a preset size, and the total number of pixels in each block is determined based on the size of the image blocks. For each image block, a first grayscale histogram of the image block is determined, wherein the first grayscale histogram contains the actual number of pixels corresponding to each grayscale level; The target number of pixels for each gray level is determined based on the total number of pixels in the block, the total number of gray levels, and the preset contrast gain. The number of over-limit pixels corresponding to each gray level is determined based on the actual number of pixels corresponding to each gray level and the target number of pixels corresponding to each gray level. The total number of over-limit pixels of the image block is determined based on the number of over-limit pixels corresponding to each gray level. The total number of over-limit pixels is then allocated to the target gray level in sequence based on a round-robin allocation mechanism. A second gray-level histogram of the image block after pixel allocation is determined, and the cumulative distribution function value corresponding to each key gray-level value is determined based on the second gray-level histogram; the cumulative distribution function value corresponding to the remaining gray-level values ​​is determined based on the cumulative distribution function value corresponding to each key gray-level value. The new gray value corresponding to each gray value is determined based on the cumulative distribution function value corresponding to each gray value. The gray values ​​of the corresponding image blocks are then updated based on the new gray values ​​to obtain the updated image blocks.

5. The method as described in claim 4, characterized in that, The step of determining the target pixel count for each gray level based on the total number of pixels in the block, the total number of gray levels, and a preset contrast gain includes: According to the formula Determine the target pixel count n for each gray level; The The total number of pixels in the block, the The total number of gray levels, the The contrast gain is given.

6. The method as described in claim 4, characterized in that, The step of determining the number of excess pixels for each gray level based on the actual number of pixels for each gray level and the number of target pixels for each gray level includes: For each gray level, the difference between the actual number of pixels and the target number of pixels is determined as the number of pixels exceeding the limit corresponding to that gray level.

7. The method as described in claim 4, characterized in that, The step of determining the cumulative distribution function value corresponding to the remaining gray values ​​based on the cumulative distribution function value corresponding to each key gray value includes: For any remaining grayscale value, determine the target key grayscale value corresponding to the remaining grayscale value; The cumulative distribution function of the remaining gray values ​​is interpolated based on the cumulative distribution function value of the target key gray value to obtain the cumulative distribution function value corresponding to the remaining gray values.

8. The method as described in claim 1, characterized in that, Determining the weld area from the preprocessed image includes: The preset edge region of the preprocessed image is determined as the reference region of the base material; The brightness threshold is determined based on the average grayscale value of all pixels in the reference area of ​​the parent material; The preprocessed image is converted into a binary image according to the brightness threshold, and multiple consecutive bright pixel clusters are extracted from the binary image. The multiple consecutive bright pixel clusters are determined as candidate regions. The candidate regions are selected based on preset area thresholds and shape features to obtain the weld region.

9. The method as described in claim 1, characterized in that, The weld inspection results include: whether there are inclusion defects in the weld area; the weld inspection results obtained by inspecting the weld area based on a preset inspection strategy include: The weld area is then filled with color. Determine whether there are color difference areas in the weld area; if so, determine that the weld has inclusion defects.

10. The method as described in claim 9, characterized in that, The weld inspection results include whether porosity exists in the weld area; after the color filling operation is performed on the weld area, the method further includes: Determine whether there are any blank areas in the weld area; if so, determine that there are pores inside the weld.

11. The method as described in claim 1, characterized in that, The weld inspection results include: weld penetration; the inspection of the weld area based on a preset inspection strategy includes: A first reference line extends from the cross-sectional edge of the base material region toward the weld region; Determine the edge contour of the weld area; Find the reference point that is furthest from the baseline in the edge contour, determine the vertical distance between the reference point and the first baseline, and determine the vertical distance as the weld depth of the weld area.

12. The method as described in claim 11, characterized in that, Find the reference point with the largest distance from the first reference line in the edge contour, including: Multiple sampling points are obtained by sampling along the edge contour at preset intervals; Determine the vertical distance between each pixel and the first baseline in sequence; The sampling point corresponding to the maximum vertical distance is determined as the reference point.

13. The method as described in claim 1, characterized in that, When the weld is a fillet weld, the weld inspection result further includes: weld wheezing; the inspection of the weld area based on a preset inspection strategy includes: A second reference line is defined on the edge profile of the weld surface; Using the second reference line as a reference, an auxiliary line parallel to the second reference line is determined at the fusion line position in the weld area; The vertical distance between the second baseline and the auxiliary line is defined as the weld head of the weld area.

14. A weld inspection device, characterized in that, The device includes: The acquisition unit is used to acquire the image to be inspected of the prefabricated weld metallographic sample when it is placed on the inspection platform. The processing unit is used to preprocess the image to be detected to obtain a preprocessed image, and to determine the weld area from the preprocessed image; The detection unit is used to detect the weld area based on a preset detection strategy and obtain the weld detection result.

15. A weld inspection system, characterized in that, The system includes: an image acquisition device and the weld inspection device as described in claim 14; wherein... The image acquisition device is used to acquire the image to be inspected of the prefabricated weld metallographic sample when it is placed on the inspection platform, and to send the image to be inspected to the weld inspection device. The weld inspection device is used to preprocess the image to be inspected to obtain a preprocessed image; determine the weld area from the preprocessed image; and inspect the weld area based on a preset inspection strategy to obtain a weld inspection result.