Three-dimensional setting printing correction method and device, equipment and storage medium

By scanning the 3D scene to obtain model and texture information, and using decision trees and reinforcement learning models to automatically generate printing correction plans, the problem of time-consuming and labor-intensive manual modification in 3D image printing is solved, and automated and efficient printing parameter correction is achieved.

CN120689566AInactive Publication Date: 2025-09-23DONGGUAN XIANGQI PRINTING PROD CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510799611.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-09-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing 3D image generation and processing technologies, printing error correction is time-consuming and labor-intensive. Manual modifications lead to project delays and large resource investment, especially when printing complex structural objects, where costs and uncertainties are high.

Method used

By scanning the 3D scene to obtain a 3D point cloud model and multispectral texture map, combined with a decision tree model and a reinforcement learning model, a printing correction plan is automatically generated, including correction amounts for nozzle temperature, ink usage, and printing speed, reducing manual intervention.

Benefits of technology

It realizes fast and automatic printing parameter correction, reduces modification time and workload, and improves printing efficiency and equipment life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689566A_ABST
    Figure CN120689566A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional setting printing correction method and device, equipment and a storage medium, and the method comprises the steps: scanning a three-dimensional setting, and obtaining a three-dimensional point cloud model, color grid data and a multispectral texture mapping graph; based on the three-dimensional point cloud model and the color grid data, determining an offset defect labeling graph and a parallax offset matrix; performing two-dimensional mapping and global correlation calculation on the multispectral texture mapping graph to generate a texture anomaly thermodynamic graph and an LAB color space deviation vector; inputting the parallax offset matrix, the offset defect labeling diagram, the texture anomaly thermodynamic diagram and the LAB color space deviation vector into a preset decision tree model, and generating a root cause classification label and a printing quality score; and based on the root cause classification label and a preset historical printing parameter database, constructing a reinforcement learning model, taking the printing quality score as a reward function of the reinforcement learning model, and outputting a printing correction scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of three-dimensional image printing, and in particular to a method, apparatus, device, and storage medium for printing and correcting three-dimensional scenery. Background Art

[0002] Current 3D image generation and processing technologies primarily rely on manual modeling by professional designers. While this approach allows for precise control of model detail and quality, it has significant limitations in practical application. In particular, when printing errors or problems occur, the model often requires significant modifications. These modifications are not only time-consuming and labor-intensive, but can also delay project schedules due to repeated adjustments. Furthermore, for complex structures, manual modeling requires an even greater investment of time and resources, increasing project costs and uncertainty. Therefore, how to effectively reduce manual intervention, minimize modification workload, and improve overall work efficiency has become a pressing issue in this field. Summary of the Invention

[0003] The present application provides a method, apparatus, device and storage medium for printing correction of a three-dimensional scene, which are used to speed up the modification efficiency and reduce the modification time when the printing parameters of a three-dimensional image need to be modified.

[0004] In a first aspect, an embodiment of the present application provides a method for printing and correcting a three-dimensional scene, the method comprising: Scan the 3D scene to obtain 3D point cloud model, color grid data and multispectral texture map; Determining an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data; Performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector; Inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; Based on the root cause classification labels and a preset historical printing parameter database, a reinforcement learning model is constructed, and the print quality score is used as a reward function of the reinforcement learning model to output a printing correction plan, which includes: a nozzle temperature correction amount, an ink correction amount, and a printing speed correction amount.

[0005] In a second aspect, an embodiment of the present application provides a printing correction device for a three-dimensional scene, wherein the printing correction device for a three-dimensional scene is configured to execute the printing correction method for a three-dimensional scene as described in any one of the embodiments of the present application, and the device comprises: The scenery scanning module is used to scan the 3D scenery and obtain the 3D point cloud model, color grid data and multispectral texture map; an offset determination module, configured to determine an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data; a texture analysis module, configured to perform two-dimensional mapping on the multispectral texture map to obtain a self-view and a cross-view, calculate the global correlation between the self-view and the cross-view using a non-local omnidirectional attention mechanism, and generate a texture anomaly heat map and a LAB color space deviation vector; A decision scoring module, configured to input the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; The result output module is used to build a reinforcement learning model based on the root cause classification label and a preset historical printing parameter database, and use the print quality score as a reward function of the reinforcement learning model to output a printing correction plan, wherein the printing correction plan includes: a nozzle temperature correction amount, an ink correction amount, and a printing speed correction amount.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device including a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the method for printing and correcting a three-dimensional scene as described in any one of the embodiments of the present application when executing the computer program.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the method for printing and correcting a three-dimensional scene as described in any one of the embodiments of the present application.

[0008] An embodiment of the present application provides a method for printing correction of a three-dimensional scene, the method comprising: scanning the three-dimensional scene to obtain a three-dimensional point cloud model, color grid data, and a multispectral texture map; determining an offset defect annotation map and a disparity offset matrix based on the three-dimensional point cloud model and the color grid data; performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector; inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; constructing a reinforcement learning model based on the root cause classification label and a preset historical printing parameter database, using the print quality score as a reward function of the reinforcement learning model, and outputting a print correction solution. Through the above method, the geometric and texture information of the three-dimensional scene is captured from multiple angles, and the offset defect annotation map and disparity offset matrix are generated by analyzing the three-dimensional point cloud model and color grid data to accurately locate and quantify the geometric deviation. The non-local omnidirectional attention mechanism is used to calculate the global correlation between the self-view and the cross-view, and the texture abnormality area is detected. The decision tree model is combined to analyze the multi-dimensional features, and the root cause classification label and print quality score are automatically generated. The historical parameter data is mined and optimized through the reinforcement learning model, and the correction plan including the nozzle temperature, ink usage and printing speed is automatically output, which reduces the workload of manual repeated debugging, speeds up the modification efficiency and reduces the modification time. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A schematic flow chart of a method for printing and correcting a three-dimensional scene provided in an embodiment of the present application; Figure 2 A schematic block diagram of a three-dimensional scene printing and correction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0011] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0012] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0013] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0014] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0015] See also Figure 1 , Figure 1 FIG. 1 is a schematic flow chart of a method for printing and correcting a three-dimensional scene provided by an embodiment of the present application. Figure 1 As shown, the specific steps of the printing correction method of the three-dimensional scene include: S101-S105.

[0016] S101, scanning a three-dimensional scene to obtain a three-dimensional point cloud model, color grid data, and a multi-spectral texture map.

[0017] For example, a multi-angle laser scanner performs a full-scale scan of a 3D scene. The laser beam emitted by the laser scanner strikes the scene's surface and then reflects back to a receiver. The spatial coordinates of each point on the surface are determined by calculating the time difference between laser emission and reception. During the scanning process, the scanning angle is rotated to ensure full coverage of the scene. Typically, at least eight different scanning angles are required to avoid blind spots. The resulting raw point cloud data undergoes noise reduction and registration to form a complete 3D point cloud model that accurately captures the scene's geometry. Simultaneously, a multispectral camera images the scene, capturing spectral information across different wavelengths, including the visible and near-infrared spectrum. The acquired image data is calibrated to create a multispectral texture map, which contains rich material and color information. The system fuses the 3D point cloud model with the multispectral texture map, establishing a precise correspondence between the two using a spatial registration algorithm. This generates color mesh data that contains both geometric structure and color characteristics, providing a comprehensive data foundation for subsequent defect detection.

[0018] S102: Determine an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data.

[0019] For example, a layered slicing method is used to decompose the 3D model vertically into multiple horizontal slices. The thickness of each slice is typically set to 0.05-0.1 mm, matching the actual 3D printing layer thickness. After processing each slice layer, an interlayer topology diagram is constructed to illustrate the connectivity and geometric feature changes between adjacent layers. Using color grid data as a reference, deviation areas in the point cloud model are identified and the offset between the actual geometry and the ideal model is calculated. Using multi-level thresholds, the system categorizes the degree of offset into three levels: mild, moderate, and severe, and identifies them with different colors on the offset defect annotation map. For areas where the offset exceeds the preset tolerance, the specific displacement in the X, Y, and Z directions is calculated to generate a parallax offset matrix, which contains the position coordinates and the corresponding 3D offset vector information. To identify the material density distribution, the color grid data is analyzed and different detection grid sizes are set for different density areas, ensuring accurate detection of offset defects even in complex structures.

[0020] S103 , performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector.

[0021] For example, a multispectral texture map is two-dimensionally mapped using a specific projection algorithm to generate two sets of complementary data: a self-view and a cross-view. The self-view preserves the original texture information, while the cross-view provides different viewing angles through spatial transformation. These two sets of view data are then analyzed using a non-local omnidirectional attention mechanism. This mechanism, based on an improved transformer attention algorithm, effectively handles asymmetric parallax and misalignment by calculating the global correlation between different pixels. Furthermore, a one-dimensional projection transformation is performed on the two sets of view data to generate a feature matrix. Subsequently, a matrix dot product operation is performed to obtain an attention weight distribution map. The attention weight distribution map is multi-directionally sampled and weighted summed to form a linear attention feature map. This feature map is then subjected to feedforward network optimization and layer normalization to obtain a non-local matching feature map. Pixel-level features of high-weighted regions are then extracted from the non-local matching feature map to construct a dense matching relationship map. This map is then converted to the LAB color space for difference analysis. The color difference value of each region is calculated to generate a LAB color space deviation vector. Based on the distribution characteristics of these deviation vectors, the system generates a texture anomaly heat map through a heat mapping algorithm, which intuitively displays the location and severity of texture defects.

[0022] S104 , inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score.

[0023] For example, multidimensional feature data is integrated into a pre-trained decision tree model for comprehensive analysis. Feature combinations are performed on the disparity offset matrix and the offset defect annotation map, and feature vectors of geometric defects are extracted through regional statistical analysis. Simultaneously, the texture anomaly heatmap is segmented at multiple scales, and the degree of anomaly in each region is calculated using the LAB color space deviation vector to generate texture defect feature vectors. The pre-trained decision tree model constructs multiple layers of decision nodes based on these feature vectors and uses the information gain criterion for feature selection, forming a complex set of decision rules. By calculating probabilities and assessing confidence levels for decision paths, the system identifies the root causes of print defects and generates root cause classification labels, covering possible problem types such as nozzle clogs, unstable temperature, uneven feeding, and excessive printing speeds. Based on the root cause analysis results and defect severity, combined with pre-set scoring rules, the system calculates a comprehensive print quality score, a quantitative indicator on a scale of 0-100, that intuitively reflects the overall quality of the printed product. This quality score not only considers the number and area of ​​defects but also weighs the degree of their impact on the finished product's functionality and aesthetics, providing an objective basis for subsequent parameter optimization.

[0024] S105: Based on the root cause classification labels and the preset historical printing parameter database, a reinforcement learning model is constructed, and the print quality score is used as a reward function of the reinforcement learning model to output a print correction plan.

[0025] Exemplarily, a reinforcement learning model is constructed using a preset historical printing parameter database and the root cause classification labels generated in the previous step. This model uses the print quality score as a reward function and automatically generates a print correction plan through an optimization algorithm. The print correction plan includes corrections for nozzle temperature, ink, and print speed. These correction parameters directly control the operating mechanism of the 3D printer's automatic nozzle cleaning device. Based on the nozzle clogging problem identified in the root cause classification label, the system adjusts the program parameters of the PLC controller to periodically activate the cleaning device during the printing process. The nozzle temperature correction in the correction plan determines the temperature to which the nozzle needs to be heated before cleaning to soften ink residue; the ink correction determines the operating speed of the second servo motor and the pressure of the scraper during the cleaning process, which are precisely controlled by the sliding shaft and spring; and the print speed correction affects the frequency of the cleaning operation and the speed of the cleaning roller driven by the first servo motor. When the printhead completes a certain amount of printing, the PLC controller, based on the correction plan's instructions, controls the second electric telescopic rod to push the cleaning platform to the printhead position. After the infrared sensor accurately locates the printhead, the system activates the scraper and sweeper roller according to the parameters optimized by the correction plan to perform a two-stage cleaning process, effectively preventing ink clogging. The entire correction plan implementation process is fully automated, requiring no human intervention, significantly improving print quality and equipment life.

[0026] An embodiment of the present application provides a method for printing correction of a three-dimensional scene, the method comprising: scanning the three-dimensional scene to obtain a three-dimensional point cloud model, color grid data, and a multispectral texture map; determining an offset defect annotation map and a disparity offset matrix based on the three-dimensional point cloud model and the color grid data; performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector; inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; constructing a reinforcement learning model based on the root cause classification label and a preset historical printing parameter database, using the print quality score as a reward function of the reinforcement learning model, and outputting a print correction solution. Through the above method, the geometric and texture information of the three-dimensional scene is captured from multiple angles, and the offset defect annotation map and disparity offset matrix are generated by analyzing the three-dimensional point cloud model and color grid data to accurately locate and quantify the geometric deviation. The non-local omnidirectional attention mechanism is used to calculate the global correlation between the self-view and the cross-view, and the texture abnormality area is detected. The decision tree model is combined to analyze the multi-dimensional features, and the root cause classification label and print quality score are automatically generated. The historical parameter data is mined and optimized through the reinforcement learning model, and the correction plan including the nozzle temperature, ink usage and printing speed is automatically output, which reduces the workload of manual repeated debugging, speeds up the modification efficiency and reduces the modification time.

[0027] In order to more clearly introduce the technical solution of the present application, the technical solution of the present application will be introduced through specific embodiments below. It should be noted that the specific embodiments are used to expand the technical solution of the present application, but are not intended to limit the present application.

[0028] In some embodiments, scanning the three-dimensional scene to obtain a three-dimensional point cloud model, color grid data, and a multi-spectral texture map includes: S1011-S1016.

[0029] S1011. Perform multi-angle laser scanning on the three-dimensional scene to obtain an original point cloud data set.

[0030] For example, a high-precision laser scanning device is used to perform a 360-degree scan of a 3D scene along a preset trajectory. The laser transmitter emits a laser beam at 0.1mm intervals, and the scanning device rotates horizontally at 15-degree intervals and tilts vertically at 10-degree intervals to ensure that every detail of the object's surface is captured. During the scanning process, the laser beam hits the object's surface and reflects back to the receiver. The precise position of the spatial coordinate point is calculated by measuring the laser's round-trip time. The entire scanning process generates a raw point cloud dataset of approximately 5 million spatial points, which contains XYZ coordinate information and reflection intensity values.

[0031] S1012. Perform Gaussian filtering and voxel downsampling on the original point cloud data set to obtain preprocessed point cloud data.

[0032] For example, a Gaussian filter algorithm was applied to the point cloud data, applying a weighted attenuation function with a filter radius of 0.5 mm and a standard deviation of 0.2. This effectively eliminated random noise and outliers generated during the scanning process. Voxel downsampling was then performed, dividing the space into a 0.3 mm cube grid. The points within each grid were merged into a single point, preserving the point cloud topology while reducing the data volume to approximately 15% of the original. The density and quality of the preprocessed point cloud data directly impacted the smoothness of the nozzle's motion trajectory during subsequent printing.

[0033] S1013. Perform iterative closest point registration and local feature descriptor matching on the pre-processed point cloud data to obtain a three-dimensional point cloud model.

[0034] For example, the Iterative Closest Point (ICP) algorithm was applied with a maximum number of iterations set to 50 and a convergence threshold of 0.001 mm to calculate the rigid transformation matrix between point clouds from different viewpoints. For overlapping areas, the Fast Point Feature Histograms (FPFH) local feature descriptor was used with a feature radius set to 2 mm. A 33-dimensional feature vector was generated for each point, and the corresponding point pairs were determined through feature vector similarity matching. The registration process used the RANSAC random sampling consensus algorithm to eliminate false matches and form a complete 3D point cloud model.

[0035] S1014 , performing geometric correction and brightness balance on the image sequence collected by the multispectral camera according to the three-dimensional point cloud model to obtain a multispectral texture map.

[0036] For example, a camera intrinsic parameter matrix and distortion coefficient model are established to perform geometric correction on the image, eliminating perspective and lens distortion. Using the grayscale world assumption and the principle of color constancy, histogram equalization and Gaussian pyramid decomposition are used to adjust the brightness and contrast of images in different bands, ensuring consistency of spectral data across bands. The corrected image is then precisely spatially mapped to the point cloud model using a projection mapping algorithm, forming a multi-band texture map. Accurate texture mapping ensures precise control of ink usage during printing, preventing frequent nozzle clogging caused by excessive ink in certain areas.

[0037] S1015. Use an octree segmentation algorithm to perform spatial division on the three-dimensional point cloud model, and extract color attributes in combination with a multispectral texture map to obtain an initial color grid.

[0038] For example, an octree algorithm is used to recursively divide the space into nested cubes, with a segmentation accuracy of 0.2mm. This allows for finer divisions in detailed areas and larger blocks in coarse areas. For each octree leaf node, the corresponding RGB color value and material reflectance characteristics are extracted from a multispectral texture map. Bilinear interpolation ensures smooth color transitions. The system further analyzes material properties, identifies regions of different materials, and assigns surface attribute parameters to each grid cell.

[0039] S1016. Apply Poisson surface reconstruction and Laplace smoothing to the initial color grid to obtain color grid data.

[0040] For example, the mesh surface is reconstructed using a Poisson equation solver with an octave depth of 8 and a solution accuracy of 10 -6 , filling small holes in the mesh and optimizing surface continuity. A Laplace smoothing algorithm is then applied with 5 iterations and a smoothing factor of 0.3, eliminating surface noise and jagged edges while preserving geometric detail. Smoothing also includes processing the color channels to ensure a smooth transition between texture boundaries. The resulting color mesh data features a highly smooth surface and precise color mapping, providing an ideal model for 3D printing. Smoothed mesh data generates a smoother print path, reduces sudden nozzle movement during printing, and reduces the probability of ink clogging.

[0041] In some embodiments, determining an offset defect annotation map and a disparity offset matrix based on the three-dimensional point cloud model and the color grid data includes: S1021-S1027.

[0042] S1021. Slice the three-dimensional point cloud model in layers to obtain a topological relationship diagram between layers.

[0043] Exemplarily, an adaptive slicing algorithm is used to perform fine layering processing on the three-dimensional point cloud model. The slice thickness is dynamically adjusted according to the geometric complexity of the model. 0.05mm thin slices are used for complex areas, and 0.15mm thick slices are used for smooth areas. In one embodiment, the model is segmented layer by layer from bottom to top along the Z-axis direction, and closed contour lines are generated for each layer, and topological features such as holes, number of contours, and mutual inclusion relationships are recorded. A two-dimensional vector field is established between adjacent layers to describe the structural change trend, and the connection points and breakpoint positions between layers are marked. The inter-layer topological relationship diagram is stored in the form of a graph data structure, with nodes representing the contour features of each layer and edges representing the inter-layer connection relationship and the degree of change. This topological diagram can reflect the structural continuity and change trend of the model in the vertical direction, and provide basic data support for subsequent printing path planning and offset analysis.

[0044] S1022 : Mapping and transforming the features of adjacent layers according to the inter-layer topological relationship diagram to obtain a first adjacent feature vector and a second adjacent feature vector.

[0045] Exemplarily, feature extraction and transformation are performed based on the topological relationship graph, and a feature mapping algorithm is executed for each pair of adjacent layers. Specifically, for the upper contour point set, the system extracts geometric features such as local curvature, normal vector, contour line density, etc. to form a 128-dimensional first feature vector; for the corresponding area of ​​the lower layer, these features are also extracted to form a second feature vector. The mapping process adopts a bidirectional projection algorithm, considering the shortest distance from point to surface and curvature matching to solve the problem of contour misalignment. The feature vector contains multiple feature dimensions such as density distribution, surface normal consistency, geometric mutation, etc., and each dimension is normalized. This bidirectional feature mapping mechanism can effectively capture subtle structural differences between adjacent layers and provide accurate feature representation for subsequent analysis of potential printing offset areas. The high-dimensional expression of the feature vector ensures the accurate quantification of changes in complex geometric shapes and provides a mathematical basis for parallax analysis.

[0046] S1023 : Obtain an inter-layer disparity weight map according to a preset correlation calculation formula, the first adjacent eigenvector, and the second adjacent eigenvector.

[0047] For example, the attention mechanism is applied to calculate the global correlation between feature vectors using the formula Calculate, where Q i represents the query matrix after the first eigenvector is linearly transformed, K j The key matrix represents the second eigenvector, where d is the feature dimension. Self-attention and cross-attention layers are constructed to calculate internal and inter-layer correlations, respectively, expanding the receptive field through a multi-head attention mechanism. Position encoding is introduced during the calculation process to preserve the spatial relative position information of features, and a Gaussian kernel function is applied to weight attenuate distant point pairs. The resulting disparity weight map is a two-dimensional heat map, with highlighted areas indicating high inter-layer structural consistency and dark areas indicating potential misalignment. The resolution of the disparity weight map matches the point cloud density, ensuring that it accurately reflects structural changes in small areas and providing an intuitive visualization basis for subsequent misalignment area marking.

[0048] S1024 : Mark the areas with preset determination thresholds for weight values ​​in the inter-layer disparity weight map to obtain a potential misalignment candidate area map.

[0049] For example, a threshold segmentation process is performed on the disparity weight map, using a threshold of 0.2 as the decision threshold. Pixels with weights below this threshold are marked. The marking process uses a connected domain analysis algorithm to aggregate adjacent low-weight pixels into a unified misaligned region, while applying morphological operations to eliminate isolated noise points. Shape features such as area, perimeter, and circularity are calculated for each candidate region, filtering out areas that are too small (less than 0.5 mm²) to avoid misjudgment. The system classifies candidate regions into three levels based on their weights: high misalignment (0-0.1), moderate misalignment (0.1-0.15), and low misalignment (0.15-0.2). These regions are marked with different colors on a map of potential misaligned candidate regions. The map of potential misaligned candidate regions is stored as a binary image, with white areas representing normal areas and colored areas representing locations with varying degrees of potential misalignment, providing regional positioning information for subsequent precise offset calculations.

[0050] S1025. Calculate the color density distribution based on the color grid data, set a 5×5 grid for areas where the color density distribution is greater than 0.8, and set a 15×15 grid for areas where the color density distribution is less than 0.3, to obtain a multi-scale grid layout diagram.

[0051] For example, color grid data is used to analyze material distribution density, calculate the color gradient and rate of change for each spatial region, and generate a density distribution heat map. High-density areas (such as support structures and solid parts) typically experience gradual color changes with low gradients, while low-density areas (such as hollowed-out areas and detailed structures) experience dramatic color changes with high gradients. An adaptive meshing strategy is designed based on the density distribution. A small 5×5 grid is applied to dense areas with density values ​​greater than 0.8 to precisely capture local offsets, while a large 15×15 grid is applied to loose areas with density values ​​less than 0.3 to effectively analyze long-range structural offsets. For intermediate density regions (0.3-0.8), the grid size is set using linear interpolation, generating a multi-scale grid layout containing grid cells of varying sizes. Each grid cell records the average density value, primary color characteristics, and grid size information for that area, providing a spatial reference frame and analysis unit for parallax offset calculations.

[0052] S1026 , performing overlapping analysis based on the multi-scale grid layout map and the potential dislocation candidate region map, calculating displacements in the X, Y, and Z directions, and obtaining a disparity offset matrix.

[0053] Exemplarily, the multi-scale grid layout map and the potential misalignment candidate area map are spatially aligned and cross-analyzed to identify overlapping areas in the two maps, which have both specific grid scales and misalignment characteristics. For each overlapping area, the optical flow method and the three-dimensional point cloud registration algorithm are applied to accurately calculate the displacement vector of the area in the X, Y, and Z directions. The calculation process takes the grid scale factor into consideration, and local fine registration is used for small grid areas, while a global registration strategy is used for large grid areas. The displacement calculation uses an improved version of the iterative nearest point algorithm, and a weight factor is added to adjust the sensitivity in different directions. The displacement amounts of all areas are combined to form a complete parallax offset matrix, and each element in the matrix contains a spatial coordinate and a corresponding three-dimensional displacement vector. The matrix is ​​stored in the form of a three-dimensional tensor, which intuitively shows the geometric offset of each area in the entire model, providing an accurate numerical basis for subsequent defect annotation and printing correction.

[0054] S1027 , marking areas in the parallax offset matrix where the displacement exceeds ±0.05 mm to obtain an offset defect marking map.

[0055] For example, ±0.05 mm is set as the key offset threshold, which is determined based on the industrial-grade 3D printing accuracy standard. The annotation process adopts a hierarchical statistical method to extract the super-threshold areas from the three directions of XYZ respectively, and merge them through Boolean operations to obtain the comprehensive offset area. The offset amplitude, offset direction and area of ​​each marked area are calculated to generate a defect feature descriptor. The offset type is divided into tensile offset (positive super-threshold) and compression offset (negative super-threshold) according to the directional properties, and then divided into six basic defect modes based on the displacement direction. The annotation map adopts pseudo-color mapping technology. Different colors represent offset areas of different severity. The color increases from blue to red, indicating that the offset ranges from mild to severe. At the same time, the boundary contour line of the defect area is generated, and numerical labels are added to indicate the specific offset value to form a complete offset defect annotation map.

[0056] In some embodiments, two-dimensional mapping and global correlation calculation are performed on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector, including: S1031-S1039.

[0057] S1031. Perform two-dimensional mapping on the multispectral texture map to obtain a self-view and a cross-view.

[0058] For example, a high-resolution multispectral camera array is used to collect texture data on the target surface. The camera array consists of five narrow-band cameras with a spectral bandwidth of 40nm, covering the visible light range of 380-780nm. The pixel resolution reaches 4096×3072, ensuring the complete capture of texture details. After geometric correction, the multispectral data is projected onto the surface of a pre-established three-dimensional model, forming a high-density texture map containing approximately 1200 data points per square millimeter. The two-dimensional mapping process uses a conformal mapping algorithm to project the texture points in the spherical coordinate system into the planar UV space, keeping texture deformation to a minimum. At the same time, two sets of texture maps are generated from independent perspectives: a self-view observed from the front of the object and a cross-view observed from a 45-degree angle. There is an approximately 40% overlap between the two sets of views, providing a data basis for subsequent correlation analysis.

[0059] S1032 , performing one-dimensional projection transformation on the self-view and the cross-view respectively to obtain a first characteristic matrix and a second characteristic matrix.

[0060] For example, the Radon transform is used to project the self-view within an angular range of 180 degrees, with an angular interval of 0.5 degrees. A projection curve is generated for each angle, and the sampling point spacing of the projection curve is 0.05mm. The spatial domain information is converted into frequency domain features through Fourier transform, from which the energy distribution and texture directionality are extracted to construct a first feature matrix with a dimension of 360×512. The same Radon transform and Fourier transform operations are performed on the cross view, but an angle offset of ±5 degrees is introduced to compensate for the viewing angle difference. The projection sampling points are increased to 0.03mm to improve the recognition ability of edge details, forming a second feature matrix with a dimension of 480×512. Each element in the two feature matrices represents the texture feature intensity at a specific angle and position, and the numerical range is normalized to between 0-1, which effectively reduces the interference of image noise on feature extraction and improves the robustness of subsequent matching calculations.

[0061] S1033. Generate a query vector and a key vector based on the first feature matrix, generate a value vector based on the second feature matrix, and obtain an attention operation input matrix.

[0062] Exemplarily, a self-attention mechanism is used to process the feature matrix. The first feature matrix is ​​decomposed into a query vector Q and a key vector K through a linear transformation layer. The transformation matrix size is 512×64, which reduces the dimension of each vector to 64 dimensions and reduces the computational complexity. The ReLU activation function is applied during the transformation process to enhance the nonlinear expression ability. The query vector Q captures the local feature pattern of the texture, and the key vector K encodes contextual information. The second feature matrix is ​​transformed through a linear transformation layer with different parameters to generate a value vector V. The transformation matrix size is 512×64, and the value vector contains the texture semantic information in the cross view. The three groups of vectors are combined to form an attention operation input matrix of size (H×W)×3×64, where H and W are the height and width of the feature map, respectively. Each row of the matrix represents a query-key-value triplet of a spatial position, providing global context perception for subsequent attention weight calculation.

[0063] S1034. Obtain an initial attention weight distribution map by calculating the matrix dot product of the query vector and the key vector.

[0064] For example, a scaled dot-product attention calculation method is applied. The transpose of the query vector Q and the key vector K is batched and matrix multiplied to produce a raw attention score matrix of dimension (H × W) × (H × W). The dot product result is divided by a scaling factor of 8 (i.e., the square root of the vector dimension 64), effectively combating the vanishing gradient problem. A softmax function is applied to the scaled attention score matrix to perform row normalization, so that the weights of each row sum to 1, forming the initial attention weight distribution map. Each element in the weight distribution map ranges from 0 to 1, representing the degree of correlation between pairs of spatial locations. Larger values ​​indicate greater texture feature similarity between the two points. To improve computational efficiency, a block sparse attention algorithm is employed, calculating only relationships between point pairs within a range of no more than 20% of the texture map width. This reduces the memory usage of the weight distribution map from the original 16GB to 2.4GB while maintaining a 94% feature capture rate.

[0065] S1035. Perform weighted summation based on the initial attention weight distribution map and the value vector to obtain a linear attention feature map.

[0066] For example, a matrix multiplication operation is performed between the attention weight distribution map and the value vector V. The weights are used as interpolation coefficients to linearly combine the value vectors, and each output position incorporates global context information. The matrix multiplication adopts a block operation strategy, dividing the large matrix into small blocks of 256×256 for parallel calculation, making full use of the parallel acceleration capability of the GPU, and increasing the operation speed by 3.8 times. The weighted summation process introduces a Gaussian kernel to limit the range of attention influence. The kernel size is set to 15×15 pixels to ensure that the weights of pixels that are far apart decay to near zero, maintaining the coherence of the local texture structure. The dimension of the linear attention feature map is H×W×64, which retains the spatial resolution of the original image. The 64-dimensional feature vector of each pixel contains the texture feature distribution information of the surrounding area. The high-response areas in the feature map usually correspond to locations with rich texture structures or significant changes, providing key information for subsequent feature optimization.

[0067] S1036. Perform feedforward network optimization and layer normalization on the linear attention feature map, and perform residual connection operation with the attention operation input matrix to obtain a non-local matching feature map.

[0068] For example, the linear attention feature map is input into a feedforward neural network consisting of two fully connected layers. The first layer has a dimension of 64×256 and uses the GELU activation function to enhance nonlinear expression capabilities. The second layer has a dimension of 256×64 and maps the features back to the original dimensional space. The network is trained using a stochastic gradient descent optimizer with a learning rate of 0.001 and a weight decay coefficient of 5e-4. 1000 iterations are performed until the loss function converges. The output of the feedforward network undergoes layer normalization. The normalized statistics are calculated based on the feature dimension, with mean zero and variance normalization. The normalization parameters γ and β are set to 1.2 and 0.2 to enhance feature discrimination. The normalized feature map is then element-wise added to the original attention operation input matrix to form a residual connection structure. This effectively alleviates the vanishing gradient problem in deep networks, retaining the original feature information while integrating the contextual associations extracted by the attention mechanism. This produces a non-local matching feature map with unchanged spatial resolution and 64 channels.

[0069] S1037 , performing pixel-level feature extraction on areas in the non-local matching feature map where the weight value is greater than 0.8, to obtain a dense matching relationship map.

[0070] Exemplarily, an adaptive threshold segmentation algorithm is applied to the non-local matching feature map, and high-response areas with weight values ​​greater than 0.8 are selected as key texture areas. These areas usually correspond to texture boundaries, color block transition zones, or surface microstructure changes. A pixel-level feature extractor is applied to each high-response area. The extractor consists of a three-layer convolutional network with convolution kernel sizes of 5×5, 3×3, and 3×3, respectively, with a step size of 1. The number of feature channels is 64-128-256. Each layer is followed by batch normalization and LeakyReLU activation function to enhance the expressive power of shallow features. The extracted pixel-level feature vectors are calculated through cosine similarity to establish a dense correspondence between the self-view and the cross-view, forming a dense matching relationship map with the same resolution as the original texture map. The matching relationship map is coded in pseudo-color, with color saturation indicating matching confidence and brightness indicating feature response strength, providing an intuitive visualization effect.

[0071] S1038. Perform LAB color space conversion according to the dense matching relationship graph, and calculate the color difference value between the self-view and the cross-view to obtain a LAB color space deviation vector.

[0072] For example, the dense matching relationship graph represented by RGB is converted to the perceptually uniform CIELAB color space. This conversion process first undergoes a linear transformation from sRGB to XYZ space, and then maps from XYZ to LAB space, with the reference white point set to the D65 standard illuminant. In LAB space, the L channel ranges from 0 to 100 to represent brightness, the a channel ranges from -128 to +127 to represent the transition from green to red, and the b channel ranges from -128 to +127 to represent the transition from blue to yellow. The Euclidean distance is calculated between the LAB values ​​at corresponding positions in the self-view and cross-view to obtain the color difference value ΔE. The color difference calculation uses the CIE2000 standard formula, introducing an illumination compensation factor kL=1.5, a chromaticity compensation factor kC=1.0, and a hue compensation factor kH=1.0 to improve the accuracy of color difference assessment. The color difference value is weighted and fused with the confidence of the matching relationship to generate a three-dimensional LAB color space deviation vector. The vector direction indicates the color shift trend, and the modulus indicates the degree of shift, providing a quantitative evaluation basis for heat map generation.

[0073] S1039. Perform region segmentation and heat mapping based on the LAB color space deviation vector and a preset threshold to obtain a texture anomaly heat map.

[0074] For example, the K-means clustering algorithm is used to classify the LAB color space deviation vector into five categories. The cluster center is initialized using the K-means++ method to improve the convergence speed, and it is iterated 50 times until the sum of the intra-class variance is minimized. The clustering results are compared with the preset threshold vector [3.0, 6.0, 12.0, 24.0]. The threshold is set based on the color difference level that the human eye can perceive. ΔE < 3.0 indicates an imperceptible difference, 3.0 ≤ ΔE < 6.0 indicates a slight difference, 6.0 ≤ ΔE < 12.0 indicates a noticeable difference, 12.0 ≤ ΔE < 24.0 indicates a significant difference, and ΔE ≥ 24.0 indicates a severe difference. A heat map is generated based on the classification results, using a gradient color spectrum from blue (low deviation) to red (high deviation). Blue areas indicate good texture matching, and red areas indicate possible texture anomalies. The heat map uses a bilinear interpolation algorithm to enhance the original texture resolution, and a 3×3 Gaussian smoothing kernel is applied to reduce noise. The edge areas are filled with mirror images to avoid artifacts. Finally, a heat map is generated that intuitively displays the distribution of texture anomalies, providing a reliable basis for subsequent surface quality assessment and defect location.

[0075] In some embodiments, a weighted summation is performed based on the initial attention weight distribution map and the value vector to obtain a linear attention feature map, including: S351-S355.

[0076] S351. Perform omnidirectional sampling on the initial attention weight distribution map, set sampling windows in 8 directions, and calculate the offset in each direction to obtain an omnidirectional offset parameter matrix.

[0077] Exemplarily, a dynamic adaptive sampling strategy is used to perform omnidirectional sampling operations on the initial attention weight distribution map. The sampling directions include eight main angles: 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315°. The size of each sampling window is set to 9×9 pixels. During the sampling process, a high-order interpolation algorithm is applied to accurately sample non-integer coordinate points. The window weight follows a Gaussian distribution, with a center weight of 1.0 and an edge decay of 0.2 to ensure spatial continuity during the sampling process. The offset is calculated based on the relative position difference between each sampling point and the center point. The offset accuracy reaches the sub-pixel level (0.05 pixels), forming an omnidirectional offset parameter matrix with spatial consistency. The matrix dimensions are H×W×16, where H and W represent the feature map height and width, respectively, and 16 represents the horizontal and vertical offset components in 8 directions. The omnidirectional offset parameter matrix captures the anisotropic characteristics of the spatial distribution of attention weights and provides precise position guidance information for subsequent feature remapping.

[0078] S352 . Remap the value vector according to the horizontal offset and the vertical offset in the omnidirectional offset parameter matrix to obtain a corrected eigenvector.

[0079] For example, a bilinear interpolation remapping algorithm is applied to spatially transform each pixel position in the value vector. The remapping kernel radius is set to 1.5 pixels, and the interpolation coefficient matrix is ​​determined by the horizontal and vertical offset components of the corresponding position in the omnidirectional offset parameter matrix. The remapping process uses Lagrangian constraints to ensure that the topological structure is not distorted. For points that fall into non-grid positions after interpolation, a weighted average strategy with a nearest neighbor search radius of 0.3 pixels is used to assign features. The algorithm is iterated three times, and the offset attenuation coefficient is set to 0.85 in each iteration to ensure convergence and computational stability. The correction process uses a position-adaptive deformable transformation network to compensate for geometric deformation caused by viewpoint differences. The dimension of the corrected feature vector is consistent with the value vector, but the spatial distribution is more consistent with the semantic consistency requirements. The feature response is enhanced along the main direction, and the feature response perpendicular to the main direction is appropriately suppressed, effectively improving the accuracy of subsequent correlation matching.

[0080] S353. Calculate the correlation strength between the corrected feature vector and the initial attention weight distribution map to obtain a pixel-level attention weight map.

[0081] For example, a normalized cross-correlation algorithm based on the Pearson correlation coefficient is used to calculate the similarity between the corrected feature vector and the initial attention weight within the local receptive field (11×11 pixel window). The correlation coefficient threshold is set to 0.6, and correlations below the threshold are smoothed and suppressed with a suppression factor of 0.25. The correlation calculation is accelerated using block sparse matrix multiplication, with each block size of 16×16. The calculation accuracy uses half-precision floating-point numbers (FP16) to improve processing efficiency. The correlation strength matrix is ​​normalized using the Softmax function with a temperature parameter set to 0.07 to ensure that the weight distribution has appropriate kurtosis. To address the uncertainty of texture-blurred areas, an entropy regularization term is introduced with an entropy weight coefficient set to 0.15. An adaptive weight decay strategy is applied to high-entropy areas (entropy values ​​greater than 3.5), resulting in a pixel-level attention weight map with spatial consistency and edge-preserving properties. The resolution of the weight map is consistent with the input features, effectively distinguishing foreground and background areas.

[0082] S354. Perform weighted accumulation on the corrected feature vectors according to the pixel-level attention weight map to obtain contextual aggregation features.

[0083] For example, a non-local attention mechanism is applied to perform weighted aggregation in the spatial domain on the corrected feature vector. The aggregation range is the global feature map, but the effective range is controlled by introducing a distance weighted attenuation function (attenuation coefficient is 0.08), and the weights of distant points decay exponentially. The weighted accumulation process uses sparse matrix multiplication to optimize computational efficiency, and only elements with weights greater than 0.15 in the pixel-level attention weight map are retained for calculation. For cross-channel interactions between feature dimensions, group convolution operations (the number of groups is set to 8) are applied to extract channel-level context information, and the channels in each group share the same weight matrix. In order to enhance the robustness of the model to scale changes, a multi-scale feature fusion strategy is introduced. Weighted accumulation is performed at the original resolution and 0.5 times the downsampled resolution, and features are merged after being restored to the original resolution through bilinear upsampling. The contextual aggregation feature captures long-range dependencies. The feature dimension is C×H×W, where C is the number of channels (256), and the spatial resolution is consistent with the input feature.

[0084] S355. Perform a deformable window convolution operation on the context aggregation feature and perform feature fusion with the pixel-level attention weight map to obtain a linear attention feature map.

[0085] For example, a deformable convolutional network (DCN) is used to adaptively extract context-aggregated features. The convolution kernel size is 3×3, the bias field learning rate is 0.01, and the bias field is initialized using a zero-mean Gaussian distribution (standard deviation 0.05). The deformable window dynamically adjusts the receptive field shape based on local texture complexity. A slender convolution kernel (with an offset of up to 5 pixels) is used for edge regions, and a nearly circular convolution kernel is used for flat regions. The convolutional features are channel-wise weighted using a Squeeze-and-Excitation (SE) attention module with a compression ratio of 16 and a GELU activation function. Channel-wise and spatial-attention weights are computed in parallel. Channel-wise attention extracts global statistics of feature responses, while spatial attention preserves local structural details. The processed features are residually connected with the pixel-level attention weight map (with a connection weight of 0.7) and feature normalized (using instance normalization) to form a linear attention feature map. This feature map preserves the original texture details and semantic structure while being globally context-aware, providing a reliable feature representation for subsequent pixel-level matching.

[0086] In some embodiments, the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector are input into a preset decision tree model to generate a root cause classification label and a print quality score, including: S1041-S1045.

[0087] S1041. Perform feature combination on the disparity offset matrix and the offset defect annotation map, and perform regional statistical analysis to obtain a geometric defect feature vector.

[0088] For example, the disparity offset matrix is ​​divided into 8×8 pixel blocks, the average offset and standard deviation in each block are calculated, and the information is correlated and matched with the annotation information of the corresponding area in the offset defect annotation map. Local statistical features are extracted for each matching area, including characteristic parameters of 12 dimensions such as maximum offset, offset direction distribution, and gradient change rate. The feature dimension is reduced to a 6-dimensional vector space through the principal component analysis method, and the Z-score normalization process is used to eliminate the dimensional effect. During the regional statistical analysis process, the offset threshold is set to 0.5mm, and key features are extracted for areas exceeding the threshold to generate a geometric defect feature vector with a significant weight.

[0089] S1042. Perform multi-scale segmentation on the texture anomaly heat map, and calculate the regional anomaly degree in combination with the LAB color space deviation vector to obtain a texture defect feature vector.

[0090] Exemplarily, an adaptive threshold segmentation algorithm is used to divide the texture anomaly heat map into three scales, with scale ratios of 1:1, 1:2 and 1:4 respectively, and the anomaly judgment threshold is set to 0.75 at each scale level. The LAB color space deviation vector is mapped to the corresponding scale level, and the color difference gradient and texture consistency index of each region are calculated. The regional anomaly degree is calculated by weighted fusion of the heat map intensity value, color difference gradient value and texture consistency index, with weight coefficients of 0.4, 0.3 and 0.3 respectively. For areas with an anomaly degree greater than 0.8, 15-dimensional local descriptors are extracted, including grayscale co-occurrence matrix features, local binary pattern features and Gabor texture features, to construct a texture defect feature vector.

[0091] S1043. Construct a decision tree node based on the geometric defect feature vector and the texture defect feature vector, and perform feature selection according to the information gain criterion to obtain a multi-layer decision rule set.

[0092] For example, the geometric defect feature vectors and texture defect feature vectors were merged into a 21-dimensional feature space, and a binary tree structure was constructed using the CART decision tree algorithm. Each node selected the optimal splitting feature based on the information gain ratio criterion. The information gain threshold was set to 0.1, and features with a feature importance score greater than 0.3 were retained for constructing decision rules. The maximum depth of the tree was set to 5 layers, and the minimum number of leaf node samples was set to 10. Pruning operations were used to optimize the tree structure to avoid overfitting. The accuracy and coverage of each rule path were calculated based on the validation set data, generating a multi-layer decision rule set containing 35 rules.

[0093] S1044. Perform path probability calculation and confidence evaluation on the multi-layer decision rule set to obtain a root cause classification label.

[0094] For example, conditional probabilities are calculated for each rule path in the decision rule set, and the Bayesian probability framework is used to evaluate rule reliability. Path probability calculations consider the distribution characteristics of node features, assuming a Gaussian distribution for continuous features and a multinomial distribution for discrete features. Confidence assessments comprehensively consider rule support, rule coverage, and rule accuracy, with a support weight of 0.3, a coverage weight of 0.3, and an accuracy weight of 0.4. The optimal rule path is selected based on the maximum confidence principle, and the corresponding defect type is used as the root cause classification label. The confidence score is recorded for subsequent quality assessment.

[0095] S1045 , performing weighted calculation based on the confidence evaluation result corresponding to the root cause classification label and a preset scoring rule to obtain a print quality score.

[0096] Exemplarily, a five-level print quality scoring system is established with a score range of 0-100 points. The scoring rules include a defect type weight matrix and a confidence correction factor. The basic deduction value for different types of defects is between 10-30 points. The confidence assessment result is mapped to a correction coefficient range of 0.6-1.2 through a sigmoid function. The higher the confidence level, the larger the correction coefficient. The quality score calculation uses a 100-point system as the starting point. The deduction value is calculated cumulatively based on the detected defect type and the corresponding confidence level. A score greater than 90 points is excellent, 80-90 points are good, 70-80 points are qualified, 60-70 points are for improvement, and below 60 points are unqualified.

[0097] In some embodiments, a reinforcement learning model is constructed based on the root cause classification labels and a preset historical printing parameter database, and the print quality score is used as a reward function of the reinforcement learning model to output a printing correction plan, including: S1051-S1055.

[0098] S1051 : Perform cluster analysis on the printing parameters and corresponding root cause classification labels in the historical printing parameter database to obtain a parameter-label mapping matrix.

[0099] For example, a K-means clustering algorithm was used to process data from a historical printing parameter database, with eight cluster centers and 100 iterations. Each printing parameter vector was normalized, including key parameters such as nozzle temperature, ink flow rate, and print speed, and the Euclidean distance between samples was calculated. By optimizing the goals of minimizing intra-cluster distance and maximizing inter-cluster distance, similar parameter combinations were grouped into the same category. Correlation analysis was performed between the clustering results and the root cause classification labels, and a mapping relationship between parameter combinations and fault types was established. A 240×180-dimensional parameter-label mapping matrix was generated, with the matrix elements representing the correlation between the parameter combinations and the fault types. The silhouette coefficient (Silhouette Coefficient) was used to assess clustering quality during the clustering process. A value of 0.78 indicated satisfactory clustering results. The DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm was used to identify and filter noisy data points, with a density threshold of 0.05 and a neighborhood radius of 3.5 standard deviation units. To improve mapping accuracy, principal component analysis (PCA) dimensionality reduction preprocessing was introduced, which retained 95% of the information while reducing the feature dimension from the original 27 dimensions to 15 dimensions, greatly improving computational efficiency and model generalization capabilities.

[0100] S1052: Construct a state space and an action space according to the parameter-label mapping matrix, and normalize the print quality score to obtain a reward function mapping table.

[0101] For example, a 15-dimensional state space is constructed based on the parameter-label mapping matrix, containing the current states of process parameters such as nozzle temperature, ink flow rate, and print speed, as well as one-hot encodings of fault types. The action space is designed as a 9-dimensional vector, corresponding to adjustable parameters such as temperature adjustment of ±5°C, ink flow adjustment of ±10%, and print speed adjustment of ±20%. Historical print quality score data is normalized using min-max processing, and the score range is mapped to the interval [-1, 1]. A 180×240-dimensional reward function mapping table is established, in which the element values ​​in the table reflect the expected benefits under different state-action combinations. The state space is constructed using the Markov decision process (MDP) framework, assuming that the current state is only related to the previous state and the action taken. The state transition probability matrix is ​​estimated from historical data using the Monte Carlo sampling method, with a total of 25,000 state transition samples. To address the sparse reward problem, an Experience Replay Buffer is introduced with a capacity of 10,000 state-action-reward triplets. A priority sampling strategy is adopted, where samples with larger TD errors have a higher probability of being selected. Sampling bias is corrected using importance weights, and the β value increases linearly from 0.4 to 1.0.

[0102] S1053. Perform a Monte Carlo tree search on the state space and action space, and perform strategy evaluation in combination with the reward function mapping table to obtain the value network parameters.

[0103] For example, the Upper Confidence Bound (UCB) strategy was used for Monte Carlo tree search, with a search depth of 8 layers and 1000 simulations. At each decision node, possible choices in the action space were expanded, the immediate reward was calculated by querying the reward function mapping table, and the cumulative reward value was propagated based on the tree structure. A deep neural network was used as the value function approximator. The network structure consisted of 4 fully connected layers with 256, 128, 64, and 32 hidden units, respectively, using the ReLU activation function. The network parameters were optimized using the backpropagation algorithm, with a learning rate set to 0.001 and 200 training rounds. To prevent overfitting, dropout regularization was applied to each layer of the network, with a dropout rate of 0.3 and an L2 weight decay coefficient of 0.0005. Batch normalization was used to accelerate convergence during training, with the number of samples per batch set to 64. The value network was trained using the mean squared error (MSE) loss function, with parameters updated using the Adam optimizer. The initial learning rate was 0.001, and a cosine annealing schedule was applied, with a minimum learning rate of 1e-5. The average prediction error on the validation set was 0.078, and the R² value reached 0.923, demonstrating good generalization performance of the value network.

[0104] S1054. Perform strategy iteration and parameter optimization based on the value network parameters and the root cause classification labels to obtain an optimized action sequence.

[0105] For example, a policy network is constructed based on the trained value network, and parameter optimization is achieved using an actor-critic architecture. The policy network outputs action probability distributions, while the value network estimates state values. The two networks share encoding layer parameters. At each training step, actions are sampled based on the current state and root cause classification labels, and environmental interactions are performed to obtain rewards and the next state. Temporal difference errors are calculated and network parameters are updated, with a discount factor set to 0.95 and an entropy regularization coefficient of 0.01. After 1000 rounds of policy iteration, an optimized action sequence consisting of 15 key adjustment steps is obtained. The optimization process uses the proximal policy optimization (PPO) algorithm with a clipping parameter ε set to 0.2. The objective function consists of a policy objective, a value loss, and an entropy reward, with a weight ratio of 1:0.5:0.01. To improve sample utilization, each environmental interaction data set is used for four rounds of parameter updates, with 10 gradient steps performed per update. Action sampling uses a diagonal Gaussian distribution, with the mean output by the policy network and the standard deviation initially set to 1.0 and adaptively adjusted during training. To address the exploration-exploitation balance problem, an adaptive KL penalty term is introduced with a target KL divergence value of 0.015. When the actual KL divergence deviates from the target value, the penalty coefficient is dynamically adjusted to ensure that the strategy update amplitude is moderate.

[0106] S1055: Parameter decoding and constraint mapping are performed on the optimized action sequence to obtain the correction amount of nozzle temperature, ink correction amount and printing speed correction amount.

[0107] For example, discrete action indices in the optimization action sequence are decoded into specific parameter adjustments. The nozzle temperature correction range is limited to ±5°C, with an adjustment step of 0.5°C; the ink flow rate correction range is ±10%, with a minimum adjustment unit of 1%; and the print speed correction range is ±20%, with an adjustment accuracy of 2%. Physical constraints are checked on the decoded parameter adjustments to ensure that the corrected parameter values ​​fall within the device's operating range. The parameter adjustment curve is smoothed using linear interpolation to generate a continuous parameter correction trajectory, preventing sudden changes in parameters from adversely affecting print quality. Parameter decoding employs a quantile mapping strategy to ensure uniformity in the distribution of adjustment values ​​while satisfying physical constraints. The coupling relationships between multiple parameters are modeled, and a parameter interaction matrix is ​​established. When a particular parameter changes, other related parameters are adjusted accordingly. For example, a 1°C increase in nozzle temperature requires a 0.8% decrease in ink flow rate to maintain viscosity stability. The correction curve is smoothed using a Savitzky-Golay filter with a window length of 5 and a polynomial order of 3, preserving the curve's trend characteristics while filtering out high-frequency disturbances. The final parameter correction scheme was evaluated through sensitivity analysis. The contribution rate of temperature correction to print quality was 45%, the contribution rate of ink flow adjustment was 30%, and the contribution rate of speed adjustment was 25%.

[0108] See also Figure 2 , Figure 2 This is a schematic block diagram of a 3D scene printing and correction device provided by an embodiment of the present application. The 3D scene printing and correction device 200 is used to execute the aforementioned 3D scene printing and correction method. The 3D scene printing and correction device 200 can be configured in a server.

[0109] Among them, the server can be an independent server, a server cluster, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0110] like Figure 2 As shown, the printing correction device 200 for a three-dimensional scene includes: a scene scanning module 201 , an offset determination module 202 , a texture analysis module 203 , a decision scoring module 204 and a result output module 205 .

[0111] The scenery scanning module 201 is used to scan the three-dimensional scenery to obtain a three-dimensional point cloud model, color grid data and multi-spectral texture mapping.

[0112] The offset determination module 202 is configured to determine an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data.

[0113] The texture analysis module 203 is used to perform two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector.

[0114] The decision scoring module 204 is used to input the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score.

[0115] The result output module 205 is used to build a reinforcement learning model based on the root cause classification label and the preset historical printing parameter database, and use the print quality score as the reward function of the reinforcement learning model to output a printing correction plan.

[0116] An embodiment of the present application provides an electronic device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a printing correction method for a three-dimensional scene as described in any one of the embodiments of the present application when executing the computer program.

[0117] An embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements a method for printing and correcting a three-dimensional scene as described in any one of the embodiments of the present application.

[0118] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for printing and correcting a three-dimensional scene, characterized in that: The method comprises: Scan the 3D scene to obtain 3D point cloud model, color grid data and multispectral texture map; Determining an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data; Performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector; Inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; Based on the root cause classification labels and a preset historical printing parameter database, a reinforcement learning model is constructed, and the print quality score is used as a reward function of the reinforcement learning model to output a printing correction plan.

2. The method for printing and correcting a three-dimensional scene according to claim 1, wherein: The scanning of the three-dimensional scene to obtain a three-dimensional point cloud model, color grid data and a multi-spectral texture map includes: Performing multi-angle laser scanning on the three-dimensional scene to obtain an original point cloud data set; Performing Gaussian filtering and voxel downsampling on the original point cloud data set to obtain preprocessed point cloud data; Performing iterative closest point registration and local feature descriptor matching on the preprocessed point cloud data to obtain the three-dimensional point cloud model; Performing geometric correction and brightness balance on an image sequence captured by a multispectral camera according to the three-dimensional point cloud model to obtain the multispectral texture map; Using an octree segmentation algorithm to spatially divide the three-dimensional point cloud model, and extracting color attributes in combination with the multispectral texture map to obtain an initial color grid; Poisson surface reconstruction and Laplace smoothing are applied to the initial color grid to obtain the color grid data.

3. The method for printing and correcting a three-dimensional scene according to claim 1, wherein: The determining of an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data includes: Slicing the three-dimensional point cloud model in layers to obtain an inter-layer topological relationship diagram; Mapping and transforming the features of adjacent layers according to the inter-layer topological relationship diagram to obtain a first adjacent feature vector and a second adjacent feature vector; Obtaining an inter-layer disparity weight map according to a preset correlation calculation formula, the first adjacent eigenvector, and the second adjacent eigenvector; Marking areas in the inter-layer disparity weight map where weight values ​​are preset to a threshold value, to obtain a potential misalignment candidate area map; Calculating color density distribution according to the color grid data, setting a 5×5 grid for the area where the color density distribution is greater than 0.8, and setting a 15×15 grid for the area where the color density distribution is less than 0.3, to obtain a multi-scale grid layout diagram; Performing an overlap analysis based on the multi-scale grid layout map and the potential misalignment candidate region map, calculating displacements in the X, Y, and Z directions, and obtaining the disparity offset matrix; Regions in the parallax offset matrix where the displacement exceeds ±0.05 mm are marked to obtain the offset defect marking map.

4. The method for printing and correcting a three-dimensional scene according to claim 1, wherein: The performing two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector includes: Performing two-dimensional mapping on the multispectral texture map to obtain a self-view and a cross-view; Performing a one-dimensional projection transformation on the self-view and the cross-view respectively to obtain a first characteristic matrix and a second characteristic matrix; Generate a query vector and a key vector according to the first feature matrix, generate a value vector according to the second feature matrix, and obtain an attention operation input matrix; Obtaining an initial attention weight distribution map by calculating the matrix dot product of the query vector and the key vector; Performing weighted summation based on the initial attention weight distribution map and the value vector to obtain a linear attention feature map; Performing feedforward network optimization and layer normalization on the linear attention feature map, and performing a residual connection operation with the attention operation input matrix to obtain a non-local matching feature map; Perform pixel-level feature extraction on areas in the non-local matching feature map where the weight value is greater than 0.8, to obtain a dense matching relationship map; Performing LAB color space conversion according to the dense matching relationship graph, and calculating the color difference value between the self-view and the cross-view to obtain the LAB color space deviation vector; Region segmentation and heat mapping are performed according to the LAB color space deviation vector and a preset threshold to obtain the texture anomaly heat map.

5. The method for printing and correcting a three-dimensional scene according to claim 4, wherein: The weighted summation is performed based on the initial attention weight distribution map and the value vector to obtain a linear attention feature map, including: Perform omnidirectional sampling on the initial attention weight distribution map, set sampling windows according to 8 directions, and calculate the offset in each direction to obtain an omnidirectional offset parameter matrix; Remapping the value vector according to the horizontal offset and the vertical offset in the omnidirectional offset parameter matrix to obtain a corrected eigenvector; Calculating the correlation strength between the corrected feature vector and the initial attention weight distribution map to obtain a pixel-level attention weight map; Performing weighted accumulation on the corrected feature vectors according to the pixel-level attention weight map to obtain contextual aggregate features; A deformable window convolution operation is performed on the contextual aggregation feature, and feature fusion is performed with the pixel-level attention weight map to obtain the linear attention feature map.

6. The method for printing and correcting a three-dimensional scene according to claim 1, wherein: The step of inputting the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score includes: Performing feature combination on the disparity offset matrix and the offset defect annotation map, and performing regional statistical analysis to obtain a geometric defect feature vector; Performing multi-scale segmentation on the texture anomaly heat map, and calculating the regional anomaly degree in combination with the LAB color space deviation vector to obtain a texture defect feature vector; Constructing a decision tree node according to the geometric defect feature vector and the texture defect feature vector, and performing feature selection according to an information gain criterion to obtain a multi-layer decision rule set; Performing path probability calculation and confidence evaluation on the multi-layer decision rule set to obtain the root cause classification label; The print quality score is obtained by performing a weighted calculation based on the confidence evaluation result corresponding to the root cause classification label and a preset scoring rule.

7. The method for printing and correcting a three-dimensional scene according to claim 1, wherein: The method includes constructing a reinforcement learning model based on the root cause classification label and a preset historical printing parameter database, using the print quality score as a reward function of the reinforcement learning model, and outputting a printing correction plan, including: Performing cluster analysis on the printing parameters and corresponding root cause classification labels in the historical printing parameter database to obtain a parameter-label mapping matrix; Constructing a state space and an action space according to the parameter-label mapping matrix, and normalizing the print quality score to obtain a reward function mapping table; Performing a Monte Carlo tree search on the state space and the action space, and performing a strategy evaluation in combination with the reward function mapping table to obtain value network parameters; Performing strategy iteration and parameter optimization based on the value network parameters and the root cause classification labels to obtain an optimized action sequence; Parameter decoding and constraint mapping are performed on the optimized action sequence to obtain the correction amount of nozzle temperature, the correction amount of ink and the correction amount of printing speed.

8. A printing correction device for a three-dimensional scene, characterized in that: The three-dimensional scene printing correction device is used to execute the three-dimensional scene printing correction method according to any one of claims 1 to 7, and the three-dimensional scene printing correction device includes: The scenery scanning module is used to scan the 3D scenery and obtain the 3D point cloud model, color grid data and multispectral texture map; an offset determination module, configured to determine an offset defect annotation map and a parallax offset matrix based on the three-dimensional point cloud model and the color grid data; A texture analysis module, configured to perform two-dimensional mapping and global correlation calculation on the multispectral texture map to generate a texture anomaly heat map and a LAB color space deviation vector; A decision scoring module, configured to input the disparity offset matrix, the offset defect annotation map, the texture anomaly heat map, and the LAB color space deviation vector into a preset decision tree model to generate a root cause classification label and a print quality score; A result output module is used to construct a reinforcement learning model based on the root cause classification label and a preset historical printing parameter database, and use the print quality score as a reward function of the reinforcement learning model to output a printing correction plan.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the printing correction method for a three-dimensional scene according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the method for printing and correcting a three-dimensional scene according to any one of claims 1 to 7.

Citation Information

Cited By

  • Aluminum alloy surface oxidation spot defect identification method and device based on machine vision

    CN120894358A

  • A method and device for identifying aluminum alloy surface oxidation spot defects based on machine vision

    CN120894358B

  • Injection molding machine in-mold identification system based on visual identification

    CN120912597A

  • A vision-based in-mold recognition system for injection molding machines

    CN120912597B