Large-view low-overlap medical image splicing method

By classifying and splicing large field of view low-overlapping medical images using methods based on SST and DOP, it solves the problems of high cost, low efficiency and difficulty in accurately splicing low-overlapping areas in the existing technology, and achieves efficient and accurate image splicing. The risk of diagnostic errors is reduced.

CN118710863APending Publication Date: 2024-09-27WUHAN LANDING INTELLIGENCE MEDICAL CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410829704.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing large-field low-overlap medical image stitching technology is costly, inefficient, and difficult to stitch accurately. There are significant challenges especially when processing low-overlap samples, which may lead to the risk of diagnostic errors.

Method used

Methods based on Structural Similarity Threshold (SST) and Dynamic Optimal Path (DOP) are used to classify visual blocks into disaster blocks and non-disaster blocks. Non-disaster blocks are prioritized for single-view image segmentation and splicing, and information entropy classification is used. The disaster block is identified by the machine and the random forest classifier, the translation amount is optimized through template matching and hill climbing algorithm, and the prediction strategy of the surrounding blocks is used for splicing when there are no valid pixels in the overlapping area of ​​the disaster block.

Benefits of technology

It improves the accuracy and efficiency of large-field low-overlap medical image stitching, reduces computational complexity, reduces the risk of medical accidents, and achieves high-quality image stitching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710863A
    Figure CN118710863A
Patent Text Reader

Abstract

The invention provides a large-view low-overlap medical image splicing method, which comprises the following steps of: loading sampled small-view image blocks, carrying out preliminary view block classification on the image blocks, distinguishing disaster blocks and non-disaster blocks, preferentially processing the disaster blocks, carrying out further blocking of a single small-view image on the disaster blocks, intelligently eliminating most non-overlap areas, and carrying out image splicing on the large-view low-overlap medical image. Secondly, splicing non-disaster blocks by using an image splicing algorithm based on a structural similarity threshold (SST), reserving splicing parameters, and not performing panoramic fusion; after all the non-disaster blocks are spliced, disaster block splicing parameters are intelligently predicted according to the splicing parameters of the spliced non-disaster blocks around the disaster blocks in sequence, namely, dynamic optimal path (DOP) splicing of the disaster blocks is achieved. And when the SST algorithm and the DOP algorithm are executed, splicing parameters of all the small-view blocks are obtained, and all the small-view blocks can be subjected to panoramic fusion splicing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical image processing, and in particular to a large-viewing-field and low-overlap medical image splicing method. Background Art

[0002] In the field of medical diagnosis, detailed observation of cell samples often relies on magnifying the samples dozens of times. However, this magnification significantly limits the range of areas that can be observed in a single microscopic field of view. Large-field medical image stitching technology effectively addresses this challenge by integrating intelligent programs into microscopic equipment, enabling the equipment to automatically perform continuous regional sampling according to a preset route. Furthermore, using large-field image stitching technology, many small-field images are combined into a large-field image for professional physicians to perform precise analysis. Considering the sampling and stitching time, equipment cost-effectiveness and ease of use, the hardware configuration of smart devices is usually basic. In order to reduce costs, although the magnification of cell samples is increased, the overlapping area set during sampling is reduced to only 3% to 7%, resulting in a significant reduction in the effective pixel content and features of the overlapping area, and some overlapping areas are even blank with no effective pixels. As the field of view expands, these factors together bring significant challenges to the image stitching task. Compared with the existing feature matching-based and deep learning-based image stitching algorithms, not only is the field of view small, but the overlap rate is often around 50%, making it impossible to stitch images accurately and quickly. Therefore, the research on this type of large field of view and low overlap medical image stitching technology has become the focus of this field.

[0003] The general process of image stitching can be divided into several core steps: image preprocessing, image registration, image fusion and reconstruction. Each step plays a key role to ensure the quality and continuity of the final image. 1) Image preprocessing: The main function of image preprocessing is to improve image quality and reduce the processing difficulty of subsequent steps. Including denoising, brightness and color correction, the purpose is to standardize image data to reduce stitching errors. Specific implementations include adjusting contrast, brightness, applying filters, etc. 2) Image registration: The purpose of registration is to determine the spatial correspondence between images. In this step, most systems first detect key feature points in each image, and then estimate the relative position and angle between images by matching these feature points. This usually involves complex algorithms to identify and match features and calculate the geometric transformation parameters required to transform one image to another. It is the most core step of image stitching. 3) Image fusion: After the images are successfully registered, the fusion step is responsible for seamlessly combining multiple images into a complete image. This includes processing and fusing overlapping areas of images to eliminate visible seams and differences. Image fusion technology ensures smooth transitions between images, optimizing the color and detail performance of the entire image through technologies such as multi-band fusion or image fusion algorithms to achieve a natural and consistent visual effect.

[0004] In the existing field of image stitching technology, most methods focus on processing natural landscape images taken by conventional cameras. These techniques usually allow extensive preprocessing of the original images to optimize the stitching effect, and the loss of some detailed pixels in the process usually does not have a significant impact on the final use. In addition, these methods can also mask small errors in registration through subsequent image fusion steps. However, in the field of medical image stitching, the situation is quite different. Medical images are usually collected by high-precision microscopic imaging equipment, involving high magnifications, and the details of each pixel may be related to the health and even life safety of the patient. The accuracy requirements of medical image stitching are much higher than those of conventional image stitching, because even a small registration error may lead to misdiagnosis and increase the risk of medical accidents. In addition, since medical images usually do not allow extensive preprocessing and the use of fusion and masking techniques, the research on large-field medical image stitching methods with low overlap areas is particularly important, but the current technical inventions for such needs are still relatively backward, especially in the processing of low overlap samples, which is almost blank. Summary of the invention

[0005] The main purpose of the present invention is to provide a large-viewing-field and low-overlap medical image stitching method to solve the problems of high cost, low efficiency and difficulty in accurately stitching low-overlap areas in the prior art.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a large-viewing-field and low-overlap medical image stitching method, S1, load the sampled small field of view blocks, perform preliminary field of view block classification on these blocks, distinguish disaster blocks from non-disaster blocks, give priority to non-disaster blocks, further block the non-disaster blocks into single small field of view images, and intelligently remove most non-overlapping areas; S2, then use the SST-based image stitching algorithm to stitch the non-disaster blocks, retain the stitching parameters, and do not perform panoramic fusion, where SST is the structural similarity threshold; S3, after all non-disaster blocks are spliced, the splicing parameters of the disaster block are intelligently predicted according to the splicing parameters of the spliced ​​non-disaster blocks around the disaster block, that is, the DOP splicing of the disaster block, where DOP is the dynamic optimal path; S4. When the SST and DOP algorithms are executed, the stitching parameters of all small field of view blocks are obtained, and all small field of view blocks can be panoramically fused and stitched to obtain the final large field of view result map.

[0007] In the preferred embodiment, the specific steps of steps S1-S4 are: A0. Data loading: A lazy loading mechanism is used to load data from disk to memory only when stitching a small field of view image. The memory is released immediately after the splicing is saved, saving memory consumption. A1. Visual field block classification: Visual field blocks are classified to identify disaster blocks and non-disaster blocks. This step uses two methods, information entropy classifier and random forest classifier, to classify visual field blocks. A2. Single-view image segmentation: Intelligently segment non-disaster blocks according to the situation, limit the matching area to the overlapping range, improve matching accuracy and reduce calculation; A3, SST-based non-disaster block splicing: Use the SSIM-based template matching algorithm and hill climbing algorithm strategy to calculate and optimize the translation, deal with local optimal traps, and output the optimal translation and overlapping area SSIM value; A4. Prediction and splicing of disaster blocks based on DOP: After the non-disaster blocks are spliced, the disaster blocks are processed. Since there are no valid pixels in the overlapping area of ​​the disaster blocks, the splicing result data of the surrounding spliced ​​disaster blocks are used for prediction and splicing. The specific prediction strategies include: nearest neighbor prediction, average prediction, most similar prediction and emergency prediction; A5. Large-view panoramic fusion: After SST and DOP, all small-view blocks are stitched together, accurate stitching parameters are obtained, and panoramic mapping is performed in the sampling order, and the overlapping areas are linearly fused; A6. Export of large field of view: Customized output module, including optimal compression result, vector preservation result and block preservation result.

[0008] In the preferred embodiment, the information entropy classifier and random forest classifier in step A1 specifically include the following steps: Information entropy classifier: The field of view blocks are classified by setting the information entropy threshold (default 3). When the information entropy is greater than the threshold, it is considered a non-disaster block, otherwise it is considered a disaster block. The threshold can be adjusted according to different samples.

[0009] Random forest classifier: A random forest binary classification model is obtained by training and learning with a large number of samples, which can directly determine whether a disaster block or a non-disaster block is present.

[0010] In the preferred solution, the specific steps of dividing the single-view image into blocks in step A2 are: A201, the overlapping area only accounts for 3-7% of the whole image, and the remaining 93-97% contains irrelevant or interfering information. This proportion needs to be clarified in order to accurately locate the overlapping part later; A202, for the registration in the horizontal direction, the left image imageA and the right image imageB in the image pair to be matched are processed in blocks respectively: CropA = right(imageA,rate) CropB =left(imageB,rate) Use the right(imageA, rate) function to extract the image block CropA with a width of rate*100% from the right side of imageA; Use the left(imageB, rate) function to extract an image block CropB with the same width of rate*100% from the left side of imageB; A203. The registration process in the vertical direction is similar to that in the horizontal direction, except that the direction of the blocks is changed to the upper or lower part, that is, a certain proportion of image blocks are intercepted from the top or bottom for matching; A204. After obtaining CropA and CropB, a matching calculation is performed only between these two blocks to find the optimal translation amount.

[0011] The advantage of doing this is that it not only limits the scope of the matching search to the vicinity of the overlapping area, thereby improving the accuracy of the registration, but also reduces unnecessary global searches and significantly reduces the computational complexity.

[0012] In the preferred solution, the specific steps of SST-based non-disaster block splicing in step A3 are: A301, initialization: use the reference coordinates recorded during sampling to calculate a window length as the initial solution, initialize a current optimal value variable best_rate, and set it to the SSIM of the initial solution; A302, Neighborhood solution generation: Locally fine-tune the current solution to generate a series of neighborhood solutions. Define a random factor d, and obtain the neighborhood interval [rate-d, rate+d] by the distance d before and after the current solution rate. Generate new neighborhood solutions within the neighborhood interval. These candidate solutions constitute the neighborhood of the current solution for subsequent evaluation and selection. A303. Evaluate and select the best neighborhood solution: Calculate the objective function value, that is, the structural similarity SSIM value, for each neighborhood solution and compare it with the current optimal similarity; If the SSIM value of a neighborhood solution is better than the current optimal similarity value, then this neighborhood solution is used as the new current solution and the current optimal value is updated; A304, termination condition judgment: judge whether the algorithm meets the termination condition. The termination condition can be configured and selected, which can be reaching a preset number of iterations, or failing to find a better solution in a certain number of iterations; If the termination condition is met, the algorithm terminates and outputs the current optimal solution, that is, the window length, as the final solution to the problem; If the termination condition is not met, return to step A2 and continue the search process; A305. Dealing with local optimal traps: Two strategies are provided, including randomly restarting the hill climbing algorithm or introducing a simulated annealing mechanism; Random restart hill climbing algorithm: the algorithm restarts the search from another random point after reaching the local optimal solution; Mechanisms such as simulated annealing: allow the algorithm to accept poor solutions with a certain probability in order to escape from the local optimum; A306. Once the algorithm terminates, the current optimal solution and its objective function value are output, including the optimal translation and the corresponding SSIM value, the optimal translation and the similarity value of the overlapping area under the translation, as a solution to the problem.

[0013] In the preferred embodiment, the specific prediction strategy of step A4 includes the following steps: Nearest neighbor prediction: Based on the assumption that the translation data of the disaster block is similar to the nearest non-disaster block in the same row or column in space, the location of the disaster block is determined, the nearest non-disaster block is identified, and its translation data is used as the prediction data, which takes advantage of the spatial proximity between image blocks; Average value prediction: Calculate the average value of the translation data of adjacent non-disaster blocks in the same row or column as the predicted translation amount of the disaster block, based on the assumption that the translation trend of the disaster block is roughly consistent with that of the non-disaster blocks in the same row or column; Most similar prediction: Find the average translation of one or several images with the highest similarity in the overlapped area after calibration of all non-disaster blocks in the same row or column as the predicted translation of the disaster block, based on the assumption that the most matching image block can be found by analyzing the similarity; Emergency prediction: For special disaster blocks in the first and last rows or columns of complex tissue samples, special disaster blocks are: the overlapping area is blank, and the non-overlapping area has a small number of pixels. Find the nearest non-disaster row or column, calculate its average vertical or horizontal translation, and use it as the vertical or horizontal translation of the disaster row or column to avoid large errors in the entire row or column. In the preferred solution, the specific steps of the large-viewing-angle panoramic fusion in step A5 are as follows: A501, select the small field of view image located in the upper left corner as the reference image; A502. Next, the remaining small field of view images are sequentially pasted into the panoramic image from top to bottom and from left to right. A503. When pasting each small field of view image into the panoramic image, special attention should be paid to the overlapping parts with the pasted images on the left and above. For these overlapping areas, linear fusion technology is used, that is, by weighted averaging the pixel values ​​in the overlapping area, a smooth transition between the two images is achieved, thereby eliminating obvious boundary traces and making the panoramic image look more natural and complete. The specific operation of linear fusion is as follows: for each pixel in the overlapping area, calculate its relative position in the left and right or upper and lower images, and then perform weighted average of the pixel values ​​at the corresponding positions of the two images according to the ratio of this position, and use this as the fused pixel value; A504: At the edge of the panoramic image, there is not enough overlapping area for fusion and a boundary effect occurs. The edge feathering technology is used to gradually reduce the pixel weight in the edge area to achieve a soft transition of the image edge. A505. After completing the mapping and fusion of all small field of view images, the entire panoramic image needs to be finally checked and optimized to ensure that there are no obvious stitching marks or color inconsistencies.

[0014] In the preferred solution, the three specific output modes of the output module in step A6 are: Best compression result: Calculate the minimum compression ratio, compress the image resolution to within 65536×65536, and then save it in a normal format; Vector Save Result: Save the image in vector format; Save the result in blocks: split the spliced ​​large field of view into small fields of view blocks of the same size, add corresponding configuration files, and equip a special display module.

[0015] The present invention provides a large-field-of-view and low-overlap medical image stitching method. In order to solve the problems of ultra-large field of view and ultra-low overlap in medical image stitching, each field of view block is classified, and a single field of view block is divided into blocks. Within a limited area, different types of field of view blocks are stitched in a specific manner to solve the problem of being unable to stitch.

[0016] The present invention discloses a method for stitching medical images with ultra-large field of view and ultra-low overlap based on structural similarity threshold and dynamic optimal path. The method adopts a divide-and-conquer strategy and adopts a stitching method based on structural similarity threshold and a stitching method based on dynamic optimal path respectively according to different characteristics of small field of view blocks to guide the effective stitching of sparse overlap and blank overlap. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 This is a principle flow chart of a large-viewing-field and low-overlap panoramic stitching algorithm according to an embodiment of the present invention; Figure 2 is a system structure diagram of a large-viewing-field and low-overlap panoramic stitching method according to an embodiment of the present invention; Figure 3 It is a diagram of the structure of the visual field block of an embodiment of the present invention and its explanation diagram; Figure 4 It is a panoramic mapping sequence diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0018] Example 1 like Figures 1 to 4 As shown in Figure 1, a large field of view and low overlap medical image stitching method is proposed. S1, load the sampled small field of view blocks, perform preliminary field of view block classification on these blocks, distinguish disaster blocks from non-disaster blocks, give priority to non-disaster blocks, further block the non-disaster blocks into single small field of view images, and intelligently remove most non-overlapping areas; S2, then use the SST-based image stitching algorithm to stitch the non-disaster blocks, retain the stitching parameters, and do not perform panoramic fusion, where SST is the structural similarity threshold; S3, after all non-disaster blocks are spliced, the splicing parameters of the disaster block are intelligently predicted according to the splicing parameters of the spliced ​​non-disaster blocks around the disaster block, that is, the DOP splicing of the disaster block, where DOP is the dynamic optimal path; S4. When the SST and DOP algorithms are executed, the stitching parameters of all small field of view blocks are obtained, and all small field of view blocks can be panoramically fused and stitched to obtain the final large field of view result map.

[0019] In the preferred embodiment, the specific steps of steps S1-S4 are: A0. Data loading: A lazy loading mechanism is used to load data from disk to memory only when stitching a small field of view image. The memory is released immediately after the splicing is saved, saving memory consumption. A1. Visual field block classification: Visual field blocks are classified to identify disaster blocks and non-disaster blocks. This step uses two methods, information entropy classifier and random forest classifier, to classify visual field blocks. A2. Single-view image segmentation: Intelligently segment non-disaster blocks according to the situation, limit the matching area to the overlapping range, improve matching accuracy and reduce calculation; A3, SST-based non-disaster block splicing: Use the SSIM-based template matching algorithm and hill climbing algorithm strategy to calculate and optimize the translation, deal with local optimal traps, and output the optimal translation and overlapping area SSIM value; A4. Prediction and splicing of disaster blocks based on DOP: After the non-disaster blocks are spliced, the disaster blocks are processed. Since there are no valid pixels in the overlapping area of ​​the disaster blocks, the splicing result data of the surrounding spliced ​​disaster blocks are used for prediction and splicing. The specific prediction strategies include: nearest neighbor prediction, average prediction, most similar prediction and emergency prediction; A5. Large-view panoramic fusion: After SST and DOP, all small-view blocks are stitched together, accurate stitching parameters are obtained, and panoramic mapping is performed in the sampling order, and the overlapping areas are linearly fused; A6. Export of large field of view: Customized output module, including optimal compression result, vector preservation result and block preservation result.

[0020] In the preferred embodiment, the information entropy classifier and random forest classifier in step A1 specifically include the following steps: Information entropy classifier: The field of view blocks are classified by setting the information entropy threshold (default 3). When the information entropy is greater than the threshold, it is considered a non-disaster block, otherwise it is considered a disaster block. The threshold can be adjusted according to different samples.

[0021] Random forest classifier: A random forest binary classification model is obtained by training and learning with a large number of samples, which can directly determine whether a disaster block or a non-disaster block is present.

[0022] In the preferred solution, the specific steps of dividing the single-view image into blocks in step A2 are: A201, the overlapping area only accounts for 3-7% of the whole image, and the remaining 93-97% contains irrelevant or interfering information. This proportion needs to be clarified in order to accurately locate the overlapping part later; A202, for the registration in the horizontal direction, the left image imageA and the right image imageB in the image pair to be matched are processed in blocks respectively: CropA = right(imageA,rate) CropB =left(imageB,rate) Use the right(imageA, rate) function to extract the image block CropA with a width of rate*100% from the right side of imageA; Use the left(imageB, rate) function to extract an image block CropB with the same width of rate*100% from the left side of imageB; A203. The registration process in the vertical direction is similar to that in the horizontal direction, except that the direction of the blocks is changed to the upper or lower part, that is, a certain proportion of image blocks are intercepted from the top or bottom for matching; A204. After obtaining CropA and CropB, a matching calculation is performed only between these two blocks to find the optimal translation amount.

[0023] The advantage of doing this is that it not only limits the scope of the matching search to the vicinity of the overlapping area, thereby improving the accuracy of the registration, but also reduces unnecessary global searches and significantly reduces the computational complexity.

[0024] In the preferred solution, the specific steps of SST-based non-disaster block splicing in step A3 are: A301, initialization: use the reference coordinates recorded during sampling to calculate a window length as the initial solution, initialize a current optimal value variable best_rate, and set it to the SSIM of the initial solution; A302, Neighborhood solution generation: Locally fine-tune the current solution to generate a series of neighborhood solutions. Define a random factor d, and obtain the neighborhood interval [rate-d, rate+d] by the distance d before and after the current solution rate. Generate new neighborhood solutions within the neighborhood interval. These candidate solutions constitute the neighborhood of the current solution for subsequent evaluation and selection. A303. Evaluate and select the best neighborhood solution: Calculate the objective function value, that is, the structural similarity SSIM value, for each neighborhood solution and compare it with the current optimal similarity; If the SSIM value of a neighborhood solution is better than the current optimal similarity value, then this neighborhood solution is used as the new current solution and the current optimal value is updated; A304, termination condition judgment: judge whether the algorithm meets the termination condition. The termination condition can be configured and selected, which can be reaching a preset number of iterations, or failing to find a better solution in a certain number of iterations; If the termination condition is met, the algorithm terminates and outputs the current optimal solution, that is, the window length, as the final solution to the problem; If the termination condition is not met, return to step A2 and continue the search process; A305. Dealing with local optimal traps: Two strategies are provided, including randomly restarting the hill climbing algorithm or introducing a simulated annealing mechanism; Random restart hill climbing algorithm: the algorithm restarts the search from another random point after reaching the local optimal solution; Mechanisms such as simulated annealing: allow the algorithm to accept poor solutions with a certain probability in order to escape from the local optimum; A306. Once the algorithm terminates, the current optimal solution and its objective function value are output, including the optimal translation and the corresponding SSIM value, the optimal translation and the similarity value of the overlapping area under the translation, as a solution to the problem.

[0025] In the preferred embodiment, the specific prediction strategy of step A4 includes the following steps: Nearest neighbor prediction: Based on the assumption that the translation data of the disaster block is similar to the nearest non-disaster block in the same row or column in space, the location of the disaster block is determined, the nearest non-disaster block is identified, and its translation data is used as the prediction data, which takes advantage of the spatial proximity between image blocks; Average value prediction: Calculate the average value of the translation data of adjacent non-disaster blocks in the same row or column as the predicted translation amount of the disaster block, based on the assumption that the translation trend of the disaster block is roughly consistent with that of the non-disaster blocks in the same row or column; Most similar prediction: Find the average translation of one or several images with the highest similarity in the overlapped area after calibration of all non-disaster blocks in the same row or column as the predicted translation of the disaster block, based on the assumption that the most matching image block can be found by analyzing the similarity; Emergency prediction: For the special disaster blocks in the first and last rows or columns of complex tissue samples, the special disaster blocks are: the overlapping area is blank and the non-overlapping area has a small number of pixels. Find the nearest non-disaster row or column and calculate its average vertical or horizontal translation as the vertical or horizontal translation of the disaster row or column to avoid large errors in the entire row or column.

[0026] In the preferred solution, the specific steps of the large-viewing-angle panoramic fusion in step A5 are as follows: A501, select the small field of view image located in the upper left corner as the reference image; A502. Next, the remaining small field of view images are sequentially pasted into the panoramic image from top to bottom and from left to right. A503. When pasting each small field of view image into the panoramic image, special attention should be paid to the overlapping parts with the pasted images on the left and above. For these overlapping areas, linear fusion technology is used, that is, by weighted averaging the pixel values ​​in the overlapping area, a smooth transition between the two images is achieved, thereby eliminating obvious boundary traces and making the panoramic image look more natural and complete. The specific operation of linear fusion is as follows: for each pixel in the overlapping area, calculate its relative position in the left and right or upper and lower images, and then perform weighted average of the pixel values ​​at the corresponding positions of the two images according to the ratio of this position, and use this as the fused pixel value; A504: At the edge of the panoramic image, there is not enough overlapping area for fusion and a boundary effect occurs. The edge feathering technology is used to gradually reduce the pixel weight in the edge area to achieve a soft transition of the image edge. A505. After completing the mapping and fusion of all small field of view images, the entire panoramic image needs to be finally checked and optimized to ensure that there are no obvious stitching marks or color inconsistencies.

[0027] In the preferred solution, the three specific output modes of the output module in step A6 are: Best compression result: Calculate the minimum compression ratio, compress the image resolution to within 65536×65536, and then save it in a normal format; Vector Save Result: Save the image in vector format; Save the result in blocks: split the spliced ​​large field of view into small fields of view blocks of the same size, add corresponding configuration files, and equip a special display module.

[0028] Example 2 Further illustrate with reference to Example 1, Figure 1-4 The structure shown mainly includes the following three steps: 1) Image stitching algorithm based on structural similarity threshold (SST): The present invention first uses the structural similarity index (SSIM) to evaluate the similarity between each small field of view image, and determines the precise translation amount of different images by dynamically adjusting the threshold. This method can effectively utilize the sparse pixel content in low-overlapping areas and optimize stitching accuracy and efficiency.

[0029] 2) Based on the dynamic optimal path stitching strategy: For invalid or blank overlapping areas, the present invention uses an automatically learned information entropy classifier (or information entropy classifier) ​​to analyze the image blocks and identify blocks containing valid content and blank blocks. For non-blank blocks, the above-mentioned SST method is applied for preliminary stitching; for blank blocks, they are not simply spliced ​​according to the sampling path like non-blank blocks, but after the non-blank blocks around them are spliced, the translation amount of the block is predicted by the translation distance of the surrounding spliced ​​blocks, thereby improving the overall stitching quality.

[0030] 3) System implementation: The present invention also provides a large-field medical image stitching system, which includes image classification, image registration, image fusion, panoramic stitching and optimization modules and storage modules. By integrating advanced intelligent algorithms and high-performance hardware devices, the present invention can automatically execute a series of workflows from image data loading to image stitching and final ultra-large field image preservation. The system aims to optimize medical image processing, improve the accuracy and efficiency of stitched images, and thus support more accurate medical diagnosis and research.

[0031] Example 3 Further illustrate with reference to Example 1, Figure 1-4 The structure shown, wherein SST (Structural Similarity Threshold): Structural Similarity Threshold DOP (Dynamic Optimal Path): Dynamic Optimal Path Disaster block: A small field of view with a blank background in the overlapping area Non-disaster blocks: small view blocks representing the overlapped area with valid cell content The general steps are as follows Figure 1-2As shown, the sampled small field of view tiles are loaded, and preliminary field of view block classification is performed on these tiles to distinguish between disaster blocks and non-disaster blocks. Non-disaster blocks are processed first, and the non-disaster blocks are further divided into single small field of view images. Most non-overlapping areas are intelligently removed, and then the non-disaster blocks are first stitched using an image stitching algorithm based on a structural similarity threshold (SST), and the stitching parameters are retained without performing panoramic fusion. After all non-disaster blocks are stitched, the stitching parameters of the disaster blocks are intelligently predicted based on the stitching parameters of the stitched non-disaster blocks around the disaster blocks, that is, the dynamic optimal path (DOP) stitching of the disaster blocks. When both the SST and DOP algorithms are executed, the stitching parameters of all small field of view blocks are obtained, and all small field of view blocks can be stitched for panoramic fusion. Get the final large field of view result map. The specific detailed steps are as follows: Data loading: In order to save the computing resources of the stitching algorithm, a special image loading module was invented. In particular, the data loading adopts the lazy loading mechanism in software engineering. The image is loaded from the disk to the memory only when it is stitched to a small field of view image, saving overall memory consumption. In the block saving mechanism, the memory is released immediately for the small field of view images that have been stitched and saved, saving overhead.

[0032] The structure of the loaded view block is as follows Figure 3 shown.

[0033] Step 1: Classification of visual field blocks Since there are no valid pixels in the overlapping area of ​​the disaster blocks, which are all background, it is impossible to splice them. The unified default value may cause the accumulation of errors in the subsequent splicing blocks, so a classifier is needed to identify the disaster blocks. Considering the generalization, the splicing system of the present invention has developed two visual field block classifiers: information entropy classifier and random forest classifier. Information Entropy Classifier Since the overlapping areas of disaster blocks are all blank backgrounds, their information entropy is often very low. You can consider using the configured information entropy threshold to classify the visual field blocks. The default threshold entroyThreshold = 3. Calculate the information entropy value of each small visual field block. When image_entropy(crop(img))>3, it is considered a non-disaster block, otherwise it is considered a disaster block. The sparseness of cell pixel content in the overlapping areas of some non-disaster blocks of different samples is different, and the threshold can be adjusted.

[0034] Random Forest Classifier A large number of samples (8635 small field of view images, 6044 training sets and 2591 test sets) are used to train and learn a random forest binary classification model. The judgment of disaster blocks or non-disaster blocks can be directly obtained. As long as the training data is rich enough, there is no need to manually configure parameters.

[0035] Step 2: Single-view image segmentation For the identified non-disaster blocks, the registration process is the process of calculating the translation amount, and the translation registration is performed according to the same pixel content in the overlapping area. However, the overlapping domain is too small (3-7%) and there are a large number of interference areas (93-97%). Therefore, it is necessary to intelligently divide the field of view into internal blocks according to the situation and limit the matching area to the overlapping range, which not only increases the matching accuracy but also reduces unnecessary calculations.

[0036] CropA = right(imageA,rate) CropB =left(imageB,rate) Where imageA is the left image in the image pair to be matched, right(img,rate) is the block portion of the right side of image img with rate*100%. Similarly, imageB is the right side of the image pair to be matched, left(img,rate) is the block portion of the left side of image img with rate*100%.

[0037] The same goes for vertical registration.

[0038] Step 3: SST-based non-disaster block splicing The non-disaster blocks are determined, and the precise calculation area is also determined. The overlapping blocks of each non-disaster block are matched pairwise to obtain the overlapping area. The template matching algorithm based on SSIM is used to calculate the translation amount, and the hill climbing algorithm strategy is used for optimization. The details are as follows: 1) Initialization: Use the reference coordinates recorded during sampling to calculate an approximate window length as the initial solution. Initialize a current optimal value variable best_rate and set it as the objective function value of the initial solution.

[0039] 2) Neighborhood solution generation: Locally fine-tune the current solution to generate a series of neighborhood solutions. Here, as in the template matching interval, a random factor d is defined, and the distance d before and after the current solution rate is extended to obtain the neighborhood interval [rate-d, rate+d], and a new neighborhood solution is generated within the neighborhood interval.

[0040] 3) Evaluate and select the best neighborhood solution: Calculate the objective function value, that is, the structural similarity (SSIM) value, for each neighborhood solution and compare it with the current optimal similarity. If the SSIM value of a neighborhood solution is better than the current optimal similarity value, then this neighborhood solution is used as the new current solution and the current optimal value is updated.

[0041] 4) Termination condition judgment: Determine whether the algorithm meets the termination condition. The termination condition can be configured and selected, which can be reaching a preset number of iterations, or failing to find a better solution in a certain number of iterations. If the termination condition is met, the algorithm terminates and outputs the current optimal solution, that is, the window length, as the final solution to the problem; if the termination condition is not met, it returns to the second step and continues the search process.

[0042] 5) Dealing with local optimal traps: In practical applications, hill climbing algorithms may encounter the problem of local optimal solutions, that is, the algorithm converges to the local optimal solution rather than the global optimal solution too early. In order to cope with this challenge, the present invention provides a configuration module, and the following two remedial strategies are available: a. Random restart of hill climbing algorithm: the algorithm restarts the search from another random point after reaching the local optimal solution; b. Mechanisms such as simulated annealing: allow the algorithm to accept a worse solution with a certain probability in order to jump out of the local optimal solution.

[0043] 6) Result output: Once the algorithm terminates, the current optimal solution and its objective function value, that is, the optimal translation amount and the similarity value of the overlapping area under the translation amount, are output as the solution to the problem.

[0044] Step 4: Disaster block prediction splicing based on DOP After the non-disaster blocks are stitched together, the next step is to process the disaster blocks. The overlapping areas of the disaster blocks are all backgrounds with no valid pixel content. Here, the stitching result data of the surrounding stitched disaster blocks is used for predictive stitching. There are four specific prediction strategies: 1) Nearest neighbor prediction: This strategy is based on the assumption that the best translation data of the disaster block is similar to its nearest non-disaster block (successfully spliced ​​image block) in space. In implementation, the specific position of the disaster block in the large field of view is first determined, and then one or more non-disaster blocks closest to it in the same row (predicted horizontal translation) or column (predicted vertical translation) are identified, and finally the translation data of these non-disaster blocks are used as the predicted translation data of the disaster block. This method takes advantage of the spatial proximity between image blocks and assumes that adjacent image blocks have similar translation characteristics in physical position.

[0045] 2) Average value prediction: This strategy predicts the translation data of the disaster block by calculating the average value of the translation data of all adjacent non-disaster blocks in the same line (predicted horizontal translation) or column (predicted vertical translation). Specifically, this method collects the translation data of all spliced ​​non-disaster blocks in the same line or column, and then calculates the arithmetic mean of these data, and uses this value as the predicted translation of the disaster block. This method is based on the assumption that the translation trend of the disaster block should be roughly consistent with the translation trend of the non-disaster blocks in the same line or column, so the average value can provide a reasonable prediction result.

[0046] 3) Most similar prediction: Find the average translation of one or several images with the highest similarity in the overlapped area of ​​all non-disaster blocks in the same row (for horizontal translation prediction) or the same column (for vertical translation prediction) after calibration, and use this value as the predicted translation of the disaster block. This strategy is based on the assumption that the image block that best matches the disaster block can be found by analyzing the similarity of the overlapped area of ​​all non-disaster blocks in the same row (for horizontal translation prediction) or the same column (for vertical translation prediction).

[0047] 4) Emergency prediction: For complex tissue samples, the first and last rows (columns) may have disaster blocks with all blank overlapping areas (there are a small number of pixels in the non-overlapping area), which are called disaster (rows). Theoretically, the errors of such rows and columns are tolerable because the overlapping areas are all blank and there are no small errors. However, in order to avoid large errors in the entire row or column. For this special sample, the present invention searches for the nearest other rows with non-disaster blocks (non-disaster rows), calculates their average vertical translation, and uses it as the vertical translation of the disaster row; or searches for the nearest other columns with non-disaster blocks (non-disaster columns), calculates their average horizontal translation, and uses it as the horizontal translation of the disaster column.

[0048] Step 5: Wide-view panoramic fusion After SST and DOP, all small view blocks are stitched together. With accurate stitching parameters, large view panoramic images can be fused and stitched. At this time, the panoramic image is mapped according to the sampling order. For example, the top left corner image (coordinate (0,0)) is used as the reference, and the order is from top to bottom and from left to right (such as Figure 4 -a), when mapping each image, the overlap between the left and top areas is considered, and the overlapped areas are linearly fused.

[0049] Step 6: Export the large field of view Due to the large field of view, ordinary png and jpg formats cannot be stored as a complete large picture, and a specially customized output module is required. The present invention adopts three output modes: 1) Best compression result: Calculate the minimum compression ratio, compress the image resolution to within 65536×65536, and then save it in a normal format.

[0050] 2) Vector saving result: Save the image in vector format, such as svg. Since vector images have no image size limit, it is a good way to save.

[0051] 3) Save the results in blocks: Split the spliced ​​large field of view into smaller blocks of the same size, add the corresponding configuration files, and equip a dedicated display module. This method is also not limited by the image size and can be saved in real time. The disadvantage is that the field of view block needs to be loaded again when reading the results.

[0052] Block saving can save the block results in real time, release the memory of the stitched image in time, and save computing resources. It is the default saving method.

[0053] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A method for stitching medical images with large field of view and low overlap, characterized by: S1, load the sampled small field of view blocks, perform preliminary field of view block classification on these blocks, distinguish disaster blocks from non-disaster blocks, give priority to non-disaster blocks, further block the non-disaster blocks into single small field of view images, and intelligently remove most non-overlapping areas; S2, then use the SST-based image stitching algorithm to stitch the non-disaster blocks, retain the stitching parameters, and do not perform panoramic fusion, where SST is the structural similarity threshold; S3, after all non-disaster blocks are spliced, the splicing parameters of the disaster block are intelligently predicted according to the splicing parameters of the spliced ​​non-disaster blocks around the disaster block, that is, the DOP splicing of the disaster block, where DOP is the dynamic optimal path; S4. When the SST and DOP algorithms are executed, the stitching parameters of all small field of view blocks are obtained, and all small field of view blocks can be panoramically fused and stitched to obtain the final large field of view result map.

2. According to claim 1, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of steps S1-S4 are: A0. Data loading: A lazy loading mechanism is used to load data from disk to memory only when stitching a small field of view image. The memory is released immediately after the splicing is saved, saving memory consumption. A1. Visual field block classification: Visual field blocks are classified to identify disaster blocks and non-disaster blocks. This step uses two methods, information entropy classifier and random forest classifier, to classify visual field blocks. A2. Single-view image segmentation: Intelligently segment non-disaster blocks according to the situation, limit the matching area to the overlapping range, improve matching accuracy and reduce calculation; A3, SST-based non-disaster block splicing: Use the SSIM-based template matching algorithm and hill climbing algorithm strategy to calculate and optimize the translation, deal with local optimal traps, and output the optimal translation and overlapping area SSIM value; A4. Prediction and splicing of disaster blocks based on DOP: After the non-disaster blocks are spliced, the disaster blocks are processed. Since there are no valid pixels in the overlapping area of ​​the disaster blocks, the splicing result data of the surrounding spliced ​​disaster blocks are used for prediction and splicing. The specific prediction strategies include: nearest neighbor prediction, average prediction, most similar prediction and emergency prediction; A5. Large-view panoramic fusion: After SST and DOP, all small-view blocks are stitched together, accurate stitching parameters are obtained, and panoramic mapping is performed in the sampling order, and the overlapping areas are linearly fused; A6. Export of large field of view: Customized output module, including optimal compression result, vector preservation result and block preservation result.

3. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of the information entropy classifier and random forest classifier in step A1 are: Information entropy classifier: The field of view blocks are classified by setting the information entropy threshold (default 3). When the information entropy is greater than the threshold, it is considered a non-disaster block, otherwise it is considered a disaster block. The threshold can be adjusted according to different samples. Random forest classifier: A random forest binary classification model is obtained by training and learning with a large number of samples, which can directly determine whether a disaster block or a non-disaster block is present.

4. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of single-view image segmentation in step A2 are as follows: A201, the overlapping area only accounts for 3-7% of the whole image, and the remaining 93-97% contains irrelevant or interfering information. This proportion needs to be clarified in order to accurately locate the overlapping part later; A202, for the registration in the horizontal direction, the left image imageA and the right image imageB in the image pair to be matched are processed in blocks respectively: CropA = right(imageA,rate) CropB =left(imageB,rate) Use the right(imageA, rate) function to extract the image block CropA with a width of rate*100% from the right side of imageA; Use the left(imageB, rate) function to extract an image block CropB with the same width of rate*100% from the left side of imageB; A203. The registration process in the vertical direction is similar to that in the horizontal direction, except that the direction of the blocks is changed to the upper or lower part, that is, a certain proportion of image blocks are intercepted from the top or bottom for matching; A204. After obtaining CropA and CropB, a matching calculation is performed only between these two blocks to find the optimal translation amount.

5. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of SST-based non-disaster block splicing in step A3 are as follows: A301, initialization: use the reference coordinates recorded during sampling to calculate a window length as the initial solution, initialize a current optimal value variable best_rate, and set it to the SSIM of the initial solution; A302, Neighborhood solution generation: Locally fine-tune the current solution to generate a series of neighborhood solutions. Define a random factor d, and obtain the neighborhood interval [rate-d, rate+d] by the distance d before and after the current solution rate. Generate new neighborhood solutions within the neighborhood interval. These candidate solutions constitute the neighborhood of the current solution for subsequent evaluation and selection. A303. Evaluate and select the best neighborhood solution: Calculate the objective function value, that is, the structural similarity SSIM value, for each neighborhood solution and compare it with the current optimal similarity; If the SSIM value of a neighborhood solution is better than the current optimal similarity value, then this neighborhood solution is used as the new current solution and the current optimal value is updated; A304, termination condition judgment: judge whether the algorithm meets the termination condition. The termination condition can be configured and selected, which can be reaching a preset number of iterations, or failing to find a better solution in a certain number of iterations; If the termination condition is met, the algorithm terminates and outputs the current optimal solution, that is, the window length, as the final solution to the problem; If the termination condition is not met, return to step A2 and continue the search process; A305. Dealing with local optimal traps: Two strategies are provided, including randomly restarting the hill climbing algorithm or introducing a simulated annealing mechanism; Random restart hill climbing algorithm: the algorithm restarts the search from another random point after reaching the local optimal solution; Mechanisms such as simulated annealing: allow the algorithm to accept poor solutions with a certain probability in order to escape from the local optimum; A306. Once the algorithm terminates, the current optimal solution and its objective function value are output, including the optimal translation and the corresponding SSIM value, the optimal translation and the similarity value of the overlapping area under the translation, as a solution to the problem.

6. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific prediction strategy of step A4 is as follows: Nearest neighbor prediction: Based on the assumption that the translation data of the disaster block is similar to the nearest non-disaster block in the same row or column in space, the location of the disaster block is determined, the nearest non-disaster block is identified, and its translation data is used as the prediction data, which takes advantage of the spatial proximity between image blocks; Average value prediction: Calculate the average value of the translation data of adjacent non-disaster blocks in the same row or column as the predicted translation amount of the disaster block, based on the assumption that the translation trend of the disaster block is roughly consistent with that of the non-disaster blocks in the same row or column; Most similar prediction: Find the average translation of one or several images with the highest similarity in the overlapped area after calibration of all non-disaster blocks in the same row or column as the predicted translation of the disaster block, based on the assumption that the most matching image block can be found by analyzing the similarity; Emergency prediction: For the special disaster blocks in the first and last rows or columns of complex tissue samples, the special disaster blocks are: the overlapping area is blank and the non-overlapping area has a small number of pixels. Find the nearest non-disaster row or column and calculate its average vertical or horizontal translation as the vertical or horizontal translation of the disaster row or column to avoid large errors in the entire row or column.

7. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of large-view panoramic fusion in step A5 are as follows: A501, select the small field of view image located in the upper left corner as the reference image; A502. Next, the remaining small field of view images are sequentially pasted into the panoramic image from top to bottom and from left to right. A503. When pasting each small field of view image into the panoramic image, special attention should be paid to the overlapping parts with the pasted images on the left and above. For these overlapping areas, linear fusion technology is used, that is, by weighted averaging the pixel values ​​in the overlapping area, a smooth transition between the two images is achieved, thereby eliminating obvious boundary traces and making the panoramic image look more natural and complete. The specific operation of linear fusion is as follows: for each pixel in the overlapping area, calculate its relative position in the left and right or upper and lower images, and then perform weighted average of the pixel values ​​at the corresponding positions of the two images according to the ratio of this position, and use this as the fused pixel value; A504: At the edge of the panoramic image, there is not enough overlapping area for fusion and a boundary effect occurs. The edge feathering technology is used to gradually reduce the pixel weight in the edge area to achieve a soft transition of the image edge. A505. After completing the mapping and fusion of all small field of view images, the entire panoramic image needs to be finally checked and optimized to ensure that there are no obvious stitching marks or color inconsistencies.

8. According to claim 2, a large-viewing-field and low-overlap medical image stitching method is characterized by: The specific steps of the output module of step A6 are: Best compression result: Calculate the minimum compression ratio, compress the image resolution to within 65536×65536, and then save it in a normal format; Vector Save Result: Save the image in vector format; Save the result in blocks: split the spliced ​​large field of view into small fields of view blocks of the same size, add corresponding configuration files, and equip a special display module.

Citation Information

Patent Citations

  • Seamless splicing method for microscopic images with low overlapping rate

    CN107093166A

  • Panoramic stitching system and method for microscopic images

    CN110807732A

  • Method, system and device for splicing and correcting large number of images, and medium

    CN116071244A