Error compensation method of Z-type scanning system, Z-type scanning system and equipment

By constructing projection vectors from overlapping image regions in a Z-scanning system, calculating reference offsets, and performing error compensation, the problem of image stitching misalignment in a Z-scanning system is solved, achieving efficient and low-cost error suppression and image quality improvement.

CN121633141APending Publication Date: 2026-03-10RUIJIA MEDICAL TECHNOLOGY (NANTONG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The Z-scanning system suffers from mechanical backlash error, projection deformation caused by changes in scanning direction, and vibration interference during the scanning process. These factors result in misalignment and seams at the image stitching points, affecting imaging accuracy and the reliability of quantitative analysis.

Method used

By acquiring the overlapping area of ​​the current layer and the previous layer, a projection vector is constructed and a reference offset estimate is calculated to generate a reference offset range. The offset prediction is then used to compensate for image errors and suppress the accumulation of displacement errors in real time.

Benefits of technology

Real-time error compensation during Z-scanning was achieved, improving the spatial consistency of images and the reliability of quantitative analysis, while reducing system complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121633141A_ABST
    Figure CN121633141A_ABST
Patent Text Reader

Abstract

The invention discloses an error compensation method of a Z-type scanning system, the Z-type scanning system and equipment. The error compensation method comprises the following steps: acquiring a first direction image acquired by the Z-type scanning system when the Z-type scanning system moves from a current layer of an object to be scanned and a second direction image acquired by the Z-type scanning system when the Z-type scanning system moves from an upper layer of the object to be scanned; calculating an image overlapping area between the first direction image and the second direction image, and determining a first image overlapping area and a second image overlapping area according to the image overlapping area; calculating a reference offset estimation value according to a first projection vector constructed by using the first image overlapping region and a second projection vector constructed by using the second image overlapping region; and selecting an offset prediction quantity in a reference offset range corresponding to the reference offset estimation value, and performing error compensation on the first direction image by using the offset prediction quantity. According to the method, accumulation of displacement errors can be inhibited in real time in the process of scanning the object to be scanned by using the Z-type scanning system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of X-ray imaging technology, in particular to an error compensation method of a Z-type scanning system, a Z-type scanning system and equipment. BACKGROUND

[0002] In the field of X-ray imaging, the acquisition of large field of view images usually needs to be achieved by scanning multiple local images and splicing them. The traditional straight-line scanning splicing technology relies on high-precision mechanical motion control, and it is difficult to realize large-scale imaging due to the limitation of device travel. When a Z-type (reciprocal) scanning path is used, due to mechanical return error, projection deformation caused by scanning direction change, and vibration interference in dynamic scanning process, direct splicing will produce obvious misplacement and joints.

[0003] More specifically, the Z-type scanning mode faces multiple technical challenges in practical application: first, the position feedback of the driving system has inherent errors, and there is a deviation between the theoretical position information provided by the motor encoder and the actual mechanical position. This deviation presents a nonlinear cumulative characteristic in the reciprocating motion process. Second, the traction rope transmission system has obvious elastic deformation problem when changing direction. When the scanning direction changes, the non-uniform distribution of force on the traction rope will cause additional position drift of the system. Third, the reverse clearance of the mechanical transmission system will introduce periodic errors in the reciprocating motion. The relative position relationship between the detector and the X-ray source is not consistent when scanning in the forward and reverse directions, which causes a significant difference between the actual overlap area between adjacent scanning lines and the theoretical calculation value. These factors together cause the reconstructed image to have anatomical structure misplacement and gray level discontinuity at the splicing position, which seriously affects the imaging accuracy of the system.

[0004] The existing system mainly relies on the open-loop position feedback of the motor encoder for Z-type scanning control. Since the encoder does not have closed-loop error correction capability, the accumulated error cannot be effectively suppressed in repeated motion. In particular, in the Z-type scanning mode, as the number of scanning steps increases, the nonlinear error of the encoder increases in the middle section of the image, which can reach up to 1.5% of the theoretical position, seriously affecting the registration accuracy of the image and the reliability of quantitative analysis. SUMMARY

[0005] The present application aims to suppress the accumulation of displacement errors in real time during the scanning of the object to be scanned by the Z-type scanning system.

[0006] According to a first aspect, an error compensation method of a Z-type scanning system is provided in an embodiment, applied to a Z-type scanning system that scans an object to be scanned according to a reciprocating scanning path, the error compensation method comprising: acquire a first direction image collected when the Z-scan system moves from an initial position of a current layer of the object to be scanned to a terminal position of the current layer, and a second direction image collected when the Z-scan system moves from an initial position of a previous layer of the object to be scanned to a terminal position of the previous layer; wherein the initial position of the current layer and the terminal position of the previous layer are located on the same side; calculate an image overlap region between the first direction image and the second direction image according to geometric parameters of the Z-scan system, take a region in the first direction image coinciding with the image overlap region as a first image overlap region, and take a region in the second direction image coinciding with the image overlap region as a second image overlap region; construct a first projection vector according to the first image overlap region, construct a second projection vector according to the second image overlap region, and calculate a reference offset estimation value between the first direction image and the second direction image according to the first projection vector and the second projection vector; generate a corresponding reference offset range based on the reference offset estimation value; wherein the reference offset range includes a plurality of offset predictors; perform error compensation on the first direction image by using an offset predictor in the reference offset range to obtain an error-compensated first direction image.

[0007] In some embodiments, calculating a reference offset estimation value between the first direction image and the second direction image according to the first projection vector and the second projection vector includes: calculating a cross-correlation coefficient between the first projection vector and the second projection vector, and calculating the reference offset estimation value between the first direction image and the second direction image according to the cross-correlation coefficient and a preset offset estimation value calculation formula.

[0008] In some embodiments, performing error compensation on the first direction image by using an offset predictor in the reference offset range to obtain an error-compensated first direction image includes: selecting a plurality of offset predictors in the reference offset range, and for each selected offset predictor, translating the first projection vector by using the offset predictor to obtain a plurality of translated first projection vectors; calculating a normalized error between each translated first projection vector and the second projection vector, respectively; performing error compensation on the first direction image by using an offset predictor corresponding to a smallest normalized error to obtain an error-compensated first direction image.

[0009] In some embodiments, the step of translating the first projection vector using the selected offset prediction to obtain multiple translated first projection vectors for each selected offset prediction includes: For each selected offset prediction, the first projection vector is translated along the scanning direction of the Z-scanning system by the offset prediction, so that the first projection vector is aligned with the second projection vector, resulting in multiple translated first projection vectors.

[0010] In some embodiments, calculating the normalization error between each of the translated first projection vector and the second projection vector includes: The normalization error between the translated first projection vector and the second projection vector is calculated based on the preset normalization error calculation formula, the translated first projection vector, and the second projection vector; the expression of the normalization error calculation formula is: ; Where cost(dx) is the normalization error, dx is the offset prediction, valid represents the overlapping area between the translated first projection vector and the second projection vector, and N valid The number of pixels in the overlapping region is represented by data2_crop, which represents the second projection vector, and data1_crop is the number of pixels in the overlapping region. adj This represents the first projection vector after the translation.

[0011] In some embodiments, constructing the first projection vector based on the first image overlapping region includes: The pixel values ​​of each row in the overlapping region of the first image are accumulated along the y-direction to obtain the first projection vector.

[0012] In some embodiments, the error compensation method further includes: The error-compensated first-direction image and the second-direction image are stitched together, or the image is reconstructed based on the error-compensated first-direction image and the second-direction image to obtain the corrected scan image.

[0013] According to a second aspect, one embodiment provides a Z-type scanning system, including a scanning platform, a mechanical motion unit, an optical imaging unit, and an image processing unit; The scanning platform is used to scan the object to be scanned; The mechanical motion unit is used to drive the scanning platform to move along a Z-shaped path; The optical imaging unit is used to acquire optical information on the object to be scanned, and obtain a first direction image and a second direction image; wherein, the first direction image is the image acquired by the Z-shaped scanning system when it moves from the initial position of the current layer of the object to be scanned to the final position of the current layer, and the second direction image is the image acquired by the Z-shaped scanning system when it moves from the initial position of the previous layer of the object to be scanned to the final position of the previous layer, and the initial position of the current layer and the final position of the previous layer are located on the same side; The image processing unit is used to perform error compensation on the first direction image using the error compensation method and the second direction image to obtain the error-compensated first direction image.

[0014] According to a third aspect, one embodiment provides an error compensation device for a Z-scanning system, comprising: Memory, used to store programs; A processor is configured to implement the error compensation method by executing a program stored in the memory.

[0015] According to a fourth aspect, one embodiment provides a computer program product including a computer program and / or instructions, which, when executed by a processor, implement the error compensation method.

[0016] According to the error compensation method, Z-scanning system, Z-scanning system error compensation device, and computer program product of the Z-scanning system described in the above embodiments, a first-direction image is acquired when the Z-scanning system moves from the initial position of the current layer of the object to be scanned to the final position of the current layer, and a second-direction image is acquired when the Z-scanning system moves from the initial position of the previous layer of the object to be scanned to the final position of the previous layer. The image overlap region between the first-direction image and the second-direction image is calculated. The region in the first-direction image that overlaps with the image overlap region is taken as the first image overlap region, and the region in the second-direction image that overlaps with the image overlap region is taken as the second image overlap region. The system constructs a first projection vector based on the overlapping region of the first image and a second projection vector based on the overlapping region of the second image. A reference offset estimate between the first and second direction images is calculated using these two projection vectors. A reference offset range is generated based on this estimate, and the offset prediction within this range is used to compensate for errors in the first direction image, resulting in an error-compensated first direction image. The overlapping regions of the first and second images are used as registration references, and the reference offset estimate between them is calculated based on their corresponding projection vectors. This eliminates the need for dedicated calibration phantoms or markers. Simultaneously, during the scanning process of the Z-scanning system, the first and second direction images are acquired in real-time, and error compensation is performed on the first direction image to prevent error accumulation without additional delay. This real-time suppression of displacement error accumulation during scanning improves the efficiency of error compensation. Attached Figure Description

[0017] Figure 1 This is a flowchart of the error compensation method for the Z-scanning system in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of a Z-type scanning system in one embodiment; Figure 3 This is a schematic diagram of the overlapping area of ​​the first image in one embodiment; Figure 4 This is a schematic diagram of the overlapping area of ​​the second image in one embodiment; Figure 5 This is a schematic diagram of the difference diagram in one embodiment; Figure 6 This is a schematic diagram of the overlapping area of ​​the first image in another embodiment; Figure 7 This is a schematic diagram of the overlapping area of ​​the second image in another embodiment; Figure 8 This is a schematic diagram of the difference diagram in another embodiment; Figure 9This is a flowchart illustrating how to perform error compensation on a first-direction image using an offset prediction within a reference offset range in one embodiment, thereby obtaining an error-compensated first-direction image. Figure 10 This is a scanned image before correction in one embodiment; Figure 11 This is a corrected scanned image in one embodiment; Figure 12 This is a schematic diagram of the structure of a Z-type scanning system in one embodiment. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.

[0019] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.

[0020] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).

[0021] Existing Z-scanning systems generally use open-loop encoder feedback to control the platform position. During reciprocating motion, due to factors such as mechanical backlash, motion lag, and inconsistencies in actuators, positional errors gradually accumulate during scanning, resulting in distortion in the image. This error cannot be detected or fed back by the encoder itself, and the system lacks self-correction capabilities, severely impacting image stitching accuracy, subsequent quantitative analysis, and the system's clinical / engineering application value. To address displacement error, some systems employ closed-loop controlled high-precision linear motors or interferometers. However, these solutions are not only expensive and complex, but also suffer from accuracy degradation after structural aging, failing to guarantee high-precision scanning over the long term. In other words, errors cannot be completely eliminated under extreme conditions or after system aging. Furthermore, introducing such high-end actuators places higher demands on the overall structure and control system, increasing debugging and maintenance difficulty. Traditional image-based error compensation methods typically require manually placed markers or dedicated calibration phantoms for position identification and alignment, increasing the user's workload and making real-time, automatic error tracking and correction difficult.

[0022] To suppress the accumulation of displacement errors in real time during the scanning process of an object using a Z-scanning system, this application provides an error compensation method for a Z-scanning system. The Z-scanning system scans the object according to a reciprocating scanning path. The error compensation method acquires a first-direction image when the Z-scanning system moves from the initial position of the current layer of the object to the final position of the current layer, and a second-direction image when the Z-scanning system moves from the initial position of the previous layer of the object to the final position of the previous layer; wherein the initial position of the current layer and the final position of the previous layer are on the same side; the first direction is calculated based on the geometric parameters of the Z-scanning system. The image overlap region between the first image and the second image is defined as follows: the region in the first image that overlaps with the first image overlap region is defined as the first image overlap region, and the region in the second image that overlaps with the second image overlap region is defined as the second image overlap region. A first projection vector is constructed based on the first image overlap region, and a second projection vector is constructed based on the second image overlap region. A reference offset estimate between the first image and the second image is calculated based on the first and second projection vectors. A corresponding reference offset range is generated based on the reference offset estimate. The reference offset range includes multiple offset predictions. Error compensation is performed on the first image using the offset predictions in the reference offset range to obtain an error-compensated first image.

[0023] The error compensation method of the Z-scanning system provided in the embodiments of this application is described below with reference to the accompanying drawings.

[0024] Figure 1A flowchart of an error compensation method for a Z-scanning system provided in an embodiment of this application is shown, which will be described in detail below.

[0025] Step S10: Acquire the first direction image captured by the Z-scanning system when it moves from the initial position of the current layer of the object to be scanned to the final position of the current layer, and the second direction image captured by the Z-scanning system when it moves from the initial position of the previous layer of the object to be scanned to the final position of the previous layer.

[0026] Specifically, the Z-scanning system scans the object to be scanned using a reciprocating scanning path. That is, when scanning the current layer of the object, the Z-scanning system moves along the X-direction from its initial position to its final position within the current layer, acquiring a first-direction image during this scanning process. When scanning the layer above the object, the Z-scanning system also moves along the X-direction, but in the opposite direction to the scanning in the current layer, acquiring a second-direction image. In other words, it acquires a second-direction image during the scanning process from the initial position to the final position of the layer above the object. The initial position of the current layer and the final position of the previous layer are located on the same side. For the scanning of the object by the Z-scanning system, bilinear interpolation can be performed based on the motor position of the Z-scanning system and the projection values ​​on the detector to obtain the first-direction and second-direction images. It is worth noting that the layer above the object refers to the layer where the Z-scanning system was located during the previous scan. Positionally, the layer above the object may be above or below the current layer.

[0027] In this embodiment, a Z-shaped scanning system scans the object to be scanned along a reciprocating scanning path, enabling the acquisition of two images—a first-direction image and a second-direction image—within a single scanning cycle, thereby improving scanning efficiency. Specifically, when using the Z-shaped scanning system to scan the object along the reciprocating scanning path, a single scanning cycle is defined as the scanning process from the initial position in the current layer of the object to the current position, and the scanning process from the initial position in the layer above the object to the current position.

[0028] Step S20: Calculate the image overlap region between the first direction image and the second direction image based on the geometric structure parameters of the Z-scanning system. Take the region in the first direction image that coincides with the image overlap region as the first image overlap region, and take the region in the second direction image that coincides with the image overlap region as the second image overlap region.

[0029] Specifically, since the Z-scanning system acquires a certain image overlap region between the first and second direction images when scanning adjacent layers of the object, the image overlap region between the first and second direction images is calculated based on the geometric parameters of the Z-scanning system. The region in the first direction image that overlaps with the image overlap region is designated as the first image overlap region, and the region in the second direction image that overlaps with the image overlap region is designated as the second image overlap region. The first image overlap region is the top region of the first direction image, and the second image overlap region is the bottom region of the second direction image.

[0030] For example, please refer to Figure 2 The geometric parameters of the Z-scanning system include the detector imaging field of view (DW), the vertical distance from the X-ray tube to the imaging plane (SO), the vertical distance from the imaging plane to the detector (OD), and the distance the Z-scanning system travels in the y-direction between the current layer and the next layer (SW). Image overlap area. Detector overlap area The detector overlap region (DO) can compensate for mechanical errors. During the actual operation of the Z-scanning system, factors such as mechanical vibration and transmission errors can cause the scanning path to deviate. The detector overlap region (DO) ensures that the critical parts of the object to be scanned are captured by the detector, improving the system's stability and reliability. Furthermore, to ensure that the Z-scanning system does not miss any scans, it is also required that… .

[0031] In this embodiment, by identifying the overlapping regions of the first and second images, the overlapping regions of the first and second images can be used as registration references during subsequent error compensation, without the need for a dedicated calibration phantom or marker point.

[0032] Step S30: Construct a first projection vector based on the overlapping region of the first image, construct a second projection vector based on the overlapping region of the second image, and calculate the reference offset estimate between the first direction image and the second direction image based on the first projection vector and the second projection vector.

[0033] Specifically, the pixel values ​​of each row in the overlapping region of the first image are accumulated along the y-direction to obtain the first projection vector, and the pixel values ​​of each row in the overlapping region of the second image are accumulated along the y-direction to obtain the second projection vector. The cross-correlation coefficient between the first projection vector and the second projection vector is calculated, and the reference offset estimate between the first direction image and the second direction image is calculated according to the cross-correlation coefficient and the preset offset estimate calculation formula.

[0034] For example, the first projection vector Second projection vector Where n represents the number of pixels in the y direction, overlap represents the overlapping area of ​​the image, and the cross-correlation coefficient corr = correlate(data1_crop, data2_crop) is used. The preset offset estimate is calculated as initial_guess = argmax(corr) - len(data2_crop) + 1, where argmax(corr) represents the index position corresponding to the maximum value in the cross-correlation coefficient array corr, and len(data2_crop) represents the length of the second projection vector.

[0035] In this embodiment, a cross-correlation coarse estimation and optimization search method are combined to register the overlapping regions of the first image and the second image, and calculate the reference offset estimate between the first direction image and the second direction image. The reference offset estimate is the optimized initial value, which can accelerate convergence.

[0036] Step S40: Generate the corresponding reference offset range based on the reference offset estimate.

[0037] Specifically, the reference offset estimate can be used as the center, and the range radius can be determined based on the error distribution such as Gaussian noise or mechanical backflash error. Multiple offset predictions can be sampled uniformly or non-uniformly within the range to generate the reference offset range.

[0038] For example, a relatively large reference offset range can be set, which is [-20, 20].

[0039] In this embodiment, a reference offset range containing multiple offset predictions is generated based on the reference offset estimate, which can improve the robustness of the system, optimize the correction accuracy, and support adaptive selection of offset predictions to adjust the image.

[0040] Step S50: Use the offset prediction in the reference offset range to perform error compensation on the first direction image to obtain the error-compensated first direction image.

[0041] Specifically, since the reference offset range includes multiple offset predictions, multiple offset predictions can be selected in the reference offset range according to the actual optimization requirements. For each selected offset prediction, the first projection vector is translated using the offset prediction to obtain multiple translated first projection vectors. The final selected offset prediction is determined based on the normalization error between each translated first projection vector and the second projection vector. The first direction image is translated by the final selected offset prediction to obtain the error-compensated first direction image.

[0042] In this embodiment of the application, during the real-time scanning process, error compensation is performed on the first direction image based on the finally selected offset prediction amount, which enables dynamic offset adjustment of the first direction image and achieves improved accuracy.

[0043] Please refer to Figures 3-5 In some embodiments, Figure 3 Indicates the overlapping area of ​​the first image. Figure 4 Indicates the overlapping region of the second image. Figure 5 This represents a difference map between the overlapping regions of the first and second images. The difference map may be generated due to mechanical system factors, optical system factors, or factors inherent to the object itself.

[0044] Please refer to Figures 6-8 In some embodiments, Figure 6 Indicates the overlapping area of ​​the first image. Figure 7 Indicates the overlapping region of the second image. Figure 8 This represents the difference between the overlapping regions of the first and second images.

[0045] In some embodiments, after constructing the first and second projection vectors, the two vectors can be standardized to improve the robustness of the algorithm under different scanning intensity conditions. The standardization process includes first calculating the mean and standard deviation of the projection vectors, then removing the mean from the projection vectors and dividing by the standard deviation.

[0046] Please refer to Figure 9 In some embodiments, step S50: using the offset prediction in the reference offset range to perform error compensation on the first direction image to obtain the error-compensated first direction image, including steps S51 to S53, which are described in detail below.

[0047] Step S51: Select multiple offset predictions within the reference offset range. For each selected offset prediction, use the offset prediction to translate the first projection vector to obtain multiple translated first projection vectors.

[0048] Specifically, for each selected offset prediction, the first projection vector is shifted along the scanning direction of the Z-scanning system by the offset prediction to align the first projection vector with the second projection vector, resulting in multiple shifted first projection vectors. Within the reference offset range [-max_offset, max_offset], local optimization methods, such as Powell's Conjugate Direction Method (Powell's method) and Limited-Memory Broyden-Fletcher-Goldfarb-Shanno with BoxConstraints (L-BFGS-B), are used to optimize and search for the offset prediction, thus obtaining multiple offset predictions.

[0049] For example, the end of the first projection vector is offset to the right compared to the end of the second projection vector. That is, the first and second projection vectors are not perfectly aligned, but there is a certain error. Therefore, the first projection vector is shifted by the predicted amount along the scanning direction (i.e., to the left) of the Z-scanning system to align the first and second projection vectors, eliminate the error, and obtain multiple shifted first projection vectors.

[0050] Step S52: Calculate the normalization error between the first and second projection vectors after each translation.

[0051] Specifically, the normalized error between the first and second projected vectors after translation is calculated based on a preset normalized error calculation formula, the first projected vector, and the second projected vector after translation. The normalized error calculation formula is used to evaluate the consistency between two data segments under different offset predictions. To ensure integer alignment, the offset predictions are rounded to the nearest integer in each iteration of optimization.

[0052] The expression for the normalized error calculation formula is: ; Where cost(dx) is the normalization error, dx is the offset prediction, valid represents the overlap region between the first and second projection vectors after translation, and N valid The data represents the number of pixels in the overlapping region, data2_crop represents the second projection vector, and data1_crop represents the second projection vector. adj This represents the first projection vector after translation.

[0053] In some embodiments, taking into account the boundary effects caused by the offset, the normalization error calculation formula is limited to the overlapping region between the translated first projection vector and the second projection vector, and invalid data outside the overlapping region is filtered out.

[0054] Step S53: Use the offset prediction corresponding to the minimum normalization error to perform error compensation on the first direction image to obtain the error-compensated first direction image.

[0055] Specifically, the minimum normalization error indicates that the first projection vector after translation using the offset prediction is closest to the second projection vector, and the two projection vectors have a small error in alignment. Therefore, the offset prediction corresponding to the minimum normalization error can be used to compensate for the error in the first direction image, resulting in the first direction image after error compensation.

[0056] In some embodiments, the error compensation method further includes: stitching together the error-compensated first-direction image and the second-direction image, or performing image reconstruction based on the error-compensated first-direction image and the second-direction image to obtain a corrected scan image.

[0057] Specifically, during image stitching or reconstruction, error compensation is performed on the first-direction image based on the offset prediction to obtain an error-compensated first-direction image. Accuracy is improved through error compensation. The error-compensated first-direction image and the second-direction image are then stitched together or reconstructed to obtain the corrected scanned image. Please refer to [reference needed]. Figure 10 and Figure 11 , Figure 10 The scanned image before correction. Figure 11 This is the corrected scanned image.

[0058] Because the errors of Z-scanning systems are affected by various nonlinear factors, including motor drive fluctuations, guide rail wear, and ambient temperature changes, these errors are unstable and uncertain, making it difficult for existing static error models to effectively adapt to dynamic changes. During Z-scanning, there is a natural overlap between the preceding and following scanned images. This application fully utilizes this area, employing image registration algorithms (such as phase correlation, mutual information, or feature point matching) to obtain the actual offset between each round trip in real time, dynamically reflecting the current system error. Based on the estimated actual offset, the system dynamically corrects the image position during image acquisition, ensuring that the final stitched or reconstructed image position is highly consistent with the physical space, effectively improving image quality and analysis accuracy. The error compensation method for a Z-scanning system according to this application does not rely on additional hardware structures or expensive sensors; it can suppress the accumulation of displacement errors in real time during the scanning process solely through algorithms. The above error compensation method has the following advantages: (1) Low cost and high precision: It does not rely on expensive linear motors or laser interferometers, the system hardware cost is low, and the accuracy of image position error control is greatly improved; (2) Strong real-time performance: The algorithm has high computational efficiency and can complete error estimation and image correction in real time during the acquisition process without additional delay; (3) Strong versatility: It is applicable to various Z-scanning systems, including bone densitometers, industrial CT, medical SPECT / PET and other equipment, and has good portability and scalability; (4) Adaptability: The system can automatically adjust parameters according to the error characteristics of different equipment, different usage cycles, and different temperature and humidity environments without manual calibration. In summary, the embodiments of this application effectively solve the problem of encoder error accumulation in the Z-scanning process while maintaining the simplicity of system hardware and controllable cost, and improve the spatial consistency of the image and the credibility of subsequent analysis, which has innovation and practical application value.

[0059] Please refer to Figure 12 This application also provides a Z-type scanning system, including a scanning platform 10, a mechanical motion unit 20, an optical imaging unit 30, and an image processing unit 40, which will be described in detail below.

[0060] The scanning platform 10 is used to scan the object to be scanned.

[0061] The mechanical motion unit 20 is used to drive the scanning platform to move along a Z-shaped path.

[0062] The optical imaging unit 30 is used to acquire optical information on the object to be scanned and obtain a first direction image and a second direction image. The first direction image is the image acquired by the Z-type scanning system when it moves from the initial position of the current layer of the object to the final position of the current layer. The second direction image is the image acquired by the Z-type scanning system when it moves from the initial position of the previous layer of the object to the final position of the previous layer. The initial position of the current layer and the final position of the previous layer are located on the same side.

[0063] The image processing unit 40 is used to perform error compensation on the first direction image using an error compensation method and a second direction image to obtain an error-compensated first direction image.

[0064] In some embodiments, the error compensation method includes: The system acquires a first-direction image when the Z-scanning system moves from the initial position of the current layer of the object to be scanned to the final position of the current layer, and a second-direction image when the Z-scanning system moves from the initial position of the previous layer of the object to be scanned to the final position of the previous layer; wherein the initial position of the current layer and the final position of the previous layer are located on the same side. The image overlap region between the first direction image and the second direction image is calculated based on the geometric parameters of the Z-scanning system. The region in the first direction image that coincides with the image overlap region is taken as the first image overlap region. The region in the second direction image that coincides with the image overlap region is taken as the second image overlap region. A first projection vector is constructed based on the overlapping region of the first image, a second projection vector is constructed based on the overlapping region of the second image, and a reference offset estimate between the first direction image and the second direction image is calculated based on the first projection vector and the second projection vector. A corresponding reference offset range is generated based on the reference offset estimate; wherein, the reference offset range includes multiple offset predictions; The first direction image is compensated for error by using the offset prediction in the reference offset range to obtain the first direction image after error compensation.

[0065] This application provides an error compensation device for a Z-scanning system, comprising: Memory, used to store programs; A processor is used to implement error compensation methods by executing programs stored in memory.

[0066] This application provides a computer program product, including a computer program and / or instructions, which implement an error compensation method when executed by a processor.

[0067] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.

[0068] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.

Claims

1. A method for error compensation of a Z-scan system, applied to a Z-scan system, the Z-scan system performing scanning on a to-be-scanned object according to a reciprocating scanning path, characterized in that, The error compensation method comprises: acquiring a first direction image collected when the Z-shaped scanning system moves from an initial position of a current layer of the object to be scanned to a termination position of the current layer, and a second direction image collected when the Z-shaped scanning system moves from an initial position of a previous layer of the object to be scanned to a termination position of the previous layer; wherein the initial position of the current layer and the termination position of the previous layer are located on the same side; calculating an image overlap region between the first direction image and the second direction image according to geometric structure parameters of the Z-shaped scanning system, taking a region in the first direction image coinciding with the image overlap region as a first image overlap region, and taking a region in the second direction image coinciding with the image overlap region as a second image overlap region; constructing a first projection vector according to the first image overlap region, constructing a second projection vector according to the second image overlap region, and calculating a reference offset estimation value between the first direction image and the second direction image according to the first projection vector and the second projection vector; generating a corresponding reference offset range based on the reference offset estimation value; wherein the reference offset range comprises a plurality of offset prediction values; performing error compensation on the first direction image by using the offset prediction values in the reference offset range to obtain an error-compensated first direction image.

2. The error compensation method of claim 1, wherein, The calculation of the reference offset estimation value between the first direction image and the second direction image according to the first projection vector and the second projection vector comprises: calculating a cross-correlation coefficient between the first projection vector and the second projection vector, and calculating the reference offset estimation value between the first direction image and the second direction image according to the cross-correlation coefficient and a preset offset estimation value calculation formula.

3. The error compensation method of claim 1, wherein, The error compensation on the first direction image by using the offset prediction values in the reference offset range to obtain an error-compensated first direction image comprises: selecting a plurality of offset prediction values in the reference offset range, and for each selected offset prediction value, translating the first projection vector by using the offset prediction value to obtain a plurality of translated first projection vectors; calculating a normalized error between each translated first projection vector and the second projection vector, respectively; performing error compensation on the first direction image by using the offset prediction value corresponding to the smallest normalized error to obtain an error-compensated first direction image.

4. The error compensation method of claim 3, wherein, The translation of the first projection vector by using the offset prediction value to obtain a plurality of translated first projection vectors comprises: for each selected offset prediction value, translating the first projection vector along a scanning direction of the Z-shaped scanning system by the offset prediction value to align the first projection vector with the second projection vector, thereby obtaining a plurality of translated first projection vectors.

5. The error compensation method of claim 3, wherein, The calculation of the normalized error between each translated first projection vector and the second projection vector comprises: According to a preset normalization error calculation formula, the first translation projection vector and the second projection vector, a normalized error between the first translation projection vector and the second projection vector is calculated; the expression of the normalization error calculation formula is: ; wherein cost(dx) is a normalized error, dx is the offset prediction, valid indicates an overlapping region between the translated first projection vector and the second projection vector, N valid represents a number of pixels of the overlapping region, data2_crop represents the second projection vector, data1_crop adj represents the translated first projection vector.

6. The error compensation method of claim 1, wherein, The first projection vector is constructed according to the first image overlap region, comprising: Accumulate each row of pixel values of the first image overlap region along the y direction to obtain the first projection vector.

7. The error compensation method of claim 1, wherein, The error compensation method further comprises: Splicing the error compensated first direction image and the second direction image, or performing image reconstruction according to the error compensated first direction image and the second direction image to obtain a corrected scanning image.

8. A Z-scan system characterized by, It comprises a scanning platform, a mechanical motion unit, an optical imaging unit and an image processing unit. The scanning platform is used for scanning the object to be scanned. The mechanical motion unit is used for driving the scanning platform to move along a Z-shaped path. The optical imaging unit is used for collecting optical information on the object to be scanned to obtain a first direction image and a second direction image; wherein the first direction image is an image collected by the Z-shaped scanning system when moving from an initial position of a current layer of the object to be scanned to a terminal position of the current layer, the second direction image is an image collected by the Z-shaped scanning system when moving from an initial position of a previous layer of the object to be scanned to a terminal position of the previous layer, and the initial position of the current layer and the terminal position of the previous layer are located on the same side. The image processing unit is used for error compensation of the first direction image by the error compensation method and the second direction image according to any one of claims 1-7, to obtain an error compensated first direction image.

9. An error compensation device for a Z-scan system, characterized by It comprises: A memory for storing programs; A processor for executing the programs stored in the memory to realize the error compensation method according to any one of claims 1-7.

10. A computer program product comprising computer programs and / or instructions, characterized in that, The computer program and / or instructions are executed by the processor to realize the error compensation method according to any one of claims 1-7. The computer program and / or instructions are executed by the processor to realize the error compensation method according to any one of claims 1-7.