High-precision scanning slice splicing method and device, computer equipment and storage medium

By performing multi-step correction and mapping processing on the images of the digital slice scanning system, the distortion and error problems during image stitching are solved, and the accuracy and quality of image stitching are significantly improved.

CN119863361APending Publication Date: 2025-04-22GUANGZHOU LBP MEDICINE SCI & TECH +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411920884.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing digital slice scanning system is prone to camera imaging distortion and scanning platform XY axis verticality error during image acquisition, resulting in patchwork during image stitching, affecting the quality of the final image.

Method used

By acquiring the sliced ​​image and generating the actual motor coordinates, image correction is performed, and calibration file data is generated; then distortion correction, CCD angle correction and platform correction are performed on the actual acquired image to ensure that the image has no distortion and corners before stitching; the corrected image is mapped onto the virtual canvas, the theoretical position is calculated and offset is performed, and the stitching process is performed.

Benefits of technology

It effectively solves the cumulative error problem caused by image edge distortion and discretization of stitching position, significantly improves the accuracy and quality of image stitching, and ensures that the final generated slicing image has extremely high definition and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863361A_ABST
    Figure CN119863361A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of high-precision scanning, in particular to a high-precision scanning slice splicing method and device, computer equipment and a storage medium, and the high-precision scanning slice splicing method comprises the steps: obtaining a slice collection image, generating and obtaining an actual motor coordinate from the slice collection image, correcting the slice acquisition image according to the actual motor coordinate to obtain calibration file data; acquiring an actual acquisition image, and correcting the actual acquisition image through the calibration file data to obtain a to-be-spliced image; mapping the to-be-spliced images to a preset virtual canvas, and obtaining pixel coordinates of each to-be-spliced image on the virtual canvas; and calculating a theoretical position of each to-be-spliced image on the virtual canvas according to the pixel coordinates, shifting each to-be-spliced image according to the theoretical position, and splicing the to-be-spliced images to obtain a slice image. The method has the effect of improving the quality of the final image of the high-precision slice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of high-precision scanning, and in particular to a high-precision scanning slice stitching method, device, computer equipment and storage medium. Background Art

[0002] At present, the digital slice scanning system is mainly composed of two parts: hardware and software. The hardware part includes high-precision digital microscope, scanning platform, high-performance computer, etc., while the software part includes scanning control software, image browsing software and image analysis software.

[0003] The working principle of the existing digital slice scanning system is to use a digital microscope to scan and collect images of glass slices frame by frame under a high-power objective lens. The microscopic scanning platform will automatically scan and move along the XY axis of the slice and automatically focus in the Z axis. The scanning control software will use program-controlled scanning to collect high-resolution digital images based on the effective magnification of the optical magnification device. Subsequently, the embedded image compression and storage software will seamlessly splice the collected images to generate a complete, fully layered digital slice image (WSI).

[0004] The above-mentioned prior art solutions have the following defects: Area array cameras will produce distortion in the process of acquiring digital images, especially at the edges of the image. If the distortion of the left and right edges of two adjacent images is inconsistent, then seams will be produced during stitching, affecting the quality of the final image. Summary of the invention

[0005] In order to improve the quality of the final image of high-precision slices, the present application provides a high-precision scan slice stitching method, device, computer equipment and storage medium.

[0006] The above-mentioned invention objective of the present application is achieved through the following technical solutions: A high-precision scanning slice stitching method, the high-precision scanning slice stitching method comprising: Acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; Acquire an actually acquired image, and perform correction processing on the actually acquired image using the calibration file data to obtain an image to be stitched; Mapping the images to be stitched onto a preset virtual canvas, and obtaining pixel coordinates of each image to be stitched on the virtual canvas; The theoretical position of each image to be spliced ​​on the virtual canvas is calculated according to the pixel coordinates, and after each image to be spliced ​​is offset according to the theoretical position, the images to be spliced ​​are spliced ​​to obtain a slice image.

[0007] By adopting the above technical solution, first, the process of obtaining the slice acquisition image and generating the actual motor coordinates ensures the initial correction basis of the image. Specifically, by calculating the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image, and then using the reference mark camera to obtain the actual position coordinates of these mark points, the positioning error of each mark point is calculated. This process not only corrects the camera imaging distortion, but also compensates for the XY axis verticality error of the scanning platform, thereby generating an accurate calibration file data. This step effectively solves the image distortion problem caused by camera imaging distortion and platform verticality error, and improves the accuracy of subsequent image processing. Secondly, the actual acquisition image is obtained and corrected by the calibration file data, which further improves the image quality. By performing distortion correction, CCD corner correction and platform correction on the actual acquisition image, it is ensured that each image is in a distortion-free and corner-free state before splicing. This not only reduces the distortion of the image edge, but also eliminates the nonlinear error caused by platform movement, so that each image can maintain a high degree of consistency and accuracy when splicing. Next, the corrected images to be stitched are mapped to a preset virtual canvas, and the pixel coordinates of each image to be stitched on the virtual canvas are obtained. This process ensures the precise position of the image during stitching by matching the actual physical position of each image with the theoretical position on the virtual canvas. Specifically, the actual physical position of each image to be stitched is obtained according to the actual motor coordinates, and then the image is mapped to the virtual canvas according to the FOV size and the actual physical position. This mapping method not only avoids the stitching error caused by pixel discretization, but also ensures that the position of the image on the virtual canvas is more accurate. Finally, the theoretical position of each image to be stitched is calculated according to its pixel coordinates on the virtual canvas, and each image to be stitched is offset according to the theoretical position, and then stitched to obtain a high-quality slice image. Specifically, by calculating the theoretical position of each image to be stitched on the virtual canvas and adjusting the pixel coordinates of the image to the integer value closest to the theoretical position, the cumulative error caused by pixel discretization is eliminated. This process not only ensures the high precision of image stitching, but also avoids image distortion caused by cumulative errors, so that the final generated slice image has extremely high clarity and consistency. In summary, the high-precision scanning slice stitching method of the present invention effectively solves the problem of cumulative errors caused by image edge distortion and discretization of stitching positions through multiple steps of correction and mapping, and significantly improves the accuracy and quality of image stitching. This technical solution is not only suitable for high-precision slice scanning systems, but can also be widely used in other fields that require high-precision image stitching, and has important application value and prospects.

[0008] In a preferred example, the present application can be further configured as follows: the acquisition of the slice acquisition image, the generation of the actual motor coordinates from the slice acquisition image, and the calibration file data after correcting the slice acquisition image according to the actual motor coordinates, specifically including: Calculate the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image; Move the fiducial mark camera to each mark point respectively, and obtain the actual position coordinates of each mark point based on the mechanical coordinate system through the fiducial mark camera; The positioning error of each marking point is calculated according to the theoretical position coordinates and the actual position coordinates, and the actual motor coordinates are obtained according to the positioning error.

[0009] By adopting the above technical solution, the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system are first calculated from the slice acquisition image. This process ensures that the position of each mark point has high accuracy, providing a reliable basis for subsequent correction and splicing. Next, the reference mark camera is moved to each mark point respectively, and the actual position coordinates of each mark point based on the mechanical coordinate system are obtained through the reference mark camera. This step verifies the accuracy of the theoretical position coordinates by actual measurement and provides a basis for further error analysis. Subsequently, the positioning error of each mark point is calculated based on the theoretical position coordinates and the actual position coordinates. The calculation of the positioning error is the core link of the entire correction process. By comparing the theoretical position and the actual position of each mark point, the error value of each mark point can be accurately determined. These error values ​​reflect various deviations that may occur in the actual operation of the system, such as the unevenness of mechanical movement, the accuracy limit of the sensor, etc. Through these error values, the performance of the system can be further optimized and the accuracy of image correction can be improved. Finally, the actual motor coordinates are obtained according to the positioning error. This process quantifies the error between the theoretical position coordinates and the actual position coordinates, and adjusts the motor coordinates to make the actual position of each marker closer to its theoretical position. This adjustment not only improves the accuracy of image correction, but also reduces image distortion caused by mechanical errors, thereby ensuring that the final slice image has higher quality and reliability.

[0010] In a preferred example, the present application may be further configured as follows: mapping the images to be stitched onto a preset virtual canvas, and obtaining the pixel coordinates of each image to be stitched on the virtual canvas, specifically includes: Acquire the actual physical position of each of the images to be stitched according to the actual motor coordinates; The FOV size corresponding to each of the images to be stitched is obtained, and the images to be stitched are mapped onto the virtual canvas according to the FOV size and the actual physical position.

[0011] By adopting the above technical solution, the accuracy and stability of high-precision scanning slice stitching can be significantly improved. Specifically, first, the actual physical position of each image to be stitched is obtained through the actual motor coordinates. This process ensures that the initial position of each image on the virtual canvas is determined based on the real physical position. The importance of this step lies in that traditional image stitching methods often rely on the relative position relationship between images for stitching, while ignoring the influence of the actual physical position, resulting in the stitching result being prone to cumulative errors. By introducing the correction of the actual physical position, this cumulative error can be effectively reduced and the overall accuracy of stitching can be improved. Secondly, the FOV size corresponding to each image to be stitched is obtained. FOV (Field of View) is the size of the field of view, which is an important parameter that determines the space occupied by the image on the virtual canvas. Different FOVs will cause the proportion and position of the image on the virtual canvas to be different. Therefore, accurately obtaining the FOV size of each image is crucial for subsequent mapping and stitching. By accurately measuring and recording the FOV size of each image, it can be ensured that the position and size of each image on the virtual canvas are as expected, further improving the accuracy of stitching. Then, the images to be stitched are mapped onto the virtual canvas according to the FOV size and the actual physical position. This process involves complex mathematical calculations and geometric transformations. Specifically, it is necessary to first determine the approximate position of each image on the virtual canvas according to the actual physical position, and then fine-tune the specific position of each image according to the FOV size. To achieve this, linear interpolation or other advanced interpolation methods can be used to ensure that the position of each image on the virtual canvas is as close to its real physical position as possible. In this way, the accumulated error caused by the discretization of the image stitching position can be effectively eliminated, making the final stitched slice image smoother and more natural. In addition, through the use of the virtual canvas, the global optimization and adjustment of the image can be conveniently performed. As a virtual space, the virtual canvas can accommodate multiple images, and the position of each image on the virtual canvas can be flexibly adjusted. This means that even if there are slight errors in the stitching process, these errors can be corrected by adjusting the position on the virtual canvas, thereby ensuring that the final stitching result achieves the best effect. This method not only improves the stitching accuracy, but also greatly simplifies the debugging and optimization work during the stitching process.

[0012] In a preferred example, the present application may be further configured as follows: the calculating of the theoretical position of each of the images to be stitched on the virtual canvas according to the pixel coordinates specifically includes: Obtaining a mapping position range of each image to be stitched according to the FOV size; The theoretical position of each of the images to be stitched is obtained from the mapping position range.

[0013] By adopting the above technical solution, the mapping position range of each image to be stitched is first obtained according to the FOV size. This process ensures that the position of each image on the virtual canvas has a clear boundary, thereby providing a basis for subsequent precise positioning. Specifically, it includes: first, according to the FOV size of each image in the actual scanning process, its initial position on the virtual canvas is determined. The FOV size determines the coverage of the image on the virtual canvas. By accurately measuring the FOV size, it can be ensured that the position of each image on the virtual canvas is accurate. Then, the mapping position range of each image on the virtual canvas is calculated according to the FOV size. This range includes the starting and ending coordinates of the image on the virtual canvas, ensuring that the position of the image on the virtual canvas is continuous. By calculating the mapping position range, it can be ensured that each image will not have gaps or overlaps during the stitching process. Then, the theoretical position of each image is obtained from the mapping position range. This process involves calculating the precise coordinates of each image to ensure that its position on the virtual canvas is optimal. By mapping the coordinates of each image to the closest theoretical position, the error caused by pixel discretization can be minimized and the overall accuracy of image stitching can be improved. Finally, the actual position of each image is fine-tuned according to the theoretical position. This process ensures that the position of each image on the virtual canvas is as close as possible to its theoretical position, thereby eliminating the accumulated error caused by pixel discretization. Through this fine-tuning, it can be ensured that the final stitched image is visually continuous and has no obvious stitching seams, which improves the overall quality of the image.

[0014] In a preferred example, the present application may be further configured as follows: after offsetting each of the images to be stitched according to the theoretical position, the images to be stitched are stitched to obtain a slice image, specifically including: Obtaining an image offset direction, and obtaining the closest integer value corresponding to each theoretical position according to the image offset direction; After each of the images to be stitched is offset according to the closest integer value, the slice image is obtained.

[0015] By adopting the above technical solution, the theoretical position of each image to be stitched on the virtual canvas can be accurately determined, thereby achieving accurate stitching of the image. Specifically, after obtaining the theoretical position of each image to be stitched, it is first necessary to determine the offset direction of the image. This process is achieved by comparing the theoretical position of each image to be stitched on the virtual canvas with its actual position. Since the actual position is usually converted from the motor coordinates, and there is a certain error in the motor coordinates, there may be a certain deviation between the actual position and the theoretical position. In order to reduce this deviation, it is necessary to calculate the closest integer value corresponding to each theoretical position. This step is achieved by finding integer coordinate points near the theoretical position. This process ensures that the position of each image to be stitched on the virtual canvas is as close to the real physical position as possible, thereby reducing the cumulative error caused by the discretization of coordinates. Next, each image to be stitched is offset according to these closest integer values. The direction and amplitude of the offset depend on the difference between the theoretical position and the actual position. In this way, each image to be stitched is accurately placed on the virtual canvas, ensuring the accuracy of image stitching. During the whole stitching process, each image to be stitched is finely adjusted through the above steps, effectively eliminating the cumulative error caused by coordinate discretization. This error is very common in traditional image stitching methods, especially when stitching a large number of images. Even if the error of a single image is very small, the accumulation will lead to significant visual deviation. In the present invention, by accurately mapping the theoretical position of each image to be stitched onto the virtual canvas and fine-tuning it, the high quality and high precision of the final stitched image are ensured.

[0016] The second object of the invention is achieved by the following technical solutions: A high-precision scanning slice splicing device, the high-precision scanning slice splicing device comprising: A calibration file acquisition module is used to acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; An image correction module is used to obtain an actual collected image, and to perform correction processing on the actual collected image using the calibration file data to obtain an image to be stitched; An image mapping module, used for mapping the images to be stitched onto a preset virtual canvas, and obtaining pixel coordinates of each image to be stitched on the virtual canvas; The image stitching module is used to calculate the theoretical position of each image to be stitched on the virtual canvas according to the pixel coordinates, offset each image to be stitched according to the theoretical position, and then stitch the images to be stitched to obtain a slice image.

[0017] By adopting the above technical solution, first, the process of obtaining the slice acquisition image and generating the actual motor coordinates ensures the initial correction basis of the image. Specifically, by calculating the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image, and then using the reference mark camera to obtain the actual position coordinates of these mark points, the positioning error of each mark point is calculated. This process not only corrects the camera imaging distortion, but also compensates for the XY axis verticality error of the scanning platform, thereby generating an accurate calibration file data. This step effectively solves the image distortion problem caused by camera imaging distortion and platform verticality error, and improves the accuracy of subsequent image processing. Secondly, the actual acquisition image is obtained and corrected by the calibration file data, which further improves the image quality. By performing distortion correction, CCD corner correction and platform correction on the actual acquisition image, it is ensured that each image is in a distortion-free and corner-free state before splicing. This not only reduces the distortion of the image edge, but also eliminates the nonlinear error caused by platform movement, so that each image can maintain a high degree of consistency and accuracy when splicing. Next, the corrected images to be stitched are mapped to a preset virtual canvas, and the pixel coordinates of each image to be stitched on the virtual canvas are obtained. This process ensures the precise position of the image during stitching by matching the actual physical position of each image with the theoretical position on the virtual canvas. Specifically, the actual physical position of each image to be stitched is obtained according to the actual motor coordinates, and then the image is mapped to the virtual canvas according to the FOV size and the actual physical position. This mapping method not only avoids the stitching error caused by pixel discretization, but also ensures that the position of the image on the virtual canvas is more accurate. Finally, the theoretical position of each image to be stitched is calculated according to its pixel coordinates on the virtual canvas, and each image to be stitched is offset according to the theoretical position, and then stitched to obtain a high-quality slice image. Specifically, by calculating the theoretical position of each image to be stitched on the virtual canvas and adjusting the pixel coordinates of the image to the integer value closest to the theoretical position, the cumulative error caused by pixel discretization is eliminated. This process not only ensures the high precision of image stitching, but also avoids image distortion caused by cumulative errors, so that the final generated slice image has extremely high clarity and consistency. In summary, the high-precision scanning slice stitching method of the present invention effectively solves the problem of cumulative errors caused by image edge distortion and discretization of stitching positions through multiple steps of correction and mapping, and significantly improves the accuracy and quality of image stitching. This technical solution is not only suitable for high-precision slice scanning systems, but can also be widely used in other fields that require high-precision image stitching, and has important application value and prospects.

[0018] The third objective of the present application is achieved through the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned high-precision scanning slice stitching method when executing the computer program.

[0019] The fourth objective of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned high-precision scanning slice stitching method.

[0020] In summary, the present application includes at least one of the following beneficial technical effects: 1. The slice acquisition image is corrected through the calibration file, eliminating the camera imaging distortion, CCD rotation angle error and the verticality error of the scanning platform XY axis, significantly improving the edge quality and overall consistency of the image, and solving the problem of inaccurate stitching caused by image edge distortion in the existing technology; 2. Map the images to be stitched onto a preset virtual canvas. By calculating the theoretical position of each image and making fine adjustments, the cumulative error caused by the discretization of the image stitching position is effectively eliminated, ensuring the high quality and continuity of the stitched image. 3. The entire method process realizes full automation from image acquisition, correction to stitching, which improves the ease of operation and work efficiency of the system, while ensuring the high precision of each step and improving the reliability and stability of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flow chart of a high-precision scanning slice stitching method in one embodiment of the present application; Figure 2 is a schematic diagram of image calibration in one embodiment of the present application; Figure 3 This is a flowchart for implementing step S10 of the method for high-precision scanning slice stitching in one embodiment of the present application; Figure 4 is a schematic diagram of compensating XY axis position and nonlinear errors in one embodiment of the present application; Figure 5 This is a flowchart for implementing step S30 of the method for high-precision scanning slice stitching in one embodiment of the present application; Figure 6 This is a flowchart for implementing step S40 of the method for high-precision scanning slice stitching in one embodiment of the present application; Figure 7 is a schematic diagram of image stitching in one embodiment of the present application; Figure 8This is another implementation flow chart of step S40 of the method for high-precision scanning slice stitching in one embodiment of the present application; Fig. 9 This is a principle block diagram of a high-precision scanning slice stitching system in one embodiment of the present application; Fig.10 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The present application is further described in detail below in conjunction with the accompanying drawings.

[0023] In one embodiment, if Figure 1 As shown, the present application discloses a high-precision scanning slice stitching method, which specifically includes the following steps: S10: Acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and correct the slice acquisition image according to the actual motor coordinates to obtain calibration file data.

[0024] In this embodiment, the slice acquisition image refers to a CCD image used to remove image distortion when generating a calibration file. The calibration file data refers to file data used to calibrate the actually acquired image.

[0025] Specifically, before stitching the images, in order to eliminate image distortion, XY axis position deviation, and nonlinear error, a standard calibration slice is first obtained to calibrate the slice acquisition image, that is, the CCD image, to remove the corresponding image distortion. Figure 2 , and rotation correction is performed on the slice acquisition image, including the use of high-precision calibration slice acquisition image, keeping the Y axis unchanged and moving the X axis. The images acquired by the straight line on the correction piece at different x positions should be connected into a straight line, and the camera rotation calibration can be performed according to the straight line angle; as well as the compensation of XY axis position and nonlinear error, including the nonlinear error of the platform is different at different positions, which can be calculated separately at each position, and the interpolation method uses linear interpolation to obtain the actual motor coordinates and obtain the corresponding calibration file data.

[0026] S20: Acquire the actual collected image, and perform correction processing on the actual collected image through calibration file data to obtain the image to be stitched.

[0027] Specifically, after obtaining the calibration file and correcting the XY axis position and the compensation of the nonlinear error, the glass slice is actually scanned and imaged through a high-power objective lens, and each slice image collected by the high-power objective lens is used as the actual collected image. Further, in order to remove the slice distortion of each actual collected image, the actual collected image is corrected by the calibration file generated in step S10, so that the image to be spliced ​​is obtained by removing the distortion, correcting the XY axis position, and compensating for the nonlinear error.

[0028] S30: Mapping the images to be stitched onto a preset virtual canvas, and obtaining pixel coordinates of each image to be stitched on the virtual canvas.

[0029] Specifically, in order to be closer to the actual physical position of each image when stitching the images to be stitched so as to eliminate the cumulative stitching error, a virtualized desktop, i.e., a virtual canvas, is constructed isomorphically, each image to be stitched is mapped onto the virtual canvas, and the coordinate position of each image to be stitched on the virtual canvas is obtained as the pixel coordinate.

[0030] S40: Calculate the theoretical position of each image to be spliced ​​on the virtual canvas according to the pixel coordinates, offset each image to be spliced ​​according to the theoretical position, and then splice the images to be spliced ​​to obtain a slice image.

[0031] Specifically, according to the pixel coordinates of each image to be stitched, the theoretical position of the corresponding image to be stitched on the virtual canvas is calculated, and each image to be stitched is offset according to a preset rule, and then each image to be stitched is processed, so that the image obtained after stitching is used as a slice image, so that the slice image eliminates image distortion, XY axis position correction, nonlinear error compensation and stitching error elimination before stitching.

[0032] In this embodiment, first, the process of acquiring the slice acquisition image and generating the actual motor coordinates ensures the initial correction basis of the image. Specifically, by calculating the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image, and then using the reference mark camera to obtain the actual position coordinates of these mark points, the positioning error of each mark point is calculated. This process not only corrects the camera imaging distortion, but also compensates for the XY axis verticality error of the scanning platform, thereby generating an accurate calibration file data. This step effectively solves the image distortion problem caused by camera imaging distortion and platform verticality error, and improves the accuracy of subsequent image processing. Secondly, the actual acquisition image is acquired and corrected by the calibration file data, which further improves the image quality. By performing distortion correction, CCD corner correction and platform correction on the actual acquisition image, it is ensured that each image is in a distortion-free and corner-free state before splicing. This not only reduces the distortion of the image edge, but also eliminates the nonlinear error caused by platform movement, so that each image can maintain a high degree of consistency and accuracy when splicing. Next, the corrected images to be stitched are mapped to a preset virtual canvas, and the pixel coordinates of each image to be stitched on the virtual canvas are obtained. This process ensures the precise position of the image during stitching by matching the actual physical position of each image with the theoretical position on the virtual canvas. Specifically, the actual physical position of each image to be stitched is obtained according to the actual motor coordinates, and then the image is mapped to the virtual canvas according to the FOV size and the actual physical position. This mapping method not only avoids the stitching error caused by pixel discretization, but also ensures that the position of the image on the virtual canvas is more accurate. Finally, the theoretical position of each image to be stitched is calculated according to its pixel coordinates on the virtual canvas, and each image to be stitched is offset according to the theoretical position, and then stitched to obtain a high-quality slice image. Specifically, by calculating the theoretical position of each image to be stitched on the virtual canvas and adjusting the pixel coordinates of the image to the integer value closest to the theoretical position, the cumulative error caused by pixel discretization is eliminated. This process not only ensures the high precision of image stitching, but also avoids image distortion caused by cumulative errors, so that the final generated slice image has extremely high clarity and consistency. In summary, the high-precision scanning slice stitching method of the present invention effectively solves the problem of cumulative errors caused by image edge distortion and discretization of stitching positions through multiple steps of correction and mapping, and significantly improves the accuracy and quality of image stitching. This technical solution is not only suitable for high-precision slice scanning systems, but can also be widely used in other fields that require high-precision image stitching, and has important application value and prospects.

[0033] In one embodiment, if Figure 3As shown, in step S10, a slice acquisition image is acquired, actual motor coordinates are generated from the slice acquisition image, and the slice acquisition image is corrected according to the actual motor coordinates to obtain calibration file data, which specifically includes: S11: Calculating the theoretical position coordinates of each marking point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image.

[0034] S12: Move the reference mark camera to each mark point respectively, and obtain the actual position coordinates of each mark point based on the mechanical coordinate system through the reference mark camera.

[0035] S13: Calculate the positioning error of each marking point according to the theoretical position coordinates and the actual position coordinates, and obtain the actual motor coordinates according to the positioning error.

[0036] Specifically, refer to Figure 4 , the actual physical coordinates of the starting point are (Dx0, Dy0), and the corresponding motor coordinates are P0 (x0, y0). The grid contains fixed actual physical interval sampling points. Assuming that the actual physical intervals of the sampling points are all d, the motor coordinates of the four sampling points adjacent to P0 are P1 (x1, y1), P2 (x2, y2), and P3 (x3, y3). Then, for any point P in the middle of the above four points, assuming that the actual physical coordinates are (Dxp, Dyp), the actual motor coordinates can be calculated using bilinear interpolation as follows: Px = x0 + (x1-x0)*(Dxp-Dx0) / d * (d-(Dyp-Dy0)) / d + (x3-x2)*(Dxp-Dx2) / d * (Dyp-Dy0) / d; Py = y0 + (y2-y0)*(Dyp-Dy0) / d * (d-(Dxp-Dx0)) / d + (y3-y1)*(Dyp-Dy1) / d * (Dxp-Dx0) / d; Similarly, the motor coordinates of all points on the plane can be calculated based on the actual motor coordinates of all sampling points.

[0037] In one embodiment, if Figure 5 As shown, in step S30, the images to be stitched are mapped onto a preset virtual canvas, and the pixel coordinates of each image to be stitched on the virtual canvas are obtained, which specifically includes: S31: Acquire the actual physical position of each image to be stitched according to the actual motor coordinates.

[0038] Specifically, the corrected actual motor coordinates are used to obtain the degree of motor movement when capturing each image to be stitched, thereby obtaining the actual physical position of each image to be stitched.

[0039] S32: Obtain the FOV size corresponding to each image to be stitched, and map the image to be stitched onto the virtual canvas according to the FOV size and the actual physical position.

[0040] Specifically, according to the shooting capability of the high-power microscope used to capture the images to be stitched, the FOV (Field of view) size corresponding to each image to be stitched is obtained. Further, according to the FOV size, the images to be stitched are arranged equidistantly and mapped onto the virtual canvas.

[0041] In one embodiment, if Figure 6 As shown, in step S40, the theoretical position of each image to be stitched on the virtual canvas is calculated according to the pixel coordinates, which specifically includes: S41: Obtaining a mapping position range of each image to be stitched according to the FOV size.

[0042] Specifically, since each image to be stitched is arranged equidistantly, the mapping position range of each image to be stitched on the virtual canvas is calculated according to the fixed pixel width of the FOV size. Figure 7 , assuming that there are a total of 8 images to be stitched, the physical width of each image is 1mm, and the corresponding motor positions are P1-P8. Assume that the fixed pixel width of each FOV is calculated to be 1000.5 pixels, and the pixel starting position of the first image is 0. Because the stitching coordinates are usually only accurate to integers, the mapping position range from the second image may be 1000 or 1001. Similarly, the mapping position range of the third image may be 2000-2002. In turn, the mapping position range of the eighth image may be 7000-7007. Considering that there may be errors in the actual motor movement, the starting position of the pixel calculated after the actual image stitching needs to float 2-8 pixels of movement error on the above basis.

[0043] S42: Obtaining the theoretical position of each image to be stitched from the mapping position range.

[0044] Specifically, by mapping the images to be stitched onto the virtual canvas, the median of the mapping position range corresponding to each image to be stitched can be used as the theoretical position. For example, the theoretical position of the third image is 2001, and the theoretical position of the eighth image is 7003.5.

[0045] In one embodiment, if Figure 8 As shown, in step S40, after each image to be stitched is offset according to the theoretical position, the images to be stitched are stitched to obtain a slice image, which specifically includes: S43: Obtain the image offset direction, and obtain the closest integer value corresponding to each theoretical position according to the image offset direction.

[0046] Specifically, according to the arrangement order of each image to be stitched, the direction toward the first image to be stitched is determined as the image direction, and each stitched pixel position obtained is offset by 1 pixel toward the theoretical position to make it closer to the theoretical position. Figure 7 , round the actual splicing pixel position of the third image to an integer closer to 2001, and round the actual splicing pixel position of the eighth image to an integer closer to 7003.5.

[0047] S44: After offsetting each image to be stitched according to the closest integer value, a slice image is obtained.

[0048] Specifically, after each image to be stitched is offset accordingly, an image composed of all the images to be stitched is used as the slice image.

[0049] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0050] In one embodiment, a high-precision scanning slice stitching device is provided, and the high-precision scanning slice stitching device corresponds to the high-precision scanning slice stitching method in the above embodiment. Fig. 9 As shown, the high-precision scanning slice stitching device includes a calibration file acquisition module, an image correction module, an image mapping module and an image stitching module. The detailed description of each functional module is as follows: A calibration file acquisition module is used to acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; An image correction module is used to obtain the actual collected image, and perform correction processing on the actual collected image through calibration file data to obtain the image to be stitched; An image mapping module is used to map the images to be stitched onto a preset virtual canvas and obtain the pixel coordinates of each image to be stitched on the virtual canvas; The image stitching module is used to calculate the theoretical position of each image to be stitched on the virtual canvas according to the pixel coordinates, offset each image to be stitched according to the theoretical position, and then stitch the images to be stitched to obtain a slice image.

[0051] Optionally, the calibration file acquisition module includes: Theoretical coordinate acquisition submodule, used to calculate the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image; The actual coordinate acquisition submodule is used to move the reference mark camera to each mark point respectively, and obtain the actual position coordinates of each mark point based on the mechanical coordinate system through the reference mark camera; The motor coordinate acquisition submodule is used to calculate the positioning error of each marking point based on the theoretical position coordinates and the actual position coordinates, and obtain the actual motor coordinates based on the positioning error.

[0052] Optionally, the image map module includes: A physical position acquisition submodule, used to acquire the actual physical position of each image to be stitched according to the actual motor coordinates; The image mapping submodule is used to obtain the FOV size corresponding to each image to be stitched, and map the image to be stitched onto the virtual canvas according to the FOV size and the actual physical position.

[0053] Optionally, the image stitching module includes: A mapping range acquisition submodule is used to obtain the mapping position range of each image to be stitched according to the FOV size; The theoretical position acquisition submodule is used to obtain the theoretical position of each image to be stitched from the mapping position range.

[0054] Optionally, the image stitching module includes: An image shift submodule is used to obtain an image shift direction, and obtain the nearest integer value corresponding to each theoretical position according to the image shift direction; The image stitching submodule is used to obtain a slice image after shifting each image to be stitched according to the nearest integer value.

[0055] For the specific definition of the high-precision scanning slice stitching device, please refer to the definition of the high-precision scanning slice stitching method above, which will not be repeated here. Each module in the above-mentioned high-precision scanning slice stitching device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0056] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a high-precision scanning slice stitching method is implemented.

[0057] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; Acquire the actual collected image, and perform correction processing on the actual collected image through calibration file data to obtain the image to be stitched; Mapping the images to be stitched onto a preset virtual canvas, and obtaining the pixel coordinates of each image to be stitched on the virtual canvas; The theoretical position of each image to be spliced ​​on the virtual canvas is calculated according to the pixel coordinates, and after each image to be spliced ​​is offset according to the theoretical position, the images to be spliced ​​are spliced ​​to obtain a slice image.

[0058] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; Acquire the actual collected image, and perform correction processing on the actual collected image through calibration file data to obtain the image to be stitched; Mapping the images to be stitched onto a preset virtual canvas, and obtaining the pixel coordinates of each image to be stitched on the virtual canvas; The theoretical position of each image to be spliced ​​on the virtual canvas is calculated according to the pixel coordinates, and after each image to be spliced ​​is offset according to the theoretical position, the images to be spliced ​​are spliced ​​to obtain a slice image.

[0059] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0060] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0061] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A high-precision scanning slice stitching method, characterized in that: The high-precision scanning slice stitching method comprises: Acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; Acquire an actually acquired image, and perform correction processing on the actually acquired image using the calibration file data to obtain an image to be stitched; Mapping the images to be stitched onto a preset virtual canvas, and obtaining pixel coordinates of each image to be stitched on the virtual canvas; The theoretical position of each image to be spliced ​​on the virtual canvas is calculated according to the pixel coordinates, and after each image to be spliced ​​is offset according to the theoretical position, the images to be spliced ​​are spliced ​​to obtain a slice image.

2. The high-precision scanning slice stitching method according to claim 1, characterized in that: The step of acquiring a slice acquisition image, generating actual motor coordinates from the slice acquisition image, and correcting the slice acquisition image according to the actual motor coordinates to obtain calibration file data specifically includes: Calculate the theoretical position coordinates of each mark point in the preset XY platform based on the mechanical coordinate system from the slice acquisition image; Move the fiducial mark camera to each mark point respectively, and obtain the actual position coordinates of each mark point based on the mechanical coordinate system through the fiducial mark camera; The positioning error of each marking point is calculated according to the theoretical position coordinates and the actual position coordinates, and the actual motor coordinates are obtained according to the positioning error.

3. The high-precision scanning slice stitching method according to claim 1, characterized in that: Mapping the images to be stitched onto a preset virtual canvas and obtaining pixel coordinates of each image to be stitched on the virtual canvas specifically includes: Acquire the actual physical position of each of the images to be stitched according to the actual motor coordinates; The FOV size corresponding to each of the images to be stitched is obtained, and the images to be stitched are mapped onto the virtual canvas according to the FOV size and the actual physical position.

4. The high-precision scanning slice stitching method according to claim 3, characterized in that: Calculating the theoretical position of each of the images to be stitched on the virtual canvas according to the pixel coordinates specifically includes: Obtaining a mapping position range of each image to be stitched according to the FOV size; The theoretical position of each of the images to be stitched is obtained from the mapping position range.

5. The high-precision scanning slice stitching method according to claim 4, characterized in that: After offsetting each of the images to be stitched according to the theoretical position, stitching the images to be stitched to obtain a slice image specifically includes: Obtaining an image offset direction, and obtaining the closest integer value corresponding to each theoretical position according to the image offset direction; After each of the images to be stitched is offset according to the closest integer value, the slice image is obtained.

6. A high-precision scanning slice splicing device, characterized in that: The high-precision scanning slice splicing device comprises: A calibration file acquisition module is used to acquire a slice acquisition image, generate and acquire actual motor coordinates from the slice acquisition image, and obtain calibration file data after correcting the slice acquisition image according to the actual motor coordinates; An image correction module is used to obtain an actual collected image, and to perform correction processing on the actual collected image using the calibration file data to obtain an image to be stitched; An image mapping module, used for mapping the images to be stitched onto a preset virtual canvas, and obtaining pixel coordinates of each image to be stitched on the virtual canvas; The image stitching module is used to calculate the theoretical position of each image to be stitched on the virtual canvas according to the pixel coordinates, offset each image to be stitched according to the theoretical position, and then stitch the images to be stitched to obtain a slice image.

7. The high-precision scanning slice splicing device according to claim 6, characterized in that: The calibration file acquisition module includes: A theoretical coordinate acquisition submodule, used for calculating the theoretical position coordinates of each mark point in a preset XY platform based on a mechanical coordinate system from the slice acquisition image; The actual coordinate acquisition submodule is used to move the reference mark camera to each mark point respectively, and obtain the actual position coordinates of each mark point based on the mechanical coordinate system through the reference mark camera; The motor coordinate acquisition submodule is used to calculate the positioning error of each marking point according to the theoretical position coordinates and the actual position coordinates, and to acquire the actual motor coordinates according to the positioning error.

8. The high-precision scanning slice stitching device according to claim 6, characterized in that: The image mapping module comprises: A physical position acquisition submodule, used for acquiring the actual physical position of each of the images to be stitched according to the actual motor coordinates; The image mapping submodule is used to obtain the FOV size corresponding to each of the images to be stitched, and map the images to be stitched onto the virtual canvas according to the FOV size and the actual physical position.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the high-precision scanning slice stitching method as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the high-precision scanning slice stitching method as claimed in any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • Method and device for aligning continuous slice images of scanning transmission electron microscope and electronic equipment

    CN121033109A