Adaptive ultrasonic image fusion method, device, equipment and medium for special-shaped workpieces
Patent Information
- Application Number
- CN202611169857.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-08-04
AI Technical Summary
[0004]本发明实施例提供一种自适应异形工件超声图像融合方法、装置、计算机设备及存储介质,以解决现有技术中异形工件相控阵超声检测图像融合时自适应差、直观性差、扩展性差等问题中的至少一个
[0053]上述自适应异形工件超声图像融合方法、装置、计算机设备及存储介质,通过参数化几何建模与声束传播建模相结合的方式,实现了对不同类型异形工件(如变径管、弯头、交叉管焊缝等)相控阵超声图像的高质量融合,显著提升了检测的自适应能力;同时,通过贴合面忽略区处理和突变阈值控制的空洞填充策略,有效消除了探头间隙虚假回波和插值伪影,增强了检测图像的直观性和判读准确性;此外,支持最大值与覆盖两种融合模式的动态切换,满足了不同检测场景下的差异化需求,大幅提高了异形工件超声检测的可靠性和效率。
Smart Images

Figure CN122694681B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic phased array detection and image processing, and in particular to an adaptive ultrasonic image fusion method, apparatus, device and medium for irregularly shaped workpieces. Background Technology
[0002] Phased-array ultrasonic testing (PAUT) technology uses electronic control to control the excitation timing of each element in the transducer array, achieving beam deflection and focusing. This allows for multi-angle scanning without mechanically moving the probe, and it has been widely used in weld inspection in fields such as power, petrochemicals, nuclear power, and aerospace. For regular workpieces, such as straight pipes or plates, a complete inspection image can be obtained by moving the probe along the weld in a straight line. However, when dealing with irregularly shaped workpieces such as circumferential welds of variable-diameter pipes, longitudinal welds (curved workpieces), elbows, and cross-shaped pipe welds (T-tubes, cross-tubes, TKY, and fillet welds), the detection range of a single echo is extremely limited due to their complex geometry. Multiple echoes and multi-angle detections are necessary to obtain complete data, and these images are then fused into a single complete inspection image. This fusion is not a simple image cropping and flipping, but a complex process requiring precise consideration of the workpiece's structural characteristics.
[0003] Currently, conventional image processing methods for inspecting irregularly shaped workpieces suffer from the following drawbacks: First, existing technologies have poor adaptability, being designed only for specific workpieces or welds of uniform thickness, failing to adapt to all irregularly shaped workpiece structures. For example, they cannot effectively handle the transition sections of reducing pipes or the elliptical curve sections of elbows. Second, they lack intuitiveness. Some methods add secondary wave workpiece simulation to the weld simulation image instead of superimposing the actual phased array image, leading to distortion in the interpretation of the location and shape of defects on the workpiece in the ultrasonic spectrum. Third, they have poor scalability, limiting the image display to the interior of the workpiece and failing to extend to the exterior, severely affecting the evaluation of surface or bottom defects. Therefore, an adaptive ultrasonic image fusion method for irregularly shaped workpieces is urgently needed to solve at least one of the above-mentioned technical problems. Summary of the Invention
[0004] This invention provides an adaptive ultrasonic image fusion method, apparatus, computer equipment, and storage medium for irregularly shaped workpieces, to solve at least one of the problems in the prior art of poor adaptability, poor intuitiveness, and poor scalability when fusing phased array ultrasonic detection images of irregularly shaped workpieces.
[0005] An adaptive ultrasonic image fusion method for irregularly shaped workpieces includes:
[0006] The original B image is acquired based on the workpiece structure information of the irregular workpiece and preprocessed to obtain preprocessed image data; the preprocessed image data includes the preprocessed B image, the preprocessed A scan line mask and the pre-interpolation coefficients.
[0007] Based on the preprocessed image data, parametric geometric modeling is performed on the irregular workpiece, a unified transformation chain is established, and a workpiece spatial reference model is obtained.
[0008] Based on the workpiece space reference model, sound beam propagation modeling is performed on the preprocessed data to determine the mapping relationship between the original B image pixels and the target image pixels, and sound beam mapping data is obtained.
[0009] Based on the sound beam mapping data, hole detection and adaptive filling under continuity constraints are performed on the mapped target image to obtain updated sound beam mapping data.
[0010] Based on the updated acoustic beam mapping data, the preprocessed B image is mapped to the target image space, and the target fused image is synthesized according to a preset fusion strategy.
[0011] Optionally, the step of acquiring the original B-image based on the workpiece structure information of the irregularly shaped workpiece and performing preprocessing to obtain preprocessed image data includes:
[0012] The focusing rule is set according to the geometric characteristics of the irregular workpiece and the weld position; the focusing rule includes the deflection angle range, focusing depth and aperture parameters;
[0013] The original B image is acquired in real time according to the focusing rule;
[0014] Based on the number of probe array elements, spacing, and scanning angle range, an A scan line mask matching the original B image is generated;
[0015] The original B image is pre-converted using bilinear interpolation with the same path length, and the interpolation position coefficients are pre-calculated to obtain the pre-processed B image and the pre-interpolation coefficients.
[0016] Synchronous nearest neighbor resampling is performed on the A scan line mask to obtain a preprocessed A scan line mask that is spatially aligned with the preprocessed B image.
[0017] Optionally, the workpiece spatial reference model includes a workpiece geometric model, a mating surface neglect area, and a unified coordinate system;
[0018] The step of parametrically geometrically modeling the irregularly shaped workpiece based on the preprocessed image data, establishing a unified transformation chain, and obtaining a spatial reference model of the workpiece includes:
[0019] Parametric geometric modeling is performed on the irregularly shaped workpiece to obtain the workpiece's geometric model; wherein, for reducer pipes, elbows, cross pipe welds and custom complex workpieces, wall thickness, diameter, radius of curvature, and intersection angle parameters are input respectively, and the curve is discretized into multiple short straight line segments;
[0020] The non-perfect fit gap between the probe and the workpiece is processed using the dynamic neglect area method to obtain the fit surface neglect area; wherein, the overlapping area between the bottom surface of the probe and the contour of the workpiece is calculated and extended outward from the boundary line segment until the angle between the extended line segment and the original boundary line segment exceeds 90°, and this extended area is defined as the fit surface neglect area.
[0021] Based on the probe pose and encoder position, a unified transformation chain is established from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system to obtain the unified coordinate system.
[0022] Optionally, the step of performing acoustic beam propagation modeling on the preprocessed data based on the workpiece spatial reference model to determine the mapping relationship between the pixels of the original B-image and the pixels of the target image, and obtaining acoustic beam mapping data, includes:
[0023] Based on the workpiece geometric model, the bonding surface neglect area, and the unified coordinate system, a double mask pruning is performed using a pre-processed A-scan line mask to obtain a set of effective source pixels located within the workpiece geometric boundary. Specifically, background pixels with a mask value of -1 are first filtered through the pre-processed A-scan line mask, and then pixels exceeding the workpiece geometric boundary are filtered through the workpiece region mask generated by the workpiece geometric model.
[0024] For the set of effective source pixels, multiple reflection path tracings are performed based on the sound beam propagation law and the geometric contour of the workpiece to determine the mapping position of each echo in the target image space and establish the correspondence between the coordinates of the effective source pixel and the target pixel.
[0025] The correspondence is written into the position mapping table and the superposition count table is updated to obtain the sound beam mapping data; the sound beam mapping data includes the position mapping table and the superposition count table.
[0026] Optionally, the location mapping table is a three-dimensional array W×H×N, where W is the width of the target image; H is the height of the target image; and N is the maximum number of echo stackings.
[0027] The superposition counting table is a two-dimensional array W×H, used to record the number of times the sound beams are superimposed;
[0028] Writes can be performed in either overwrite or non-overwrite mode. In non-overwrite mode, writing only occurs if the number of overlays is less than the maximum number of overlays; and / or,
[0029] The step of performing multiple reflection path tracing on the effective source pixel set based on the sound beam propagation law and the workpiece geometric contour to determine the mapping position of each echo in the target image space includes:
[0030] Using the same line ratio mapping method, the sound beam starting point is located in the reference row according to the A scan line number of the effective source pixel, the initial sound line segment from the sound beam starting point to the effective source pixel is constructed, and the sound line path is iteratively tracked in the workpiece contour.
[0031] Find the nearest intersection point with the workpiece contour line segment along the current sound ray direction;
[0032] If the intersection point is located within the neglected area of the mating surface, it is considered an invalid reflection, and the sound ray continues to be tracked past the intersection point along the original direction;
[0033] If the intersection point is not within the neglected area of the mating surface, it is considered a valid reflection, the echo count is incremented by 1, and a new direction is calculated according to the law of reflection. The tracking continues from the intersection point as the new starting point.
[0034] Until the preset number of echoes is reached or there are no subsequent intersections, the coordinates of the final physical intersection are converted into the pixel coordinates of the target image to obtain the mapping position corresponding to the effective source pixel.
[0035] Optionally, the step of performing hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data to obtain updated sound beam mapping data includes:
[0036] Based on the sound beam mapping data, pixels with a superposition count of zero are identified as holes to be filled.
[0037] Using horizontal linear interpolation, for the hole sequence between two adjacent valid points in the same row, the beam path span difference between the valid points on both sides of the hole is calculated; if the difference exceeds a preset threshold or the valid points on both sides belong to different A scan lines, interpolation is prohibited and the hole is retained; otherwise, the source pixel coordinates of the hole point are calculated according to a linear ratio and filled into the position mapping table;
[0038] For isolated holes that cannot be handled by horizontal linear interpolation, search for the nearest valid point in the neighborhood and directly copy its source pixel coordinates to the location mapping table of the hole; if the length of consecutive holes exceeds the preset limit, no filling is performed;
[0039] After filling all the voids, update the position mapping table and the superposition count table to obtain the updated sound beam mapping data.
[0040] Optionally, the step of mapping the preprocessed B image to the target image space based on the updated beam mapping data, and synthesizing the target fused image according to a preset fusion strategy, includes:
[0041] Based on the fusion mode selected by the user, a preset fusion strategy is determined; the preset fusion strategy includes maximum value fusion and coverage fusion;
[0042] Traverse each pixel of the target image, and based on the position mapping table and superposition count table in the updated beam mapping data, read all source pixel coordinates mapped to the target pixel position, and extract the corresponding amplitude value from the preprocessed B image;
[0043] If maximum value fusion is selected, all extracted amplitude values are compared, and only the maximum value is retained as the grayscale value of the target pixel; if overlay fusion is selected, only the amplitude value of the source pixel that was last mapped to the target pixel position is retained.
[0044] The grayscale values of each target pixel are written into the target image space to obtain the target fused image.
[0045] An adaptive ultrasonic image fusion device for irregularly shaped workpieces includes:
[0046] The data acquisition and preprocessing module is used to acquire the original B image based on the workpiece structure information of the irregular workpiece and perform preprocessing to obtain preprocessed image data; the preprocessed image data includes the preprocessed B image, the preprocessed A scan line mask, and the pre-interpolation coefficients.
[0047] The workpiece spatial reference modeling module is used to perform parametric geometric modeling on the irregular workpiece based on the preprocessed image data, establish a unified transformation chain, and obtain the workpiece spatial reference model.
[0048] The acoustic beam propagation and mapping modeling module is used to perform acoustic beam propagation modeling on the preprocessed data based on the workpiece spatial reference model, determine the mapping relationship between the original B image pixels and the target image pixels, and obtain acoustic beam mapping data.
[0049] An adaptive hole filling and optimization module is used to perform hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data, so as to obtain updated sound beam mapping data.
[0050] The multi-mode image fusion and output module is used to map the preprocessed B image to the target image space based on the updated beam mapping data, and synthesize the target fused image according to a preset fusion strategy.
[0051] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the above-described adaptive ultrasonic image fusion method for irregularly shaped workpieces.
[0052] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described adaptive ultrasonic image fusion method for irregularly shaped workpieces.
[0053] The aforementioned adaptive ultrasonic image fusion method, apparatus, computer equipment, and storage medium for irregularly shaped workpieces achieve high-quality fusion of phased array ultrasonic images of different types of irregularly shaped workpieces (such as reducing pipes, elbows, and welded seams of intersecting pipes) by combining parametric geometric modeling with acoustic beam propagation modeling, significantly improving the adaptive capability of the detection. Simultaneously, through the handling of the neglected area on the mating surface and the void filling strategy with abrupt threshold control, false echoes and interpolation artifacts in the probe gap are effectively eliminated, enhancing the intuitiveness and accuracy of the detected images. Furthermore, it supports dynamic switching between maximum value and coverage fusion modes, meeting the differentiated needs of different detection scenarios and greatly improving the reliability and efficiency of ultrasonic detection of irregularly shaped workpieces. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart of an adaptive ultrasonic image fusion method for irregularly shaped workpieces according to an embodiment of the present invention;
[0056] Figure 2 This is a photograph of an irregularly shaped workpiece according to one embodiment of the present invention;
[0057] Figure 3a This is a top view of an irregularly shaped workpiece in one embodiment of the present invention;
[0058] Figure 3b This is a schematic cross-sectional view of an irregularly shaped workpiece at the 0° direction in one embodiment of the present invention;
[0059] Figure 3c This is a schematic cross-sectional view of an irregularly shaped workpiece at a 45° angle in one embodiment of the present invention;
[0060] Figure 3d This is a schematic cross-sectional view of an irregularly shaped workpiece at 90° in one embodiment of the present invention;
[0061] Figure 4a This is a simulated image of the pre-fusion B image at a 0° cross-section in one embodiment of the present invention;
[0062] Figure 4b This is a simulated image of the pre-fusion B image in a 30° section according to one embodiment of the present invention;
[0063] Figure 4c This is a simulated image of the pre-fusion B image at a 90° cross-section in one embodiment of the present invention;
[0064] Figure 5a This is a simulated image of the fused B image at a 0° cross-section in one embodiment of the present invention;
[0065] Figure 5b This is a simulated image of the fused B image at a 30° cross-section in one embodiment of the present invention;
[0066] Figure 5c This is a simulated image of the fused B image at a 90° cross-section in one embodiment of the present invention;
[0067] Figure 6 This is a schematic diagram of an adaptive ultrasonic image fusion device for irregularly shaped workpieces according to an embodiment of the present invention;
[0068] Figure 7 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. 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.
[0070] In one embodiment, such as Figure 1 As shown, an adaptive ultrasonic image fusion method for irregularly shaped workpieces is provided, including the following steps S10~S50.
[0071] S10. Acquire the original B image based on the workpiece structure information of the irregular workpiece and perform preprocessing to obtain preprocessed image data; the preprocessed image data includes the preprocessed B image, the preprocessed A scan line mask, and the pre-interpolation coefficients.
[0072] S20. Based on the preprocessed image data, perform parametric geometric modeling on the irregular workpiece, establish a unified transformation chain, and obtain the workpiece spatial reference model.
[0073] S30. Based on the workpiece space reference model, perform acoustic beam propagation modeling on the preprocessed data, determine the mapping relationship between the original B image pixels and the target image pixels, and obtain acoustic beam mapping data.
[0074] S40. Based on the sound beam mapping data, perform hole detection and adaptive filling under continuity constraints on the mapped target image to obtain updated sound beam mapping data.
[0075] S50. Based on the updated acoustic beam mapping data, the preprocessed B image is mapped to the target image space, and the target fused image is synthesized according to a preset fusion strategy.
[0076] Understandably, this embodiment provides an adaptive ultrasonic image fusion method for irregularly shaped workpieces. By performing parametric geometric modeling and acoustic beam propagation modeling on complex geometric shapes such as welds of variable-diameter pipes, elbows, and intersecting pipes, high-quality fusion of phased-array ultrasonic inspection images is achieved. This method can be widely applied to non-destructive testing of welds on irregularly shaped workpieces in fields such as power, petrochemicals, nuclear power, and aerospace. It effectively solves the technical problems of traditional testing methods, such as poor adaptability, insufficient intuitiveness, and limited scalability due to the complexity of workpiece shapes, significantly improving the detection rate and interpretation accuracy of internal defects in irregularly shaped workpieces. Figure 2 , Figures 3a-3d As shown, Figure 2 Here is a photograph of an irregularly shaped workpiece as an example. Figure 3a This is a top view of the irregularly shaped workpiece. Figure 3b This is a schematic diagram of the cross-section of an irregularly shaped workpiece at the 0° direction. Figure 3c This is a schematic diagram of the cross-section of an irregularly shaped workpiece at a 45° angle. Figure 3d This is a schematic diagram of the cross-section of an irregularly shaped workpiece at 90°.
[0077] Specifically, focusing rules can be set based on the workpiece structure information (including geometric features and weld positions) of irregularly shaped workpieces to acquire original B-images in real time, and then preprocessed image data can be obtained through preprocessing. Preprocessed image data refers to a set of intermediate data obtained after digitizing, pre-calculating features, and converting the format of the original phased array ultrasonic signal. This includes preprocessed B-images, preprocessed A-scan line masks, and pre-interpolation coefficients. Preprocessed B-images are image data obtained by converting the original fan-shaped or linear B-images into regular rectangular grids through bilinear interpolation with the same acoustic path. Preprocessed A-scan line masks are pixel-level index arrays spatially aligned with the preprocessed B-images, used to identify the A-scan line number to which each pixel belongs (the corresponding index number is filled in for valid areas, and -1 is filled in for background areas) to achieve rapid background pruning in subsequent steps. Pre-interpolation coefficients are position coefficients pre-calculated during the interpolation conversion process to avoid repeated interpolation calculations in the real-time imaging loop and accelerate image generation.
[0078] Next, based on the preprocessed image data, parametric geometric modeling of the irregularly shaped workpiece can be performed, and a unified coordinate transformation system can be established to obtain the workpiece spatial reference model. The workpiece spatial reference model consists of three components: the workpiece geometric model, the contact surface neglect area, and the unified coordinate system. The workpiece geometric model is obtained by inputting physical parameters such as wall thickness, diameter, radius of curvature, and intersection angle, and discretizing the contour curves of reducing pipes, elbows, cross pipe welds, and custom complex workpieces into multiple short straight line segments. The contact surface neglect area addresses the problem of large surface curvature of irregularly shaped workpieces and the inability of the probe to fully contact them. A dynamic neglect area method is used to calculate the overlapping area between the probe bottom surface and the workpiece contour, extending outward from the boundary line segment to a region defined by an angle exceeding 90° with the original line segment. This region is used to eliminate false near-field echoes caused by probe gaps in subsequent beam tracking. The unified coordinate system is a transformation chain established based on the probe pose and encoder position, from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system, ensuring that all data is processed under the same spatial reference.
[0079] After obtaining the workpiece spatial reference model, sound beam propagation modeling can be performed on the preprocessed data based on the workpiece spatial reference model to determine the mapping relationship between the pixels of the original B image and the pixels of the target image, thus obtaining sound beam mapping data. This data includes a position mapping table and a superposition count table, which are used to describe the pixel correspondence after multiple reflections of the sound beam within the irregularly shaped workpiece. In some examples, firstly, double mask pruning is performed using the preprocessed A scan line mask and the workpiece region mask generated by the workpiece geometry model to obtain the set of effective source pixels located within the workpiece geometric boundary; then, for the set of effective source pixels, multiple reflection path tracing is performed based on the sound beam propagation law and the workpiece geometric contour. The sound beam starting point is located using the same-line proportional mapping method, and the sound ray path is iteratively traced in the workpiece contour. Effective or invalid reflection is determined based on whether the intersection point is located within the ignored area of the bonding surface, until a preset number of echoes is reached or there are no subsequent intersections, determining the mapping position of each echo in the target image space; finally, the target mapping position corresponding to the effective source pixels is written into the position mapping table and the superposition count table is updated.
[0080] After obtaining the acoustic beam mapping data, hole detection and adaptive filling under continuity constraints can be performed on the mapped target image based on the acoustic beam mapping data to obtain updated acoustic beam mapping data. Since some target pixel positions may not be covered by any acoustic beam during the forward mapping process (i.e., hole points with a superposition count of zero), filling is required to ensure the continuity and integrity of the image. The filling adopts a dual strategy of horizontal linear interpolation as the main method and nearest-neighbor interpolation as the auxiliary method, and introduces a mutation threshold judgment mechanism before interpolation: calculate the difference in acoustic beam path span between the effective points on both sides of the hole. If the difference exceeds a preset threshold or the effective points on both sides belong to different A scan lines, the acoustic beam path is determined to be discontinuous, and interpolation is prohibited to prevent the generation of false artifacts; otherwise, the source pixel coordinates of the hole point are calculated linearly and filled into the position mapping table. For isolated hole points that cannot be handled by horizontal interpolation, the nearest effective point in the neighborhood is searched and its source pixel coordinates are directly copied, but forced filling is not performed when the length of continuous holes exceeds a preset limit.
[0081] Finally, based on the updated acoustic beam mapping data, the preprocessed B image is mapped to the target image space, and the target fused image is synthesized according to a preset fusion strategy. The fusion strategy includes two modes: maximum value fusion and coverage fusion, which users can flexibly switch between according to their detection needs. Maximum value fusion is suitable for defect detection scenarios; for multiple source pixels mapped to the same target location, only the signal with the largest grayscale value is retained, effectively preventing background noise from averaging out weak defect signals. Coverage fusion is suitable for layered analysis scenarios; only the source pixel signal last mapped to the target location is retained, clearly displaying image features at a specific sound path and avoiding interference from overlapping signals at different depths. The final output target fused image is geometrically realistic, signal-fidelity preserved, and continuous and complete. Users can switch fusion modes at any time without recalculating the acoustic path, enabling real-time interactive image evaluation.
[0082] The adaptive ultrasonic image fusion method for irregularly shaped workpieces provided in this embodiment achieves high-quality fusion of phased array ultrasonic images of different types of irregularly shaped workpieces (such as reducing pipes, elbows, and welded seams of intersecting pipes) by combining parametric geometric modeling and acoustic beam propagation modeling, significantly improving the adaptive capability of the detection. At the same time, through the void filling strategy of neglecting the bonding surface area and controlling the abrupt threshold, false echoes and interpolation artifacts in the probe gap are effectively eliminated, enhancing the intuitiveness and interpretation accuracy of the detection images. In addition, it supports dynamic switching between two fusion modes: maximum value and coverage, meeting the differentiated needs of different detection scenarios and greatly improving the reliability and efficiency of ultrasonic detection of irregularly shaped workpieces.
[0083] Optionally, step S10, namely, acquiring the original B image based on the workpiece structure information of the irregularly shaped workpiece and performing preprocessing to obtain preprocessed image data, includes:
[0084] S101. Set a focusing rule based on the geometric features and weld position of the irregular workpiece; the focusing rule includes the deflection angle range, focusing depth, and aperture parameters;
[0085] S102. Acquire the original B image in real time according to the focusing rule;
[0086] S103. Generate an A scan line mask that matches the original B image based on the number of probe array elements, spacing, and scanning angle range.
[0087] S104. Perform bilinear interpolation pre-conversion on the original B image and pre-calculate the interpolation position coefficients to obtain the pre-processed B image and the pre-interpolation coefficients.
[0088] S105. Perform synchronous nearest neighbor resampling on the A scan line mask to obtain a preprocessed A scan line mask that is spatially aligned with the preprocessed B image.
[0089] Understandably, the phased array focusing rule can be determined using a simulation wizard based on the geometry of irregularly shaped workpieces (such as variable diameter, curved surfaces, and T-joints) and the spatial location of the weld. The focusing rule includes, but is not limited to, deflection angle range, focusing depth, and aperture parameters. Here, the deflection angle range refers to the maximum / minimum allowable deflection angle when the probe elements excite sound waves, determining the lateral range of the workpiece covered by the sound beam. The focusing depth is the target depth at which the sound wave energy is focused, affecting the resolution of defect detection. The aperture parameter is the number and arrangement span of the array elements involved in focusing, relating to the beam width and energy concentration.
[0090] Secondly, based on the established focusing rules, phased array ultrasound data is acquired in real time via linear, sector, or combined scans to form raw B-images. These raw B-images contain multi-dimensional information such as ultrasound echo amplitude, probe pose, scanning angle sequence, and encoder coordinates.
[0091] Next, based on the number of probe array elements (the number of units transmitting / receiving ultrasound), spacing (the physical distance between adjacent array elements), and scanning angle range (the angular range covered by the ultrasound beam), the detection boundary of the sound beam in the imaging area is calculated, and an A scan line mask of the same size as the original B image is generated. In the A scan line mask, the effective area pixels are filled with the corresponding A scan line index, and the invalid background is filled with -1, realizing "fast pruning" and "same-line proportional mapping".
[0092] Then, bilinear interpolation is performed on the original B image (bilinear fitting of pixel grayscale according to sound path distance to convert irregular grid into regular rectangular grid), and interpolation position coefficients are pre-calculated (the interpolation weight of each pixel is stored to avoid repeated calculations in real-time imaging), and the pre-processed B image (regular gridded ultrasound image) and pre-interpolation coefficients are output (to accelerate subsequent mapping).
[0093] Finally, nearest neighbor resampling (taking the nearest pixel value while maintaining spatial alignment efficiency) is performed on the A scan line mask to make it perfectly match the spatial resolution and size of the preprocessed B image, thus obtaining the preprocessed A scan line mask and ensuring index consistency of pixel-level operations in subsequent steps.
[0094] This embodiment precisely adapts to irregularly shaped workpieces through focusing laws, ensuring sound beam coverage and defect detection accuracy. The collaborative design of the A-scan line mask and image pre-interpolation not only enables rapid pruning of invalid areas but also significantly reduces the computational load of real-time imaging through pre-calculated coefficients. Mask resampling ensures spatial alignment, providing efficient and accurate basic data for subsequent forward mapping, ultimately improving the real-time performance and reliability of phased array ultrasonic imaging in the inspection of complex workpieces.
[0095] Optionally, the workpiece spatial reference model includes a workpiece geometric model, a mating surface neglect area, and a unified coordinate system;
[0096] Step S20, namely, based on the preprocessed image data, performing parametric geometric modeling on the irregularly shaped workpiece, establishing a unified transformation chain, and obtaining the workpiece spatial reference model, includes:
[0097] S201. Perform parametric geometric modeling on the irregular workpiece to obtain the workpiece geometric model; wherein, for reducer pipes, elbows, cross pipe welds and custom complex workpieces, respectively input the wall thickness, diameter, radius of curvature and intersection angle parameters, and discretize the curve into multiple short straight line segments.
[0098] S202. The non-perfect fit gap between the probe and the workpiece is processed by the dynamic neglect area method to obtain the fit surface neglect area; wherein, the overlapping area between the bottom surface of the probe and the contour of the workpiece is calculated and extended outward from the boundary line segment until the angle between the extended line segment and the original boundary line segment exceeds 90°, and this extended area is defined as the fit surface neglect area.
[0099] S203. Based on the probe pose and encoder position, establish a unified transformation chain from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system to obtain the unified coordinate system.
[0100] Intuitively, physical workpieces can be transformed into computer-processable digital geometric models. For different types of irregularly shaped workpieces, the system requires specific physical parameters as the basis for modeling. Parametric geometric modeling refers to driving the construction of geometric shapes through predefined variables (such as dimensions and angles); the workpiece geometric model is a collection of line segments composed of numerous short straight lines, generated after these variables are calculated by algorithms. Specifically, for workpieces of revolution such as reducing pipes and equal-thickness pipes, the wall thickness, diameter, and radius of curvature need to be input, and the system converts them into circular or elliptical curve segments of the inner and outer walls; for elbows and cross-shaped pipes (such as T-shaped and cross-shaped welds), since the cross-sectional shape changes with the arc length, the system needs to combine the position information fed back by the encoder to calculate and update the curve parameters of the current cross-section in real time; and for custom complex workpieces, line segments are extracted by loading the CAD model, and manual annotation is used to distinguish the weld area from the base material area, thereby completing the establishment of the entire three-dimensional model.
[0101] In industrial non-destructive testing, probes often cannot perfectly fit the surface of irregularly shaped workpieces with large curvatures, leading to spurious echoes in the detection signal caused by physical gaps. The dynamic neglect region method is an algorithmic strategy designed to address this issue of imperfect probe-workpiece fit. First, the probe's physical dimensions (length, width, height, wedge angle, etc.) are calculated in the probe coordinate system, and then transformed to a unified workpiece coordinate system through rotation and translation. Subsequently, the system calculates the overlapping area or nearest neighbor area between the probe's bottom surface and the workpiece contour line, acquiring all workpiece line segments within this area. The system then expands outward from the boundary line segment of this area, stopping once the angle between the newly expanded line segment and the original boundary line segment exceeds 90 degrees. This final determined expansion area is defined as the fit surface neglect region. Its core function is to directly eliminate the first reflection intersection point falling into this region during subsequent ray tracing, effectively filtering spurious near-field echoes and ensuring the purity of the detection data.
[0102] To accurately map the raw data acquired by the probe onto the visual display interface, a unified spatial reference must be established that spans both physical and screen spaces. The unified transformation chain refers to the mathematical process of linking the kinematic parameters of the detection equipment with their spatial geometric relationships. Specifically, this step uses the probe center as the origin and leverages the probe pose (including rotation matrices and translation vectors) and the encoder position (reflecting the probe's actual physical position on the workpiece) to construct a transformation relationship from the "probe local coordinate system" to the "workpiece physical coordinate system." Based on this, a mapping from the workpiece coordinate system to the "display pixel coordinate system" is further established. By establishing this complete transformation chain, the system can unify all detection data under the same spatial reference for fusion and processing, ensuring absolute consistency between graphic rendering and the spatial position of the physical entity.
[0103] This embodiment successfully solves the core problems of poor surface fit and inaccurate spatial positioning in the inspection of irregularly shaped workpieces by constructing a parametric geometric model, a dynamically ignored region, and a unified coordinate transformation chain. On the one hand, the introduction of the dynamically ignored region effectively filters out artifact noise caused by probe suspension, significantly improving the signal-to-noise ratio and defect identification accuracy of ultrasonic imaging. On the other hand, the unified coordinate system ensures precise matching between the virtual model and the actual workpiece in millimeter-level space, realizing the visualization reconstruction and quantitative evaluation of the inspection data, and significantly enhancing the system's intelligence level and reliability in the inspection of complex pipe welds.
[0104] Optionally, step S30, namely, based on the workpiece spatial reference model, performing acoustic beam propagation modeling on the preprocessed data to determine the mapping relationship between the original B-image pixels and the target image pixels, and obtaining acoustic beam mapping data, includes:
[0105] S301. Based on the workpiece geometric model, the bonding surface neglect area, and the unified coordinate system, double mask pruning is performed using a pre-processed A-scan line mask to obtain a set of effective source pixels located within the workpiece geometric boundary; wherein, background pixels with a mask value of -1 are first filtered through the pre-processed A-scan line mask, and pixels exceeding the workpiece geometric boundary are then filtered through the workpiece region mask generated by the workpiece geometric model.
[0106] S302. For the set of effective source pixels, perform multiple reflection path tracking based on the sound beam propagation law and the geometric contour of the workpiece to determine the mapping position of each echo in the target image space and establish the correspondence between the coordinates of the effective source pixel and the target pixel.
[0107] S303. Write the correspondence into the position mapping table and update the superposition count table to obtain the sound beam mapping data; the sound beam mapping data includes the position mapping table and the superposition count table.
[0108] Understandably, dual mask pruning filters out truly effective data points for imaging from the raw detection data. The effective source pixel set refers to the set of pixels that both contain effective detection signals and are actually located within the three-dimensional geometric volume of the workpiece. Specifically, firstly, a preprocessed A-scan line mask is used for the first layer of filtering. The mask value of each pixel is read, and pixels marked "-1" (representing background noise or meaningless signals) are directly removed, retaining only potential signal points. Subsequently, a corresponding workpiece region mask is generated using the workpiece geometric model. The pixels filtered in the first layer are compared with this mask, and pixels that, although valid signals, have physical coordinates that exceed the actual three-dimensional contour range of the workpiece are removed. The pixels remaining after this dual pruning constitute a clean and accurate initial data source for subsequent acoustic beam tracking.
[0109] After obtaining the effective source pixels, the system needs to simulate the actual physical propagation process of ultrasonic waves inside the workpiece. Beam tracking refers to calculating the complete path of the sound wave from emission to reception based on set physical laws such as sound velocity and attenuation, combined with the three-dimensional geometric topology of the workpiece. Specifically, for each effective source pixel, the system iteratively calculates based on sound beam propagation laws (such as Snell's law of reflection) and the workpiece's geometric contour: an initial sound ray is emitted from the source point, and the nearest intersection point with the workpiece contour is found to determine whether an effective reflection occurs (while simultaneously traversing the invalid "fitting surface ignore zone"); if an effective reflection is determined, the echo count is updated and the sound ray direction is changed to continue tracking forward until the preset number of echoes is reached. Each time a valid reflection intersection point (i.e., physical coordinates) is determined, the system immediately performs coordinate transformation, mapping the three-dimensional physical coordinates to the target pixel coordinates in the target two-dimensional image space, thereby establishing a one-to-one correspondence between "effective source pixels" and "target pixels".
[0110] Finally, the abstract beam tracking path is transformed into concrete beam mapping data. This beam mapping data is the core intermediate variable ultimately used for image rendering, and it consists of two parts: a position mapping table and a stacking count table. After traversing all valid source pixels and their reflection paths, the system begins executing the final write logic. For each successfully tracked endpoint (FinalX, FinalY), the system first checks if it exceeds the limits. If it does not, it updates both tables according to the coverage mode: in coverage mode, the target coordinates are directly bound to the source coordinates, and the count at that location is reset to 1; in non-coverage mode, the system reads the current stacking count at that location, and if it has not reached the maximum allowed stacking count, the source coordinates are appended to the mapping table, and the count is incremented by 1. This process ultimately generates two complete two-dimensional array tables, recording how each pixel is derived from the source data and how many valid echoes have covered that pixel.
[0111] This embodiment introduces a dual mask pruning mechanism, which greatly eliminates the interference of background noise and invalid physical space, ensuring that subsequent computational resources are focused on the real signal. On this basis, through high-precision beam tracking and coordinate mapping, the problem of digitally restoring the ultrasonic propagation path inside complex irregular workpieces is successfully solved. The final generated beam mapping data not only fully preserves the physical characteristics of multi-echo superposition, but also provides solid data support for subsequent image hole filling and high-fidelity rendering, significantly improving the accuracy and visual effect of ultrasonic tomography.
[0112] Optionally, the location mapping table is a three-dimensional array W×H×N, where W is the width of the target image; H is the height of the target image; and N is the maximum number of echo stackings.
[0113] The superposition counting table is a two-dimensional array W×H, used to record the number of times the sound beams are superimposed;
[0114] Writes can be performed in either overwrite or non-overwrite mode. In non-overwrite mode, writes are only performed when the number of overlays is less than the maximum number of overlays.
[0115] Understandably, two core data structures can be constructed to store the beam tracking results. The position mapping table is a three-dimensional array of size W×H×N, where W and H are the width and height of the target image (in pixels), respectively, and N is the preset maximum number of echo superpositions (e.g., 3 times). Each element of this array stores the source image coordinates (SrcX, SrcY), initially all of which are assigned invalid values (e.g., -1). The superposition count table is a two-dimensional array of size W×H, used to record the number of times the beam has been superimposed at each target pixel location; its initial value is set to 0.
[0116] When writing the source-target mapping relationship obtained from the tracking into these two tables, either an overlay mode or a non-overlay mode can be selected. In overlay mode, regardless of whether the current target pixel already has a record, the original value is directly replaced with the new source coordinates, and the overlay count at that location is reset to 1. In non-overlay mode, the system first checks the value in the overlay count table corresponding to the target pixel: only when the value is less than the maximum number of echo overlays N is it allowed to append the new source coordinates to the next layer of the position mapping table (i.e., the next depth index), and the overlay count is incremented by 1; if the maximum number has been reached, the writing is skipped. This design ensures that in multi-echo scenes, each pixel is contributed by at most N different path sound beams, avoiding image distortion caused by excessive overlay.
[0117] This embodiment effectively controls the number of acoustic beam superpositions by coordinating the location mapping table and the superposition count table, combined with covered and non-covered writing modes, thus avoiding oversaturation distortion of multi-echo signals. At the same time, it preserves complete imaging information under a limited number of superpositions, thereby improving image quality and data utilization.
[0118] Optionally, step S302, namely, performing multiple reflection path tracing on the effective source pixel set based on the sound beam propagation law and the workpiece geometric contour to determine the mapping position of each echo in the target image space, includes:
[0119] S3021. Using the same line ratio mapping method, the sound beam starting point is located in the reference row according to the A scan line number of the effective source pixel, the initial sound line segment from the sound beam starting point to the effective source pixel is constructed, and the sound line path is iteratively tracked in the workpiece contour.
[0120] S3022. Find the nearest intersection point with the workpiece contour line segment along the current sound ray direction;
[0121] S3023. If the intersection point is located within the neglected area of the mating surface, it is considered an invalid reflection, and the sound ray continues to be tracked past the intersection point along the original direction.
[0122] S3024. If the intersection point is not within the neglected area of the mating surface, it is considered a valid reflection, the echo count is incremented by 1, and a new direction is calculated according to the law of reflection. The tracking continues from the intersection point as the new starting point.
[0123] S3025. Until the preset number of echoes is reached or there are no subsequent intersections, the coordinates of the final physical intersection are converted into the pixel coordinates of the target image to obtain the mapping position corresponding to the effective source pixel.
[0124] Understandably, an initial physical tracking ray is first established for each valid source pixel. The co-linear scaling method is a coordinate localization algorithm based on geometric linear interpolation, used to quickly calculate the actual physical emission point of the current sound beam on a reference row (e.g., row 0) of an ultrasound image. Specifically, the system reads the A scan line number ID of the valid source pixel, and uses the relative position ratio of this number in the reference row to deduce the corresponding physical coordinate origin. Then, it connects this starting point with the current valid source pixel (…). This constructs an initial acoustic line segment. This line segment represents the first propagation path of the ultrasonic wave inside the workpiece, and the system will use this line segment as input to enter subsequent iterative tracking loops.
[0125] After determining the direction of the current sound ray segment, the system needs to find the impact point of the sound wave within the complex 3D workpiece model. The nearest intersection point is the collision point that is closest to all line segments in the workpiece's geometric contour set along the direction of the sound ray's extension. The algorithm traverses the workpiece contour database, calculates the potential intersection points between the sound ray segment and each contour line segment, and filters them by comparing the distances of these intersection points to the origin of the sound ray. The nearest intersection point represents the first medium interface encountered by the sound wave during propagation, conforming to the physical law that ultrasound propagates in a straight line and preferentially undergoes reflection in a uniform medium.
[0126] To address the issue of probes failing to fully fit the surface of irregularly shaped workpieces due to their high curvature, the system incorporates a special gap handling strategy during tracking. The contact surface neglect area is a specific region generated during the initial modeling stage, specifically used to mark the range of physical gaps between the probe and the workpiece. When the calculated intersection point falls within this area, the system determines that the signal is not an echo from a genuine internal material defect, but rather an invalid reflection (gap artifact) caused by the probe being suspended. In this case, the algorithm does not terminate tracking or generate a reflected signal at this point; instead, it commands the acoustic ray to maintain its original incident direction and penetrate the interface directly, continuing to search for the next valid physical intersection point deep within the workpiece.
[0127] When the intersection of the sound ray is located on the actual geometric boundary of the workpiece and not within the neglected region, the system confirms that a real physical reflection has occurred. The determination of a valid reflection marks a complete round-trip sound beam process. At this point, the system increments the current echo counter by 1 and, based on Snell's law of reflection (i.e., the angle of incidence equals the angle of reflection, combined with the normal vector of the workpiece surface), accurately calculates the new propagation direction of the reflected sound ray. Subsequently, the system uses the newly obtained valid intersection as a new starting point to reconstruct the sound ray segment and continues to challenge the next iteration until the termination condition is met.
[0128] Finally, when the sound ray reaches a preset number of echoes or there are no subsequent intersections, the physical calculation results are converted into the spatial coordinates required for image synthesis. The preset number of echoes is the maximum reflection level limit set by the imaging algorithm (e.g., focusing only on single or double reflections). If, during the tracking process, the sound ray scatters beyond the workpiece boundary before reaching the preset number of echoes (i.e., no subsequent intersections), the tracking is considered a failure; conversely, when the echo count reaches the target or the final termination point is found, the tracking stops. The system then extracts the three-dimensional physical coordinates (DstX, DstY) of the final intersection point and, through a pre-established unified coordinate system transformation chain, inversely projects it into pixel coordinates (FinalX, FinalY) in the two-dimensional target image space, thereby locking the exact landing point of the effective source pixel in the final image.
[0129] This embodiment successfully achieved accurate physical simulation of the propagation path of ultrasonic waves inside complex irregular workpieces by introducing the same-line proportional mapping method and rigorous geometric contour collision detection; by dynamically processing the neglected area of the mating surface, artifact interference caused by poor probe coupling was effectively eliminated, ensuring the authenticity of the imaging data; the iterative tracking mechanism based on the law of reflection enabled the algorithm to accurately capture multiple echo signals of deep defects, significantly improving the accuracy of ultrasonic tomography in depth resolution and quantitative defect assessment.
[0130] Optionally, step S40, namely, performing hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data to obtain updated sound beam mapping data, includes:
[0131] S401. Based on the sound beam mapping data, identify pixels with a superposition count of zero as holes to be filled.
[0132] S402. Using horizontal linear interpolation, calculate the beam path span difference between the effective points on both sides of the hole for the hole sequence between two adjacent effective points in the same row; if the difference exceeds a preset threshold or the effective points on both sides belong to different A scan lines, then interpolation is prohibited and the hole is retained; otherwise, calculate the source pixel coordinates of the hole point according to a linear ratio and fill them into the position mapping table.
[0133] S403. For isolated holes that cannot be handled by horizontal linear interpolation, search for the nearest valid point in the neighborhood and directly copy its source pixel coordinates to the position mapping table of the hole; if the length of consecutive holes exceeds the preset limit, no filling is performed.
[0134] S404. After filling all voids, update the position mapping table and the superposition count table to obtain the updated sound beam mapping data.
[0135] Understandably, the pixels in the target image can be traversed and screened based on the beam mapping data generated in the previous step. A hole is a pixel with a count of 0 in the overlay counter table, indicating that the location has not yet been covered by any valid beam path, and therefore appears as a blank area after the initial mapping. The system traverses the overlay counter table and marks all pixels with a count of 0 as "points to be filled", which will then be the target objects for subsequent interpolation operations.
[0136] For a sequence of consecutive holes between two adjacent valid points (i.e., pixels with a stack count greater than 0) within the same row, the system uses horizontal linear interpolation as the primary filling method. Before interpolation, the difference in the beam path span between the valid points on both sides of the hole must be calculated—that is, the absolute value of the difference in the physical path distances between the two valid points. This difference is a key indicator for determining whether the beam propagation is continuous. If this difference exceeds a preset abrupt change threshold, it indicates that although the two points are adjacent in the image, they may cross different reflecting surfaces or have experienced beam distortion in physical space. In this case, interpolation is prohibited, and the hole is preserved to avoid generating false artifacts. In addition, cross-line protection is also required: if the two valid points belong to different A-scan lines (i.e., different mask numbers), interpolation is also prohibited to prevent the mixing of beam data from different incident angles. Only when the difference is within the threshold range and they belong to the same A-scan line, are the source pixel coordinates of the hole calculated linearly and filled into the position mapping table, while the corresponding stack count is updated to 1.
[0137] For isolated voids that horizontal linear interpolation cannot handle (such as vertical breakpoints or single voids in the horizontal direction), the system employs nearest-neighbor interpolation as an auxiliary strategy. Specifically, it searches for the nearest valid point around the void and directly copies the source pixel coordinates of that valid point to the void's location mapping table, while simultaneously updating the stacking count. However, if the length of a continuous void exceeds a preset large-aperture protection limit, the sound beam in that area is considered discontinuous, and no forced filling is performed; it remains as background to avoid generating misleading information. This strategy ensures image continuity while avoiding erroneous data introduced by blind filling.
[0138] After filling all the holes, the system updates the position mapping table and the overlay count table. At this point, the previously broken valid data areas become continuous and hole-free, and all filled points have passed physical path continuity checks (abrupt threshold, cross-line protection, large hole protection). The updated beam mapping data becomes the complete data source for the final image synthesis, ensuring the geometric realism and visual integrity of the subsequent rendering results.
[0139] This embodiment employs a dual interpolation strategy of horizontal priority and proximity complementation, combined with abrupt change threshold, cross-line protection, and large aperture protection mechanisms. This approach not only fills in image holes but also strictly suppresses false artifacts caused by abrupt changes in the acoustic beam path or mixing of different scan lines. The final output acoustic beam mapping data maintains physical continuity and avoids overfitting errors, significantly improving the clarity and reliability of ultrasound tomography.
[0140] Optionally, step S50, namely, mapping the preprocessed B image to the target image space based on the updated beam mapping data, and synthesizing the target fused image according to a preset fusion strategy, includes:
[0141] S501. Determine a preset fusion strategy based on the fusion mode selected by the user; the preset fusion strategy includes maximum value fusion and coverage fusion;
[0142] S502. Traverse each pixel of the target image, and based on the position mapping table and superposition count table in the updated beam mapping data, read all source pixel coordinates mapped to the target pixel position, and extract the corresponding amplitude value from the preprocessed B image.
[0143] S503. If maximum value fusion is selected, all extracted amplitude values are compared, and only the maximum value is retained as the grayscale value of the target pixel; if overlay fusion is selected, only the amplitude value of the source pixel that was last mapped to the target pixel position is retained.
[0144] S504. Write the grayscale value of each target pixel into the target image space to obtain the target fused image.
[0145] Understandably, a flexible imaging interface can be provided, allowing users to select different preset fusion strategies based on their detection needs. These preset fusion strategies include maximum value fusion and coverage fusion. Maximum value fusion is a signal enhancement strategy suitable for conventional flaw detection scenarios, especially when detecting weak signal defects such as microcracks and lack of fusion. Its core logic is to retain only the signal with the largest amplitude from multiple acoustic beams mapped to the same target pixel, thus preventing strong background noise or bottom echoes from "averaging" out weak defect signals. Coverage fusion is a layered analysis strategy suitable for scenarios requiring the differentiation of echoes at different depths or the observation of specific interlayer structures. Its core logic is to retain only the signal that was last mapped to the target pixel (usually corresponding to the highest echo count), thus clearly displaying image features at a specific acoustic path and avoiding interference from overlapping signals at different depths. After the user selects a mode, the system uses the corresponding logical rules as the basis for subsequent fusion calculations.
[0146] After determining the fusion mode, the system begins to traverse the target image space pixel by pixel. For each target pixel, the system first queries the superposition count table in the updated beam mapping data to read the superposition count at that location (i.e., how many valid source pixels are mapped to the current location). If the superposition count is 0, it means there is no beam coverage, and the pixel is directly set to the background color (black). If the superposition count is greater than 0, the system reads the coordinates of all source pixels mapped to that location sequentially according to the source pixel coordinate list stored in the location mapping table. Subsequently, the amplitude values (i.e., the grayscale intensity values of the ultrasound signal) corresponding to these coordinates are extracted from the preprocessed B image as the raw data input for subsequent fusion calculations.
[0147] Based on the fusion strategy selected by the user in S501, the system performs the corresponding data merging operation. If maximum value fusion is selected, the system will iterate through all amplitude values extracted from S502, find the maximum value by comparing them one by one, and use this maximum value as the final grayscale value of the target pixel. This process can effectively preserve the strongest signal features, and is particularly suitable for highlighting echoes with weak defects. If overlay fusion is selected, the system directly reads the coordinates of the source pixel last written in the position mapping table (i.e., the latest position indicated by the number of overlays), and retrieves the amplitude value corresponding to that coordinate from the preprocessed B image, directly assigning it to the target pixel. This process can clearly show the image features under a specific sound path, facilitating layered interpretation.
[0148] After calculating the grayscale values of all target pixels, the system writes these grayscale values pixel by pixel into the target image space to form the final target fused image. The target fused image has the following characteristics: the pixel position strictly corresponds to the physical space of the workpiece (geometric realism); in maximum value mode, weak defect signals are not lost (signal fidelity); the image has no holes or breaks, and the visual effect is continuous and complete (continuous completeness). Users can switch fusion modes at any time without recalculating the sound path, enabling real-time interactive image evaluation (flexible interaction).
[0149] This embodiment offers two selectable modes: maximum value fusion and overlay fusion. This balances defect detection sensitivity and layered analysis clarity within a single imaging process. Users can flexibly switch modes according to their detection needs without repeatedly calculating acoustic ray paths. Maximum value fusion effectively prevents weak signals from being overwhelmed by strong backgrounds, significantly improving the detection rate of defects such as microcracks and incomplete fusion. Overlay fusion avoids the overlap of echo signals from different depths, providing clear image evidence for acoustic beam path analysis and interlayer structure interpretation, thus realizing intelligent and interactive ultrasonic tomography.
[0150] In one application example, such as Figures 4a-4c As shown, Figure 4a A simulated image of the pre-fusion B image at a 0° cross-section; Figure 4b A simulated image of the pre-fusion B image at a 30° cross section; Figure 4c This is a simulated image of the original B-image at a 90° cross-section. For example... Figures 5a-5c As shown, Figure 5a This is a simulated image of the fused B image at a 0° cross-section; Figure 5b This is a simulated image of the fused B image at a 30° cross-section; Figure 5c This is a simulated image of the fused B image at a 90° cross-section.
[0151] By comparing the changes in the images before and after fusion, it can be seen that: before fusion, the B image only displays simulated graphics on a single cross-section (such as 0°), resulting in a limited field of view, especially in areas beyond the first wave, making it impossible to intuitively obtain the specific location of defects in the three-dimensional weld space; while after fusion, through the superposition and mapping of multi-section data (0°, 30°, 90°), the B image not only achieves a comprehensive expansion of the detection area, but more importantly, it can clearly and intuitively reconstruct the real spatial location of defects in the weld, greatly facilitating the location analysis and evaluation of internal defects in complex and irregular workpieces by inspection personnel.
[0152] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0153] In one embodiment, an adaptive ultrasonic image fusion device for irregularly shaped workpieces is provided, which corresponds one-to-one with the adaptive ultrasonic image fusion method for irregularly shaped workpieces described in the above embodiments. For example... Figure 6 As shown, the adaptive ultrasonic image fusion device for irregularly shaped workpieces includes:
[0154] The data acquisition and preprocessing module 10 is used to acquire the original B image based on the workpiece structure information of the irregular workpiece and perform preprocessing to obtain preprocessed image data; the preprocessed image data includes the preprocessed B image, the preprocessed A scan line mask and the pre-interpolation coefficients.
[0155] The workpiece space reference modeling module 20 is used to perform parametric geometric modeling on the irregular workpiece based on the preprocessed image data, establish a unified transformation chain, and obtain the workpiece space reference model.
[0156] The acoustic beam propagation and mapping modeling module 30 is used to perform acoustic beam propagation modeling on the preprocessed data based on the workpiece spatial reference model, determine the mapping relationship between the original B image pixels and the target image pixels, and obtain acoustic beam mapping data.
[0157] The adaptive hole filling and optimization module 40 is used to perform hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data to obtain updated sound beam mapping data.
[0158] The multi-mode image fusion and output module 50 is used to map the preprocessed B image to the target image space based on the updated beam mapping data, and synthesize the target fused image according to a preset fusion strategy.
[0159] Optionally, the data acquisition and preprocessing module 10 is also used for:
[0160] The focusing rule is set according to the geometric characteristics of the irregular workpiece and the weld position; the focusing rule includes the deflection angle range, focusing depth and aperture parameters;
[0161] The original B image is acquired in real time according to the focusing rule;
[0162] Based on the number of probe array elements, spacing, and scanning angle range, an A scan line mask matching the original B image is generated;
[0163] The original B image is pre-converted using bilinear interpolation with the same path length, and the interpolation position coefficients are pre-calculated to obtain the pre-processed B image and the pre-interpolation coefficients.
[0164] Synchronous nearest neighbor resampling is performed on the A scan line mask to obtain a preprocessed A scan line mask that is spatially aligned with the preprocessed B image.
[0165] Optionally, the workpiece spatial reference model includes a workpiece geometric model, a mating surface neglect area, and a unified coordinate system; the workpiece spatial reference modeling module 20 is also used for:
[0166] Parametric geometric modeling is performed on the irregularly shaped workpiece to obtain the workpiece's geometric model; wherein, for reducer pipes, elbows, cross pipe welds and custom complex workpieces, wall thickness, diameter, radius of curvature, and intersection angle parameters are input respectively, and the curve is discretized into multiple short straight line segments;
[0167] The non-perfect fit gap between the probe and the workpiece is processed using the dynamic neglect area method to obtain the fit surface neglect area; wherein, the overlapping area between the bottom surface of the probe and the contour of the workpiece is calculated and extended outward from the boundary line segment until the angle between the extended line segment and the original boundary line segment exceeds 90°, and this extended area is defined as the fit surface neglect area.
[0168] Based on the probe pose and encoder position, a unified transformation chain is established from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system to obtain the unified coordinate system.
[0169] Optionally, the sound beam propagation and mapping modeling module 30 is also used for:
[0170] Based on the workpiece geometric model, the bonding surface neglect area, and the unified coordinate system, a double mask pruning is performed using a pre-processed A-scan line mask to obtain a set of effective source pixels located within the workpiece geometric boundary. Specifically, background pixels with a mask value of -1 are first filtered through the pre-processed A-scan line mask, and then pixels exceeding the workpiece geometric boundary are filtered through the workpiece region mask generated by the workpiece geometric model.
[0171] For the set of effective source pixels, multiple reflection path tracings are performed based on the sound beam propagation law and the geometric contour of the workpiece to determine the mapping position of each echo in the target image space and establish the correspondence between the coordinates of the effective source pixel and the target pixel.
[0172] The correspondence is written into the position mapping table and the superposition count table is updated to obtain the sound beam mapping data; the sound beam mapping data includes the position mapping table and the superposition count table.
[0173] Optionally, the location mapping table is a three-dimensional array W×H×N, where W is the width of the target image; H is the height of the target image; and N is the maximum number of echo stackings.
[0174] The superposition counting table is a two-dimensional array W×H, used to record the number of times the sound beams are superimposed;
[0175] Writes can be performed in either overwrite or non-overwrite mode. In non-overwrite mode, writing only occurs if the number of overlays is less than the maximum number of overlays; and / or,
[0176] The step of performing multiple reflection path tracing on the effective source pixel set based on the sound beam propagation law and the workpiece geometric contour to determine the mapping position of each echo in the target image space includes:
[0177] Using the same line ratio mapping method, the sound beam starting point is located in the reference row according to the A scan line number of the effective source pixel, the initial sound line segment from the sound beam starting point to the effective source pixel is constructed, and the sound line path is iteratively tracked in the workpiece contour.
[0178] Find the nearest intersection point with the workpiece contour line segment along the current sound ray direction;
[0179] If the intersection point is located within the neglected area of the mating surface, it is considered an invalid reflection, and the sound ray continues to be tracked past the intersection point along the original direction;
[0180] If the intersection point is not within the neglected area of the mating surface, it is considered a valid reflection, the echo count is incremented by 1, and a new direction is calculated according to the law of reflection. The tracking continues from the intersection point as the new starting point.
[0181] Until the preset number of echoes is reached or there are no subsequent intersections, the coordinates of the final physical intersection are converted into the pixel coordinates of the target image to obtain the mapping position corresponding to the effective source pixel.
[0182] Optionally, the adaptive hole filling and optimization module 40 is also used for:
[0183] Based on the sound beam mapping data, pixels with a superposition count of zero are identified as holes to be filled.
[0184] Using horizontal linear interpolation, for the hole sequence between two adjacent valid points in the same row, the beam path span difference between the valid points on both sides of the hole is calculated; if the difference exceeds a preset threshold or the valid points on both sides belong to different A scan lines, interpolation is prohibited and the hole is retained; otherwise, the source pixel coordinates of the hole point are calculated according to a linear ratio and filled into the position mapping table;
[0185] For isolated holes that cannot be handled by horizontal linear interpolation, search for the nearest valid point in the neighborhood and directly copy its source pixel coordinates to the location mapping table of the hole; if the length of consecutive holes exceeds the preset limit, no filling is performed;
[0186] After filling all the voids, update the position mapping table and the superposition count table to obtain the updated sound beam mapping data.
[0187] Optionally, the multi-mode image fusion and output module 50 is also used for:
[0188] Based on the fusion mode selected by the user, a preset fusion strategy is determined; the preset fusion strategy includes maximum value fusion and coverage fusion;
[0189] Traverse each pixel of the target image, and based on the position mapping table and superposition count table in the updated beam mapping data, read all source pixel coordinates mapped to the target pixel position, and extract the corresponding amplitude value from the preprocessed B image;
[0190] If maximum value fusion is selected, all extracted amplitude values are compared, and only the maximum value is retained as the grayscale value of the target pixel; if overlay fusion is selected, only the amplitude value of the source pixel that was last mapped to the target pixel position is retained.
[0191] The grayscale values of each target pixel are written into the target image space to obtain the target fused image.
[0192] Specific limitations regarding the adaptive ultrasonic image fusion device for irregularly shaped workpieces can be found in the limitations of the adaptive ultrasonic image fusion method for irregularly shaped workpieces mentioned above, and will not be repeated here. Each module in the aforementioned adaptive ultrasonic image fusion device for irregularly shaped workpieces can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0193] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data related to the adaptive ultrasonic image fusion method for irregularly shaped workpieces. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an adaptive ultrasonic image fusion method for irregularly shaped workpieces.
[0194] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the adaptive ultrasonic image fusion method for irregularly shaped workpieces described in the above embodiment; to avoid repetition, this will not be repeated here. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the embodiment of the adaptive ultrasonic image fusion device for irregularly shaped workpieces; to avoid repetition, this will not be repeated here.
[0195] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the adaptive ultrasonic image fusion method for irregularly shaped workpieces described in the above embodiment. To avoid repetition, this will not be described again here. Alternatively, when executed by a processor, the computer program implements the functions of each module / unit in the above embodiment of the adaptive ultrasonic image fusion device for irregularly shaped workpieces. To avoid repetition, this will not be described again here.
[0196] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0197] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0198] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An adaptive ultrasonic image fusion method for irregularly shaped workpieces, characterized in that, include: The original B-image is acquired based on the workpiece structure information of the irregular workpiece and preprocessed to obtain preprocessed image data; The preprocessed image data includes preprocessed image B, preprocessed scan line mask A, and pre-interpolation coefficients; Based on the preprocessed image data, parametric geometric modeling is performed on the irregular workpiece, a unified transformation chain is established, and a workpiece spatial reference model is obtained; the workpiece spatial reference model includes a workpiece geometric model, a mating surface neglect area, and a unified coordinate system. Based on the workpiece space reference model, sound beam propagation modeling is performed on the preprocessed data to determine the mapping relationship between the original B image pixels and the target image pixels, and sound beam mapping data is obtained. Based on the sound beam mapping data, hole detection and adaptive filling under continuity constraints are performed on the mapped target image to obtain updated sound beam mapping data. Based on the updated acoustic beam mapping data, the preprocessed B image is mapped to the target image space, and the target fused image is synthesized according to a preset fusion strategy; The step of performing parametric geometric modeling on the irregularly shaped workpiece based on the preprocessed image data, establishing a unified transformation chain, and obtaining a workpiece spatial reference model includes: Parametric geometric modeling is performed on the irregularly shaped workpiece to obtain the workpiece's geometric model; wherein, for reducer pipes, elbows, cross pipe welds and custom complex workpieces, wall thickness, diameter, radius of curvature, and intersection angle parameters are input respectively, and the curve is discretized into multiple short straight line segments; The non-perfect fit gap between the probe and the workpiece is processed using the dynamic neglect area method to obtain the neglect area of the fit surface; wherein, the overlapping area between the bottom surface of the probe and the contour of the workpiece is calculated and expanded outward from the boundary line segment until the angle between the expanded line segment and the original boundary line segment exceeds 90°, and the expanded area is defined as the neglect area of the fit surface. Based on the probe pose and encoder position, a unified transformation chain is established from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system to obtain the unified coordinate system.
2. The adaptive ultrasonic image fusion method for irregularly shaped workpieces according to claim 1, characterized in that, The process of acquiring the original B-image based on the workpiece structure information of the irregularly shaped workpiece and performing preprocessing to obtain preprocessed image data includes: The focusing rule is set according to the geometric characteristics of the irregular workpiece and the weld position; the focusing rule includes the deflection angle range, focusing depth and aperture parameters; The original B image is acquired in real time according to the focusing rule; Based on the number of probe array elements, spacing, and scanning angle range, an A scan line mask matching the original B image is generated; The original B image is pre-converted using bilinear interpolation with the same path length, and the interpolation position coefficients are pre-calculated to obtain the pre-processed B image and the pre-interpolation coefficients. Synchronous nearest neighbor resampling is performed on the A scan line mask to obtain a preprocessed A scan line mask that is spatially aligned with the preprocessed B image.
3. The adaptive ultrasonic image fusion method for irregularly shaped workpieces according to claim 1, characterized in that, Based on the workpiece spatial reference model, the preprocessed data is modeled for acoustic beam propagation to determine the mapping relationship between the pixels of the original B-image and the pixels of the target image, thus obtaining acoustic beam mapping data, including: Based on the workpiece geometric model, the bonding surface neglect area, and the unified coordinate system, a double mask pruning is performed using a pre-processed A-scan line mask to obtain a set of effective source pixels located within the workpiece geometric boundary. Specifically, background pixels with a mask value of -1 are first filtered through the pre-processed A-scan line mask, and then pixels exceeding the workpiece geometric boundary are filtered through the workpiece region mask generated by the workpiece geometric model. For the set of effective source pixels, multiple reflection path tracing is performed based on the sound beam propagation law and the geometric contour of the workpiece to determine the mapping position of each echo in the target image space and establish the correspondence between the coordinates of the effective source pixels and the target pixels. The correspondence is written into the position mapping table and the superposition count table is updated to obtain the sound beam mapping data; the sound beam mapping data includes the position mapping table and the superposition count table.
4. The adaptive ultrasonic image fusion method for irregularly shaped workpieces according to claim 3, characterized in that, The location mapping table is a three-dimensional array W×H×N, where W is the width of the target image; H is the height of the target image; and N is the maximum number of echo stackings. The superposition counting table is a two-dimensional array W×H, used to record the number of times the sound beams are superimposed; Writes can be performed in either overwrite or non-overwrite mode. In non-overwrite mode, writing only occurs if the number of overlays is less than the maximum number of overlays; and / or, The step of performing multiple reflection path tracing on the effective source pixel set based on the sound beam propagation law and the workpiece geometric contour to determine the mapping position of each echo in the target image space includes: Using the same line ratio mapping method, the sound beam starting point is located in the reference row according to the A scan line number of the effective source pixel, the initial sound line segment from the sound beam starting point to the effective source pixel is constructed, and the sound line path is iteratively tracked in the workpiece contour. Find the nearest intersection point with the workpiece contour line segment along the current sound ray direction; If the intersection point is located within the neglected area of the mating surface, it is considered an invalid reflection, and the sound ray continues to be tracked past the intersection point along the original direction; If the intersection point is not within the neglected area of the mating surface, it is considered a valid reflection, the echo count is incremented by 1, and a new direction is calculated according to the law of reflection. The tracking continues from the intersection point as the new starting point. Until the preset number of echoes is reached or there are no subsequent intersections, the coordinates of the final physical intersection are converted into the pixel coordinates of the target image to obtain the mapping position corresponding to the effective source pixel.
5. The adaptive ultrasonic image fusion method for irregularly shaped workpieces according to claim 1, characterized in that, The step of performing hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data to obtain updated sound beam mapping data includes: Based on the sound beam mapping data, pixels with a superposition count of zero are identified as holes to be filled. Using horizontal linear interpolation, for the hole sequence between two adjacent valid points in the same row, the beam path span difference between the valid points on both sides of the hole is calculated; if the difference exceeds a preset threshold or the valid points on both sides belong to different A scan lines, interpolation is prohibited and the hole is retained; otherwise, the source pixel coordinates of the hole point are calculated according to a linear ratio and filled into the position mapping table; For isolated holes that cannot be handled by horizontal linear interpolation, search for the nearest valid point in the neighborhood and directly copy its source pixel coordinates to the location mapping table of the hole; if the length of consecutive holes exceeds the preset limit, no filling is performed; After filling all the voids, update the position mapping table and the superposition count table to obtain the updated sound beam mapping data.
6. The adaptive ultrasonic image fusion method for irregularly shaped workpieces according to claim 1, characterized in that, The step of mapping the preprocessed B image to the target image space based on the updated beam mapping data, and synthesizing the target fused image according to a preset fusion strategy, includes: Based on the fusion mode selected by the user, a preset fusion strategy is determined; the preset fusion strategy includes maximum value fusion and coverage fusion; Traverse each pixel of the target image, and based on the position mapping table and superposition count table in the updated beam mapping data, read all source pixel coordinates mapped to the target pixel position, and extract the corresponding amplitude value from the preprocessed B image; If maximum value fusion is selected, all extracted amplitude values are compared, and only the maximum value is retained as the grayscale value of the target pixel; if overlay fusion is selected, only the amplitude value of the source pixel that was last mapped to the target pixel position is retained. The grayscale values of each target pixel are written into the target image space to obtain the target fused image.
7. An adaptive ultrasonic image fusion device for irregularly shaped workpieces, characterized in that, include: The data acquisition and preprocessing module is used to acquire the original B-image based on the workpiece structure information of the irregular workpiece and perform preprocessing to obtain preprocessed image data. The preprocessed image data includes preprocessed image B, preprocessed scan line mask A, and pre-interpolation coefficients; The workpiece spatial reference modeling module is used to perform parametric geometric modeling on the irregular workpiece based on the preprocessed image data, establish a unified transformation chain, and obtain the workpiece spatial reference model; the workpiece spatial reference model includes the workpiece geometric model, the contact surface neglect area, and a unified coordinate system; The acoustic beam propagation and mapping modeling module is used to perform acoustic beam propagation modeling on the preprocessed data based on the workpiece spatial reference model, determine the mapping relationship between the original B image pixels and the target image pixels, and obtain acoustic beam mapping data. An adaptive hole filling and optimization module is used to perform hole detection and adaptive filling under continuity constraints on the mapped target image based on the sound beam mapping data, so as to obtain updated sound beam mapping data. The multi-mode image fusion and output module is used to map the preprocessed B image to the target image space based on the updated beam mapping data, and synthesize the target fused image according to a preset fusion strategy. The workpiece space reference modeling module is also used for: Parametric geometric modeling is performed on the irregularly shaped workpiece to obtain the workpiece's geometric model; wherein, for reducer pipes, elbows, cross pipe welds and custom complex workpieces, wall thickness, diameter, radius of curvature, and intersection angle parameters are input respectively, and the curve is discretized into multiple short straight line segments; The non-perfect fit gap between the probe and the workpiece is processed using the dynamic neglect area method to obtain the neglect area of the fit surface; wherein, the overlapping area between the bottom surface of the probe and the contour of the workpiece is calculated and expanded outward from the boundary line segment until the angle between the expanded line segment and the original boundary line segment exceeds 90°, and the expanded area is defined as the neglect area of the fit surface. Based on the probe pose and encoder position, a unified transformation chain is established from the probe coordinate system to the workpiece physical coordinate system and then to the display pixel coordinate system to obtain the unified coordinate system.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the adaptive ultrasonic image fusion method for irregularly shaped workpieces according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the adaptive ultrasonic image fusion method for irregularly shaped workpieces according to any one of claims 1 to 6.
Citation Information
Patent Citations
Computing systems and methods for masking ultrasound images
CA3252173A1
Phased array ultrasonic detection method and system for small connecting pipe detection
CN122171689A
