Brick profile feature structure light three-dimensional reconstruction method and device for ancient city wall digitization

CN122737408APending Publication Date: 2026-09-11OCEANOGRAPHIC INSTR RES INST SHANDONG ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611215284.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

受古城墙砖体纹理重复、风化及弱纹理区域影响,特征匹配易失效,易产生点云空洞和重建误差,难以准确恢复砖体铭文、细微裂缝等微小结构,测量精度通常难以满足文物精细化建档要求

Benefits of technology

1.数据采集鲁棒性强、细节还原度高,适配野外全工况古城墙扫描。本发明专用传感器搭载高帧率工业相机与窄带滤光组件,可抑制手持抖动畸变与环境杂光干扰,单次扫描视场达1500×900mm,兼顾采集效率;硬件搭配相位求解方案可完整保留墙砖铭文、微米级风化裂纹、砖缝凹凸等微尺度文物细节,单帧点云密度远高于地面激光扫描设备,满足文物精细化建档精度要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122737408A_ABST
    Figure CN122737408A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of cultural relic digital protection, optical three-dimensional measurement and point cloud data processing, and particularly relates to a brick profile feature structure light three-dimensional reconstruction method and device for ancient city wall digitization. The method comprises the following steps: multi-view data acquisition; feature extraction, calculating the phase gradient of the wrapped phase map first, and then extracting the horizontal boundary point set and the vertical boundary point set; mapping the two-dimensional brick profile feature to a three-dimensional space, and generating a three-dimensional brick profile feature by using the three-dimensional point cloud; coarse registration; fine registration; global correction, eliminating global cumulative error, and outputting a complete three-dimensional point cloud model in a global unified coordinate system. Compared with the prior art, the application has the beneficial effects that: the data acquisition has strong robustness and high detail restoration degree, is suitable for field full-condition ancient city wall scanning; the registration accuracy and stability of the repeated masonry scene are greatly improved; the closed loop graph optimization eliminates long-distance scanning cumulative error, and supports integrated reconstruction of a hundred square meter complete wall.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of digital preservation of cultural relics, optical 3D measurement and point cloud data processing technology. Specifically, it relates to a method and device for structural light 3D reconstruction of brick outline features for the digitization of ancient city walls. It is applicable to millimeter-level 3D digital acquisition, precise modeling and protection and restoration of brick and stone cultural heritage such as ancient city walls, brick pagodas and ancient building walls. Background Technology

[0002] Ancient city walls are important brick and stone cultural heritage sites in my country. Their digital archiving, damage monitoring, archaeological research, and conservation and restoration all rely on high-precision 3D digital technology. Due to the large scale, repetitive brick textures, severe surface weathering, and rich details of the ancient city walls, 3D reconstruction requires non-destructive, large-scale, high-precision reconstruction with complete preservation of details. Existing 3D reconstruction technologies mainly include motion photogrammetry, terrestrial laser scanning, and structured light scanning, all of which have limitations to varying degrees.

[0003] I. Motion photogrammetry relies on multi-view image matching to reconstruct 3D models, requiring the acquisition of a large number of overlapping images, resulting in significant computational overhead. Due to the repetitive textures, weathering, and weak texture areas of ancient city wall bricks, feature matching is prone to failure, easily producing point cloud voids and reconstruction errors. It is difficult to accurately restore minute structures such as brick inscriptions and fine cracks, and the measurement accuracy is usually insufficient to meet the requirements for refined archiving of cultural relics.

[0004] Second, ground-based laser scanning acquires point clouds through laser ranging. While suitable for large-scale measurements, it has limited spatial sampling density and is insufficient in representing details such as brick seams, inscriptions, and weathering. Furthermore, complex surfaces such as reflective surfaces and weathering can easily cause point cloud gaps. Additionally, large-scale city wall scanning requires data acquisition from multiple sites, and cumulative errors can easily occur during point cloud stitching.

[0005] Third, structured light scanning boasts sub-millimeter-level measurement accuracy and high point cloud density, effectively capturing surface details of cultural relics. However, its single-scan field of view is limited, requiring multi-site scanning and point cloud registration for large-area city walls. Existing registration methods mainly rely on manual marking or general point cloud features. Among these, the marking point method has the problem of contacting cultural relics and affecting safety; general registration algorithms such as 4PCS, NDT, and FPFH are prone to mismatch and cumulative errors in the scene of repeated bricks on city walls, resulting in point cloud layering and misalignment, making it difficult to achieve stable and high-precision large-scale reconstruction.

[0006] Therefore, there is an urgent need for a structured light 3D reconstruction and point cloud registration method that requires no manual marking, is applicable to repetitive brick and stone structure scenarios, and has high precision, high robustness, and high efficiency, in order to meet the needs of millimeter-level 3D digital archiving, protection, and restoration of brick and stone cultural heritage such as ancient city walls. Summary of the Invention

[0007] To address the problems existing in the prior art, this invention provides a method and apparatus for three-dimensional reconstruction of brick outline features using structured light for the digitization of ancient city walls.

[0008] The technical solution adopted by this invention to solve its technical problem is as follows: a three-dimensional reconstruction method for brick outline features of ancient city walls using structured light, comprising the following steps: S1. Multi-view data acquisition: Using a handheld structured light sensor that integrates narrowband optical filter components and a high frame rate industrial camera, sinusoidal phase-shifted fringe images are projected onto the city wall. Deformed fringe images modulated by the surface topography of the city wall are acquired. The wrapping phase corresponding to each pixel is solved by the phase profile measurement method to obtain the wrapping phase map. Combined with the system calibration parameters, triangulation is used to generate a three-dimensional point cloud. S2. Feature extraction: First, calculate the phase gradient of the wrapped phase map, then extract the horizontal boundary point set and the vertical boundary point set; then, perform logical AND fusion and morphological processing on the horizontal boundary point set and the vertical boundary point set of multiple phase images with different phase shift steps to obtain two-dimensional brick outline features; finally, according to the pixel mapping relationship, map the two-dimensional brick outline features to three-dimensional space, and use the three-dimensional point cloud to generate three-dimensional brick outline features. S3. Coarse registration: First, the shape context histogram corresponding to the two-dimensional brick outline features is used to construct the line appearance similarity cost function for two-dimensional line pre-matching. Then, the two-dimensional outline matching correspondence is mapped to the three-dimensional brick outline features, and the objective function is constructed with the minimum spatial distance of the matched outline lines as the optimization objective. Singular value decomposition is used to iteratively solve the problem to obtain the coarse registration transformation matrix. S4. Fine registration: Using the coarse registration transformation matrix as the initial iteration value, global geometric constraints are established using all dense 3D coordinates of two adjacent point clouds. The goal is to minimize the Euclidean distance between corresponding spatial points of the source point cloud and the target point cloud. The fine registration transformation matrix is ​​then solved. S5. Global correction: Plan a closed-loop scanning path along the city wall, define the pose transformation matrix after each single-frame scan as a graph node, define the device motion relationship between two adjacent scans as graph edge constraints, construct a global total error function, use the Levenberg-Marquardt algorithm to minimize the global total error, solve for the optimal pose matrix after all scan nodes are corrected, eliminate global cumulative error, and output a complete 3D point cloud model in a global unified coordinate system.

[0009] Preferably, in the feature extraction step, the calculation formulas for extracting the horizontal boundary point set and the vertical boundary point set are as follows: ; ; in, This represents the set of horizontal boundary points extracted from the i-th horizontal phase image; This represents the i-th horizontally wrapped phase image; This represents the set of vertical boundary points extracted from the i-th vertical phase image; This represents the i-th vertically wrapped phase image; This represents rounding to the nearest integer. This represents the gradient solver operator.

[0010] Preferably, in the feature extraction step, the horizontal boundary point sets extracted from multiple phase images with different phase shift steps are first logically ANDed and fused to generate a global horizontal boundary set. Simultaneously, the vertical boundary point sets are logically ANDed and fused to generate a global vertical boundary set. Then, the global horizontal boundary set and the global vertical boundary set are logically ORed and fused to generate a two-dimensional brick outline feature. Then, the broken lines are repaired by morphological closing operation, and scattered noise points are filtered by using the region area threshold to obtain a continuous two-dimensional brick outline line.

[0011] Preferably, in the coarse registration step, the line appearance similarity cost function is: ; in, The cost of the appearance similarity between the j-th two-dimensional contour line of the source point cloud and the k-th two-dimensional contour line of the target point cloud; The shape context histogram representing the j-th brick outline of the source point cloud; The shape context histogram representing the k-th brick outline of the target point cloud.

[0012] Preferably, in the coarse registration step, the optimization formula for solving the coarse registration transformation matrix is: ; in, This represents the optimal coarse registration 3D rotation matrix obtained from the solution; This represents the optimal coarse registration 3D translation matrix obtained from the solution; Represents the j-th three-dimensional brick outline feature of the source point cloud; The j-th three-dimensional brick outline feature represents the target point cloud; This represents the coarse registration 3D rotation matrix obtained in the previous iteration; argmin represents the coarse registration 3D translation matrix obtained in the previous iteration; argmin represents the values ​​of R and T that minimize the result of the subsequent summation. The Euclidean norm is used to calculate the spatial distance between two matching lines; the summation formula is used to sum the squares of the spatial distances of all matching lines.

[0013] Preferably, in the global correction step, The pose transformation matrix after each single-frame scan is defined as a graph node. The motion relationship between two adjacent scans is defined as the graph edge constraint. A closed-loop scan path is planned along the city wall to form a closed-loop constraint between the scan start position and the end position. A global error function is constructed, and the corresponding error term formula is: ; in, This represents the motion error term corresponding to the m-th graph node; This represents the motion parameters of adjacent scanning devices actually acquired. This represents the theoretically expected motion parameters of adjacent scanning devices; The Levenberg-Marquardt algorithm is used to minimize the global total error, and the optimal pose matrix after correction of all scan nodes is solved. The corresponding formulas for the total error and the optimal solution are as follows: ; ; Where C(X) represents the total global error comprised of all scan nodes; This represents the transpose of the error term matrix; represents the information matrix corresponding to the m-th constraint edge; the larger the value, the higher the credibility of the motion constraint. X represents the set of all scanned pose nodes. This represents the set of optimal solutions for all scan poses after global correction.

[0014] A structured light 3D reconstruction device for brick outline features of ancient city walls for digitalization includes: a handheld structured light sensor and a data processing module communicatively connected to the handheld structured light sensor. An integrated handheld structured light sensor includes: A DLP projection module is used to project a periodically fixed sinusoidal phase-shifted stripe pattern onto the city wall. A high frame rate industrial camera, equipped with a short focal length optical lens and a narrow band optical filter, is used to acquire deformed stripe images modulated by the surface topography of the city wall, and to suppress interference from ambient stray light and wall surface scattering and reflection. The main control synchronization circuit board is electrically connected to the high frame rate industrial camera and DLP projection module to achieve millisecond-level timing synchronization between stripe projection and image acquisition. The data processing module is configured to execute steps S2-S5 of the brick outline feature structured light three-dimensional reconstruction method for digitizing ancient city walls in this invention.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The data acquisition is robust and offers high detail reproduction, making it suitable for scanning ancient city walls under all working conditions in the field. This invention's dedicated sensor is equipped with a high-frame-rate industrial camera and narrow-band filter components, which can suppress handheld shake distortion and ambient light interference. A single scan field of view reaches 1500×900mm, balancing acquisition efficiency. The hardware, combined with a phase-solving scheme, can completely preserve micro-scale details of cultural relics such as brick inscriptions, micron-level weathering cracks, and uneven brick joints. The point cloud density per frame is far higher than that of ground-based laser scanning equipment, meeting the accuracy requirements for refined archiving of cultural relics.

[0016] 2. Mark-free and non-destructive registration, fully compliant with cultural relic protection standards. This invention utilizes the natural brick seam contours of the wall as matching features, eliminating the need to paste artificial targets on the surface of the ancient city wall. This completely avoids irreversible secondary damage to the weathered layer and glaze of the ancient bricks caused by target pasting and removal, solving the industry pain point that traditional mark registration schemes cannot be applied to scanning brick and stone cultural relics.

[0017] 3. Significantly improved registration accuracy and stability in repetitive brick and stone scenes. The brick outline features extracted based on phase gradient are not affected by water stains, moss, weathering grayscale noise on the wall surface. The three-level registration process of coarse registration - fine registration - global map optimization is specially adapted to periodic brick wall structures. The registration RMSE is only 67.53μm, which is far superior to the general registration algorithms NDT and 4PCS. There are no problems such as large-area layering, misalignment, or matching failure.

[0018] 4. Closed-loop graph optimization eliminates accumulated errors from long-distance scanning, supporting integrated reconstruction of complete walls at the 100-square-meter level. By planning the closed-loop scanning path and combining it with graph optimization algorithms to uniformly correct the pose of all scans, the accumulated errors caused by continuous splicing of multiple sites are effectively eliminated. The output is a complete 3D model with a globally unified coordinate system. There are no seams or geometric distortions at splicing positions such as corners, ends, and crenellations of the city wall. Standardized digital archives of cultural relics can be directly generated for archaeology, restoration, and long-term disease monitoring. Attached Figure Description

[0019] Figure 1 This is a flowchart of the three-dimensional reconstruction process in this invention.

[0020] Figure 2 This is a schematic diagram of the structured light three-dimensional sensing device in this invention.

[0021] Figure 3 This is a schematic diagram of the three-dimensional perception principle in this invention.

[0022] Figure 4 This is a 3D point cloud image of the city wall acquired by the structured light sensor developed in this invention. The left side shows the 3D point cloud with texture information, and the right side shows the 3D point cloud without texture information.

[0023] Figure 5The images show 3D point cloud maps of the city wall obtained using a traditional laser scanner. The left side shows the 3D point cloud with texture information, while the right side shows the 3D point cloud without texture information.

[0024] Figure 6 Source point cloud (a) and target point cloud (b) used for the performance comparison experiment of registration of the three methods of this invention, NDT and 4PCS.

[0025] Figure 7 The figures show the registration results (a) and registration performance (b) of the method of the present invention. The red boxes indicate the error distribution areas.

[0026] Figure 8 This is a registration performance graph for the NDT method.

[0027] Figure 9 The registration performance diagram is shown for the 4PCS method.

[0028] Figure 10 This is a 3D reconstruction image obtained from a straight-wall scanning experiment of the Nanjing City Wall.

[0029] Figure 11 This is a 3D reconstruction image obtained from a scanning experiment of the Nanjing city wall battlements.

[0030] In the picture: 1. Protective housing, 2. Digital industrial camera, 3. DLP projection module, 4. Main control synchronous control circuit board, 5. Front optical filter assembly. Detailed Implementation

[0031] To facilitate understanding of this application, a more detailed description is provided below with reference to the accompanying drawings and specific embodiments. However, this application can be implemented in many different forms and is not limited to the embodiments described in this specification. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.

[0032] To address the shortcomings of traditional 3D scanning equipment in complex field data acquisition scenarios involving ancient city walls, such as poor imaging stability, strong interference from ambient light, and limited coverage per scan, existing general-purpose structured light equipment suffers from low frame rates that easily lead to handheld motion distortion. Furthermore, the lack of dedicated optical path filtering structures results in severe interference from wall stains and scattered reflections, hindering phase solving and making it difficult to balance large-area wall acquisition efficiency with sub-millimeter reconstruction accuracy. This invention addresses these technical issues by optimizing the light source, imaging, synchronization control, and optical filtering structure through integrated dedicated handheld structured light sensing hardware. This suppresses environmental noise and motion errors from the data acquisition source, improving data acquisition quality and operational efficiency under various field conditions.

[0033] To address the technical problems of repeated brick arrangement in ancient city walls and the significant shortcomings of traditional point cloud registration methods, manual registration can damage cultural relics, and common registration algorithms such as NDT and 4PCS are prone to mismatch in periodic brick pattern scenes. Continuous scanning and stitching from multiple stations will continuously accumulate errors, ultimately causing layering, misalignment, and voids in the 3D model, making it impossible to achieve high-precision global reconstruction of city walls at the 100-meter level. This invention relies on phase gradient extraction of natural brick outline features to construct the model.

[0034] This invention is divided into two core modules: integrated structured light sensing hardware specifically for ancient city walls and a 3D reconstruction algorithm for brick outline registration. For example... Figure 1 The complete workflow shown is as follows: multi-view data acquisition using a dedicated structured light sensor, 2D / 3D brick profile feature extraction based on phase information, coarse registration based on the brick profile, fine registration and optimization of the point cloud, global correction through pose map optimization, and output of a complete 3D digital model of the ancient city wall. The entire process requires no manual markings and ultimately outputs a high-precision point cloud model with textured details and inscriptions in a unified coordinate system.

[0035] Specific steps: (a) The construction of an integrated structured light scanning device for ancient city walls, including the outer shell and the camera, projection module and control circuit board assembled inside the outer shell. The camera and projection module are respectively connected to the control circuit board.

[0036] like Figure 2As shown, the integrated handheld structured light sensor is assembled inside a protective housing 1. It mainly consists of a digital industrial camera 2, a DLP projection module 3, a main control and synchronization circuit board 4, and a front-mounted optical filter assembly 5. ① The DLP projection module 3 projects a sinusoidal phase-shifted fringe pattern with a fixed period of 16 pixels. The modulated fringe carries the depth information of the measured wall surface and can capture subtle depth changes using phase gradients. ② The imaging unit uses a Basler high-frame-rate industrial camera with an image resolution of 1920×1200 and an imaging frame rate of up to 200fps, effectively reducing motion distortion caused by device shaking during handheld operation. Balancing 3D reconstruction accuracy and field acquisition efficiency, the camera is equipped with a short-focal-length optical lens, achieving an effective field of view of 1500×900mm while providing ample depth of field, enabling large-scale, one-time scanning acquisition of tall city wall facades. ③ A narrow-band optical filter is fitted to the front of the camera lens, effectively suppressing stray light from the environment and grayscale interference from wall-scattered reflections, significantly improving the phase image signal-to-noise ratio. ④ The main control synchronization circuit board 4 establishes electrical connections with the digital industrial camera 2 and the DLP projection module 3, achieving millisecond-level timing synchronization between stripe projection and image acquisition, ensuring precise matching between phase-shifted stripe projection and image capture, and avoiding phase calculation errors caused by timing deviations. The sensor's overall dimensions are 178×52×85mm, employing a miniaturized and lightweight design. It supports both handheld mobile scanning operations and tripod-mounted fixed-point acquisition, adapting to various complex field operation areas such as battlements, wall corners, and narrow passages.

[0037] The working principle of the device is as follows Figure 3 As shown, the DLP projection module 3 projects sinusoidal phase-shifted fringes onto the scene under test (city wall). These fringes deform due to modulation of the surface morphology of the bricks on the city wall. The digital industrial camera 2 acquires images of the deformed fringes, solves for the wrapping phase of each pixel using a phase profile measurement method, and obtains a phase image through phase calculation. Then, combined with system calibration parameters, the three-dimensional coordinates of each pixel are calculated using a triangulation algorithm, generating a high-density three-dimensional point cloud through triangulation. The digital industrial camera 2 retains the wall texture and color information, mapping this information onto each point of the three-dimensional point cloud. The fringes, after optical modulation of the target surface morphology, carry three-dimensional spatial information, generating a textured three-dimensional point cloud. The digital industrial camera 2 and the DLP projection module 3 are time-synchronized to complete the real-time acquisition of the coded image, which can be represented as: .

[0038] in, For the acquired coded image, For camera pixels, Background light intensity, In order to adjust the system, For the number of phase shift steps, The encoded package phase value.

[0039] Traditional structured light methods rely on phase-shifting algorithms to determine the wrapping phase. Solving the problem yields the following results: .

[0040] The phase unwrapping method can be used to obtain the absolute phase. Distribution: ; in, This provides phase order information. Combining this with calibration information will then enable the reconstruction of the 3D point cloud.

[0041] (II) Step-by-step implementation scheme of brick outline registration algorithm To address the issues of traditional structured light scanning relying on manual labeling, the tendency of general registration algorithms to mismatch in repetitive brick pattern scenes, misalignment of point cloud layers, and large cumulative errors from multi-station scanning, a brick contour feature registration algorithm is proposed, with the following steps: Step 1: Two-dimensional / three-dimensional brick profile feature extraction based on phase gradient.

[0042] Traditional methods rely on grayscale and depth maps to extract brick joint boundaries, which are easily affected by wall stains and weathering, resulting in broken lines. This invention utilizes the high sensitivity of phase values ​​to abrupt changes in depth to directly extract brick boundaries from the encapsulated phase image. The complete operation process and corresponding formulas are as follows: First, horizontal and vertical phase images are acquired separately, and the absolute values ​​of the gradients of the two types of phase images are calculated. Then, weak noise is filtered out by rounding, generating the horizontal and vertical boundary point sets of a single phase image. The corresponding calculation formula is as follows: ; ; in, This represents the set of horizontal boundary points extracted from the i-th horizontal phase image; This represents the i-th horizontally wrapped phase image; This represents the set of vertical boundary points extracted from the i-th vertical phase image; This represents the i-th vertically wrapped phase image; This represents rounding to the nearest integer. Represents absolute value operation; This represents the gradient solver operator.

[0043] Subsequently, multiple phase images with different phase shift steps were acquired. A logical AND fusion was performed on the horizontal boundary point sets extracted from these images, and a simultaneous logical AND fusion was performed on the vertical boundary point sets. Random noise points in individual images were filtered out to generate stable global horizontal and vertical boundary sets. Taking three images as an example, the corresponding calculation formula is as follows: ; ; in, The set of global horizontal brick joint boundary points representing the completed fusion; Represents logical AND operation; This represents the set of global vertical brick joint boundary points after fusion is complete.

[0044] Subsequently, the global horizontal boundary set and the vertical boundary set are logically ORed and fused to generate a complete and intact two-dimensional brick outline feature. Then, morphological closing operations are used to repair broken lines, and scattered noise points are filtered out using area thresholding to obtain clear and continuous two-dimensional lines of the wall brick outline. The corresponding calculation formula is as follows: ; in, This represents the final set of extracted two-dimensional brick outline features. Represents a logical OR operation.

[0045] Since each phase image pixel corresponds one-to-one with the coordinates of a 3D point cloud, the 2D brick outline features are mapped according to the pixel mapping relationship. Mapping to three-dimensional space to generate three-dimensional brick outline features The three-dimensional geometric topological constraints of the wall brick gaps are fully preserved, providing a stable matching benchmark for subsequent point cloud registration.

[0046] Step 2: Coarse registration based on 2D and 3D brick outline features.

[0047] The core function of coarse registration is to solve the coarse rotation and translation transformation matrices of two adjacent sets of point clouds, providing reliable initial values ​​for subsequent fine registration and avoiding fine registration from getting trapped in local optima. The overall calculation is divided into three parts: two-dimensional contour pre-matching, three-dimensional contour matching, and transformation matrix solving.

[0048] First, the source point cloud 2D contour line set is analyzed. Target point cloud 2D contour line set For each set of contour lines, a shape context histogram is calculated, a line appearance similarity cost function is constructed, and two-dimensional line pre-matching is completed. The corresponding similarity calculation formula is as follows: ; in, Representing the source cloud Two-dimensional contour lines and target point cloud The cost of appearance similarity of two-dimensional contour lines; Representing the source cloud Histogram of the shape context of the brick outline; Representing the target point cloud The shape context histogram of the brick outline; the fractional whole is used to quantify the difference in shape between two outlines, and the smaller the value, the higher the matching degree of the lines.

[0049] Mapping the two-dimensional contour line matching correspondences to three-dimensional brick contour features to construct a three-dimensional contour line matching correspondence set. and The objective function is constructed with the goal of minimizing the spatial distance between matching contour lines. The optimal rotation matrix R and translation matrix T are then solved iteratively using Singular Value Decomposition (SVD) to obtain the coarse registration transformation matrix. The corresponding optimization formula is as follows: ; in, This represents the optimal coarse registration 3D rotation matrix obtained from the solution; This represents the optimal coarse registration 3D translation matrix obtained from the solution; Representing the source cloud Three-dimensional brick outline features; Representing the target point cloud Three-dimensional brick outline features; This represents the coarse registration 3D rotation matrix obtained in the previous iteration; argmin represents the coarse registration 3D translation matrix obtained in the previous iteration; argmin represents the values ​​of R and T that minimize the result of the subsequent summation. The Euclidean norm is used to calculate the spatial distance between two matching lines; the summation formula is used to sum the squares of the spatial distances of all matching lines.

[0050] Step 3: Fine registration of dense 3D point cloud constraints.

[0051] Rotation and translation matrices output from coarse registration As initial iteration values, the dense 3D coordinates of both sets of point clouds are used as global geometric constraints to further eliminate coarse registration residual biases and minimize the source point cloud. Target point cloud correspondence Taking the Euclidean distance between spatial points as the objective, we solve for the high-precision fine-registration transformation matrix, and the corresponding optimization formula is as follows: .

[0052] in, This represents the optimal fine registration 3D rotation matrix obtained by solving the problem; This represents the optimal fine registration 3D translation matrix obtained by solving the problem; This represents the optimal coarse registration 3D rotation matrix obtained from the solution; This represents the optimal coarse registration 3D translation matrix obtained from the solution; This represents the coordinates of the m-th 3D point in the source point cloud. This represents the coordinates of the m-th 3D point in the target point cloud.

[0053] Step 4: Optimize the closed-loop graph for global pose correction.

[0054] A 100-meter-long city wall requires hundreds of continuous scans and stitching. Each subsequent coarse and fine registration accumulates transformation errors, causing significant misalignment of the wall's beginning and end scan segments. This invention employs a closed-loop scan path combined with a graph optimization algorithm to uniformly correct the poses of all scans, eliminating global accumulated errors and finally outputting a complete 3D point cloud model in a globally unified coordinate system. The pose transformation matrix after each single-frame scan is defined as a graph node. The motion relationship between two adjacent scans is defined as the graph edge constraint. A closed-loop scan path is planned along the city wall to form a closed-loop constraint between the scan start position and the end position. A global error function is constructed, and the corresponding error term formula is: ; in, This represents the motion error term corresponding to the m-th graph node; This represents the motion parameters of adjacent scanning devices actually acquired. This represents the theoretically expected motion parameters of adjacent scanning devices.

[0055] A global total error function is constructed by integrating all node error terms. An information matrix is ​​introduced to assign weights to each constraint edge. The Levenberg-Marquardt algorithm is used to minimize the global total error. The optimal pose matrix after correction of all scan nodes is then solved. The corresponding formulas for the total error and the optimal solution are as follows: ; ; in, This represents the total global error comprised of all scanned nodes. This represents the transpose of the error term matrix; represents the information matrix corresponding to the m-th constraint edge; the larger the value, the higher the credibility of the motion constraint. X represents the set of all scanned pose nodes. This represents the optimal solution set of all scan poses after global correction. After global correction of the global graph, all single-frame point clouds are unified to the same world coordinate system. The entire 3D model of the city wall is seamless, layered, and free of geometric distortion, and the global geometric consistency is greatly improved.

[0056] (III) Experimental Verification of the City Wall Scene This invention selected the Nanjing Ming City Wall scene to conduct a complete experiment, and set up three types of verification experiments: single frame point cloud accuracy comparison, registration algorithm horizontal comparison, and large-area city wall complete digitization. All experimental data quantitatively proved the advanced nature of the solution of this invention.

[0057] Example 1: The single-frame point cloud reconstruction result of the structured light sensor developed in this invention, as shown below. Figure 4 As shown.

[0058] Comparative Example 1: Single-frame point cloud reconstruction results from a traditional laser scanner, such as... Figure 5 As shown.

[0059] Example 1 and Comparative Example 1 constitute a comparative experiment of single-view wall reconstruction effects. Figure 4 The structured light sensor developed by this invention can completely reproduce ancient official inscriptions, fine brick seams, and weathering pits on the surface of wall bricks. Figure 5 Traditional laser scanners can only reproduce the rough shape of the wall, and the text on the brick surface is completely lost; the point cloud density difference between the two is more than 10 times.

[0060] Example 2: Forty sets of adjacent point cloud samples of the city wall were selected to test the registration scheme of the present invention. The results are shown in [the table below]. Figure 7 .

[0061] Comparative Example 2: Forty sets of adjacent point cloud samples of the city wall were selected to test the registration scheme of the NDT algorithm. The results are shown in […]. Figure 8 .

[0062] Comparative Example 3: Forty sets of adjacent point cloud samples of the city wall were selected to test the registration scheme of the 4PCS algorithm. The results are shown in [the table below]. Figure 9 .

[0063] Example 2, along with Comparative Examples 2 and 3, constitute a horizontal comparison experiment of the registration algorithm. The quantitative comparison results are as follows: Figures 6-9 As shown in Table 1, Figure 6 (a) is the source point cloud, and (b) is the target point cloud. The algorithm proposed in this invention has a registration RMSE error of 67.53 micrometers and takes 39 seconds to process a single point cloud; the NDT algorithm has a registration RMSE error of 5.72 millimeters and takes 65 seconds to process a single point cloud, and is prone to matching failure in repetitive brick pattern scenarios; the 4PCS algorithm has a registration RMSE error of 19.98 millimeters and takes 102 seconds to process a single point cloud, and has a very high probability of matching failure under periodic brick wall structures. The error heatmap intuitively shows that there are large-area layering deviations in the splicing area of ​​traditional algorithms, while the splicing area of ​​this invention has no obvious error color blocks and has a very high degree of fit. In the error heatmap, the color level represents the magnitude of the error, specifically blue, green, orange to red, indicating that the error magnitude increases, blue indicates low error, and red indicates high error.

[0064] Table 1. Point cloud registration results using three different methods Example 3: Large-area digital measurement experiment of the entire city wall. A typical structure of the straight wall section and battlements of the Nanjing Ming City Wall was selected, with each test area covering tens of square meters. The results are as follows: Figures 10-11 As shown, the dimensions of the straight wall scan model are 5.5×0.3×2.0m, and the dimensions of the battlement scan model are 5.9×6.3×1.8m. A single modeling process requires stitching together hundreds of point cloud frames. After global correction using a global map, the complete 3D model is seamless and without any breaks. The weathering texture of the brick surface and ancient inscriptions are all completely preserved. It can directly generate standardized digital archives of cultural relics that integrate 3D geometric coordinates, inscription text information, and weathering damage annotations, making it suitable for use throughout the entire process of archaeological research and cultural relic restoration.

[0065] In this invention, brick outline features refer to the outline features of the bricks that make up the city wall.

[0066] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for 3D reconstruction of brick outline features using structured light for the digitization of ancient city walls, characterized in that, Includes the following steps: S1. Multi-view data acquisition: Using a handheld structured light sensor that integrates narrowband optical filter components and a high frame rate industrial camera, sinusoidal phase-shifted fringe images are projected onto the city wall. Deformed fringe images modulated by the surface topography of the city wall are acquired. The wrapping phase corresponding to each pixel is solved by the phase profile measurement method to obtain the wrapping phase map. Combined with the system calibration parameters, triangulation is used to generate a three-dimensional point cloud. S2. Feature extraction: First, calculate the phase gradient of the wrapped phase image, then extract the horizontal boundary point set and the vertical boundary point set; then, perform logical AND fusion and morphological processing on the horizontal boundary point set and the vertical boundary point set of multiple phase images with different phase shift steps to obtain two-dimensional brick outline features. Finally, based on the pixel mapping relationship, the two-dimensional brick outline features are mapped to three-dimensional space, and the three-dimensional point cloud is used to generate three-dimensional brick outline features. S3. Coarse registration: First, the shape context histogram corresponding to the two-dimensional brick outline features is used to construct the line appearance similarity cost function for two-dimensional line pre-matching. Then, the two-dimensional outline matching correspondence is mapped to the three-dimensional brick outline features, and the objective function is constructed with the minimum spatial distance of the matched outline lines as the optimization objective. Singular value decomposition is used to iteratively solve the problem to obtain the coarse registration transformation matrix. S4. Fine registration: Using the coarse registration transformation matrix as the initial iteration value, global geometric constraints are established using all dense 3D coordinates of two adjacent point clouds. The goal is to minimize the Euclidean distance between corresponding spatial points of the source point cloud and the target point cloud. The fine registration transformation matrix is ​​then solved. S5. Global correction: Plan a closed-loop scanning path along the city wall, define the pose transformation matrix after each single-frame scan as a graph node, define the device motion relationship between two adjacent scans as graph edge constraints, construct a global total error function, use the Levenberg-Marquardt algorithm to minimize the global total error, solve for the optimal pose matrix after all scan nodes are corrected, eliminate global cumulative error, and output a complete 3D point cloud model in a global unified coordinate system.

2. The method for three-dimensional reconstruction of brick outline features using structured light for digitizing ancient city walls according to claim 1, characterized in that, In the feature extraction step, the calculation formulas for extracting the horizontal boundary point set and the vertical boundary point set are as follows: ; ; in, This represents the set of horizontal boundary points extracted from the i-th horizontal phase image; This represents the i-th horizontally wrapped phase image; This represents the set of vertical boundary points extracted from the i-th vertical phase image; This represents the i-th vertically wrapped phase image; This represents rounding to the nearest integer. This represents the gradient solver operator.

3. The method for three-dimensional reconstruction of brick outline features using structured light for digitizing ancient city walls according to claim 2, characterized in that, In the feature extraction step, the horizontal boundary point sets extracted from multiple phase images with different phase shift steps are first logically ANDed and fused to generate a global horizontal boundary set. Simultaneously, the vertical boundary point sets are logically ANDed and fused to generate a global vertical boundary set. Then, the global horizontal boundary set and the global vertical boundary set are logically ORed and fused to generate two-dimensional brick outline features. Finally, morphological closing operations are used to repair the broken lines, and scattered noise points are filtered out using a region area threshold to obtain continuous two-dimensional brick outline lines.

4. The method for three-dimensional reconstruction of brick outline features using structured light for digitizing ancient city walls according to claim 1, characterized in that, In the coarse registration step, the line appearance similarity cost function is: ; in, The cost of the appearance similarity between the j-th two-dimensional contour line of the source point cloud and the k-th two-dimensional contour line of the target point cloud; The shape context histogram representing the j-th brick outline of the source point cloud; The shape context histogram representing the k-th brick outline of the target point cloud.

5. The method for three-dimensional reconstruction of brick outline features using structured light for digitizing ancient city walls according to claim 1, characterized in that, In the coarse registration step, the optimization formula for solving the coarse registration transformation matrix is: ; in, This represents the optimal coarse registration 3D rotation matrix obtained from the solution; This represents the optimal coarse registration 3D translation matrix obtained from the solution; Represents the j-th three-dimensional brick outline feature of the source point cloud; The j-th three-dimensional brick outline feature represents the target point cloud; This represents the coarse registration 3D rotation matrix obtained in the previous iteration; argmin represents the coarse registration 3D translation matrix obtained in the previous iteration; argmin represents the values ​​of R and T that minimize the result of the subsequent summation. The Euclidean norm is used to calculate the spatial distance between two matching lines; the summation formula is used to sum the squares of the spatial distances of all matching lines.

6. The method for three-dimensional reconstruction of brick outline features using structured light for digitizing ancient city walls according to claim 1, characterized in that, In the global correction step The pose transformation matrix after each single-frame scan is defined as a graph node. The motion relationship between two adjacent scans is defined as the graph edge constraint. A closed-loop scan path is planned along the city wall to form a closed-loop constraint between the scan start position and the end position. A global error function is constructed, and the corresponding error term formula is: ; in, This represents the motion error term corresponding to the m-th graph node; This represents the motion parameters of adjacent scanning devices actually acquired. This represents the theoretically expected motion parameters of adjacent scanning devices; The Levenberg-Marquardt algorithm is used to minimize the global total error, and the optimal pose matrix after correction of all scan nodes is solved. The corresponding formulas for the total error and the optimal solution are as follows: ; ; Where C(X) represents the total global error comprised of all scan nodes; This represents the transpose of the error term matrix; represents the information matrix corresponding to the m-th constraint edge; the larger the value, the higher the credibility of the motion constraint. X represents the set of all scanned pose nodes. This represents the set of optimal solutions for all scan poses after global correction.

7. A structured light 3D reconstruction device for brick outline features of ancient city walls for digitalization, characterized in that, include: A handheld structured light sensor and a data processing module communicatively connected to the handheld structured light sensor. An integrated handheld structured light sensor includes: A DLP projection module is used to project a periodically fixed sinusoidal phase-shifted stripe pattern onto the city wall. A high frame rate industrial camera, equipped with a short focal length optical lens and a narrow band optical filter, is used to acquire deformed stripe images modulated by the surface topography of the city wall, and to suppress ambient stray light and interference from wall surface scattering and reflection. The main control synchronization circuit board is electrically connected to the high frame rate industrial camera and DLP projection module to achieve millisecond-level timing synchronization between stripe projection and image acquisition. The data processing module is configured to execute steps S2-S5 as described in claim 1.