An image alignment method, device, apparatus and storage medium

CN118967755BActive Publication Date: 2026-09-25BIOISLAND LAB +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410777389.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2026-09-25
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

[0004]发明人在进行电子显微镜图像拼接算法分析研究时,经过研究发现采用NCC算法在某些情况下无法识别到两张图像的相似特征,导致无法成功对齐

Benefits of technology

[0019]本发明实施例提供的一种图像对齐方法、装置、设备及存储介质,通过将SIFT算法集成到NCC算法中,改进NCC算法流程,解决了NCC算法对图像的尺度变化和旋转变化敏感导致的图像对齐失败的问题,实现了提高图像间的关键点的互相关性,降低因图像尺度变化和旋转变化引起的图像对齐失败的概率,提高图像对齐算法的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967755B_ABST
    Figure CN118967755B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to an image alignment method, device, equipment and storage medium. The method comprises: in the case that the NCC cross-correlation coefficient between a source image and a to-be-aligned image meets a first preset condition, determining a SIFT feature point pair between the source image and the to-be-aligned image; based on the SIFT feature point pair, according to a spatial transformation relationship between the source image and the to-be-aligned image, performing image projection on the to-be-aligned image to obtain a projection image; in the case that the NCC cross-correlation coefficient between the source image and the projection image meets a second preset condition, aligning the projection image with the source image based on an NCC algorithm. The technical solution of the embodiments of the present application can reduce the probability of image alignment failure caused by image scale change and rotation change, and improve the stability of the image alignment algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image alignment method, apparatus, device, and storage medium. Background Technology

[0002] After scanning the sample layer by layer using an electron microscope, a series of electron microscope images are obtained, and these electron microscope images need to be aligned layer by layer.

[0003] Normalized Cross-Correlation (NCC) is a commonly used similarity metric in image processing. It can be used to calculate the similarity between two images for tasks such as template matching and object detection, describing the correlation between two vectors, windows, or samples of the same dimension. The NCC algorithm is relatively simple to compute and can be implemented using the Fast Fourier Transform (FFT), offering advantages such as fast computation, ease of implementation, and simple, intuitive results. Therefore, it is widely used in image alignment.

[0004] During their research and analysis of electron microscope image stitching algorithms, the inventors discovered that the NCC algorithm sometimes fails to identify similar features between two images, leading to alignment failures. For example, during electron microscope image acquisition, layer-by-layer scanning of the sample can cause slight sample movement or tilting, minor mechanical vibrations or displacements of the acquisition equipment, or issues related to sample conductivity. All of these factors can cause scale changes and rotational shifts in the electron microscope images during the layer-by-layer scanning process. The NCC method is highly sensitive to these scale and rotational changes, making it prone to alignment failures. Summary of the Invention

[0005] This invention provides an image alignment method, apparatus, device, and storage medium, with the aim of improving the success rate of image alignment.

[0006] In a first aspect, embodiments of the present invention provide an image alignment method, comprising:

[0007] If the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition, determine the scale-invariant feature transform (SIFT) feature point pair between the source image and the image to be aligned.

[0008] Based on the SIFT feature point pairs, according to the spatial transformation relationship between the source image and the image to be aligned, the image to be aligned is projected to obtain a projected image;

[0009] If the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition, the projected image is aligned with the source image based on the NCC algorithm.

[0010] In a second aspect, embodiments of the present invention provide an image alignment device, comprising:

[0011] The feature point pair determination module is used to determine the SIFT feature point pair between the source image and the image to be aligned when the NCC cross-correlation coefficient between the source image and the image to be aligned meets a first preset condition;

[0012] The image projection module is used to project the image to be aligned based on the SIFT feature point pairs and according to the spatial transformation relationship between the source image and the image to be aligned, to obtain a projected image.

[0013] The image alignment module is used to align the projected image with the source image based on the NCC algorithm when the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition.

[0014] Thirdly, embodiments of the present invention provide an electronic device, including:

[0015] One or more processors;

[0016] Memory, used to store one or more programs;

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the image alignment method provided in any embodiment of the present invention.

[0018] Fourthly, embodiments of the present invention provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an image alignment method as provided in any embodiment of the present invention.

[0019] This invention provides an image alignment method, apparatus, device, and storage medium. By integrating the SIFT algorithm into the NCC algorithm, the NCC algorithm process is improved, solving the problem of image alignment failure caused by the sensitivity of the NCC algorithm to image scale and rotation changes. This improves the cross-correlation of key points between images, reduces the probability of image alignment failure caused by image scale and rotation changes, and enhances the stability of the image alignment algorithm. Attached Figure Description

[0020] Figure 1 A flowchart of an image alignment method provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a schematic diagram of the structure of an image alignment device provided in Embodiment 2 of the present invention;

[0022] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention;

[0023] Figure 4 Here is an example of a two-layer electron microscope image of a sample in an embodiment of the present invention;

[0024] Figure 5a for Figure 4 Normalized cross-correlation of two-layer electron microscopy images;

[0025] Figure 5b for Figure 4 Normalized cross-correlation of two-layer electron microscope images after NIFT processing;

[0026] Figure 6 for Figure 4 A schematic diagram of the feature points extracted by NIFT after random rotation of two layers of electron microscope images;

[0027] Figure 7a for Figure 6 Normalized cross-correlation of two electron microscope images after random rotation;

[0028] Figure 7b for Figure 6 Normalized cross-correlation of two electron microscope images after random rotation and NIFT processing;

[0029] Figure 8 for Figure 4 A schematic diagram showing the feature points extracted by NIFT after random cropping of the image to be stitched.

[0030] Figure 9a for Figure 8 Normalized cross-correlation of two electron microscope images after random cropping of the image to be stitched;

[0031] Figure 9b for Figure 8 The normalized cross-correlation of two electron microscope images after random cropping of the images to be stitched and NIFT processing. Detailed Implementation

[0032] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0033] Example 1

[0034] Figure 1 This is a flowchart of an image alignment method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where electron microscope images are aligned and stitched together after scanning a sample layer by layer. The method can be executed by an image alignment device, which can be implemented by hardware and / or software and is generally integrated into an electronic device, such as a computer device. The method specifically includes:

[0035] Step 110: If the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition, determine the SIFT feature point pairs between the source image and the image to be aligned.

[0036] The process involves layer-by-layer scanning of the samples, resulting in a sequence of multiple electron microscope (EM) images. Image stitching requires image alignment, typically by aligning adjacent EM images. At the start of image alignment, the source image can be the first EM image in the sequence, or it can be a manually selected EM image. The image to be aligned is an EM image adjacent to the source image, usually a subsequent EM image. If some EM images have already been aligned, the currently aligned image can be selected as the source image. The NCC algorithm is used to obtain the cross-correlation coefficient between the source and EM images, reflecting their similarity. This step aims to determine if highly similar regions can be found between the two images without any processing. If the correlation meets the conditions for NCC alignment, the points found by the NCC algorithm can be used directly for image alignment. This eliminates the need for extracting other feature points, reducing time complexity and improving efficiency. The above-mentioned NCC cross-correlation coefficient meets the first preset condition, which means that the correlation between the source image and the image to be aligned cannot meet the conditions for alignment using the NCC algorithm. In this case, it is necessary to use the SIFT algorithm to extract other feature points to improve the NCC algorithm and complete the image alignment.

[0037] In one optional implementation, if the NCC cross-correlation coefficient between the source image and the image to be aligned meets a first preset condition, the SIFT feature point pairs between the source image and the image to be aligned are determined. This includes: calculating the NCC cross-correlation coefficient between the source image and the image to be aligned; comparing the top-ranked NCC cross-correlation coefficient with a preset threshold; if the top-ranked NCC cross-correlation coefficient is less than the preset threshold, calculating SIFT feature points between the source image and the image to be aligned, and determining the matching SIFT feature point pairs. Specifically, the peak value of the NCC cross-correlation coefficient can be compared with the preset threshold to determine if the peak value is less than the set threshold. If it is less than the preset threshold, it indicates a significant difference between the images, and factors such as scale changes or rotation changes may affect the peak value of the NCC. In this case, SIFT feature points need to be extracted to determine the matching SIFT feature point pairs between the source image and the image to be aligned. For example, the preset threshold is 0.3. The SIFT algorithm is invariant to changes in image scale. Even if the image scale changes, SIFT can still stably detect feature point pairs between images. The SIFT algorithm also has rotation invariance, making SIFT perform well when encountering image rotation. However, due to the high complexity of the SIFT algorithm, it is inefficient when aligning a large number of images.

[0038] Step 120: Based on SIFT feature point pairs, according to the spatial transformation relationship between the source image and the image to be aligned, project the image to be aligned to obtain the projected image.

[0039] This process involves using SIFT feature points to perform geometric transformations between the estimated images, projecting the images to be aligned to obtain a projected image. This step aims to obtain a new image that has almost no scale or rotation changes compared to the source image, allowing for subsequent NCC calculations to ensure alignment quality and reduce the probability of misalignment.

[0040] Step 130: If the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition, align the projected image with the source image based on the NCC algorithm.

[0041] This step involves calculating the NCC cross-correlation coefficient between the source image and the newly obtained projected image. This step is to reconfirm the similarity between the source and projected images, further ensuring the relationship between them and reducing the probability of misalignment. If, based on the NCC cross-correlation coefficient between the source and projected images, it is determined that the second preset condition is met, meaning the two images can be aligned using the NCC algorithm, then...

[0042] The technical solution of the present embodiment integrates the SIFT algorithm into the NCC algorithm and improves the flow of the NCC algorithm, which solves the problem of image alignment failure caused by the NCC algorithm's sensitivity to the scale change and rotation change of images, improves the cross-correlation of key points between images, reduces the probability of alignment failure caused by image scale change and rotation change, and improves the stability of the image alignment algorithm.

[0043] In an optional implementation, before determining the SIFT feature point pairs between the source image and the image to be aligned when the NCC cross-correlation coefficient between the source image and the image to be aligned meets a preset condition, the method further includes:

[0044] Acquiring a series of electron microscope images obtained by layer-by-layer scanning of a sample through an electron microscope;

[0045] Taking the previous electron microscope image as the source image, and taking the adjacent subsequent electron microscope image as the image to be aligned.

[0046] For example, after layer-by-layer scanning of a sample is completed, n layers of electron microscope images are obtained, and layer-by-layer alignment is required. m images (1 ≤ m < n) have been aligned in the early stage, then the m-th image is the source image, and the (m+1)-th image is the image to be aligned, and so on. It can be understood that both n and m are integers greater than 1.

[0047] In an optional implementation, performing image projection on the image to be aligned based on the SIFT feature point pairs according to the spatial transformation relationship between the source image and the image to be aligned to obtain a projected image includes:

[0048] According to the SIFT feature point pairs, the Random Sample Consensus (RANSAC) algorithm is used to determine the geometric transformation model between the source image and the image to be aligned; wherein common models include translation, affine transformation, etc.

[0049] Using the geometric transformation model to perform image projection on the image to be aligned to obtain a corresponding projected image.

[0050] In an optional implementation, when the NCC cross-correlation coefficient between the source image and the projected image meets a second preset condition, aligning the projected image with the source image based on the NCC algorithm includes:

[0051] Calculating the NCC cross-correlation coefficient between the source image and the projected image;

[0052] Selecting the top-ranked NCC cross-correlation coefficients by value and comparing them with a preset threshold;

[0053] If the top-ranked NCC cross-correlation coefficients by value are greater than or equal to the preset threshold, aligning the projected image with the source image based on the NCC algorithm.

[0054] Among them, the peak value of the NCC cross-correlation coefficient can be compared with a preset threshold. If the peak value is greater than or equal to the preset threshold, it indicates that the projected image and the source image can be aligned based on the NCC algorithm.

[0055] In one alternative implementation, the image alignment method further includes:

[0056] If the NCC cross-correlation coefficient between the source image and the projected image is less than a preset threshold, an alignment failure message is returned. Specifically, the peak value of the NCC cross-correlation coefficient between the source image and the projected image can be compared with the preset threshold. If the peak value of the NCC cross-correlation coefficient between the source image and the projected image is less than the preset threshold, it indicates that the source image and the projected image cannot be successfully aligned.

[0057] The inventors verified the effectiveness of the image alignment method in the embodiments of the present invention through experiments, including comparative quantitative results of NCC+SIFT, SIFT, and NCC, cases of NCC / SIFT alignment failure but NCC+SIFT (NIFT) alignment success, rotation invariance verification, and scale invariance verification.

[0058] First, a comparative experiment was conducted on three methods: NIFT, SIFT, and NCC. The overall advantages and disadvantages of the three methods were quantified by comparing the success rate and time consumption of image stitching. The results are shown in Table 1. It can be seen that NIFT combines the advantages of SIFT and NCC. While maintaining the high success rate of SIFT, the average time consumption is only 40% of that of SIFT, and the success rate is 9.1% higher than that of NCC, demonstrating the superiority of the proposed NIFT method.

[0059] Table 1

[0060] NIFT 97.6% 194.07s SIFT 97.6% 490.22s NCC 88.5% 160.46s

[0061] To verify that NIFT can align cases where NCC alignment fails, experimental data was tested on 166 sets of images. Each set contained two images, and samples from the two adjacent layers where NCC alignment failed were selected. The NCC and NIFT results were calculated separately. Figure 4 These are two layers of samples that failed NCC alignment. Their normalized cross-correlation is as follows: Figure 5a As shown, the maximum value is 0.0955, which is lower than the set threshold of 0.3. Figure 5b The image is aligned using NIFT. The maximum NCC value is 0.4607, which is greater than the threshold of 0.3, and the peak value is prominent, demonstrating the optimization effect of NIFT.

[0062] To verify that NIFT has rotation invariance, the images to be stitched were randomly rotated. Figure 6 After random rotation, NIFT can effectively extract feature points. After random image rotation, the NCC (Network Capacity) decreases significantly, such as... Figure 7a As shown. Even after NIFT processing, a high NCC can still be obtained, such as... Figure 7b As shown. Therefore, NIFT inherits the advantages of SIFT and possesses rotational invariance.

[0063] To verify that NIFT has scale invariance, the images to be stitched were randomly cropped. Figure 8 After random cropping, NIFT can effectively extract feature points. The NCC (Network Control Point) of a randomly cropped image is shown below. Figure 9a As shown, the peaks are low and contain interference. The NCC after NIFT processing is as follows: Figure 9b As shown, the NCC peak after NIFT processing is high and unique. Therefore, NIFT possesses scale invariance.

[0064] Experiments show that this method solves the problems of the original NCC algorithm, has scale invariance and rotation invariance, and is robust to image scale and rotation transformations.

[0065] Example 2

[0066] Figure 2 This is a schematic diagram of the structure of an image alignment device provided in Embodiment 2 of the present invention, as shown below. Figure 2 As shown, the image alignment device includes: a feature point pair determination module 210, an image projection module 220, and an image alignment module 230, wherein,

[0067] The feature point pair determination module 210 is used to determine the SIFT feature point pairs between the source image and the image to be aligned when the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition.

[0068] The image projection module 220 is used to project the image to be aligned based on SIFT feature point pairs and according to the spatial transformation relationship between the source image and the image to be aligned, so as to obtain a projected image.

[0069] The image alignment module 230 is used to align the projected image with the source image based on the NCC algorithm when the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition.

[0070] Optionally, the feature point pair determination module 210 includes:

[0071] The first coefficient calculation unit is used to calculate the NCC cross-correlation coefficient between the source image and the image to be aligned.

[0072] The first coefficient comparison unit is used to select the NCC cross-correlation coefficient with the highest numerical ranking and compare it with a preset threshold.

[0073] The feature point calculation unit is used to calculate SIFT feature points between the source image and the image to be aligned if the cross-correlation coefficient of the NCC with the highest numerical value is less than a preset threshold, and to determine the matching SIFT feature point pairs.

[0074] Optionally, the image alignment device also includes:

[0075] The image acquisition module is used to acquire a series of electron microscope images obtained by scanning the sample layer by layer with an electron microscope before determining the SIFT feature point pairs between the source image and the image to be aligned, provided that the NCC cross-correlation coefficient between the source image and the image to be aligned meets the preset conditions.

[0076] The image determination module is used to take the preceding electron microscope image as the source image and the adjacent following electron microscope image as the image to be aligned.

[0077] Optionally, the image projection module 220 includes:

[0078] The model determination unit is used to determine the geometric transformation model between the source image and the image to be aligned using the Random Sample Consensus (RANSAC) algorithm based on SIFT feature point pairs.

[0079] The projection unit is used to project the image to be aligned using a geometric transformation model to obtain the corresponding projected image.

[0080] Optionally, the image alignment module 230 includes:

[0081] The second coefficient calculation unit is used to calculate the NCC cross-correlation coefficient between the source image and the projected image;

[0082] The second coefficient comparison unit is used to select the NCC cross-correlation coefficient with the highest numerical ranking and compare it with a preset threshold.

[0083] The second feature point calculation unit is used to align the projected image with the source image based on the NCC algorithm if the NCC cross-correlation coefficient of the highest value is greater than or equal to a preset threshold.

[0084] Optionally, the image alignment device also includes:

[0085] The failure information return module is used to return alignment failure information if the NCC cross-correlation coefficient of the source image and the projected image is less than a preset threshold.

[0086] The image alignment device provided in the embodiments of the present invention can execute the image alignment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0087] Example 3

[0088] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention, as shown below. Figure 3 As shown, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in the electronic device can be one or more. Figure 3 Taking a processor 310 as an example; the processor 310, memory 320, input device 330, and output device 340 in the electronic device can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0089] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the image alignment method in this embodiment of the invention (e.g., the feature point pair determination module 210, image projection module 220, and image alignment module 230 in the image alignment device). The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 320, thereby implementing the image alignment method described above.

[0090] The memory 320 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 320 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include memory remotely located relative to the processor 310, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0091] Input device 330 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 340 may include display devices such as a display screen.

[0092] Example 4

[0093] Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an image alignment method, including:

[0094] If the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition, determine the SIFT feature point pair between the source image and the image to be aligned;

[0095] Based on the SIFT feature point pairs, according to the spatial transformation relationship between the source image and the image to be aligned, the image to be aligned is projected to obtain a projected image;

[0096] If the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition, the projected image is aligned with the source image based on the NCC algorithm.

[0097] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the image alignment method provided in any embodiment of the present invention.

[0098] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0099] It is worth noting that in the above-described embodiments of the image alignment device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0100] Although the present invention has been described in detail above with general descriptions, specific embodiments, and experiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. An image alignment method, characterized in that, include: If the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition, determine the SIFT feature point pair between the source image and the image to be aligned; Based on the SIFT feature point pairs, according to the spatial transformation relationship between the source image and the image to be aligned, the image to be aligned is projected to obtain a projected image; If the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition, the projected image is aligned with the source image based on the NCC algorithm. The step of determining the SIFT feature point pairs between the source image and the image to be aligned, when the NCC cross-correlation coefficient between the source image and the image to be aligned meets a first preset condition, includes: Calculate the NCC cross-correlation coefficient between the source image and the image to be aligned; The cross-correlation coefficients of NCCs with the highest numerical values ​​are compared with a preset threshold. If the cross-correlation coefficient of the NCC with the highest numerical ranking is less than the preset threshold, calculate the SIFT feature points between the source image and the image to be aligned, and determine the matching SIFT feature point pairs. The step of projecting the image to be aligned based on the SIFT feature point pairs and the spatial transformation relationship between the source image and the image to be aligned, to obtain a projected image, includes: Based on the SIFT feature point pairs, the geometric transformation model between the source image and the image to be aligned is determined using the Random Sample Consensus (RANSAC) algorithm. The image to be aligned is projected using the geometric transformation model to obtain the corresponding projected image. When the NCC cross-correlation coefficient between the source image and the projected image meets the second preset condition, aligning the projected image with the source image based on the NCC algorithm includes: Calculate the NCC cross-correlation coefficient between the source image and the projected image; The cross-correlation coefficients of NCCs with the highest numerical ranking are compared with the preset threshold. If the NCC cross-correlation coefficient of the highest numerical sorting is greater than or equal to the preset threshold, the projected image is aligned with the source image based on the NCC algorithm. If the NCC cross-correlation coefficient between the source image and the projected image is less than the preset threshold, an alignment failure message is returned.

2. The method according to claim 1, characterized in that, Before determining the SIFT feature point pairs between the source image and the image to be aligned, provided that the NCC cross-correlation coefficient between the source image and the image to be aligned meets the first preset condition, the method further includes: Acquire a series of electron microscopy images obtained by scanning the sample layer by layer using an electron microscope; The preceding electron microscope image is used as the source image, and the adjacent following electron microscope image is used as the image to be aligned.

3. An image alignment device, characterized in that, include: The feature point pair determination module is used to determine the SIFT feature point pair between the source image and the image to be aligned when the NCC cross-correlation coefficient between the source image and the image to be aligned meets a first preset condition. The image projection module is used to project the image to be aligned based on the SIFT feature point pairs and according to the spatial transformation relationship between the source image and the image to be aligned, to obtain a projected image. An image alignment module is used to align the projected image with the source image based on the NCC algorithm when the NCC cross-correlation coefficient between the source image and the projected image meets a second preset condition. The feature point pair determination module includes: The first coefficient calculation unit is used to calculate the NCC cross-correlation coefficient between the source image and the image to be aligned; The first coefficient comparison unit is used to select the NCC cross-correlation coefficient with the highest numerical ranking and compare it with a preset threshold. The feature point calculation unit is used to calculate the SIFT feature points between the source image and the image to be aligned if the NCC cross-correlation coefficient of the image with the highest numerical value is less than the preset threshold, and to determine the matching SIFT feature point pairs. Image projection module, including: The model determination unit is used to determine the geometric transformation model between the source image and the image to be aligned using the Random Sample Consensus (RANSAC) algorithm based on SIFT feature point pairs. The projection unit is used to project the image to be aligned using a geometric transformation model to obtain the corresponding projected image. Image alignment module, including: The second coefficient calculation unit is used to calculate the NCC cross-correlation coefficient between the source image and the projected image; The second coefficient comparison unit is used to select the NCC cross-correlation coefficient with the highest numerical ranking and compare it with a preset threshold. The second feature point calculation unit is used to align the projected image with the source image based on the NCC algorithm if the NCC cross-correlation coefficient of the numerically ranked first is greater than or equal to a preset threshold. The failure information return module is used to return alignment failure information if the NCC cross-correlation coefficient of the source image and the projected image is less than a preset threshold.

4. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image alignment method as described in any one of claims 1-2.

5. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the image alignment method as described in any one of claims 1-2.