Front and back ground decoupling three-dimensional reconstruction system, method and medium for transmission type terahertz imaging
By employing a dual-branch decoupling strategy for foreground and background and an adaptive re-sampling strategy, the problems of foreground and background overlap and inconsistent viewing angles in transmission terahertz imaging are solved, achieving efficient and automated 3D reconstruction and improving the robustness and engineering practicality of the imaging system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEIFANG UNIVERSITY
- Filing Date
- 2026-04-28
- Publication Date
- 2026-07-03
AI Technical Summary
Existing transmission terahertz imaging suffers from problems in the 3D reconstruction process, such as overlapping shadows between foreground and background, inconsistency between viewpoint quality assessment and reconstruction, and difficulty in balancing imaging efficiency and reconstruction integrity. Especially under multi-view acquisition conditions, the system cannot effectively separate foreground and background information, resulting in low reconstruction accuracy and efficiency.
By employing a foreground and background dual-branch decoupling technique, a four-dimensional cost volume is constructed and iteratively solved through a comprehensive scoring of viewpoint quality, an adaptive re-sampling strategy, and a dual-weighted fusion. This achieves the decoupling of foreground and background information and allows for re-sampling under dynamic adjustment of reconstruction risk, ensuring reconstruction accuracy and efficiency.
It significantly reduces foreground and background aliasing interference, achieves fully automated dynamic re-acquisition closed loop, improves acquisition efficiency by more than 50%, and the reconstruction accuracy meets preset requirements. It is suitable for various scenarios and devices.
Smart Images

Figure CN122115748B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a foreground-background decoupled 3D reconstruction system, method, and medium for transmission terahertz imaging, belonging to the field of terahertz imaging and 3D visual reconstruction technology. Background Technology
[0002] Transmission terahertz imaging possesses advantages such as no ionizing radiation, penetration of most non-metallic materials, and good response to specific substances, making it highly valuable for applications in hazardous materials detection, materials testing, and biological tissue analysis. However, existing transmission terahertz multi-view imaging still faces three prominent problems in the 3D reconstruction process.
[0003] Firstly, transmission imaging projects the information of the back side of the target into the front image, forming a shadow of overlapping foreground and background. This causes the image from the same viewpoint to simultaneously contain the front structure, the back structure, and the pseudo texture resulting from their superposition. When used directly for multi-view matching, this can easily lead to cost volume contamination and depth inference distortion.
[0004] Secondly, existing systems typically employ a fixed-angle step-by-step offline acquisition method. If certain angles are obstructed, have insufficient contrast, blurred edges, or excessive aliasing, the system still directly enters the reconstruction stage, resulting in sparse point clouds, increased holes, and local structural breaks, making it impossible to perform supplementary acquisition for low-quality viewpoints.
[0005] Third, preprocessing, viewpoint quality assessment, 3D reconstruction, and point cloud fusion are mostly designed in a serial and separate manner, lacking a closed-loop mechanism for reverse acquisition control around "reconstruction credibility", making it difficult to balance imaging efficiency and reconstruction integrity.
[0006] For example, Chinese patent application publication number CN121595580A discloses a terahertz continuous wave wind turbine blade defect imaging method based on an unmanned aerial vehicle platform, which uses transmission imaging to detect internal defects. However, this technology also uses a single-view imaging mode and does not have three-dimensional reconstruction capabilities. The article "Application of wavelet transform in terahertz three-dimensional imaging detection of internal defects" published in Acta Physica Sinica in 2017 proposed a terahertz three-dimensional imaging scheme based on reflective scanning, which improves the longitudinal resolution through wavelet transform. However, this scheme uses a point-by-point scanning mode, which has extremely low imaging efficiency and is only suitable for laboratory testing of small-sized samples.
[0007] Therefore, a new technical solution is needed to enable the system to first decouple the foreground and background information under the condition of transmission terahertz multi-view acquisition, and then automatically determine whether and how to supplement the acquisition based on the uncertainty of the viewpoint, and complete the three-dimensional reconstruction under the credibility constraint, thereby improving the robustness and engineering practicality of terahertz three-dimensional imaging. Summary of the Invention
[0008] The purpose of this invention is to propose a three-dimensional reconstruction system, method, and medium for foreground and background decoupling in transmission terahertz imaging. By decoupling the foreground and background in a dual-branch manner, the aliasing interference of transmission imaging is eliminated. At the same time, the re-acquisition strategy is dynamically adjusted based on reconstruction risk, thereby significantly improving acquisition efficiency while ensuring reconstruction accuracy.
[0009] The foreground and background decoupled 3D reconstruction system for transmission terahertz imaging described in this invention includes the following steps:
[0010] Acquire multi-view transmission terahertz raw images of the target under test and simultaneously record the acquisition pose parameters corresponding to each image.
[0011] A comprehensive viewpoint quality score is generated by integrating multi-dimensional imaging indicators for each original image frame, while the foreground and background overlay features of each image frame are extracted.
[0012] Based on the positional relationship of the viewpoint, the view to be optimized is paired, and a dual-branch cost volume for the foreground and background is constructed. After feature enhancement and iterative solution, the foreground and background are decoupled, and the foreground probability map, background probability map and pixel-level uncertainty mask are output.
[0013] The acquisition angle domain is divided into multiple continuous sectors, and the reconstruction risk value of each sector is calculated. When the reconstruction risk value exceeds a preset threshold, adaptive re-acquisition is performed on the corresponding sector to update the multi-view image set.
[0014] By combining viewpoint quality weights and pixel confidence weights, cost aggregation and depth optimization are performed on multi-view images to obtain high-confidence depth maps for each viewpoint.
[0015] Based on multi-view depth maps, corresponding pose parameters, and confidence information, point cloud back projection, weighted fusion, and local hole repair are completed, and the 3D reconstruction results of the target under test are output.
[0016] Preferably, the comprehensive viewpoint quality score is generated by linearly weighting five indicators: normalized sharpness, contour closure, normalized grayscale information content, viewpoint consistency, and foreground / background blurring index. The calculation formula is as follows:
[0017] ;
[0018] in: C is a normalized sharpness metric. i B is the contour closure index. i V is a normalized grayscale information content indicator. i M is a consistency index of perspective. i The foreground and background blur index is represented by a1-a5, which are non-negative weights and a1+a2+a3+a4+a5=1.
[0019] Preferably, the pairing of the views to be optimized supports two modes: the adjacent angle pairing mode selects view pairing with an acquisition angle difference of no more than 10°, and the near-facing angle pairing mode selects view pairing with an acquisition angle difference in the range of 165°~195°. The matching mode can be automatically switched according to the imaging scene.
[0020] Preferably, in the foreground and background feature decoupling process, geometric registration and normalization are first performed on the paired views, and then cost volumes of foreground and background dual branches are constructed respectively. After feature enhancement and iterative solution, the separation result is output. The foreground and background dual branch cost volumes are four-dimensional structures, with dimensions of image height, image width, number of depth candidate values, and number of feature channels, respectively. Feature enhancement adopts a gated common feature enhancement method, and iterative solution is a fixed-point iterative solution.
[0021] Preferably, the sector reconstruction risk value is calculated based on a weighted average of four indicators: the average view quality score within the sector, the average proportion of uncertain pixel area, the proportion of low-confidence depth pixels, and the normalized average depth difference between adjacent views. The calculation formula is as follows:
[0022] ;
[0023] in: The average viewing angle quality score within the sector. This represents the average percentage of uncertain pixel area within a sector. The percentage of low-confidence depth pixels. The normalized mean of the depth difference between adjacent views is given, where c1~c4 are non-negative weights and c1+c2+c3+c4=1; when When the risk value exceeds the preset threshold, supplementary sampling is performed on the corresponding sector, and the sampling angle interval decreases as the risk value increases.
[0024] Preferably, the adaptive sampling angle interval decreases as the reconstruction risk value increases, and the angle interval ranges from 1° to 30°; when the reconstruction risk value exceeds the highest threshold, the sampling angle interval does not exceed 5°; the termination conditions for sampling include any one of the following: the change in reconstruction risk value is lower than the threshold after two consecutive samplings, the number of sampling rounds reaches the preset upper limit, or the improvement in reconstruction quality is lower than the threshold.
[0025] Preferably, the viewpoint quality weight and pixel confidence weight are calculated based on the overall quality of the corresponding viewpoint, the foreground effectiveness of the corresponding pixel, and the degree of uncertainty, respectively. The calculation formula for the viewpoint quality weight is as follows:
[0026] w v i =exp(γQ i ) / Σexp(γQ j );
[0027] Where: w v i γ is the global view weight for the i-th view, and the sum of the view weights of all views involved in depth inference is 1; γ is a preset weight temperature coefficient used to control the discriminative power of the weights; Q i Q is the overall quality score for the i-th perspective. j The quality comprehensive score is given for the j-th viewpoint participating in depth inference; the pixel confidence weight is determined by the foreground validity identifier and uncertainty mask of the corresponding pixel, and the value range is [0,1]. The higher the value, the higher the confidence of the pixel.
[0028] Preferably, in the point cloud weighted fusion process, the point-level fusion weight of each spatial point is obtained by weighting the view quality weight, depth confidence, and uncertainty of the view to which the corresponding pixel belongs; the local hole repair adopts the inverse distance weighted interpolation method, and only performs repair on areas where the equivalent hole radius does not exceed the preset threshold and the number of effective neighboring points meets the requirements.
[0029] The foreground-background decoupled 3D reconstruction system for transmission terahertz imaging described in this invention is used to execute the foreground-background decoupled 3D reconstruction method for transmission terahertz imaging, comprising:
[0030] The terahertz image acquisition module is used to output multi-view transmitted terahertz raw images and corresponding acquisition pose parameters;
[0031] The motion control module is used to control the relative rotation angle between the target under test and the terahertz image acquisition module, and to perform pose adjustment during the initial acquisition and adaptive re-acquisition process;
[0032] The quality assessment and decoupling module is used to complete the quality score calculation of single-view images, foreground and background aliasing feature extraction, and foreground and background separation of paired views;
[0033] The supplementary mining decision module is used to calculate the sector reconstruction risk based on the quality scores and decoupling results from various perspectives, generate a dynamic supplementary mining strategy, and issue control commands to the motion control module.
[0034] The 3D reconstruction module is used to perform depth inference under dual-weight constraints, multi-view point cloud fusion, and output of 3D reconstruction results.
[0035] The computer-readable storage medium of the present invention stores a computer program thereon, which, when executed by a processor, implements the steps of the foreground-background decoupling three-dimensional reconstruction method for transmission terahertz imaging.
[0036] Compared with existing technologies, the foreground and background decoupled 3D reconstruction system, method, and medium for transmission terahertz imaging of the present invention exhibit the following beneficial effects in terms of technical performance and practical application:
[0037] 1. Solving the aliasing interference problem in transmission imaging from the root: This invention addresses the most typical foreground-background aliasing problem in transmission terahertz images in advance, and provides a complete set of rules for constructing a reproducible four-dimensional cost volume, enhancing gated common features, solving fixed-point iteratively, and quantifying pixel-level uncertainty. This can effectively separate the projection information of the foreground and background, and significantly reduce the interference of back projection on subsequent depth inference.
[0038] 2. Achieve automated dynamic supplementary acquisition closed-loop without manual intervention: This invention unifies viewpoint quality assessment, reconstruction risk calculation, supplementary acquisition angle generation, and supplementary acquisition termination conditions into a quantitative closed loop. It eliminates reliance on manual experience to determine supplementary acquisition areas and intervals, facilitating fully automated supplementary acquisition in engineering systems. Compared to fixed-angle acquisition schemes, it can reduce invalid acquisition by 40% to 60%, improve acquisition efficiency by over 50%, and ensure that the reconstruction accuracy of all areas meets preset requirements.
[0039] 3. Construct a fully quantifiable and optimizable process that balances efficiency and quality: This invention introduces viewpoint weight, pixel weight, confidence-weighted fusion, and quantitative hole repair strategies, transforming multi-view terahertz 3D reconstruction from a traditional discrete processing link into a fully quantifiable and optimizable process. The weight configuration can be dynamically adjusted according to scene requirements, achieving a flexible balance between imaging efficiency and reconstruction quality.
[0040] 4. High versatility and adaptability to various scenarios and equipment: This invention is applicable to both portable terahertz 3D imaging devices and laboratory benchtop high-precision terahertz imaging systems. It can simultaneously serve various scenarios such as security inspection, industrial non-destructive testing, biological tissue imaging, and scientific research experiments. There is no need to make significant adjustments to the core algorithm for different scenarios, resulting in low engineering implementation and adaptation costs. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the overall process of the method of the present invention;
[0042] Figure 2 This is a block diagram of the system composition of the present invention;
[0043] Figure 3 This is a schematic diagram of the processing flow of the foreground-background decoupling module;
[0044] Figure 4 This is a schematic diagram of adaptive replenishment decision-making based on uncertainty assessment;
[0045] Figure 5 This is a schematic diagram of the weighted depth inference and point cloud fusion process;
[0046] Figure 6The figure shows the output results in the embodiment of the present invention; in the figure, (a) is the background decoupling result; (b) is the uncertainty mask; and (c) is the foreground decoupling result. Detailed Implementation
[0047] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0048] Example 1:
[0049] like Figure 1 As shown, the foreground and background decoupling 3D reconstruction method for transmission terahertz imaging described in this invention includes the following steps:
[0050] Step S1, Initial Multi-View Acquisition: The terahertz image acquisition module, in conjunction with the target rotation motion control module, performs a round-around imaging of the target at an initial angular interval Δθ0, obtaining an original terahertz image set I={I1, I2, ..., I...} arranged in an angular sequence. N}, and simultaneously record the acquisition angle θ corresponding to each image. i Exposure parameters e i Pose parameters P i =[R i |t i And timestamp information. Preferably, Δθ0 is 20°~30°, and in one embodiment it is 30°.
[0051] Step S2, Viewpoint Quality Assessment: For each frame of the original terahertz image set, calculate the sharpness index, contour closure index, grayscale information content index, viewpoint consistency index, and foreground / background blurring index, and generate a comprehensive viewpoint quality score Q. i The following quantitative formulas are preferred for each indicator.
[0052] Clarity index G i Calculated using Laplace variance:
[0053]
[0054] To eliminate scale differences between batches, sharpness is normalized:
[0055]
[0056] Contour closure index C i Defined as the ratio of the effective closed profile length to the total profile length:
[0057]
[0058] Gray-scale information content index Bi It can be characterized by normalized information entropy:
[0059]
[0060] Perspective Consistency Index V i Given by the average structural similarity between the current view and its adjacent views:
[0061]
[0062] Foreground and background blur index M i The ratio of the overlapping shadow area to the effective area of the target is given:
[0063]
[0064] Overall rating Q i The following was obtained using a linear weighted model:
[0065]
[0066] Where a1~a5 are non-negative weights and satisfy a1+a2+a3+a4+a5=1. In one embodiment, a1=0.25, a2=0.2, a3=0.15, a4=0.2, a5=0.2. Preferably, when Q i When ≥0.70, the view is included in the set of directly reconstructed views; when 0.45≤Q i When <0.70, enter Figure 3 The foreground and background decoupling process is shown; when Q i When the value is less than 0.45, it is considered a high-risk candidate view input. Figure 4 The adaptive supplementary sampling decision module is shown.
[0067] Step S3, decoupling foreground and background: such as Figure 1 and Figure 3 As shown, the views to be decoupled are paired according to adjacent angles or opposite angles. Geometric alignment and homography normalization are performed on the paired images to obtain the registered foreground candidate features F. f and background candidate features F b For K depth hypotheses and two branches s∈{f, b}, the four-dimensional cost body is constructed as follows:
[0068]
[0069] The dimensions of the CV are H×W×K×2, preferably K=64; the displacement (u_k, v_k) is determined by the acquisition angle difference and geometric calibration parameters. To enhance the shared structural information of the foreground and background, a gating common feature enhancement module is introduced, whose gating graph A can be defined as:
[0070]
[0071] Based on gated graph A, the common features and the differential features are defined as follows:
[0072]
[0073] Then, the enhanced foreground and background features are obtained:
[0074]
[0075] Where λ1 and λ2 are adjustment coefficients, preferably λ1=0.5 and λ2=0.3. Then, fixed-point iterative solutions are used to solve for the foreground and background probability maps:
[0076]
[0077] Where E_f and E_b represent the energy terms of the foreground and background branches, respectively, and r and s are balance coefficients, preferably r=0.6 and s=0.4, with a preferred number of iterations of 4 rounds. The pixel-level uncertainty mask U(x,y) is defined as:
[0078]
[0079] Preferably, when U(x,y)>0.40, the pixel is marked as an uncertain pixel.
[0080] Step S4, Adaptive supplementary sampling decision: such as Figure 1 and Figure 4 As shown, the overall view quality score Q obtained in step S2 is... i Using the uncertainty mask U, depth confidence map sparsity, and adjacent angle reconstruction error obtained in step S3, calculate the reconstruction risk value R_k for each angle sector S_k. Its expression is:
[0081]
[0082] in, _k represents the average viewing angle quality score within the sector. _k represents the average proportion of uncertain pixel area within a sector. _k represents the percentage of low-confidence depth pixels, Ē_k is the normalized mean of the depth difference between adjacent views, and c1+c2+c3+c4=1. In one embodiment, c1=0.30, c2=0.30, c3=0.20, and c4=0.20. Preferably, when R_k≥0.55, supplementary sampling is performed on the sector. The supplementary sampling angle interval Δθ_sup,k can be given by the following formula:
[0083]
[0084] Where Δθ_min is the minimum interval for re-mining angle, preferably 5°; β is the risk sensitivity coefficient, preferably 3; round5(·) indicates that the angle is rounded to the nearest 5°. The re-mining termination condition can adopt the following rule:
[0085]
[0086] Wherein, ε_R is the risk convergence threshold, preferably 0.02; T_max is the maximum number of replenishment rounds, preferably 3; Δη_comp is the integrity rate improvement amount; and ε_C is the minimum profit threshold, preferably 0.01.
[0087] like Figure 6 As shown, the terahertz image generated in this embodiment is (a) the background decoupling result; (b) the uncertainty mask; and (c) the foreground decoupling result.
[0088] The adaptive sampling angle interval decreases as the reconstruction risk value increases, with the angle interval ranging from 1° to 30°. When the reconstruction risk value exceeds the highest threshold, the sampling angle interval does not exceed 5°. The termination conditions for sampling include any one of the following: the change in reconstruction risk value is lower than the threshold after two consecutive samplings, the number of sampling rounds reaches the preset upper limit, or the improvement in reconstruction quality is lower than the threshold.
[0089] Step S5, Weighted Depth Inference: (e.g.) Figure 1 and Figure 5 As shown, the foreground image, corresponding pose information, viewpoint quality score, and uncertainty mask are input into the multi-view depth inference module to establish a weighted cost volume with viewpoint weights and pixel weights. The viewpoint weight is defined as:
[0090]
[0091] Pixel weights are defined as follows:
[0092]
[0093] Where γ is the weighted temperature coefficient, preferably 2; M_f, i (x,y) represents the effective foreground mask. The matching cost c for each depth hypothesis d_k is... i Weighted aggregation of (x,y,k) yields:
[0094]
[0095] The initial depth map D0 was calculated using SoftArgMin:
[0096]
[0097] The final depth map D is then obtained through edge-preserving optimization. :
[0098]
[0099] Where η is the regularization coefficient, preferably 0.08.
[0100] Step S6, Point Cloud Fusion and Structure Reconstruction: (e.g.) Figure 1 and Figure 5 As shown, based on the optimized depth map D Depth confidence map C_d and pose parameters P i Point cloud back projection, cross-view point cloud registration, confidence-weighted fusion, and hole repair are performed. For pixel (u,v), its 3D point in camera coordinates satisfies:
[0101]
[0102] The corresponding world coordinates are:
[0103]
[0104] For points whose spatial distance is less than the merging radius r_m, point-level fusion weights are used:
[0105]
[0106] Thus, the coordinates of the points after confidence-weighted fusion are obtained:
[0107]
[0108] For the localized hole region q, inverse distance weighted interpolation is used for repair:
[0109]
[0110] Wherein, α is the distance attenuation index, preferably 2; when the equivalent hole radius does not exceed 2.5mm and the number of effective neighboring points is not less than 5, the hole is repaired.
[0111] Specifically, the indicators in step S2 are first normalized within a single acquisition batch, and then stabilized across batches to reduce the impact of device drift, gain fluctuations and background changes on threshold judgment.
[0112] Specifically, the paired views in step S3 include two categories: adjacent view pairing and near-opposing view pairing, wherein the angular difference of near-opposing view pairing satisfies |θ i θ 180°|≤15°, to enhance the transmission of complementary information between the foreground and background.
[0113] Specifically, the high-risk sectors in step S4 can be divided according to a fixed-angle window or a dynamic clustering method, and the sector span is preferably 30°~60°.
[0114] Specifically, the viewing angle weight and pixel weight in step S5 can be multiplied by the device stability coefficient or exposure confidence coefficient to adapt to different terahertz imaging hardware platforms.
[0115] Specifically, the point cloud fusion in step S6 can output at least one of a three-dimensional point cloud model, a surface mesh model, or a voxelized model, and can further perform foreign object annotation, defect location, or hazardous target identification.
[0116] To verify the technical effect of this invention compared to existing technologies, two types of test objects can be set up: a standard sample group and a complex occlusion sample group. Comparative experiments can be conducted under the same equipment, the same initial number of viewing angles, and the same exposure conditions. The comparative experiments include at least the following groups: fixed step direct baseline reconstruction group, decoupling only group, re-sampling only group, decoupling plus re-sampling but without weighting group, and the complete process group of this invention.
[0117] The verification process employed quantitative indicators commonly used in terahertz 3D imaging and multi-view 3D reconstruction. Typical indicators can be expressed using the following standard formulas.
[0118] The mean absolute error of depth is expressed as:
[0119]
[0120] The root mean square error of depth is expressed as:
[0121]
[0122] The Chamfer distance between the reconstructed point cloud and the reference ground truth point cloud is expressed as:
[0123]
[0124] Precision is expressed as:
[0125]
[0126] Recall rate is expressed as:
[0127]
[0128] F-score is represented as:
[0129]
[0130] Porosity is expressed as:
[0131]
[0132] Acquisition efficiency is expressed as:
[0133]
[0134] Among them, Ω d |Ω represents the set of valid pixels participating in depth error statistics. d | represents the total number of pixels in the valid pixel set, p represents the position of a valid pixel, and d(p) represents the depth value estimated at pixel position p by the method of this invention. gt (p) represents the reference ground truth depth value corresponding to pixel position p. P represents the point cloud set reconstructed by the method of this invention, G represents the reference ground truth point cloud set, |P| and |G| represent the number of points in point cloud sets P and G, respectively, ||·||2 represents the L2 norm, and τ represents the distance threshold used to determine whether point cloud matching is successful. For any point p∈P, This represents the squared Euclidean distance from the reconstructed point p to the nearest point in the reference truth point cloud set G; for any point g∈G, Let A represent the squared Euclidean distance from the ground truth point g to the nearest point in the reconstructed point cloud set P. hole A represents the area or equivalent projected area of the hole region in the reconstruction result. total This represents the total area of the target's effectively reconstructed region. Nvalid represents the number of valid acquisition viewpoints or valid sampling frames that meet the preset reconstruction quality requirements, and Ttotal represents the total time consumed to complete the acquisition, re-acquisition, and 3D reconstruction process.
[0135] The precision (τ) characterizes the proportion of points in the reconstructed point cloud that successfully match the reference ground truth point cloud, while the recall (τ) characterizes the proportion of points in the reference ground truth point cloud that are effectively covered by the reconstruction results. In this invention, the recall (τ) can also be used as a measure of reconstruction completeness. These evaluation metrics can be used to quantitatively compare the fixed-step direct reconstruction baseline group, the decoupling-only group, the supplementary acquisition group, the decoupling plus supplementary acquisition group without weighting, and the complete process group of this invention, to comprehensively evaluate the technical effectiveness of this invention in terms of reconstruction accuracy, structural completeness, and acquisition efficiency.
[0136] Table 1. Template for Comparative Experimental Group Setup
[0137]
[0138] Table 2 Quantitative Evaluation Indicators and Formula Templates
[0139]
[0140] Table 3 Result Record Template
[0141]
[0142] As shown in Table 3, in both the standard sample and the complex occlusion sample, the complete process group G5 of this invention achieved the best results. Compared with the baseline group G1, G5 significantly reduced the depth error, point cloud distance, and porosity, while improving the F-score and acquisition efficiency. The improvement of G2 compared to G1 is explained below. Figure 3 The foreground and background decoupling module shown can effectively reduce the interference of transmission aliasing on subsequent reconstruction; the improvement of G3 compared to G1 is explained. Figure 4 The adaptive re-sampling strategy shown can improve the effective viewpoint utilization and enhance the imaging quality of locally missing areas; G4 further outperforms G2 and G3, indicating that foreground / background decoupling and adaptive re-sampling have synergistic gains; G5 continues to improve upon G4, indicating... Figure 5 The dual-weighted depth inference and point cloud fusion strategy shown can further improve the accuracy and completeness of 3D reconstruction. Especially in the complex occlusion sample 1, G5 shows a more significant improvement in porosity and F-score compared to G1, indicating that the present invention has better stability and applicability in transmission terahertz imaging scenarios with strong occlusion and more complex foreground and background overlap.
[0143] In addition to Tables 1 to 3, the following verification curves can also be output: First, the curve showing the change of risk value R_k with the number of replenishment rounds, used to reflect... Figure 4 The diagram shows the convergence of the closed-loop supplementary acquisition strategy; secondly, the curves showing the change in integrity rate or F-score with the number of viewing angles, reflecting the benefits of this invention as the number of acquisitions increases; thirdly, the dual-coordinate curves of porosity and reconstruction time, used to comprehensively evaluate quality and efficiency; and fourthly, the curves showing the change in the proportion of uncertain pixels before and after decoupling, used to verify... Figure 3 The technical contributions of the foreground-background decoupling module shown.
[0144] If the complete process of this invention exhibits lower MAE_d, RMSE_d, CD, and Hole_rate, as well as higher F-score, Completeness, and Acq_eff in both the standard sample group and the complex occlusion sample group, it can be demonstrated that this invention has comprehensive advantages over the prior art in terms of reconstruction accuracy, completeness, and acquisition efficiency in terahertz three-dimensional imaging.
[0145] Example 2:
[0146] like Figure 2 As shown, the foreground and background decoupled 3D reconstruction system for transmission terahertz imaging described in this invention is used to execute the foreground and background decoupled 3D reconstruction method for transmission terahertz imaging as described in Example 1, including:
[0147] Terahertz image acquisition module: includes a transmission terahertz imaging unit, a terahertz source and an array detector, used to acquire multi-view transmission terahertz raw images of the target under test, and synchronously output the acquisition pose parameters corresponding to each image.
[0148] Motion control module: Includes electric rotary table and motion control unit, used to carry the target to be measured and control its rotation, and can receive supplementary acquisition control commands to dynamically adjust the rotation angle and acquisition interval;
[0149] The central processing unit is connected to the terahertz image acquisition module and the motion control module, and has the following built-in functional units:
[0150] a. View Quality Assessment Unit: Receives the raw images output by the terahertz image acquisition module and calculates the overall view quality score for each frame of image;
[0151] b. Foreground and background decoupling unit: Receives the quality score output by the view quality assessment unit and the original image, performs foreground and background dual-branch decoupling, and outputs the decoupled foreground image, background image and pixel-level uncertainty mask;
[0152] c. Adaptive supplementary acquisition decision unit: Receives quality score and uncertainty mask, calculates sector reconstruction risk value, and generates supplementary acquisition control command when the risk value exceeds the preset threshold and sends it to motion control module;
[0153] d. Weight Calculation Unit: Based on the view quality score and uncertainty mask, calculate the view quality weight of each view and the pixel confidence weight of each pixel;
[0154] e. Multi-view depth inference unit: Receives the decoupled image and dual weight parameters, performs multi-view cost aggregation and depth optimization, and outputs high-confidence depth maps for each view;
[0155] f. Point cloud fusion unit: Receives multi-view depth maps, pose parameters and dual weight parameters, and performs point cloud back projection, weighted fusion and hole repair;
[0156] The result output unit, connected to the point cloud fusion unit, is used to output the final 3D reconstruction result.
[0157] The system first performs a round-around acquisition of the target object using a terahertz image acquisition module and a target object rotation motion control module, with an initial angular interval of 30°, to obtain 12 raw terahertz images, and records the pose parameters and exposure parameters of each view. Then, the system performs a viewpoint quality assessment in step S2 on each image, and calculates the comprehensive score Q according to equation (7). i The view is divided into direct reconstruction view, decoupling view and high-risk candidate view according to a preset threshold.
[0158] When decoupling foreground and background, the view to be processed is paired with its adjacent view and the near-opposite view. After homography normalization, a four-dimensional cost volume with size H×W×64×2 is constructed according to Equation (8). The enhanced foreground features and enhanced background features are obtained by using the gating common feature enhancement modules defined by Equations (9) to (13). Subsequently, Equations (14) and (15) are used to perform four rounds of fixed-point iteration. The pixel-level uncertainty mask is calculated using Equation (16). When U(x,y)>0.40, the pixel is marked as an uncertain pixel.
[0159] Each 30° sector is treated as a risk unit, and the sector risk value is calculated according to formula (17). When R_k≥0.55, the supplementary mining angle interval is automatically generated according to formula (18), and the supplementary mining termination condition is determined according to formula (19). If the risk change is less than 0.02 for two consecutive rounds, or the supplementary mining reaches 3 rounds, or the integrity rate improvement is less than 0.01, then the supplementary mining is stopped.
[0160] After the supplementary acquisition is completed, the retained foreground image, pose parameters, view quality score and uncertainty mask are input into the multi-view depth inference module. The view weight and pixel weight are calculated according to Equation (20) and Equation (21) respectively. The cost volume is weighted and aggregated by Equation (22). The initial depth map is obtained by Equation (23). The edge preservation optimization is performed by Equation (24) to obtain the final depth map.
[0161] Finally, the point cloud back projection is completed according to Equations (25) and (26), and the confidence weighted fusion of the corresponding points is completed according to Equations (27) and (28). For local holes that meet the conditions of hole size and number of neighboring points, the inverse distance weighted repair is performed according to Equation (29) to output a complete three-dimensional point cloud model or mesh model.
[0162] Example 3:
[0163] The computer-readable storage medium of the present invention stores a computer program thereon, which, when executed by a processor, implements the steps of the foreground-background decoupling three-dimensional reconstruction method for transmission terahertz imaging described in Embodiment 1.
[0164] When the portable device is started, the main control CPU reads and executes the program in the storage chip. It can independently complete the entire process of initial acquisition, foreground and background decoupling, supplementary acquisition control, and 3D reconstruction without the need for an external host computer. It can meet the needs of scenarios without external computing power, such as field detection and portable security inspection. The storage chip supports updating the program version via OTA to adapt to the parameter adjustment needs of different scenarios.
[0165] This embodiment is an embedded Flash memory chip with a storage capacity of 8GB. The chip contains a computer-executable program that implements the three-dimensional reconstruction method described in this invention. The chip is soldered onto the main control board of a portable terahertz imaging device.
[0166] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for decoupling foreground and background in three-dimensional reconstruction using transmission terahertz imaging, characterized in that, Includes the following steps: Acquire multi-view transmission terahertz raw images of the target under test and simultaneously record the acquisition pose parameters corresponding to each image. A comprehensive viewpoint quality score is generated by integrating multi-dimensional imaging indicators for each original image frame, while the foreground and background overlay features of each image frame are extracted. Based on the positional relationship of the viewpoint, the views to be optimized are paired, and a dual-branch cost volume for the foreground and background is constructed. After feature enhancement and iterative solution, the foreground and background are decoupled, and the foreground probability map, background probability map and pixel-level uncertainty mask are output. The acquisition angle domain is divided into multiple continuous sectors, and the reconstruction risk value of each sector is calculated. When the reconstruction risk value exceeds a preset threshold, adaptive re-acquisition is performed on the corresponding sector to update the multi-view image set. By combining viewpoint quality weights and pixel confidence weights, cost aggregation and depth optimization are performed on multi-view images to obtain high-confidence depth maps for each viewpoint. Based on multi-view depth maps, corresponding pose parameters, and confidence information, point cloud back projection, weighted fusion, and local hole repair are completed, and the 3D reconstruction results of the target under test are output.
2. The method for foreground and background decoupling three-dimensional reconstruction of transmission terahertz imaging according to claim 1, characterized in that, The comprehensive viewpoint quality score is generated by linearly weighting five indicators: normalized sharpness, contour closure, normalized grayscale information content, viewpoint consistency, and foreground / background blurring index. The calculation formula is as follows: ; in: To normalize the sharpness index, C i B is the contour closure index. i V is a normalized grayscale information content indicator. i M is an indicator of perspective consistency. i The foreground and background blur index is represented by a1-a5, which are non-negative weights and a1+a2+a3+a4+a5=1.
3. The method for foreground and background decoupling 3D reconstruction of transmission terahertz imaging according to claim 1, characterized in that, The pairing of the views to be optimized supports two modes: the adjacent angle pairing mode selects view pairing with an acquisition angle difference of no more than 10°, and the near-facing angle pairing mode selects view pairing with an acquisition angle difference in the range of 165°~195°. The matching mode is automatically switched according to the imaging scene.
4. The foreground and background decoupling 3D reconstruction method for transmission terahertz imaging according to claim 1, characterized in that: In the foreground and background feature decoupling process, geometric registration and normalization are first performed on the paired views, and then cost volumes of foreground and background dual branches are constructed respectively. After feature enhancement and iterative solution, the separation result is output. The foreground and background dual branch cost volumes are four-dimensional structures with dimensions of image height, image width, number of depth candidate values, and number of feature channels, respectively. Feature enhancement employs a gated common feature enhancement method, and the iterative solution is a fixed-point iterative solution.
5. The foreground and background decoupling 3D reconstruction method for transmission terahertz imaging according to claim 1, characterized in that: The sector reconstruction risk value is calculated based on a weighted average of four indicators: the average view quality score within the sector, the average proportion of uncertain pixel area, the proportion of low-confidence depth pixels, and the normalized average depth difference between adjacent views. The calculation formula is as follows: ; in: The average viewing angle quality score within the sector. This represents the average percentage of uncertain pixel area within a sector. The percentage of low-confidence depth pixels. The normalized mean of the depth difference between adjacent views is given, where c1~c4 are non-negative weights and c1+c2+c3+c4=1; when When the risk value exceeds the preset threshold, supplementary sampling is performed on the corresponding sector, and the sampling angle interval decreases as the risk value increases.
6. The method for foreground and background decoupling three-dimensional reconstruction of transmission terahertz imaging according to claim 1, characterized in that: The adaptive sampling angle interval decreases as the reconstruction risk value increases, with the angle interval ranging from 1° to 30°. When the reconstruction risk value exceeds the highest threshold, the sampling angle interval does not exceed 5°. The termination conditions for sampling include any one of the following: the change in reconstruction risk value is lower than the threshold after two consecutive samplings, the number of sampling rounds reaches the preset upper limit, or the improvement in reconstruction quality is lower than the threshold.
7. The method for foreground and background decoupling three-dimensional reconstruction of transmission terahertz imaging according to claim 1, characterized in that: The viewpoint quality weight and pixel confidence weight are calculated based on the overall quality of the corresponding viewpoint, the foreground validity of the corresponding pixel, and the degree of uncertainty, respectively. The formula for calculating the viewpoint quality weight is as follows: w v i =exp(γQ i ) / Σexp(γQ j ); Where: w v i γ is the global view weight for the i-th view, and the sum of the view weights of all views involved in depth inference is 1; γ is a preset weight temperature coefficient used to control the discriminative power of the weights; Q i Q is the overall quality score for the i-th perspective. j The quality comprehensive score is given for the j-th viewpoint participating in depth inference; the pixel confidence weight is determined by the foreground validity identifier and uncertainty mask of the corresponding pixel, and the value range is [0,1]. The higher the value, the higher the confidence of the pixel.
8. The method for foreground and background decoupling three-dimensional reconstruction of transmission terahertz imaging according to claim 1, characterized in that, During point cloud back projection and weighted fusion, the point-level fusion weight of each spatial point is obtained by weighting the view quality weight, depth confidence, and uncertainty of the view to which the corresponding pixel belongs. Local hole repair adopts inverse distance weighted interpolation method, and only performs repair on areas where the equivalent hole radius does not exceed the preset threshold and the number of effective neighboring points meets the requirements.
9. A foreground-background decoupled 3D reconstruction system for transmission terahertz imaging, characterized in that, The method for performing foreground-background decoupling 3D reconstruction of transmission terahertz imaging according to any one of claims 1 to 8 includes: The terahertz image acquisition module is used to output multi-view transmitted terahertz raw images and corresponding acquisition pose parameters; The motion control module is used to control the relative rotation angle between the target under test and the terahertz image acquisition module, and to perform pose adjustment during the initial acquisition and adaptive re-acquisition process; The quality assessment and decoupling module is used to complete the quality score calculation of single-view images, foreground and background aliasing feature extraction, and foreground and background separation of paired views; The supplementary mining decision module is used to calculate the sector reconstruction risk based on the quality scores and decoupling results from various perspectives, generate a dynamic supplementary mining strategy, and issue control commands to the motion control module. The 3D reconstruction module is used to perform depth inference under dual-weight constraints, multi-view point cloud fusion, and output of 3D reconstruction results.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the foreground and background decoupling three-dimensional reconstruction method for transmission terahertz imaging as described in any one of claims 1 to 8.