Microscope image splicing method based on complementary registration and confidence ranking
By combining the complementary strategies of phase correlation and feature matching, the stitching problems caused by mechanical errors and sample irregularities in microscope image stitching are solved, achieving efficient and robust image registration and seamless stitching, which is suitable for microscope image stitching in biomedical research.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-17
AI Technical Summary
Traditional microscope image stitching techniques suffer from problems such as accumulated mechanical errors, positioning errors caused by sample irregularities, and insufficient image stitching quality in biomedical research. In particular, when cell images have high texture repeatability and large contrast variations, it is difficult to achieve accurate correction and seamless stitching.
A microscope image stitching method based on complementary registration and confidence ranking is adopted. It combines the complementary strategies of phase correlation and feature matching. The reliability of the registration result is judged by calculating the normalized cross-correlation coefficient (NCC) through Fourier transform. ORB/SIFT features are extracted in the estimated overlapping area for fine matching. The global position propagation algorithm based on confidence ranking and spatial weight image fusion are combined to generate a seamless stitched image.
It improves image registration accuracy and computational efficiency, adapts to the irregularity of biological samples, reduces the risk of error propagation, and achieves a visually seamless panoramic stitching effect with preserved details, making it suitable for large-scale microscopic image stitching.
Smart Images

Figure CN121685254A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image stitching technology, and in particular to a microscope image stitching method based on complementary registration and confidence ranking. Background Technology
[0002] With the in-depth development of digital pathology and cell biology research, automated microscope platforms have become a key tool in modern biomedical research. However, a series of technical challenges introduced during image acquisition seriously affect the quality and accuracy of subsequent image stitching. First, the inherent precision limitations of the stage's mechanical motion system lead to a cumulative effect of positioning errors, resulting in unpredictable micro-displacements between adjacent images, which traditional stitching algorithms based on fixed overlap rates struggle to accurately correct. Second, the unique characteristics of biological samples further exacerbate the stitching difficulties. The randomness of the spatial distribution, the heterogeneity of morphology and size, and the dynamic nature of growth states of target cells in cell cultures or tissue sections, coupled with the non-centered shooting method determined based on cell distribution density and specific regions of interest in actual operation, cause the overall shooting area to deviate from the ideal grid position, resulting in irregular variations in the overlapping area between adjacent images. Furthermore, traditional image stitching techniques exhibit significant shortcomings in such application scenarios: the fixed overlap rate assumption fails due to large fluctuations in the actual overlapping area, making it difficult to set the registration search range; the feature consistency assumption is difficult to hold due to the high repetition of cell image textures and large contrast variations, ultimately leading to problems such as blurring, loss of details, or structural distortion in the stitched image. There is an urgent need to develop new intelligent image stitching methods that can effectively compensate for mechanical errors and sample irregularities. Summary of the Invention
[0003] To overcome the technical deficiencies of existing technologies, this invention provides a microscope image stitching method based on complementary registration and confidence ranking.
[0004] The technical solution adopted in this invention is a microscope image stitching method based on complementary registration and confidence ranking, comprising the following steps:
[0005] S1. Obtain multiple sub-images to be stitched from the image acquisition platform, and preprocess each acquired sub-image.
[0006] S2. For each pair of adjacent sub-images, perform displacement estimation and registration based on a complementary strategy to obtain the relative displacement vector of the image pair and the corresponding confidence score. The complementary strategy includes: firstly, using a phase correlation method based on Fourier transform for preliminary registration and calculating the confidence score of the result; if the confidence score is lower than the set normalized cross-correlation confidence score threshold, then switch to the alternative registration scheme based on feature matching.
[0007] S3. Based on the relative displacement vectors and confidence scores of all image pairs, calculate the absolute position of each sub-image in the global coordinate system using a global position propagation algorithm driven by confidence ranking.
[0008] S4. Perform image fusion based on the absolute positions of all sub-images to generate the final panoramic stitched image.
[0009] Preferably, in step 2, the phase correlation method and its confidence calculation method include the following steps: S2.1a: Perform Fourier transform on the two images, calculate their normalized cross power spectrum and perform inverse Fourier transform to obtain the phase correlation matrix, and extract the first N candidate shifts from it. S2.1b: For each candidate displacement, calculate the normalized cross-correlation coefficient (NCC) of the two images in the corresponding overlapping region; S2.1c: Select the candidate displacement with the highest NCC value as the optimal displacement, and use this NCC value as the confidence level of the registration result of this phase correlation method.
[0010] Preferably, in step S2, switching to the alternative registration scheme based on feature matching specifically includes: S2.2a: Based on the overlapping region of the images, extract the first type of image features in the overlapping region of the two images respectively, and perform initial matching and mismatch removal to obtain a coarse matching point set; S2.2b: Use the estimated prior translation to verify the geometric consistency of the coarse matching point set and filter out the valid coarse matching points; S2.2c: Within the local neighborhood of the effective coarse matching points, extract the second type of image features for fine matching to obtain a set of fine matching points; S2.2d: Perform consistency verification on the offsets of the fine matching point set, calculate the average value of the offsets of the verified matching points, and use it as the final relative displacement vector; S2.2e: If fine matching fails, then revert to the prior translation as the relative displacement vector.
[0011] Preferably, the first type of image feature is an ORB feature, and the mismatch elimination adopts a grid-based motion statistics GMS algorithm; the second type of image feature is a SIFT feature; the geometric consistency verification refers to selecting matching point pairs whose deviation from the prior translation is within a preset tolerance range.
[0012] Preferably, in step S3, the confidence-ranked global position propagation algorithm includes: S3.1: Treat all sub-images as grid nodes, initialize the position state of each node to uncalculated; set the image node with the highest confidence displacement observation as the anchor point, set its absolute position as the origin, and add it to a priority queue sorted by the highest association confidence of the node. S3.2: Loop execution: Take out the currently located node with the highest confidence from the priority queue, traverse its unlocated neighbor nodes; according to the neighbor direction, select the displacement observation with the highest confidence that satisfies the direction dominance condition from the relevant displacement observation set, calculate the absolute position of the neighbor node, mark it as located and add it to the priority queue. S3.3: When the priority queue is empty or all connected nodes are located, output the absolute positions of all nodes.
[0013] Preferably, the direction dominance condition means that: for horizontal neighbors, the selected displacement observation should satisfy that the absolute value of its horizontal displacement component is greater than the absolute value of its vertical displacement component by a preset multiple; for vertical neighbors, the absolute value of its vertical displacement component is greater than the absolute value of its horizontal displacement component by a preset multiple.
[0014] Preferably, in step 4, the image fusion employs a weighted average method based on a spatial weight map, including: S4.1: Determine the size of the output canvas based on the absolute position and size of all sub-images; S4.2: Generate a spatial weight map for each input sub-image, where the weight map has high weights in the central region and low weights in the edge region; S4.3: Map all sub-images onto the global canvas according to their absolute positions, and perform pixel-level weighted accumulation. The accumulated value of each pixel is the sum of the product of the pixel value of each image at that position and the corresponding value of its weight map. S4.4: Normalize the accumulated weight of the canvas according to the total weight at each pixel position to obtain the final stitched image.
[0015] The beneficial effects of this invention are: 1. This invention improves registration accuracy while ensuring computational efficiency by combining a complementary registration strategy of phase correlation and feature matching. First, the phase correlation method is used to quickly estimate the global translation. Then, the reliability of the registration result is judged based on the normalized cross-correlation coefficient (NCC). When the NCC is lower than a set threshold, it automatically switches to an alternative scheme based on ORB feature extraction and SIFT fine-grained matching, thereby achieving efficient and robust image registration.
[0016] 2. This invention proposes extracting ORB / SIFT features only within the estimated overlapping region and applying geometric prior constraints to filter coarse matching points to improve matching quality. Furthermore, local fine-tuning further optimizes the matching results, making this method particularly suitable for biological samples with sparse targets and non-centered images.
[0017] 3. This invention proposes a location propagation algorithm based on confidence ranking, which prioritizes processing the most reliable unlocated images to avoid low-quality offsets affecting the global layout. This strategy not only enhances the consistency of the global layout but also significantly reduces the risk of error propagation.
[0018] 4. This invention employs a pixel-level weighted accumulation and normalization strategy based on a spatial weight map, ensuring a large contribution from the image center and a small contribution from the edges, resulting in a natural transition and eliminating stitching seams. This method guarantees a visually seamless effect while preserving detailed information, making it suitable for stitching large-scale microscopic images. Attached Figure Description
[0019] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0020] Figure 1 This is a schematic diagram of the overall structure of the present invention;
[0021] Figure 2 This is a flowchart of the displacement estimation and registration scheme based on the complementary strategy of the present invention;
[0022] Figure 3 This is a preview image of the images to be stitched together according to the present invention;
[0023] Figure 4 This is a diagram showing the completed assembly of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the various embodiments of this invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this invention to facilitate a better understanding of this application. However, the technical solutions claimed in the claims of this application can be implemented even without these technical details and with various variations and modifications based on the following embodiments.
[0025] like Figure 1-3 As shown, this embodiment provides a microscope image stitching method based on complementary registration and confidence ranking, including the following steps:
[0026] S1. Obtain multiple sub-images to be stitched from the image acquisition platform, and preprocess each acquired sub-image.
[0027] S2. For each pair of adjacent sub-images, perform displacement estimation and registration based on a complementary strategy to obtain the relative displacement vector of the image pair and the corresponding confidence score. The complementary strategy includes: firstly, using a phase correlation method based on Fourier transform for preliminary registration and calculating the confidence score of the result; if the confidence score is lower than the set normalized cross-correlation confidence score threshold, then switch to the alternative registration scheme based on feature matching.
[0028] S3. Based on the relative displacement vectors and confidence scores of all image pairs, calculate the absolute position of each sub-image in the global coordinate system using a global position propagation algorithm driven by confidence ranking.
[0029] S4. Perform image fusion based on the absolute positions of all sub-images to generate the final panoramic stitched image.
[0030] The following details the specific methods and steps.
[0031] S1. Acquire multiple sub-images to be stitched from the image acquisition platform, and preprocess each acquired sub-image. An image preprocessing model is used to enhance the features of each sub-image. Specifically, this includes: converting the color image to a grayscale image, applying a contrast-limited adaptive histogram equalization algorithm to enhance image contrast, and normalizing the image pixel values to eliminate the influence of brightness differences on subsequent stitching. These operations are existing image processing techniques and not innovative aspects of this method, therefore they will not be elaborated upon here; the preprocessed images are used in all subsequent steps.
[0032] S2. Displacement estimation and registration based on complementary strategies, aiming to calculate the displacement of any pair of adjacent images. and The relative translation between the two and the confidence level of the result. This invention introduces a complementary registration strategy combining phase correlation and feature matching, which ensures the accuracy and reliability of displacement estimation through a dual verification mechanism.
[0033] Step 2, the phase correlation method and its confidence calculation method, includes the following steps: S2.1a: Perform Fourier transform on the two images, calculate their normalized cross power spectrum and perform inverse Fourier transform to obtain the phase correlation matrix, and extract the first N candidate shifts from it. S2.1b: For each candidate displacement, calculate the normalized cross-correlation coefficient (NCC) of the two images in the corresponding overlapping region; S2.1c: Select the candidate displacement with the highest NCC value as the optimal displacement, and use this NCC value as the confidence level of the registration result of this phase correlation method. The specific steps are explained in detail below.
[0034] First, a phase-correlation-first registration strategy is implemented, including frequency domain analysis and cross-power spectrum calculation: specifically, assuming two adjacent images... and Satisfying translation relationship Their Fourier transforms are respectively and Their frequency domain relationship satisfies and satisfies
[0035]
[0036] Calculate the normalized cross-power spectrum: ;
[0037]
[0038] in express .
[0039] Calculate the phase correlation matrix and candidate shifts, and obtain the phase correlation matrix by performing an inverse Fourier transform on the cross-power spectrum. ,in
[0040] .
[0041] In theory, exist( , A sharp peak appears at (). In actual calculations, we detect the top N maximum values in the PCM and their coordinates to form a candidate displacement set.
[0042] Determine the confidence level of the image offset for each candidate translation amount. Define the overlapping area of the two images under this translation: Overlapping areas of reference images:
[0043]
[0044] Overlapping areas of the images to be registered:
[0045]
[0046] The above slicing operation assumes the image coordinate origin is at the top left corner, the x-axis is to the right, and the y-axis is downward. Let the size of the overlapping region be... The total number of pixels is .
[0047] Normalized cross-correlation coefficient (NCC) is calculated for each pair of overlapping regions. Calculate their normalized cross-correlation: mean:
[0048]
[0049] Standard deviation:
[0050]
[0051] Normalized cross-correlation coefficient:
[0052]
[0053] Set the normalized cross-correlation confidence threshold If the normalized cross-correlation coefficient corresponding to the optimal translation satisfies
[0054]
[0055] If the phase correlation registration result is accepted, the image stitching process can proceed directly; if
[0056]
[0057] If the current phase correlation result is rejected, an alternative registration scheme based on feature matching is triggered.
[0058] When the normalized cross-correlation confidence level obtained by the phase correlation method When this happens, the system automatically activates the feature-based alternative registration scheme.
[0059] The alternative registration scheme based on feature matching adopts an adaptive feature extraction and hierarchical matching strategy, balancing efficiency and robustness. If no valid matching point is found, it regresses to the preset overlap offset.
[0060] Switching to the feature-matching-based alternative registration scheme specifically includes: S2.2a: Based on the overlapping region of the images, extract the first type of image features in the overlapping region of the two images respectively, and perform initial matching and mismatch removal to obtain a coarse matching point set; S2.2b: Use the estimated prior translation to verify the geometric consistency of the coarse matching point set and filter out the valid coarse matching points; S2.2c: Within the local neighborhood of the effective coarse matching points, extract the second type of image features for fine matching to obtain a set of fine matching points; S2.2d: Perform consistency verification on the offsets of the fine matching point set, calculate the average value of the offsets of the verified matching points, and use it as the final relative displacement vector; S2.2e: If fine matching fails, then revert to the prior translation as the relative displacement vector; the specific steps are explained below.
[0061] Based on feature extraction of known overlapping regions, let the image... and The overlapping regions are as follows:
[0062]
[0063] Where:
[0064]
[0065] exist and Extract ORB features from within:
[0066]
[0067] right and Perform nearest neighbor matching;
[0068] The GMS algorithm is applied to remove spatially inconsistent mismatches, resulting in an initial matching set:
[0069]
[0070] Perform distance consistency verification on coarse matching points. To ensure that the matching point pairs conform to the estimated overlapping geometry, calculate the relative offset of each pair of points:
[0071]
[0072] Set tolerance threshold (based on overlapping region scale):
[0073]
[0074] in This is an empirical proportionality coefficient. Matching pairs that satisfy the following conditions are retained:
[0075]
[0076] in( The prior translation estimated from the boundary of the overlapping region is:
[0077]
[0078] Let the set of coarsely matched points after filtering be ? .
[0079] For coarse matching point set Each matching pair in ( Define a local window (such as radius) around it. (pixels)
[0080]
[0081] exist and Extract SIFT features from the inner layer and perform bidirectional nearest neighbor matching (Lowe's ratiotest) to generate a fine-grained set of matching point pairs:
[0082]
[0083] Perform offset consistency verification and average offset calculation for each fine-matching point pair ( ), calculate its local offset:
[0084]
[0085] Further outlier removal (e.g., using median absolute deviation (MAD) or a simple threshold):
[0086]
[0087] in For all The mean, Its standard deviation. Finally, the average translation offset is calculated as the registration parameter:
[0088]
[0089] in This represents the number of fine-grained matching points that passed the consistency verification.
[0090] Set a fallback mechanism for no feature points or failed matching. (For example If feature matching fails, the prior overlap offset is used directly as the final result.
[0091]
[0092] Output the final translation vector Used for image stitching.
[0093] S3. Image position calculation based on confidence ranking: After estimating the offsets between adjacent image pairs, the local offsets need to be fused into a globally consistent image layout. This step proposes a propagation-based position calculation method based on offset confidence ranking. Using high-confidence matching pairs as pivots, the absolute coordinates of each image in the entire image array are derived step by step, effectively suppressing the interference of low-quality offsets on the global layout. In step S3, the global position propagation algorithm driven by confidence ranking includes: S3.1: Treat all sub-images as grid nodes, initialize the position state of each node to uncalculated; set the image node with the highest confidence displacement observation as the anchor point, set its absolute position as the origin, and add it to a priority queue sorted by the highest association confidence of the node. S3.2: Loop execution: Take out the currently located node with the highest confidence from the priority queue, traverse its unlocated neighbor nodes; according to the neighbor direction, select the displacement observation with the highest confidence that satisfies the direction dominance condition from the relevant displacement observation set, calculate the absolute position of the neighbor node, mark it as located and add it to the priority queue. S3.3: When the priority queue is empty or all connected nodes are located, output the absolute positions of all nodes. Specific steps are explained below. The direction dominance condition refers to the following: for horizontal neighbors, the selected displacement observation should satisfy a preset multiple where the absolute value of its horizontal displacement component is greater than the absolute value of its vertical displacement component; for vertical neighbors, the absolute value of its vertical displacement component should satisfy a preset multiple where the absolute value of its horizontal displacement component is greater than the absolute value of its horizontal displacement component.
[0094] Let the sub-image be... Grid arrangement, total number of images .make Indicates the first Zhang Image The set of all associated offset observations, where each offset term is defined as:
[0095]
[0096] in The translation component is relative to a neighboring image. The corresponding confidence score is given.
[0097] Initialize image position and priority queue; define image position structure:
[0098]
[0099] in This is a Boolean flag indicating whether the image location has been calculated. Calculate the maximum confidence score for each image:
[0100]
[0101] Select the image with the highest global confidence as the starting anchor point:
[0102]
[0103] Set its absolute position as the origin of the coordinate system and mark it as calculated:
[0104]
[0105] Construct a max-heap priority queue ,according to Images to be processed are sorted in descending order:
[0106]
[0107] Confidence-driven position propagation, when If not empty, repeat the following operations: pop the current image and retrieve the index of the top image in the queue. Its corresponding grid coordinates are:
[0108]
[0109] Traverse the four neighboring domains and define the neighbor direction set:
[0110]
[0111] For each legal neighbor (satisfy and ), calculate its linear index:
[0112]
[0113] like If (not calculated), then try to assign a position to it.
[0114] Determine the source of offset and filter criteria based on relative direction: right neighbor From the image The offset set is used to filter items that satisfy the horizontal dominance condition:
[0115]
[0116] Select the offset with the highest confidence level:
[0117]
[0118] Left Neighbor From the current image The offset set is used to filter the horizontal dominant items and then applied in reverse:
[0119]
[0120] downstairs neighbor From the image Offset-focused filtering of vertical dominant items:
[0121]
[0122] Upper Neighbor From the image The offset is used to filter vertical dominant items and then applied in reverse.
[0123] If a valid offset exists Then update the absolute coordinates according to the direction:
[0124]
[0125] mark and will Add to priority queue (Priority is) ).
[0126] When the queue is empty, the positions of all connected images have been calculated. Output the position array:
[0127] .
[0128] S4. Image stitching based on weighted fusion, obtaining the global absolute position of all images. Next, this step performs seamless fusion of multiple images to generate the final panoramic image. To suppress stitching artifacts caused by exposure differences, registration residuals, or motion blur in overlapping areas, a pixel-level weighted accumulation and normalization strategy based on a spatial weight map is adopted.
[0129] In step S4, the image fusion employs a weighted average method based on a spatial weight map, including: S4.1: Determine the size of the output canvas based on the absolute position and size of all sub-images; S4.2: Generate a spatial weight map for each input sub-image, where the weight map has high weights in the central region and low weights in the edge region; S4.3: Map all sub-images onto the global canvas according to their absolute positions, and perform pixel-level weighted accumulation. The accumulated value of each pixel is the sum of the product of the pixel value of each image at that position and the corresponding value of its weight map. S4.4: Normalize the accumulated weights on the canvas according to the total weights at each pixel position to obtain the final stitched image. The specific steps are explained below.
[0130] Define the output canvas size, and set the first... Zhang Input Image The size is (high (width), and the position of its upper left corner in the global coordinate system is The boundaries of the canvas required for the stitched result are determined by the following formula:
[0131]
[0132] Therefore, the output image size is defined as follows:
[0133]
[0134] Construct a weighted accumulation buffer and initialize two floating-point buffers:
[0135] Accumulated image buffer The initial value is zero;
[0136] Cumulative weighted graph The initial value is zero.
[0137] For each image Perform the following operation: Calculate its starting coordinates in the output canvas:
[0138]
[0139] Generate spatial weight graph :
[0140] The weighting function is designed with a smooth decay pattern, high at the center and low at the edges, to reduce the contribution at image boundaries and avoid stitching seams. Specifically, it is defined as:
[0141]
[0142] in
[0143]
[0144] For small constants (such as This is used to prevent numerical instability caused by weights being zero. —Mapping the image and weights to a global buffer:
[0145] For each pixel Calculate its coordinates in the output canvas:
[0146]
[0147] like Falling within the effective range (i.e.) Then, the accumulation will be performed:
[0148]
[0149] Normalization generates the final image, for each pixel position in the output canvas. If the cumulative weight is non-zero, a weighted average is performed:
[0150]
[0151] Final output image By It is truncated and quantized to 8-bit unsigned.
[0152] This invention provides a microscope image stitching method based on complementary registration and confidence ranking, which exhibits advantages over existing technologies in several aspects. Specifically:
[0153] Addressing Mechanical System Errors: This invention introduces a complementary registration strategy with dual verification. Traditional stitching algorithms rely on a single registration mechanism, which cannot effectively handle mechanical positioning errors and irregular sample distribution. This invention improves registration accuracy while maintaining computational efficiency by combining phase correlation and feature matching. First, the global translation is quickly estimated using phase correlation. Then, the reliability of the registration result is judged based on the normalized cross-correlation coefficient (NCC). When the NCC falls below a set threshold, it automatically switches to an alternative scheme based on ORB feature extraction and SIFT fine-tuning, thereby achieving efficient and robust image registration.
[0154] Adapting to Sample Irregularities: While some techniques extract features across the entire image, this is inefficient and susceptible to background noise for microscopic images. This invention proposes extracting ORB / SIFT features only within the estimated overlapping region and applying geometric prior constraints to filter coarse matching points, thus improving matching quality. Furthermore, local fine-tuning further optimizes the matching results, making this method particularly suitable for biological samples with sparse targets and non-centered images.
[0155] Constructing a globally consistent layout: A position propagation algorithm based on confidence ranking is proposed in this invention. Traditional stitching processes often employ a simple chain-like propagation method, which can distort the entire layout if a registration error occurs at any step. This prioritizes processing the most reliable unlocated images, avoiding the impact of low-quality offsets on the global layout. This strategy not only enhances the consistency of the global layout but also significantly reduces the risk of error propagation.
[0156] S Achieves Seamless Fusion: Pixel-level weighted accumulation based on spatial weights can lead to problems such as brightness abrupt changes, blurred boundaries, or ghosting in overlapping areas due to simple averaging or direct overlay. This invention employs a pixel-level weighted accumulation and normalization strategy based on a spatial weight map, ensuring a large contribution from the image center and a small contribution from the edges, resulting in a natural transition and eliminating stitching seams. This method guarantees a visually seamless effect while preserving detailed information, making it suitable for stitching large-scale microscopic images.
[0157] In summary, this invention not only achieves multiple technological innovations at the algorithm level, but also provides a complete solution for practical biomedical imaging needs at the system level. Compared with existing technologies, it has significant advantages in accuracy, robustness, adaptability, and practicality, providing strong technical support for cutting-edge fields such as digital pathology, high-content screening, and organoid imaging.
[0158] Those skilled in the art will understand that the above embodiments are specific examples of implementing the present invention, and in practical applications, various changes in form and detail may be made without departing from the spirit and scope of the present invention.
Claims
1. A method for microscopic image stitching based on complementary registration and confidence ranking, characterized in that: The method comprises the following steps, S1, obtaining a plurality of sub-images to be spliced from an image acquisition platform, and preprocessing each of the collected sub-images; S2, for each pair of adjacent sub-images, performing displacement estimation and registration based on a complementary strategy to obtain a relative displacement vector and a corresponding confidence score of the image pair; the complementary strategy comprises: firstly performing preliminary registration based on a Fourier transform-based phase correlation method and calculating the confidence of the result, and if the confidence is lower than a set normalized cross-correlation confidence threshold, switching to an alternative registration scheme based on feature matching; S3, based on the relative displacement vectors and confidence scores of all image pairs, calculating the absolute position of each sub-image in the global coordinate system through a global position propagation algorithm driven by confidence sorting; S4, image fusion is performed according to the absolute positions of all sub-images to generate a final panoramic spliced image.
2. The microscope image stitching method based on complementary registration and confidence ranking of claim 1, wherein: In step 2, the phase correlation method and its confidence calculation method comprise the following steps, S2.1a: Fourier transform is performed on the two images, the normalized cross-power spectrum is calculated and inverse Fourier transform is performed to obtain a phase correlation matrix, and the first N candidate displacements are extracted therefrom; S2.1b: for each candidate displacement, the normalized cross-correlation coefficient NCC of the two images in the corresponding overlapping region is calculated; S2.1c: the candidate displacement with the highest NCC value is selected as the optimal displacement, and the NCC value is taken as the confidence of the registration result of this phase correlation method.
3. The microscope image stitching method based on complementary registration and confidence ranking of claim 2, wherein: In step S2, switching to the alternative registration scheme based on feature matching specifically comprises: S2.2a: based on the image overlapping region, first-type image features are extracted in the overlapping region of the two images respectively, and initial matching and false matching elimination are performed to obtain a coarse matching point set; S2.2b: the coarse matching point set is verified for geometric consistency using the estimated prior translation to filter out effective coarse matching points; S2.2c: second-type image features are extracted in the local neighborhood of the effective coarse matching points for fine matching to obtain a fine matching point set; S2.2d: the offset of the fine matching point set is verified for consistency, and the average value of the matching point offsets that pass the verification is taken as the final relative displacement vector; S2.2e: if fine matching fails, the prior translation is used as the relative displacement vector.
4. The microscope image stitching method based on complementary registration and confidence ranking of claim 3, wherein: The first-type image features are ORB features, the false matching elimination adopts a grid-based motion statistics GMS algorithm; the second-type image features are SIFT features; the geometric consistency verification refers to filtering out matching point pairs with a deviation from the prior translation within a preset tolerance range.
5. The microscopy image stitching method based on complementary registration and confidence ordering of any one of claims 1-4, characterized in that: In step S3, the global position propagation algorithm driven by confidence sorting comprises: S3.1: all sub-images are regarded as grid nodes, the position state of each node is initialized as not calculated; the image node with the highest confidence displacement observation is set as an anchor point, the absolute position of which is set as the origin, and it is added to a priority queue sorted by the highest associated confidence of the nodes; S3.2: cyclically execute: take out the currently highest confidence positioned node from the priority queue, traverse its unpositioned neighbor nodes; according to the neighbor direction, select the highest confidence displacement observation from the relevant displacement observation set which satisfies the direction dominance condition, calculate the absolute position of the neighbor node, and mark it as positioned and join the priority queue; S3.3: when the priority queue is empty or all connected nodes are positioned, output the absolute position of all nodes.
6. The microscope image stitching method based on complementary registration and confidence ranking of claim 5, wherein: The direction dominance condition refers to: for horizontal neighbors, the selected displacement observation should satisfy that the absolute value of the horizontal displacement component is greater than the absolute value of the vertical displacement component by a preset multiple; for vertical neighbors, the absolute value of the vertical displacement component is greater than the absolute value of the horizontal displacement component by a preset multiple.
7. The microscope image stitching method based on complementary registration and confidence ranking of claim 1, wherein: In step S4, the image fusion adopts a weighted average method based on a spatial weight map, including: S4.1: determine the size of the output canvas according to the absolute position and size of all sub-images; S4.2: generate a spatial weight map for each input sub-image, the weight map has high weight in the center region and low weight in the edge region; S4.3: map all sub-images to the global canvas according to their absolute positions, and perform weighted accumulation at the pixel level, the accumulation value of each pixel being the sum of the product of the pixel value of each image at that position and the corresponding value of its weight map; S4.4: normalize the accumulated canvas according to the total weight at each pixel position to obtain the final stitched image.