Image splicing method and system based on priori knowledge and spanning tree

By aligning and stitching pathological slice images based on prior knowledge and spanning tree, the problems of large stitching error and slow processing speed in the existing technology are solved, and efficient and robust image stitching effect is achieved, suitable for large-scale high-resolution Real-time stitching of pathological images.

CN119130790APending Publication Date: 2024-12-13上海隶创科技有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410995304.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the image stitching method is sensitive to rotation, scaling and deformation, has poor robustness, high computing resources consumption, and slow processing speed. It cannot meet the real-time stitching requirements of large-scale high-resolution pathological images, and has high requirements for initial alignment. The splicing error is large.

Method used

Using a priori knowledge and spanning tree-based image stitching method, by obtaining the grid position and coverage area of ​​the pathological slice image as priori knowledge, aligning adjacent images using an enhanced phase correlation algorithm, and filtering low-quality with normalized cross-correlation algorithm Align, spanning the tree to stitch the image blocks to form a complete pathological slice image.

Benefits of technology

The processing speed of image stitching is improved, the stitching error is reduced, the robustness of rotation, scaling and deformation is enhanced, the requirements for initial alignment are reduced, and efficient large-scale high-resolution pathological image stitching is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119130790A_ABST
    Figure CN119130790A_ABST
Patent Text Reader

Abstract

The invention provides an image splicing method and system based on priori knowledge and a spanning tree. The method comprises the following steps: obtaining a plurality of pathological section images to be spliced shot by a digital pathological scanner; taking the grid position and the coverage area of the image as priori knowledge; aligning adjacent pathological section images by using an enhanced phase correlation algorithm according to the priori knowledge; discarding low-quality adjacent image alignment by using a normalized cross-correlation algorithm so as to segment the aligned complete image into a plurality of disconnected image blocks; a spanning tree process is executed in each image block, after a spanning tree corresponding to each image block is obtained according to a result of the spanning tree, multiple spanning trees are spliced, and a complete pathological section image is obtained according to a splicing result; the method has the advantages that the splicing error is small under the condition that the processing speed is high, and the influence of micro rotation of the camera on the image position can be effectively dealt with.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image splicing, and in particular to an image splicing method and system based on prior knowledge and a spanning tree. Background Art

[0002] With the advancement of medical technology, digital pathology has become an important tool for modern pathological diagnosis. Digital pathology uses high-resolution scanning equipment to convert pathological sections into digital images, and doctors can use computers to perform detailed analysis and diagnosis on these images. In digital pathology, in order to obtain a complete pathological section image, it is usually necessary to stitch multiple high-resolution images. These images often cover different areas of the entire section, so they must be combined into a complete image through stitching technology. The quality of image stitching is highly dependent on the extraction and matching of image features.

[0003] At present, many stitching algorithms rely on image features in the spatial domain for matching and stitching; however, the spatial domain jigsaw method has some inherent defects. First, the spatial domain method is very sensitive to image rotation, scaling and deformation, which are difficult to avoid in actual operations. Therefore, the existing spatial domain jigsaw method has poor robustness to these deformations and is prone to stitching errors. Second, the spatial domain method usually requires a lot of computing resources and has a slow processing speed, which cannot meet the real-time stitching requirements of large-scale high-resolution pathological images. Since the resolution of pathological images is very high, the amount of calculation in the stitching process is very large and the processing speed is very slow, which seriously affects the efficiency of real-time diagnosis and analysis. Third, the spatial domain jigsaw has high requirements for the initial alignment of the image. If the initial alignment error is large, the stitching effect will be significantly reduced. Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an image stitching method and system based on prior knowledge and a spanning tree, so as to solve the problems of large image stitching error and slow processing speed in the prior art.

[0005] In order to achieve the above-mentioned purpose and other related purposes, the present invention provides the following technical solutions:

[0006] An image stitching method based on prior knowledge and a spanning tree comprises the following steps: obtaining a plurality of pathological slice images to be stitched taken by a digital pathology scanner, wherein the content of each of the pathological slice images to be stitched includes different regions of the entire pathological slice; after forming a grid of the plurality of pathological slice images to be stitched, determining the grid position of each pathological slice image and recording the coverage area between adjacent images, and using the grid position and coverage area of ​​the image as prior knowledge; aligning adjacent pathological slice images according to the prior knowledge and using an enhanced phase correlation algorithm;

[0007] The aligned pathological slice images are screened using a normalized cross-correlation algorithm, and low-quality adjacent image alignments are discarded based on the screening results, thereby dividing the aligned complete image into multiple unconnected blocks; a spanning tree process is performed in each of the blocks, and after a spanning tree corresponding to each block is obtained based on the results of the spanning tree, multiple spanning trees are spliced ​​to obtain a complete pathological slice image based on the splicing results.

[0008] An image stitching system based on prior knowledge and a spanning tree comprises: an acquisition module, used to acquire a plurality of pathological slice images to be stitched taken by a digital pathology scanner, wherein the content of each of the pathological slice images to be stitched includes different regions of the entire pathological slice; a determination module, used to form a grid of the plurality of pathological slice images to be stitched, determine the grid position of each pathological slice image and record the coverage area between adjacent images, and use the grid position and coverage area of ​​the image as prior knowledge;

[0009] An alignment and screening module is used to align adjacent pathological slice images according to the prior knowledge and using an enhanced phase correlation algorithm, and to screen the aligned pathological slice images using a normalized cross-correlation algorithm, and to discard low-quality adjacent image alignments based on the screening results, thereby dividing the aligned complete image into multiple unconnected blocks; a splicing module is used to execute a tree generation process in each of the blocks, and after obtaining a spanning tree corresponding to each block according to the results of the spanning tree, multiple spanning trees are spliced ​​to obtain a complete pathological slice image according to the splicing results.

[0010] An electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image stitching method based on prior knowledge and a spanning tree as described above.

[0011] In one embodiment of the present invention, after forming a grid of several pathological slice images to be spliced, the grid position of each pathological slice image is determined and the coverage area between adjacent images is recorded, and the grid position and coverage area of ​​the image are used as prior knowledge, including: after naming and forming a grid of several pathological slice images to be spliced ​​by scanning and shooting with a digital pathology scanner, recording them as initial grid positions, generating an initial spanning tree, and recording the coverage area between adjacent images at the same time, and using the grid position and coverage area of ​​the image as prior knowledge.

[0012] In one embodiment of the present invention, the alignment of adjacent pathological slice images based on prior knowledge and using an enhanced phase correlation algorithm includes: extracting the overlapping areas in each pair of adjacent images in the grid based on the prior knowledge, calculating the relative displacement between adjacent images using an enhanced phase correlation algorithm, and aligning the adjacent images based on the relative displacement.

[0013] In one embodiment of the present invention, the overlapping areas in each pair of adjacent images in the grid are extracted based on prior knowledge, and the relative displacement between adjacent images is calculated using an enhanced phase correlation algorithm, and the adjacent images are aligned based on the relative displacement, including: obtaining the maximum second-order partial derivative of the cross-correlation function of the two adjacent images in the frequency domain through iterative calculation, and deriving the relative displacement between adjacent images based on the maximum second-order partial derivative.

[0014] In one embodiment of the present invention, the iterative calculation obtains the maximum second-order partial derivative of the cross-correlation function of two adjacent images in the frequency domain, and the relative displacement between adjacent images is obtained according to the maximum second-order partial derivative, including: obtaining the relative displacement between adjacent images according to the following formula:

[0015] Among them, r fg (x0, y0) is the cross-correlation function of two adjacent images in the frequency domain; the image f(x, y) and the image to be aligned g(x, y), their corresponding Fourier transforms are F(u, v) and G(u, v) respectively; M and N are the image sizes; F(u, v) = DFT(f), G(u, v) = DFT(g), F * (u,v) and G * (u,v) are their conjugates respectively; is the second-order partial derivative of the cross-correlation function. The second-order partial derivative can be used to determine the concavity of the surface. When it is at its maximum, x0 is the most accurate offset distance.

[0016] In one embodiment of the present invention, the displacement of adjacent images is usually evaluated by calculating the X and Y directions. However, due to the characteristics of the linear motor, the motor repeatability in the Y direction meets the approximate linear relationship of the fitting, so it is not necessary to calculate each time. Because it is a high-throughput stitching, 4 segments are evenly selected in the X direction to calculate the offset in the Y direction. The middle value of each offset is taken, and a straight line is fitted at the 4 points. According to the slope, the images are aligned according to the offset in the X direction.

[0017] In one embodiment of the present invention, the normalized cross-correlation algorithm is used to screen the aligned pathological slice images, and low-quality adjacent image alignments are discarded according to the screening results, thereby dividing the aligned complete image into multiple unconnected blocks, including: discarding low-quality adjacent image alignments according to the following formula: Among them, A and B are two adjacent images A and B; A, and B, are the overlapping areas of image A and image B; and is the mean of the overlapping area; A i and B i is the value of a single pixel in the overlapping area.

[0018] In one embodiment of the present invention, the process of executing the spanning tree in each of the blocks, obtaining the spanning tree corresponding to each block according to the result of the spanning tree, splicing multiple spanning trees, and obtaining a complete pathological slice image according to the splicing result, includes: independently executing the spanning tree process for each block, obtaining the spanning tree corresponding to each block, directly walking from one image to another (starting from the starting point) along the edge and accumulating each pairwise alignment along the way to obtain the final corrected position, and finally splicing the multiple spanning trees according to the prior knowledge and relative displacement to obtain a complete pathological slice image.

[0019] As described above, the image stitching method and system based on prior knowledge and spanning tree of the present invention have the following beneficial effects: the present invention takes the grid position and coverage area of ​​the pathological slice image to be stitched as prior knowledge, uses the enhanced phase correlation algorithm to align adjacent pathological slice images, then uses the normalized cross-correlation algorithm to discard the low-quality adjacent image alignment, and finally uses the spanning tree to generate the position of each image, so as to achieve the purpose of large-scale batch stitching to generate complete digital pathological slices, thereby making the stitching error smaller under the condition of faster processing speed, and can effectively deal with the influence of slight rotation of the camera on the image position. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of an image stitching method based on prior knowledge and a spanning tree in a first embodiment of the present invention;

[0021] Figure 2 is a schematic diagram of an image stitching system based on prior knowledge and a spanning tree in a second embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of an electronic device in a third embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of an image grid formed according to the scanning and shooting method of a digital pathology scanner in the present invention;

[0024] Figure 5 is a schematic diagram of an ideal spanning tree in the present invention;

[0025] Figure 6 is a schematic diagram of the relative displacement that the images to be aligned in the present invention need to move;

[0026] Figure 7 It is a schematic diagram of the linear fitting of the Y-direction offset in the present invention;

[0027] Figure 8 is a schematic diagram of using the normalized cross-correlation algorithm to remove low-quality alignment in the present invention;

[0028] Fig. 9 It is a schematic diagram of generating multiple groups of spanning trees by multiple blocks in the present invention;

[0029] Fig.10 is a schematic diagram of splicing multiple spanning trees in the present invention;

[0030] Fig.11 The present invention corresponds to Figure 4 Schematic diagram of the complete pathological section image obtained after splicing;

[0031] Fig.12 It is a schematic diagram of performing straight-line linear fitting on all nodes in the row where the node is located in the process of splicing multiple spanning trees in the present invention. DETAILED DESCRIPTION

[0032] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0033] The first embodiment of the present invention relates to an image stitching method based on prior knowledge and a spanning tree, the process is as follows: Figure 1 As shown, the details are as follows:

[0034] Step 101: Acquire a plurality of pathological slice images to be spliced, which are taken by a digital pathology scanner.

[0035] Specifically, the contents of each of the pathological slice images to be spliced ​​include different regions of the entire pathological slice, and the contents of most of the pathological slice images to be spliced ​​have some similar regions.

[0036] Step 102, after forming a grid of several pathological slice images to be spliced, determine the grid position of each pathological slice image and record the coverage area between adjacent images, and use the grid position and coverage area of ​​the image as prior knowledge.

[0037] For more details, see Figure 4 , after naming and forming a grid for several pathological slice images to be spliced ​​by scanning and shooting with a digital pathology scanner, the initial grid position (the coordinates represented by the point in the upper left corner of the image) is recorded to generate an initial spanning tree. The specific steps are: starting from the first image, the spanning tree node is the geometric center of each image (the center point of the image), and the grid position of the image is the coordinate of the geometric center; at the same time, the coverage area between adjacent images is recorded, and the grid position and coverage area of ​​the image are used as prior knowledge. For an ideal spanning tree, please refer to Figure 5 .

[0038] Step 103: align adjacent pathological slice images based on prior knowledge and using an enhanced phase correlation algorithm.

[0039] Specifically, phase correlation is a fast, parameter-free method that can calculate image alignment with maximum cross-correlation, but it is only applicable to aligning images that are translated relative to each other in the X and Y directions. It cannot directly align images that are different due to rotation, scaling, tilt or non-affine transformation. This limitation is overcome by using an improved phase correlation algorithm; so for each pair of adjacent images in the grid, the overlapping areas in the adjacent images are extracted based on prior knowledge, and then the images are translated by using an enhanced phase method, so that the relative displacement between adjacent images can be obtained; and the present invention also uses a discrete Laplacian operator to pre-filter the input image to eliminate autocorrelation, thereby enhancing phase correlation.

[0040] More specifically, we first iteratively calculate the second-order partial derivative of the maximum cross-correlation function of two adjacent images in the frequency domain, and then obtain the relative displacement between adjacent images based on the maximum second-order partial derivative. Ideally, the overlapping areas are the same, that is, (x0, y0) is 0. Undesirably, the overlapping areas are different, and one of the two adjacent images needs to be moved toward the other image by (x0, y0). For details, please refer to Figure 6 ;

[0041] The relative displacement between adjacent images is obtained according to the following formula: Among them, r fg (x0, y0) is the cross-correlation function of two adjacent images in the frequency domain; the image f(x, y) and the image to be aligned g(x, y), their corresponding Fourier transforms are F(u, v) and G(u, v) respectively; M and N are the image sizes; F(u, v) = DFT(f), G(u, v) = DFT(g), F * (u,v) and G * (u,v) are their conjugates respectively; is the second-order partial derivative of the cross-correlation function. The second-order partial derivative can be used to determine the concavity of the surface. When it is at its maximum, x0 is the most accurate offset distance;

[0043] The improvement of the present invention is that: usually, the displacement of adjacent images needs to be calculated in the X and Y directions, but due to the characteristics of the linear motor, the motor repetition accuracy in the Y direction meets the fitting approximate linear relationship, so it is not necessary to calculate each time. Because it is a high-throughput stitching, 4 segments are evenly selected in the x direction to calculate the offset in the y direction, the middle value of each offset is taken, a straight line is fitted at the 4 points, and the images are aligned according to the slope and the offset in the x direction. For details, please refer to Figure 7 .

[0044] Step 104, using a normalized cross-correlation algorithm to screen the aligned pathological slice images, discarding low-quality adjacent image alignments based on the screening results, thereby segmenting the aligned complete image into multiple unconnected blocks.

[0045] Specifically, low-quality adjacent image alignments are discarded according to the following formula: Among them, A and B are two adjacent images A and B; A, and B, are the overlapping areas of image A and image B; and is the mean of the overlapping area; A i and B i is the value of a single pixel in the overlapping area; the negative logarithm of the NCC value is used, hereinafter referred to as ENCC. The present invention uses this ENCC threshold and prior knowledge to determine whether to discard low-quality adjacent image alignments. When low-quality alignments are discarded, the corresponding edges are deleted from the adjacent images; the present invention solves this problem by constructing a minimum spanning tree with ENCC values ​​as edge weights and only retaining alignments corresponding to the edges in the tree, so that redundant alignments can be discarded and the position of each image is clear, please refer to 8 for details.

[0046] Step 105, executing a spanning tree process in each image block, obtaining a spanning tree corresponding to each image block according to the spanning tree result, splicing multiple spanning trees, and obtaining a complete pathological slice image according to the splicing result.

[0047] Specifically, since the edge deletion process in the above steps may divide the aligned complete image into multiple unconnected blocks, in this embodiment, the blocks include at least two images, so the present invention independently performs the spanning tree process for each block; with this spanning tree, it is possible to directly walk along the edge from one image to another (starting from the starting point) and accumulate each pairwise alignment along the way to obtain the final corrected position, and finally combine the prior knowledge and relative displacement (deviation) to connect multiple spanning trees together to obtain a complete pathological slice image, please refer to 9, Fig.10 and Fig.11 .

[0048] More specifically, the process of executing the spanning tree in each tile is as follows: taking each image as a node, the geometric center position of the image represents the node position, shifting its geometric center by the offset, and then connecting it with the adjacent image according to the matching relationship; each tree starts from the image with the smallest center position coordinate value, and preferentially connects to the right side. If there is no image on the right side, the spanning tree is oriented downward, and the branch length is <2448 pixels;

[0049] The specific steps of stitching multiple spanning trees based on prior knowledge and offset to obtain a complete pathological slice image based on the stitching result are as follows: Prior knowledge records the initial position of each image. Because of the existence of poor matching, multiple trees or independent nodes may be generated. All nodes in the row where the node is located are linearly fitted, and then the independent node is placed in the position after fitting to obtain a complete pathological slice image. For details, please refer to Fig.12 .

[0050] The second embodiment of the present invention relates to an image stitching system based on prior knowledge and a spanning tree, see Figure 2 ,include:

[0051] An acquisition module, used for acquiring a plurality of pathological slice images to be spliced ​​taken by a digital pathology scanner, wherein the content of each pathological slice image to be spliced ​​includes different regions of the entire pathological slice;

[0052] A determination module, used to determine the grid position of each pathological slice image and record the coverage area between adjacent images after forming a grid of several pathological slice images to be spliced, and use the grid position and coverage area of ​​the image as prior knowledge;

[0053] An alignment and screening module is used to align adjacent pathological slice images based on prior knowledge and using an enhanced phase correlation algorithm, and to screen the aligned pathological slice images using a normalized cross-correlation algorithm, and to discard low-quality adjacent image alignments based on the screening results, thereby dividing the aligned complete image into multiple unconnected blocks;

[0054] The splicing module is used to execute the spanning tree process in each image block, obtain the spanning tree corresponding to each image block according to the spanning tree result, splice multiple spanning trees, and obtain a complete pathological slice image according to the splicing result.

[0055] It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first embodiment.

[0056] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.

[0057] The third embodiment of the present invention relates to an electronic device, see Figure 3 ,include:

[0058] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned image stitching method based on prior knowledge and spanning tree.

[0059] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0060] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0061] A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program, and the computer program implements the above method embodiment when executed by a processor.

[0062] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0063] In summary, the present invention not only combines the frequency domain method and the spanning tree method to stitch images, but also uses an improved frequency domain matching algorithm, and obtains a spanning tree through the combined action of frequency domain matching and calculation of ENCC values, thereby removing bad matches, effectively adjusting the structure of the tree, and improving the jigsaw puzzle effect. Different spanning trees are combined according to prior knowledge, and the prior knowledge is used as an auxiliary correction. Therefore, the present invention not only has a faster processing speed, but also has better robustness to deformation, thereby reducing the stitching error, and has lower requirements for initial alignment, resulting in a better stitching effect.

[0064] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. All equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. An image stitching method based on prior knowledge and spanning tree, characterized in that: The following steps are involved: Acquire a plurality of pathological slice images to be spliced ​​taken by a digital pathology scanner, wherein the content of each of the pathological slice images to be spliced ​​includes different regions of the entire pathological slice; After forming a grid of several pathological slice images to be spliced, determining the grid position of each pathological slice image and recording the coverage area between adjacent images, and using the grid position and coverage area of ​​the image as prior knowledge; Aligning adjacent pathological slice images according to the prior knowledge and using an enhanced phase correlation algorithm; The aligned pathological slice images are screened using a normalized cross-correlation algorithm, and low-quality adjacent image alignments are discarded based on the screening results, thereby dividing the aligned complete image into multiple unconnected blocks; The process of generating a tree is performed in each of the image blocks. After the corresponding spanning tree of each image block is obtained according to the result of the tree generation, a plurality of spanning trees are spliced ​​together to obtain a complete pathological slice image according to the splicing result.

2. The image stitching method based on prior knowledge and spanning tree according to claim 1, characterized in that: After forming a grid of the plurality of pathological slice images to be spliced, determining the grid position of each pathological slice image and recording the coverage area between adjacent images, and using the grid position and coverage area of ​​the image as prior knowledge, including: After naming and forming a grid by scanning and shooting with a digital pathology scanner, several pathology slice images to be spliced ​​are recorded as initial grid positions, an initial spanning tree is generated, and the coverage areas between adjacent images are recorded at the same time. The grid positions and coverage areas of the images are used as prior knowledge.

3. The image stitching method based on prior knowledge and spanning tree according to claim 1, characterized in that: The method of aligning adjacent pathological slice images according to prior knowledge and using an enhanced phase correlation algorithm includes: The mutually overlapping regions in each pair of adjacent images in the grid are extracted according to the prior knowledge, and the relative displacement between the adjacent images is calculated using an enhanced phase correlation algorithm, and the adjacent images are aligned according to the relative displacement.

4. The image stitching method based on prior knowledge and spanning tree according to claim 3, characterized in that: The method of extracting overlapping areas in each pair of adjacent images in the grid according to prior knowledge, calculating the relative displacement between adjacent images using an enhanced phase correlation algorithm, and aligning adjacent images according to the relative displacement includes: The maximum second-order partial derivative of the cross-correlation function of two adjacent images in the frequency domain is obtained by iterative calculation, and the relative displacement between the adjacent images is obtained according to the maximum second-order partial derivative.

5. The image stitching method based on prior knowledge and spanning tree according to claim 4, characterized in that: The method of obtaining the maximum second-order partial derivative of the cross-correlation function of two adjacent images in the frequency domain through iterative calculation, and obtaining the relative displacement between adjacent images according to the maximum second-order partial derivative, comprises: The relative displacement between adjacent images is obtained according to the following formula: Among them, r fg (x0, y0) is the cross-correlation function of two adjacent images in the frequency domain; the image f(x, y) and the image to be aligned g(x, y), their corresponding Fourier transforms are F(u, v) and G(u, v) respectively; M and N are the image sizes; F(u, v) = DFT(f), G(u, v) = DTF(g), F * (u,v) and G * (u,v) are their conjugates respectively; is the second-order partial derivative of the cross-correlation function. The second-order partial derivative can be used to determine the concavity of the surface. When it is at its maximum, x0 is the most accurate offset distance.

6. The image stitching method based on prior knowledge and spanning tree according to claim 5, characterized in that: Usually, the displacement of adjacent images needs to be calculated in the X and Y directions. However, due to the characteristics of linear motors, the motor repeatability in the Y direction meets the approximate linear relationship, so it is not necessary to calculate it every time. Because it is a high-throughput stitching, 4 segments are evenly selected in the X direction to calculate the offset in the Y direction. The middle value of each offset is taken, and a straight line is fitted at the 4 points. According to the slope, the images are aligned according to the offset in the X direction.

7. The image stitching method based on prior knowledge and spanning tree according to claim 1, characterized in that: The aligned pathological slice images are screened using a normalized cross-correlation algorithm, and low-quality adjacent image alignments are discarded according to the screening results, thereby dividing the aligned complete image into multiple unconnected blocks, including: Low-quality adjacent image alignments are discarded according to the following formula: Among them, A and B are two adjacent images A and B; A, and B, are the overlapping areas of image A and image B; and is the mean of the overlapping area; A i and B i is the value of a single pixel in the overlapping area.

8. The image stitching method based on prior knowledge and spanning tree according to claim 3, characterized in that: The process of executing the spanning tree in each of the image blocks, obtaining the spanning tree corresponding to each image block according to the result of the spanning tree, splicing multiple spanning trees, and obtaining a complete pathological slice image according to the splicing result, includes: The spanning tree process is performed independently for each of the image blocks. After the spanning tree corresponding to each image block is obtained, the final correction position is obtained by directly walking from one image to another (starting from the starting point) along the edge and accumulating each pairwise alignment along the way. Finally, multiple spanning trees are spliced ​​according to the prior knowledge and relative displacement to obtain a complete pathological slice image.

9. An image stitching system based on prior knowledge and spanning tree, characterized in that: include: An acquisition module, used for acquiring a plurality of pathological slice images to be spliced ​​taken by a digital pathology scanner, wherein the content of each of the pathological slice images to be spliced ​​includes different regions of the entire pathological slice; A determination module, used to determine the grid position of each pathological slice image and record the coverage area between adjacent images after forming a grid of several pathological slice images to be spliced, and use the grid position and coverage area of ​​the image as prior knowledge; An alignment and screening module, used to align adjacent pathological slice images according to the prior knowledge and using an enhanced phase correlation algorithm, and screen the aligned pathological slice images using a normalized cross-correlation algorithm, discarding low-quality adjacent image alignments according to the screening results, thereby dividing the aligned complete image into multiple unconnected blocks; The splicing module is used to execute the process of generating a tree in each of the image blocks, obtain the corresponding spanning tree of each image block according to the result of the spanning tree, splice multiple spanning trees, and obtain a complete pathological slice image according to the splicing result.

10. An electronic device, characterized in that: include: at least one processor; as well as, A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image stitching method based on prior knowledge and spanning tree as described in any one of claims 1 to 8.

Citation Information

Cited By

  • High-precision real-time medical image splicing method and system

    CN119671849A

  • A high-precision real-time medical image stitching method and system

    CN119671849B