A real-time stitching artifact elimination method and system for pathological section scanning images

CN121685328BActive Publication Date: 2026-09-18HANGZHOU DEEP INFORMATICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511655366.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-09-18
Estimated Expiration
2045-11-12

AI Technical Summary

Technical Problem

[0002]在病理诊断领域,病理切片扫描图像的完整性对精准诊断至关重要;由于扫描仪单次扫描范围有限,需将多幅局部扫描图像拼接成完整图像;然而,现有拼接技术易因扫描仪水平偏差、图像重叠区域亮度与色彩不均,产生明显拼接痕迹,干扰医生对病理特征的判断

Benefits of technology

[0052] As can be seen from the above, the real-time stitching trace removal method and system for pathological slide scan images provided in this application achieves real-time stitching trace removal technology for pathological slide scan images by performing horizontal calibration on a preset scanner, obtaining the feature parameters of the preset scanner, processing to obtain the optimal number of overlapping pixels, processing based on the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix, acquiring a target image, extracting the average brightness and color values ​​of the overlapping area between the target image and adjacent images, compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, processing based on the compensated two-dimensional weight matrix to obtain fused pixels, performing elimination processing on the target image and adjacent images to obtain a processed image, extracting the image quality parameters of the overlapping area of ​​the processed image, and determining whether error correction needs to be performed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685328B_ABST
    Figure CN121685328B_ABST
Patent Text Reader

Abstract

The application provides a real-time splicing trace elimination method and system for pathological section scanning images. The method comprises the following steps: performing horizontal calibration on a preset scanner, obtaining characteristic parameters of the preset scanner, processing to obtain an optimal number of overlapping pixels, processing according to the optimal number of overlapping pixels, obtaining an initial two-dimensional weight matrix, collecting a target image, extracting average brightness values and color values of overlapping areas of the target image and adjacent images, and performing compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, processing to obtain fused pixels according to the compensated two-dimensional weight matrix, performing elimination processing on the target image and the adjacent images to obtain a processed image, extracting image quality parameters of overlapping areas of the processed image, and judging whether error correction needs to be performed, thereby realizing the real-time splicing trace elimination technology for pathological section scanning images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method and system for real-time removal of stitching marks from scanned images of pathological slides. Background Technology

[0002] In the field of pathological diagnosis, the integrity of scanned images of pathological slides is crucial for accurate diagnosis. Since the scanning range of a single scanner is limited, multiple partial scan images need to be stitched together to form a complete image. However, existing stitching techniques are prone to producing obvious stitching marks due to scanner horizontal deviations and uneven brightness and color in overlapping areas of the images, which can interfere with doctors' judgment of pathological features.

[0003] While there are currently image stitching optimization methods, most are not designed specifically for the characteristics of pathological slide scanning scenarios. Some methods do not perform horizontal calibration on the scanner first, making it difficult to eliminate the influence of the device's own deviation. Some methods do not dynamically obtain the optimal number of overlapping pixels and construct an appropriate weight matrix, resulting in poor fusion effects. Furthermore, most methods lack real-time monitoring and error correction mechanisms for the image quality of overlapping areas, which cannot guarantee the stability of the image quality after stitching and makes it difficult to meet the high image accuracy requirements of pathological diagnosis.

[0004] Effective technical solutions are urgently needed to address the above problems. Summary of the Invention

[0005] The purpose of this application is to provide a method and system for real-time stitching trace removal of pathological slide scan images. This method involves horizontally calibrating a preset scanner, obtaining its feature parameters, processing to obtain the optimal number of overlapping pixels, processing based on the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix, acquiring a target image, extracting the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, processing based on the compensated two-dimensional weight matrix to obtain fused pixels, processing the target image and adjacent images to obtain a processed image, extracting image quality parameters of the overlapping areas of the processed image, and determining whether error correction is needed. This achieves real-time stitching trace removal of pathological slide scan images.

[0006] This application also provides a method for real-time removal of stitching marks in pathological slide scan images, including the following steps:

[0007] Perform horizontal calibration on the preset scanner;

[0008] Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels;

[0009] The initial two-dimensional weight matrix is ​​obtained by processing the optimal number of overlapping pixels.

[0010] Acquire a target image, extract the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix;

[0011] The fused pixels are obtained by processing the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain the processed image.

[0012] Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction is required.

[0013] Optionally, in the real-time stitching trace removal method for pathological slide scan images described in this application, the step of obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes:

[0014] Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size;

[0015] The pixel correction coefficients are obtained by processing the optical resolution and camera pixel size using a preset overlapping pixel correction model.

[0016] Obtain the preset number of overlapping pixels, and perform correction processing based on the pixel correction coefficient to obtain the optimal number of overlapping pixels.

[0017] Optionally, in the real-time stitching trace removal method for pathological slide scan images described in this application, the step of processing based on the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix includes:

[0018] Based on the optimal number of overlapping pixels, a one-dimensional weight distribution column is obtained through calculation.

[0019] The initial two-dimensional weight matrix is ​​obtained by processing the one-dimensional weight distribution.

[0020] Optionally, in the real-time stitching trace removal method for pathological slide scan images described in this application, the steps of acquiring the target image, extracting the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix include:

[0021] Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them to obtain the average brightness difference;

[0022] Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them separately to obtain the color deviation value;

[0023] The weighted processing is performed based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction.

[0024] The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

[0025] Optionally, in the real-time stitching trace removal method for pathological slide scan images described in this application, the step of obtaining fused pixels by processing according to the compensated two-dimensional weight matrix and performing elimination processing on the target image and adjacent images to obtain the processed image includes:

[0026] The overlapping region is weighted and fused according to the compensated two-dimensional weight matrix to obtain the weighted overlapping pixels.

[0027] The target image and its neighboring images are eliminated based on the weighted overlapping pixels to obtain the processed image.

[0028] Optionally, in the real-time stitching trace removal method for pathological slide scan images described in this application, the step of extracting image quality parameters of the overlapping region of the processed image and determining whether error correction needs to be performed includes:

[0029] Image quality parameters of the overlapping region in the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity.

[0030] The quality evaluation coefficients are obtained by processing the structure similarity index, peak signal-to-noise ratio, and gradient continuity through a preset splicing quality evaluation model.

[0031] The threshold comparison result is obtained by comparing the quality assessment coefficient with the preset quality assessment threshold.

[0032] If the quality assessment coefficient is less than the preset quality assessment threshold, then corresponding error correction needs to be performed.

[0033] Secondly, this application provides a real-time stitching trace removal system for pathological slide scan images. The system includes a memory and a processor. The memory includes a program for a real-time stitching trace removal method for pathological slide scan images. When the program for the real-time stitching trace removal method for pathological slide scan images is executed by the processor, it performs the following steps:

[0034] Perform horizontal calibration on the preset scanner;

[0035] Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels;

[0036] The initial two-dimensional weight matrix is ​​obtained by processing the optimal number of overlapping pixels.

[0037] Acquire a target image, extract the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix;

[0038] The fused pixels are obtained by processing the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain the processed image.

[0039] Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction is required.

[0040] Optionally, in the real-time stitching trace removal system for pathological slide scan images described in this application, the step of obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes:

[0041] Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size;

[0042] The pixel correction coefficients are obtained by processing the optical resolution and camera pixel size using a preset overlapping pixel correction model.

[0043] Obtain the preset number of overlapping pixels, and perform correction processing based on the pixel correction coefficient to obtain the optimal number of overlapping pixels.

[0044] Optionally, in the real-time stitching trace removal system for pathological slide scan images described in this application, the step of processing according to the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix includes:

[0045] Based on the optimal number of overlapping pixels, a one-dimensional weight distribution column is obtained through calculation.

[0046] The initial two-dimensional weight matrix is ​​obtained by processing the one-dimensional weight distribution.

[0047] Optionally, in the real-time stitching trace removal system for pathological slide scan images described in this application, the steps of acquiring the target image, extracting the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix include:

[0048] Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them to obtain the average brightness difference;

[0049] Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them separately to obtain the color deviation value;

[0050] The weighted processing is performed based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction.

[0051] The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

[0052] As can be seen from the above, the real-time stitching trace removal method and system for pathological slide scan images provided in this application achieves real-time stitching trace removal technology for pathological slide scan images by performing horizontal calibration on a preset scanner, obtaining the feature parameters of the preset scanner, processing to obtain the optimal number of overlapping pixels, processing based on the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix, acquiring a target image, extracting the average brightness and color values ​​of the overlapping area between the target image and adjacent images, compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, processing based on the compensated two-dimensional weight matrix to obtain fused pixels, performing elimination processing on the target image and adjacent images to obtain a processed image, extracting the image quality parameters of the overlapping area of ​​the processed image, and determining whether error correction needs to be performed.

[0053] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description

[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 A flowchart of a method for real-time stitching trace removal of pathological slide scan images provided in an embodiment of this application;

[0056] Figure 2 A flowchart illustrating the method for obtaining the optimal number of overlapping pixels in a real-time stitching trace removal method for pathological slide scan images provided in this application embodiment;

[0057] Figure 3 A flowchart illustrating the process of obtaining the initial two-dimensional weight matrix for the real-time stitching trace removal method for pathological slide scan images provided in this application embodiment;

[0058] Figure 4 A flowchart illustrating the process of obtaining the compensated two-dimensional weight matrix in the real-time stitching trace removal method for pathological slide scan images provided in this application embodiment;

[0059] Figure 5 This is a schematic diagram of the weights in four directions of a one-dimensional weighted distribution column for the real-time stitching trace removal method for pathological slide scan images provided in the embodiments of this application. Detailed Implementation

[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0061] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0062] Please refer to Figure 1 , Figure 1 This is a flowchart of a method for real-time stitching artifact removal of pathological slide scan images according to some embodiments of this application. This method for real-time stitching artifact removal of pathological slide scan images is used in terminal devices, such as computers and mobile terminals. The method for real-time stitching artifact removal of pathological slide scan images includes the following steps:

[0063] S11. Perform horizontal calibration on the preset scanner;

[0064] S12. Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels;

[0065] S13. Process according to the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix;

[0066] S14. Acquire the target image, extract the average brightness and color values ​​of the overlapping area between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain the compensated two-dimensional weight matrix.

[0067] S15. Based on the compensated two-dimensional weight matrix, the fused pixels are obtained, and the target image and adjacent images are eliminated to obtain the processed image.

[0068] S16. Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction needs to be performed.

[0069] It should be noted that, to address the issues of stitching marks caused by scanner horizontal deviations, uneven brightness and color in overlapping areas, and the lack of real-time quality monitoring and error correction mechanisms affecting stitching quality during the stitching of pathological slide scan images, the following steps are taken: First, the preset scanner is horizontally calibrated, and its characteristic parameters, including optical resolution and camera pixel size, are obtained. Pixel correction coefficients are then obtained through an overlapping pixel correction model. Further correction is performed using a preset overlapping pixel count to obtain the optimal overlapping pixel count. Next, based on the optimal overlapping pixel count, a one-dimensional weighted distribution column (top left and bottom right) is obtained. This one-dimensional weight is then distributed according to the length and width of the acquired image. The array is expanded into four initial two-dimensional weight matrices (left, top, right, and bottom). The target image is acquired, and the average brightness and color values ​​of the overlapping areas between the target image and adjacent images are extracted. The initial two-dimensional weight matrices are then compensated to obtain a compensated two-dimensional weight matrix. The fused pixels are obtained based on the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain a processed image. Image quality parameters of the overlapping areas of the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity. Further processing is performed to obtain quality evaluation coefficients, and it is determined whether error correction needs to be performed. This enables a technique for real-time stitching trace elimination of pathological slide scan images.

[0070] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the method for obtaining the optimal number of overlapping pixels in a real-time stitching artifact removal technique for pathological slide scan images according to some embodiments of this application. According to an embodiment of the present invention, obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes:

[0071] S21. Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size;

[0072] S22. Based on the optical resolution and camera pixel size, a preset overlapping pixel correction model is used to process the data to obtain pixel correction coefficients;

[0073] S23. Obtain the preset number of overlapping pixels, and perform correction processing in combination with the pixel correction coefficient to obtain the optimal number of overlapping pixels.

[0074] It should be noted that the process involves acquiring the characteristic parameters of a preset scanner, accurately capturing its optical resolution and camera pixel size. Optical resolution determines the scanner's ability to capture details, directly affecting image sharpness; camera pixel size is related to the spatial sampling accuracy of the image. Based on these parameters, a preset overlapping pixel correction model is used for computation. This model integrates the imaging characteristics of the optical system and pixel mapping rules, converting the numerical relationship between optical resolution and pixel size into quantifiable pixel correction coefficients. Subsequently, an initially set preset number of overlapping pixels is introduced, combined with the aforementioned pixel correction coefficients for correction. During the correction process, the preset values ​​are adaptively adjusted according to the actual optical performance of the scanner and the physical size of the pixels, ultimately obtaining the optimal number of overlapping pixels that balances stitching stability and image integrity.

[0075] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating the process of obtaining an initial two-dimensional weight matrix in a real-time stitching artifact removal method for pathological slide scan images according to some embodiments of this application. According to an embodiment of the present invention, the step of processing based on the optimal number of overlapping pixels to obtain the initial two-dimensional weight matrix includes:

[0076] S31. Based on the optimal number of overlapping pixels, a one-dimensional weight distribution column is obtained through calculation.

[0077] S32. Process the one-dimensional weight distribution column to obtain the initial two-dimensional weight matrix.

[0078] It should be noted that the sigmoid function with scaling parameters is calculated based on half of the optimal overlapping pixel count (overlap) to determine when it approaches 1. The approximate value is set to 0.99, and the calculated k value is used as the k value of the parameterized sigmoid function. The formula for calculating the k value is as follows:

[0079]

[0080] Where k is the value to be calculated, overlap is the set optimal number of overlapping pixels, and p is the set approximation value; the parameterized translated sigmoid function is as follows:

[0081]

[0082] The fusion weight distribution column is obtained by substituting each value of 0-overlap into the sigmoid function. For an image, when stitching images, the left and top edges have higher weights. Therefore, at the bottom and right overlapping pixels of each image, the weight is σ(x), and for the top and left edges, the weight is 1-σ(x), ensuring that the sum of the weights of each corresponding pixel at the overlap is 1. This yields the weight distribution column W. L1 WT1 W R1 W B1 , representing the one-dimensional weight distribution columns at the top left and bottom right of the image, respectively; based on the length and width of the acquired image, each weight distribution column is expanded into two dimensions to generate a pre-set initial two-dimensional weight matrix W in four directions. L2 W R2 W T2 W B2 ,in,

[0083]

[0084] Please refer to Figure 4 , Figure 4 This is a flowchart illustrating the process of obtaining a compensated two-dimensional weight matrix in a real-time stitching artifact removal method for pathological slide scan images according to some embodiments of this application. According to an embodiment of the present invention, the steps of acquiring a target image, extracting the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix include:

[0085] S41. Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them respectively to obtain the average brightness difference.

[0086] S42. Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them respectively to obtain the color deviation value;

[0087] S43. Perform weighted processing based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction.

[0088] S44. The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

[0089] It should be noted that the process involves acquiring the target image, locating its overlapping area with adjacent images, and extracting the average brightness value of this area in key directions such as horizontal and vertical. The mean brightness difference between the target image and adjacent images in each direction of the overlapping area is calculated. Simultaneously, for each direction of the overlapping area, corresponding color values ​​(such as RGB three-channel component values) are extracted. Through color space conversion and statistical analysis, the color deviation value between the target image and adjacent images in each direction is calculated. Based on the mean brightness difference and color deviation value, combined with the sensitivity weight of the pathological slide image to brightness and color consistency, a weighted calculation is performed to obtain the corresponding weight compensation coefficient for each direction. Finally, the weight compensation coefficient for each direction is embedded into the corresponding position of the initial two-dimensional weight matrix. Compensation processing is achieved through point-by-point correction of matrix elements, ensuring that the compensated two-dimensional weight matrix can adapt to the brightness and color characteristics of the overlapping area.

[0090] According to an embodiment of the present invention, the step of obtaining fused pixels by processing the compensated two-dimensional weight matrix and performing elimination processing on the target image and adjacent images to obtain a processed image includes:

[0091] The overlapping region is weighted and fused according to the compensated two-dimensional weight matrix to obtain the weighted overlapping pixels.

[0092] The target image and its neighboring images are eliminated based on the weighted overlapping pixels to obtain the processed image.

[0093] It should be noted that after obtaining the compensated two-dimensional weight matrix, a weighted fusion process is performed on the overlapping areas of the target image and adjacent images, using this matrix as the core basis. During this process, the weight value of each element in the matrix is ​​precisely matched to the pixel at the corresponding position in the overlapping area. The weight and pixel value are multiplied, and the results of the calculation on the corresponding pixels of the target image and adjacent images are summed to obtain the weighted overlapping pixels at each position. Then, after completing the calculation of the weighted overlapping pixels, the target image and adjacent images are eliminated based on the result: the repeated pixels of the target image and adjacent images in the original overlapping area are replaced with the weighted overlapping pixels, while ensuring that the pixels in the non-overlapping areas remain in their original state. In this way, the splicing traces caused by information inconsistency in the original overlapping area are eliminated, and finally a processed image with a natural transition and overall coherence is obtained.

[0094] According to an embodiment of the present invention, the step of extracting image quality parameters of the overlapping region of the processed image and determining whether error correction needs to be performed includes:

[0095] Image quality parameters of the overlapping region in the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity.

[0096] The quality evaluation coefficients are obtained by processing the structure similarity index, peak signal-to-noise ratio, and gradient continuity through a preset splicing quality evaluation model.

[0097] The threshold comparison result is obtained by comparing the quality assessment coefficient with the preset quality assessment threshold.

[0098] If the quality assessment coefficient is less than the preset quality assessment threshold, then corresponding error correction needs to be performed.

[0099] It should be noted that key image quality parameters are extracted from the overlapping regions of the processed images, specifically including structural similarity index, peak signal-to-noise ratio (PSNR), and gradient continuity. The structural similarity index measures the consistency of structural information within the overlapping regions; a value closer to 1 indicates a better structural match. PSNR reflects the degree of noise interference in the image; a higher value indicates less image distortion. Gradient continuity assesses the smoothness of the edge transitions in the overlapping regions, directly related to the visibility of stitching marks. These three parameters—structural similarity index, PSNR, and gradient continuity—are input into a preset stitching quality evaluation model. This model, through... Different weights are assigned to each parameter (e.g., the structural similarity index has a higher weight because structural information in pathological images is more critical for diagnosis). After normalization and weighted summation, a comprehensive quantitative quality assessment coefficient is generated. Then, the quality assessment coefficient is compared with a preset quality assessment threshold (set according to the image accuracy requirements of pathological diagnosis) to obtain the threshold comparison result. If the quality assessment coefficient is less than the threshold, it indicates that there are still obvious structural mismatches, noise interference, or edge breaks in the overlapping area. In this case, an error correction mechanism needs to be triggered to optimize the stitching effect by adjusting the weight matrix parameters or recalibrating the scanner to ensure that the image quality meets the diagnostic requirements.

[0100] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the weights in four directions of a one-dimensional weighted distribution column for the real-time stitching artifact removal method for pathological slide scan images provided in this application embodiment. According to an embodiment of the present invention, the weighted distribution column W... L1 W T1 W B1 W B1 These represent the one-dimensional weight distribution columns of the top left and bottom right of the image, respectively. When stitching images together, the images on the left and top have higher weights.

[0101] Secondly, the present invention also discloses a real-time stitching trace removal system for pathological slide scan images, comprising a memory and a processor. The memory includes a method program for real-time stitching trace removal of pathological slide scan images. When the method program for real-time stitching trace removal of pathological slide scan images is executed by the processor, it performs the following steps:

[0102] Perform horizontal calibration on the preset scanner;

[0103] Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels;

[0104] The initial two-dimensional weight matrix is ​​obtained by processing the optimal number of overlapping pixels.

[0105] Acquire a target image, extract the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix;

[0106] The fused pixels are obtained by processing the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain the processed image.

[0107] Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction is required.

[0108] It should be noted that, to address the issues of stitching marks caused by scanner horizontal deviations, uneven brightness and color in overlapping areas, and the lack of real-time quality monitoring and error correction mechanisms affecting stitching quality during the stitching of pathological slide scan images, the following steps are taken: First, the preset scanner is horizontally calibrated, and its characteristic parameters, including optical resolution and camera pixel size, are obtained. Pixel correction coefficients are then obtained through an overlapping pixel correction model. Further correction is performed using a preset overlapping pixel count to obtain the optimal overlapping pixel count. Next, based on the optimal overlapping pixel count, a one-dimensional weighted distribution column (top left and bottom right) is obtained. This one-dimensional weight is then distributed according to the length and width of the acquired image. The array is expanded into four initial two-dimensional weight matrices (left, top, right, and bottom). The target image is acquired, and the average brightness and color values ​​of the overlapping areas between the target image and adjacent images are extracted. The initial two-dimensional weight matrices are then compensated to obtain a compensated two-dimensional weight matrix. The fused pixels are obtained based on the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain a processed image. Image quality parameters of the overlapping areas of the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity. Further processing is performed to obtain quality evaluation coefficients, and it is determined whether error correction needs to be performed. This enables a technique for real-time stitching trace elimination of pathological slide scan images.

[0109] According to an embodiment of the present invention, obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes:

[0110] Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size;

[0111] The pixel correction coefficients are obtained by processing the optical resolution and camera pixel size using a preset overlapping pixel correction model.

[0112] Obtain the preset number of overlapping pixels, and perform correction processing based on the pixel correction coefficient to obtain the optimal number of overlapping pixels.

[0113] It should be noted that the process involves acquiring the characteristic parameters of a preset scanner, accurately capturing its optical resolution and camera pixel size. Optical resolution determines the scanner's ability to capture details, directly affecting image sharpness; camera pixel size is related to the spatial sampling accuracy of the image. Based on these parameters, a preset overlapping pixel correction model is used for computation. This model integrates the imaging characteristics of the optical system and pixel mapping rules, converting the numerical relationship between optical resolution and pixel size into quantifiable pixel correction coefficients. Subsequently, an initially set preset number of overlapping pixels is introduced, combined with the aforementioned pixel correction coefficients for correction. During the correction process, the preset values ​​are adaptively adjusted according to the actual optical performance of the scanner and the physical size of the pixels, ultimately obtaining the optimal number of overlapping pixels that balances stitching stability and image integrity.

[0114] According to an embodiment of the present invention, the step of processing based on the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix includes:

[0115] Based on the optimal number of overlapping pixels, a one-dimensional weight distribution column is obtained through calculation.

[0116] The initial two-dimensional weight matrix is ​​obtained by processing the one-dimensional weight distribution.

[0117] It should be noted that the sigmoid function with scaling parameters is calculated based on half of the optimal overlapping pixel count (overlap) to determine when it approaches 1. The approximate value is set to 0.99, and the calculated k value is used as the k value of the parameterized sigmoid function. The formula for calculating the k value is as follows:

[0118]

[0119] Where k is the value to be calculated, overlap is the set optimal number of overlapping pixels, and p is the set approximation value; the parameterized translated sigmoid function is as follows:

[0120]

[0121] The fusion weight distribution column is obtained by substituting each value of 0-overlap into the sigmoid function. For an image, when stitching images, the left and top edges have higher weights. Therefore, at the bottom and right overlapping pixels of each image, the weight is σ(x), and for the top and left edges, the weight is 1-σ(x), ensuring that the sum of the weights of each corresponding pixel at the overlap is 1. This yields the weight distribution column W. L1 W T1 W B1 W B1, representing the one-dimensional weight distribution columns at the top left and bottom right of the image, respectively; based on the length and width of the acquired image, each weight distribution column is expanded into two dimensions to generate a pre-set initial two-dimensional weight matrix W in four directions. L2 W R2 W T2 W B2 ,in,

[0122]

[0123] According to an embodiment of the present invention, the steps of acquiring a target image, extracting the average brightness and color values ​​of the overlapping areas of the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix include:

[0124] Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them to obtain the average brightness difference;

[0125] Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them separately to obtain the color deviation value;

[0126] The weighted processing is performed based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction.

[0127] The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

[0128] It should be noted that the process involves acquiring the target image, locating its overlapping area with adjacent images, and extracting the average brightness value of this area in key directions such as horizontal and vertical. The mean brightness difference between the target image and adjacent images in each direction of the overlapping area is calculated. Simultaneously, for each direction of the overlapping area, corresponding color values ​​(such as RGB three-channel component values) are extracted. Through color space conversion and statistical analysis, the color deviation value between the target image and adjacent images in each direction is calculated. Based on the mean brightness difference and color deviation value, combined with the sensitivity weight of the pathological slide image to brightness and color consistency, a weighted calculation is performed to obtain the corresponding weight compensation coefficient for each direction. Finally, the weight compensation coefficient for each direction is embedded into the corresponding position of the initial two-dimensional weight matrix. Compensation processing is achieved through point-by-point correction of matrix elements, ensuring that the compensated two-dimensional weight matrix can adapt to the brightness and color characteristics of the overlapping area.

[0129] According to an embodiment of the present invention, the step of obtaining fused pixels by processing the compensated two-dimensional weight matrix and performing elimination processing on the target image and adjacent images to obtain a processed image includes:

[0130] The overlapping region is weighted and fused according to the compensated two-dimensional weight matrix to obtain the weighted overlapping pixels.

[0131] The target image and its neighboring images are eliminated based on the weighted overlapping pixels to obtain the processed image.

[0132] It should be noted that after obtaining the compensated two-dimensional weight matrix, a weighted fusion process is performed on the overlapping areas of the target image and adjacent images, using this matrix as the core basis. During this process, the weight value of each element in the matrix is ​​precisely matched to the pixel at the corresponding position in the overlapping area. The weight and pixel value are multiplied, and the results of the calculation on the corresponding pixels of the target image and adjacent images are summed to obtain the weighted overlapping pixels at each position. Then, after completing the calculation of the weighted overlapping pixels, the target image and adjacent images are eliminated based on the result: the repeated pixels of the target image and adjacent images in the original overlapping area are replaced with the weighted overlapping pixels, while ensuring that the pixels in the non-overlapping areas remain in their original state. In this way, the splicing traces caused by information inconsistency in the original overlapping area are eliminated, and finally a processed image with a natural transition and overall coherence is obtained.

[0133] According to an embodiment of the present invention, the step of extracting image quality parameters of the overlapping region of the processed image and determining whether error correction needs to be performed includes:

[0134] Image quality parameters of the overlapping region in the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity.

[0135] The quality evaluation coefficients are obtained by processing the structure similarity index, peak signal-to-noise ratio, and gradient continuity through a preset splicing quality evaluation model.

[0136] The threshold comparison result is obtained by comparing the quality assessment coefficient with the preset quality assessment threshold.

[0137] If the quality assessment coefficient is less than the preset quality assessment threshold, then corresponding error correction needs to be performed.

[0138] It should be noted that key image quality parameters are extracted from the overlapping regions of the processed images, specifically including structural similarity index, peak signal-to-noise ratio (PSNR), and gradient continuity. The structural similarity index measures the consistency of structural information within the overlapping regions; a value closer to 1 indicates a better structural match. PSNR reflects the degree of noise interference in the image; a higher value indicates less image distortion. Gradient continuity assesses the smoothness of the edge transitions in the overlapping regions, directly related to the visibility of stitching marks. These three parameters—structural similarity index, PSNR, and gradient continuity—are input into a preset stitching quality evaluation model. This model, through... Different weights are assigned to each parameter (e.g., the structural similarity index has a higher weight because structural information in pathological images is more critical for diagnosis). After normalization and weighted summation, a comprehensive quantitative quality assessment coefficient is generated. Then, the quality assessment coefficient is compared with a preset quality assessment threshold (set according to the image accuracy requirements of pathological diagnosis) to obtain the threshold comparison result. If the quality assessment coefficient is less than the threshold, it indicates that there are still obvious structural mismatches, noise interference, or edge breaks in the overlapping area. In this case, an error correction mechanism needs to be triggered to optimize the stitching effect by adjusting the weight matrix parameters or recalibrating the scanner to ensure that the image quality meets the diagnostic requirements.

[0139] According to an embodiment of the present invention, the weight distribution column W L1 W T1 W R1 W B1 These represent the one-dimensional weight distribution columns of the top left and bottom right of the image, respectively. When stitching images together, the images on the left and top have higher weights.

[0140] This invention discloses a method and system for real-time stitching artifact removal of pathological slide scan images. The method involves: horizontally calibrating a preset scanner to obtain its feature parameters; processing these parameters to obtain the optimal number of overlapping pixels; processing the optimal number of overlapping pixels to obtain an initial two-dimensional weight matrix; acquiring a target image; extracting the average brightness and color values ​​of the overlapping areas between the target image and adjacent images; compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix; processing the compensated two-dimensional weight matrix to obtain fused pixels; performing artifact removal processing on the target image and adjacent images to obtain a processed image; extracting image quality parameters of the overlapping areas of the processed image; and determining whether error correction is needed. This achieves real-time stitching artifact removal of pathological slide scan images.

[0141] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0142] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0143] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0144] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0145] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

Claims

1. A method for real-time removal of stitching marks in scanned images of pathological sections, characterized in that, Includes the following steps: Perform horizontal calibration on the preset scanner; Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels; The initial two-dimensional weight matrix is ​​obtained by processing the optimal number of overlapping pixels. Acquire a target image, extract the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix; The fused pixels are obtained by processing the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain the processed image. Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction needs to be performed; The step of processing according to the optimal number of overlapping pixels to obtain the initial two-dimensional weight matrix includes: processing according to the optimal number of overlapping pixels to obtain a one-dimensional weight distribution column of the upper left and lower right of the image, and expanding the one-dimensional weight distribution column into four initial two-dimensional weight matrices of left, top, right and bottom according to the length and width of the acquired image. The process involves acquiring the target image, extracting the average brightness and color values ​​of the overlapping regions between the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, including: Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them to obtain the average brightness difference; Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them separately to obtain the color deviation value; The weighted processing is performed based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction. The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

2. The method for real-time stitching trace removal of pathological slide scan images according to claim 1, characterized in that, The step of obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes: Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size; The pixel correction coefficients are obtained by processing the optical resolution and camera pixel size using a preset overlapping pixel correction model. Obtain the preset number of overlapping pixels, and perform correction processing based on the pixel correction coefficient to obtain the optimal number of overlapping pixels.

3. The method for real-time stitching trace removal of pathological slide scan images according to claim 1, characterized in that, The step of obtaining fused pixels by processing the compensated two-dimensional weight matrix and performing elimination processing on the target image and adjacent images to obtain the processed image includes: The overlapping region is weighted and fused according to the compensated two-dimensional weight matrix to obtain the weighted overlapping pixels. The target image and its neighboring images are eliminated based on the weighted overlapping pixels to obtain the processed image.

4. The method for real-time stitching trace removal of pathological slide scan images according to claim 1, characterized in that, The step of extracting image quality parameters of the overlapping region of the processed image and determining whether error correction needs to be performed includes: Image quality parameters of the overlapping region in the processed image are extracted, including structural similarity index, peak signal-to-noise ratio, and gradient continuity. The quality evaluation coefficients are obtained by processing the structural similarity index, peak signal-to-noise ratio, and gradient continuity through a preset splicing quality evaluation model. The threshold comparison result is obtained by comparing the quality assessment coefficient with the preset quality assessment threshold. If the quality assessment coefficient is less than the preset quality assessment threshold, then corresponding error correction needs to be performed.

5. A real-time stitching trace removal system for pathological slide scan images, characterized in that, The system includes a memory and a processor. The memory contains a program for a real-time method to remove stitching marks from scanned images of pathological slides. When the program for the real-time method to remove stitching marks from scanned images of pathological slides is executed by the processor, it performs the following steps: Perform horizontal calibration on the preset scanner; Obtain the feature parameters of the preset scanner and process them to obtain the optimal number of overlapping pixels; The initial two-dimensional weight matrix is ​​obtained by processing the optimal number of overlapping pixels. Acquire a target image, extract the average brightness and color values ​​of the overlapping areas between the target image and adjacent images, and perform compensation processing on the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix; The fused pixels are obtained by processing the compensated two-dimensional weight matrix, and the target image and adjacent images are eliminated to obtain the processed image. Extract the image quality parameters of the overlapping region of the processed image and determine whether error correction needs to be performed; The step of processing according to the optimal number of overlapping pixels to obtain the initial two-dimensional weight matrix includes: processing according to the optimal number of overlapping pixels to obtain a one-dimensional weight distribution column of the upper left and lower right of the image, and expanding the one-dimensional weight distribution column into four initial two-dimensional weight matrices of left, top, right and bottom according to the length and width of the acquired image. The process involves acquiring the target image, extracting the average brightness and color values ​​of the overlapping regions between the target image and adjacent images, and compensating the initial two-dimensional weight matrix to obtain a compensated two-dimensional weight matrix, including: Acquire the target image, extract the average brightness values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them to obtain the average brightness difference; Extract the color values ​​corresponding to each direction of the overlapping area between the target image and adjacent images, and process them separately to obtain the color deviation value; The weighted processing is performed based on the mean difference in brightness and the color deviation value to obtain the weight compensation coefficients corresponding to each direction. The initial two-dimensional weight matrix is ​​compensated according to the weight compensation coefficient to obtain the compensated two-dimensional weight matrix.

6. The real-time stitching trace removal system for pathological slide scan images according to claim 5, characterized in that, The step of obtaining the feature parameters of the preset scanner and processing them to obtain the optimal number of overlapping pixels includes: Obtain the feature parameters of the preset scanner, including optical resolution and camera pixel size; The pixel correction coefficients are obtained by processing the optical resolution and camera pixel size using a preset overlapping pixel correction model. Obtain the preset number of overlapping pixels, and perform correction processing based on the pixel correction coefficient to obtain the optimal number of overlapping pixels.

Citation Information

Patent Citations

  • Image brightness and color balancing method and system for video stitching

    CN104240211A

  • Image mosaic method, device, electronic device and storage medium

    CN109300085A