A method and system for fan illumination correction of digital slide scanning

CN122961907APending Publication Date: 2026-10-23SHENZHEN SHENGQIANG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611452483.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

在同一套扫描参数下,每个扫描视野都会残留与该厚度对应的亮度分布,全片拼接后会出现与扫描视野网格周期一致的块状亮度差异,即拼接格子现象,严重影响数字切片的图像质量与后续诊断观察

Benefits of technology

1、本发明将载玻片厚度(等效光程)作为照明系统的补偿参量,以厚度补偿量为输入匹配对应的光源驱动量与平场校正矩阵,从硬件驱动与校正系数两个层面预先响应厚度变化,再通过光强环、形状环分别调控整体亮度与分布形态,从照明场匹配这一根源上实现校正,能够同时解决玻片厚度变化带来的整体光强水平漂移和扇形场分布形态改变的耦合效应。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122961907A_ABST
    Figure CN122961907A_ABST
Patent Text Reader

Abstract

The application discloses a kind of fan-shaped illumination correction method and system of digital slice scanning, comprising the following steps: S1, obtain the thickness of slide or equivalent optical path as thickness compensation quantity;S2, determine corresponding light source driving quantity and flat field correction matrix according to the thickness compensation quantity;S3, in the state that slide is kept in optical path, collect blank field image of this piece;S4, execute light intensity ring adjustment, so that the average brightness of blank field image of this piece falls into the target brightness window of unsaturated;S5, execute shape ring correction matrix;S6, target scanning image is corrected before nonlinear gray scale conversion to apply final flat field correction matrix to correct.The application is input with thickness compensation quantity, matches corresponding light source driving quantity and flat field correction matrix, then controls overall brightness and distribution form by light intensity ring and shape ring respectively, can simultaneously solve the coupling effect of overall light intensity level drift and fan-shaped field distribution form change caused by slide thickness variation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital slice scanning technology, and in particular to a fan-shaped illumination correction method and system for digital slice scanning. Background Technology

[0002] A digital pathology slide scanner is a core device that converts tissue samples on pathological slides into full-slide digital images through optical scanning. In transmission brightfield scanning mode, the transmission light source is positioned below the stage. The light passes sequentially through the slide, mounting medium, and coverslip before entering the objective lens. A planar image sensor acquires multiple local field-of-view images with a certain degree of overlap according to a grid or serpentine scanning path. Then, an image stitching algorithm is used to generate a complete full-slide digital slice.

[0003] Currently, most mass-produced digital pathology scanners, considering cost factors, do not adopt a strict Köhler illumination structure. Instead, they use light-emitting diodes combined with simple homogenizing elements to form a transmission light source. The light beam emitted by this type of light source propagates in a spatially divergent manner, forming a two-dimensional light intensity distribution at the sample focal plane with high brightness at the center and gradually decreasing towards the periphery, or with a directional brightness gradient. This type of illumination field is usually called a fan-shaped illumination field.

[0004] Currently, there is no unified standard for the thickness of pathological slides and coverslips, resulting in variations in thickness between different manufacturers and batches. Existing scanning equipment typically has the capability to measure the total thickness or individual slide thickness, but these measurements are mostly used only for slide acceptance and not as compensation parameters for the illumination system. When the slide thickness changes, the working distance from the light source to the sample focal plane and the optical path length of the light in the glass medium also change. For a sector illumination field, this change is not simply a rise or fall in overall brightness, but rather a simultaneous alteration of the overall light intensity level and the two-dimensional light intensity distribution. Under the same set of scanning parameters, each scanning field will retain a brightness distribution corresponding to that thickness. After stitching the entire slide, blocky brightness differences consistent with the grid period of the scanning field will appear, known as the stitching grid phenomenon, severely affecting the image quality of digital slides and subsequent diagnostic observation.

[0005] Currently, some targeted solutions have been adopted to address the issues of uniformity correction and brightness differences in transmitted illumination, such as the fixed blank field flat field correction method, the optical system displacement correction method combined with the white image without a slide, the thickness uniformity quality inspection scheme, the blank area acquisition and correction method of the slide itself, the overlapping area fusion and histogram alignment method, and the thickness-related focusing optimization scheme. However, the above solutions either assume that the illumination field is independent of the thickness of the slide or are designed based on the Köhler illumination conjugate relationship, or they only address uniformity quality inspection or attempt to cover up grid defects through post-fusion. None of them can simultaneously solve the coupled problem of "overall light intensity window drift with thickness" and "fan-shaped field distribution shape changing with thickness", thus failing to eliminate the grid problem of slides of different thicknesses from the root cause of illumination field matching. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of the prior art by providing a method and system for sector illumination correction in digital slice scanning.

[0007] The objective of this invention is achieved through the following technical solution: a method for sector illumination correction in digital slice scanning, comprising the following steps: S1. Obtain the glass slide thickness or equivalent optical path as the thickness compensation amount. S2. Determine the corresponding light source driving amount and flat field correction matrix based on the thickness compensation amount; S3. With the slide held in the optical path, acquire the blank field image of the slide; S4. Execute the light intensity ring adjustment so that the average brightness of the blank field image of this film falls into the unsaturated target brightness window; S5. Perform shape loop correction: Perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of this film, if the brightness non-uniformity of the corrected blank field image of this film does not exceed the preset non-uniformity threshold, then the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image of this film exceeds the preset non-uniformity threshold, then the shape residual matrix of this film is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. S6. Before nonlinear grayscale transformation, the target scan image is corrected by applying a final flat field correction matrix, and then scan stitching and grid detection are performed.

[0008] Preferably, in step S1, the thickness compensation amount is obtained by using the thickness of the glass slide measured by direct measurement as the thickness compensation amount. If the thickness of the slide cannot be measured by direct measurement, the equivalent optical path is used as the thickness compensation. The equivalent optical path is the difference between the focusing height of the slide and the reference height at the current objective lens magnification. The reference height is the position encoder reading along the optical axis after focusing with a standard blank slide of known thickness at the corresponding objective lens magnification.

[0009] Preferably, in step S2, a lookup table arranged by thickness level is pre-established offline. Each thickness level in the lookup table corresponds to a pair of stored light source driving quantity and flat field correction matrix. The corresponding parameter is retrieved from the lookup table based on the thickness compensation amount, or linear interpolation is performed between adjacent parameters to obtain the corresponding light source driving amount and flat field correction matrix. The interpolated flat field correction matrix is ​​then subjected to mean normalization.

[0010] Preferably, the flat field correction matrix corresponding to each thickness level in the lookup table is generated in the following manner: For each color channel, spatial smoothing is performed on the blank field image corresponding to that thickness level; the arithmetic mean brightness of the pixels in the smoothed blank field image is calculated, and the ratio of the arithmetic mean brightness to the brightness of each pixel after smoothing is used as the unlimited gain of the corresponding pixel. If the brightness of a smoothed pixel is lower than a preset noise threshold, the unlimited gain of that pixel is set to 1 and it is not included in the arithmetic mean brightness calculation. The unconstrained gain of each pixel is limited to between a preset lower gain limit and a higher gain limit, and then divided by the spatial average gain of all pixels after constraining to obtain the flat field correction matrix of the color channel.

[0011] Preferably, in step S4, the light intensity loop adjustment adopts a closed-loop iterative method, specifically including: The initial light source driving value is obtained from the lookup table based on the thickness compensation amount. Under the current light source driving value, the transmitted light source is illuminated and a blank field image is acquired. The average brightness of all pixels in the blank field image and the maximum brightness of each color channel are calculated, and a saturation check is performed. The specific method for saturation check is as follows: The maximum brightness is compared with the preset saturation threshold. If the maximum brightness exceeds the preset saturation threshold, the current light source driving amount is reduced based on the ratio of the preset saturation threshold to the maximum brightness, and a blank field image is re-acquired for saturation verification until the maximum brightness does not exceed the preset saturation threshold. After the saturation check passes, perform the average brightness check; the specific method for the average brightness check is as follows: The average brightness of the blank field image is compared with the preset target brightness. If the absolute difference between the average brightness of the blank field image and the preset target brightness exceeds the preset brightness tolerance, the current light source driving amount is adjusted according to the ratio of the preset target brightness to the current average brightness of the blank field image, and the blank field image is re-acquired for average brightness verification until the absolute difference between the average brightness of the blank field image and the preset target brightness does not exceed the preset brightness tolerance. After saturation and average brightness checks, the current light source driving quantity is locked.

[0012] Preferably, in step S5, the shape residual matrix of the local image is generated based on the ratio of the average brightness of each color channel of the local blank field image to the brightness of each pixel of the corresponding color channel.

[0013] Preferably, in step S5, the flat field gain of each pixel during the flat field correction process is clamped and the proportion of the clamped pixels to the total number of pixels is counted as the clamping area. If the clamping area exceeds the preset area threshold, the process returns to step S4 and the light source driving amount is reduced to narrow the dynamic range of the illumination field. After the center region of the blank field image returns to the linear response region, the blank field image is re-acquired and shape loop correction is performed.

[0014] As a preferred embodiment, the specific method for scanning and stitching in step S6 is as follows: Target scan images are acquired using a grid scanning method with overlapping stripes in each field of view. Linear weighting is applied to the brightness transition within the overlapping stripes of adjacent fields of view. The specific method is as follows: Weight values ​​are set sequentially along the direction away from the previous viewpoint, with the weight values ​​linearly decreasing from 1 to 0. The output pixel brightness value in the overlapping area is: ; in, The output pixel brightness value within the overlapping area. This represents the original pixel brightness value corresponding to the previous adjacent viewpoint in this overlapping region. This represents the original pixel brightness value corresponding to the current field of view in the overlapping area. This is the weight value.

[0015] As a preferred embodiment, the specific method for grid detection in step S6 is as follows: After scanning and stitching to obtain a full slice image, a thumbnail is generated. The width and height of a single scan field of view on the thumbnail are used as the block size. The thumbnail is divided into horizontal strips of the corresponding field of view row and vertical strips of the corresponding field of view column along the row and column directions, respectively. The arithmetic mean of all pixels in each horizontal and vertical strip is taken to obtain the corresponding one-dimensional average brightness sequence in the row direction and the one-dimensional average brightness sequence in the column direction. For the row-direction and column-direction one-dimensional average brightness sequences, a moving average with a window larger than two scanning fields is used to remove slow-varying trends. Fourier transforms are then performed on the row-direction and column-direction one-dimensional average brightness sequences after removing the slow-varying trends, and the amplitude at the normalized spatial frequency of 1 is extracted from the row-direction and column-direction one-dimensional average brightness sequences. A 1 and overall average amplitude A 0, Take amplitude A 1 and amplitude A The ratio of 0 is used as the periodic component. If the periodic component of the row direction one-dimensional average brightness sequence or the column direction one-dimensional average brightness sequence is greater than the preset periodic component threshold, it is determined that there is a cell, and steps S4 to S6 are re-executed.

[0016] A sector illumination correction system for digital slice scanning includes: Thickness acquisition unit, used to acquire the thickness of the glass slide or the equivalent optical path as a thickness compensation amount; Flat field storage unit is used to store the light source driving quantity and flat field correction matrix in pairs according to thickness level; The blank field acquisition unit is used to acquire blank field images of the slide while the slide is held in the optical path. The light intensity ring control unit is used to adjust the light source drive amount or exposure parameters so that the average brightness of the blank field image falls into the unsaturated target brightness window. The shape ring correction unit is used to perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of the current image, if the brightness non-uniformity of the corrected blank field image does not exceed the preset non-uniformity threshold, the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image exceeds the preset non-uniformity threshold, the shape residual matrix of the current image is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. An image processing unit is used to apply a final flat-field correction matrix to the target scan image for correction. The stitching unit is used to stitch together images from different scanning fields. The grid detection unit is used to perform grid detection on the stitched scanned image.

[0017] The beneficial effects of this invention are: 1. This invention uses the thickness of the glass slide (equivalent optical path) as a compensation parameter of the lighting system. The thickness compensation amount is used as input to match the corresponding light source driving amount and flat field correction matrix. It responds to thickness changes in advance from two levels: hardware driving and correction coefficient. Then, the overall brightness and distribution pattern are controlled by the light intensity ring and shape ring respectively. The correction is achieved from the root of lighting field matching. It can solve the coupling effect of overall light intensity level drift and fan-shaped field distribution pattern change caused by glass slide thickness change.

[0018] 2. In this invention, the light intensity ring adjustment addresses the overall light intensity drift caused by thickness variations, controlling the average brightness of the blank field within the unsaturated target window. This avoids overexposure and loss of detail while ensuring that the brightness is within the optimal imaging range, thus solving the problem of overall light intensity window shift under different thicknesses. The shape ring correction addresses the thickness-related distribution deformation of the two-dimensional brightness gradient of the fan-shaped illumination field, employing a second-order correction mode of "pre-calibrated flat field matrix + local image shape residual correction": first, basic homogenization is achieved through a pre-calibrated matrix that matches the thickness, then the residual matrix of the local image blank field is superimposed for fine correction, and mean normalization ensures that the brightness benchmark is consistent after correction. This can control the brightness non-uniformity within a preset threshold, accurately correcting the distribution characteristics of the fan-shaped field where the center is bright and the periphery is attenuated. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention.

[0020] Figure 2 This is a schematic diagram illustrating the effect of changes in slide thickness on the sector illumination field and the stitched imaging. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0022] Those skilled in the art should understand that, in the disclosure of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting this invention.

[0023] It is understood that the term "a" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple, and the term "a" should not be understood as a limitation on the number.

[0024] like Figure 1 to Figure 2 As shown, a fan-shaped illumination correction method for digital slice scanning includes the following steps: S1. Obtain the thickness of the glass slide or the equivalent optical path as the thickness compensation amount.

[0025] S2. Determine the corresponding light source driving amount and flat field correction matrix based on the thickness compensation amount; S3. With the slide held in the optical path, acquire the blank field image of the slide; S4. Execute the light intensity ring adjustment so that the average brightness of the blank field image of this film falls into the unsaturated target brightness window; S5. Perform shape loop correction: Perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of this film, if the brightness non-uniformity of the corrected blank field image of this film does not exceed the preset non-uniformity threshold, then the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image of this film exceeds the preset non-uniformity threshold, then the shape residual matrix of this film is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. S6. Before nonlinear grayscale transformation, the target scan image is corrected by applying a final flat field correction matrix, and then scan stitching and grid detection are performed.

[0026] This invention is applied to the scanning and stitching process of a digital surface array using fan-shaped divergent transmitted illumination. The fan-shaped illumination field refers to the two-dimensional light intensity distribution formed on the sample surface by the divergent beam emitted from the transmitted light source, rather than the uniform illumination field under Köhler illumination.

[0027] In step S1, the thickness compensation is obtained by prioritizing the use of the glass slide thickness measured directly. This method of using the direct measurement of the glass slide thickness as the compensation is a direct acquisition of the core physical quantity (glass slide thickness) that causes changes in the illumination field. The thickness value directly corresponds to the changes in the glass optical path and the working distance between the light source and the focal plane. The physical mapping relationship is clear, and there is no cumulative error from indirect conversion. This provides the most accurate input reference for subsequent matching of the light source driving quantity and calling the pre-calibrated flat field correction matrix, ensuring correction accuracy from the source.

[0028] If the thickness of the slide cannot be measured by direct measurement, the equivalent optical path is used as the thickness compensation. The equivalent optical path is the difference between the focusing height of the slide and the reference height at the current objective lens magnification. The reference height is the position encoder reading along the optical axis after focusing with a standard blank slide of known thickness at the corresponding objective lens magnification.

[0029] When using the equivalent optical path as the thickness compensation amount, the specific operation method is as follows: Take a standard blank glass slide of known thickness; focus the standard slide at the current objective magnification of the scanning device, and record the position encoder reading along the optical axis when focusing is completed as the reference height. Write the reference height, the thickness of the standard glass slide, and the magnification together into the storage unit of the scanning device.

[0030] During the actual scanning process, once the slide (the glass slide being scanned) has finished focusing, the focusing height of the slide in the current scan is read. The equivalent optical path is obtained by subtracting the reference height at that magnification from the actual focusing height of the slide, and this is used as the thickness compensation amount. The thickness compensation amount is used for subsequent simultaneous indexing light source driving amount and plan field correction matrix.

[0031] In step S2, a lookup table arranged by thickness level is pre-established offline. For each thickness level in the lookup table, a pair of light source driving quantities and flat field correction matrices are stored. The corresponding parameters of the level are retrieved from the lookup table according to the thickness compensation amount, or the corresponding light source driving quantity and flat field correction matrix are obtained by linear interpolation between adjacent levels. The interpolated flat field correction matrix is ​​then subjected to mean normalization.

[0032] The calibration process for the lookup table includes: during equipment assembly or periodic maintenance, preparing at least three blank glass or blank slides of known thicknesses covering the sample thickness range; acquiring multiple frames of blank fields at the corresponding scanning focus height for each thickness and averaging them by pixels; recording the light source drive quantity corresponding to each thickness when adjusting the average brightness of the blank field to the unsaturated target brightness window, and the corresponding flat field correction matrix; storing these two in pairs. A blank field image refers to an image acquired when the slide is held in the optical path, light passes through the glass but there is no tissue or the tissue area is below a preset area threshold within the field of view. The light source drive quantity refers to the electrical quantity that controls the intensity of the transmitted light source, specifically the control voltage output by the digital-to-analog converter of the illumination channel, or the drive current and power percentage corresponding to that voltage.

[0033] The flat field correction matrix corresponding to each thickness level in the lookup table is generated in the following manner: For each color channel, spatial smoothing is performed on the blank field image corresponding to the thickness level. The arithmetic mean brightness of the pixels in the smoothed blank field image is calculated, and the ratio of the arithmetic mean brightness to the brightness of each pixel after smoothing is used as the unlimited gain of the corresponding pixel. If the brightness of the smoothed pixel is lower than a preset noise threshold, the unlimited gain of the pixel is set to 1 and is not included in the arithmetic mean brightness calculation. The unlimited gain of each pixel is limited to between a preset lower gain limit and a preset upper gain limit, and then divided by the spatial average value of the gain of all pixels after limiting, to obtain the flat field correction matrix of the color channel.

[0034] Specifically, for a given color channel, its blank field image is denoted as... B ( x , y First, spatial smoothing is performed to obtain the smoothed blank field image B. ( x , y The smoothing window can use a 3x3 or 5x5 average to reduce interference from dust.

[0035] Average brightness of current color channel m Equal to the smoothed blank field image B ( x , y Arithmetic mean over all pixels. Unlimited gain. g ( x , y )= m / B ( x , y ).

[0036] Blank field image B after smoothing ( x , y If the pixel brightness is below a preset noise threshold, the unlimited gain of that pixel... g Set to 1, and it will not participate in subsequent averaging. This sets the unlimited gain of the pixel. g Limit to the lower limit G min and upper limit G max After that, divide by the gain after the limit. g The spatial average value is used to obtain the channel flat field correction matrix. C ( x , y ),Right now: C ( x , y =Clip( m / B ( x , y )) / mean(Clip( m / B )); In the above formula, Clip means pressing G. min G max Amplitude limiting, where mean represents spatial averaging, ensures that the average value of the flat field correction matrix C(x,y) is 1 across all pixels. The three color channels (R channel, B channel, and G channel) are calculated separately using the above formula, and combined to form the flat field correction matrix for that thickness level. During normal correction, the pixel value of the corresponding color channel in the target scan image is multiplied by the flat field correction matrix C(x,y) for that color channel.

[0037] Linear interpolation is performed between adjacent gear levels to obtain the corresponding light source drive quantity and flat field correction matrix. The interpolation process is as follows: The lookup table is arranged into several levels according to thickness from smallest to largest. Let the first level be... k The thickness of the strip is d k Corresponding light source driving quantity I k Peace field correction matrix C k If the thickness of this film... d If the thickness is less than or equal to the lowest thickness level, then the light source driving amount and plane field correction matrix of the lowest thickness level are used; if d If the thickness is greater than or equal to the maximum thickness level, then the light source driving amount corresponding to the maximum thickness level is used. I k Peace field correction matrix C k .like d Falling into the adjacent two gears d k and d k+1 Between, let the intermediate coefficient for: α =( d - d k ) / ( d k+1 - d k ); α is between 0 and 1. Then the interpolated light source driving quantity I(d) and the flat field correction matrix C(x,y,d) are: I(d) = (1-α)·I k +α·I k+1; C(x,y,d)=(1-α)·C k (x,y)+α·C k+1 (x,y); The flat field correction matrix C(x,y,d) obtained after interpolation is then normalized to the mean.

[0038] In step S3, after focusing is completed and before the formal grid scan, based on the preview image or positioning image, select an area on the film with no tissue or tissue area below a preset area threshold as a blank field area, and obtain a blank field image of the blank field area.

[0039] In step S4, the light source driving quantity obtained by looking up the table is only an initial reference value. Closed-loop fine-tuning (i.e., light intensity loop adjustment) needs to be performed on this initial reference value. The light intensity loop adjustment adopts a closed-loop iterative method, specifically including: The initial light source driving value is obtained from the lookup table based on the thickness compensation amount; the transmitted light source is lit under the current light source driving value, and a blank field image (obtained from step S3) is acquired. The average brightness of all pixels in the blank field image is calculated. M and the maximum brightness of each color channel M max Then, a saturation check is performed; the specific method for the saturation check is as follows: Maximum brightness M max With preset saturation threshold S A comparison is performed; if the maximum brightness exceeds the preset saturation threshold... S Then, based on the ratio of the preset saturation threshold to the maximum brightness, the current light source driving amount is reduced, and the adjustment formula is as follows: I new = I old × S / M max ; Where, I new I is the adjusted light source driving quantity. old The amount of light source drive before adjustment; Then, a blank field image is re-acquired for saturation verification until the maximum brightness does not exceed the preset saturation threshold.

[0040] After the saturation check passes, perform the average brightness check; the specific method for the average brightness check is as follows: The average brightness M of the blank field image is compared with the preset target brightness T. If the absolute difference between the average brightness M of the blank field image and the preset target brightness T exceeds the preset brightness tolerance, the current light source driving amount is adjusted according to the ratio of the preset target brightness to the current average brightness of the blank field image. Its adjustment formula is as follows: I new =I old ×T / M; In the formula, I new I is the adjusted light source driving quantity. old The amount of light source drive before adjustment; Then, a blank field image is re-acquired for average brightness verification until the absolute difference between the average brightness of the blank field image and the preset target brightness does not exceed the preset brightness tolerance; after passing the saturation verification and average brightness verification, the current light source driving quantity is locked.

[0041] If the number of iterations exceeds the preset maximum, the light source or exposure is determined to be abnormal, and the scanning of this image is stopped. The preset target brightness is... T Take the average brightness of the blank field when it enters the target window during factory calibration; the brightness tolerance can be taken as the preset target brightness. T Two to five percent.

[0042] In step S5, the shape residual matrix of this image is generated based on the ratio of the average brightness of each color channel of the blank field image of this image to the brightness of each pixel of the corresponding color channel.

[0043] Specifically, whether to overlay the shape residual matrix of this piece is determined according to the following method: First, apply the current flat field correction matrix to the blank field image of this film, and then calculate the brightness non-uniformity of the corrected blank field image. or : or =( I max - I min ) / I avg ; In the formula, I max The maximum brightness value of the corrected blank field image. I min The minimum brightness value of the corrected blank field image. I avg This represents the average brightness of the corrected blank field image.

[0044] like or If the non-uniformity does not exceed the preset non-uniformity threshold (the preset non-uniformity threshold can be 5%), it means that the lookup table shape has matched the image, and the current flat field correction matrix is ​​directly used without superimposing the image shape residual matrix. If orIf the non-uniformity exceeds the preset threshold, it indicates that the shape of this image still deviates from the lookup table. Common causes include thickness falling between two levels, light source aging, and glass texture of this image. Only then is the shape residual matrix of this image superimposed. The shape residual matrix of this image is multiplied pixel by pixel with the current flat field correction matrix. After multiplication, a mean normalization process is performed again.

[0045] Furthermore, the flat field gain of each pixel is clamped during the flat field correction process, and the proportion of clamped pixels to the total number of pixels is counted as the clamping area. If the clamping area exceeds the preset area threshold, the process returns to step S4 and the light source driving amount is reduced to narrow the dynamic range of the illumination field. After the center area of ​​the blank field image returns to the linear response area, the blank field image is re-acquired and shape loop correction is performed.

[0046] Here, flat gain refers to the multiplicative coefficient of the flat correction matrix on each pixel and each color channel, used to multiply the brightness at that location by the target distribution. When the flat gain exceeds a preset lower limit or a preset upper limit, the flat gain of that pixel is rewritten to the lower limit or upper limit value; this operation is called clamping.

[0047] When the clamping area exceeds the preset area threshold (10%), return to step S4 to reduce the dynamic range of the fan-shaped lighting field.

[0048] The specific approach to reducing the dynamic range of the illumination field is as follows: if the central region of the blank field image is close to brightness saturation, reduce the light source driving amount so that the central region returns to the linear response region before re-acquiring the blank field image, thus avoiding overestimation of the edge flat field gain after the central region is flattened.

[0049] The dynamic range of the illumination field is defined as the ratio of the average brightness of the central region to the average brightness of the edge regions. Returning the central region to the linear response zone means reducing the overall light intensity level of the illumination field by decreasing the light source drive, so that the peak light intensity of the originally saturated image center region drops below the image sensor's saturation threshold.

[0050] In step S6, the target scan image satisfies the following requirements when the final flat field correction matrix is ​​applied: After the original single-channel target image is converted into a three-channel color image, and before the non-linear grayscale transformation, the corresponding channels are multiplied pixel by pixel.

[0051] The specific method for scanning and stitching is as follows: Target scan images are acquired using a grid scanning method with overlapping stripes in each field of view. Linear weighting is applied to the brightness transition within the overlapping stripes of adjacent fields of view. The specific method is as follows: Weight values ​​are set sequentially along the direction away from the previous viewpoint, with the weight values ​​linearly decreasing from 1 to 0. The output pixel brightness value in the overlapping area is: ; in, The output pixel brightness value within the overlapping area. This represents the original pixel brightness value corresponding to the previous adjacent viewpoint in this overlapping region. This represents the original pixel brightness value corresponding to the current field of view in the overlapping area. This is the weight value.

[0052] The above scanning stitching method only eliminates the brightness step at the seam, without changing the brightness field within each scanning field of view.

[0053] The specific method for grid detection is as follows: After scanning and stitching to obtain a full-slice image, a low-magnification thumbnail is generated. Using the width and height corresponding to a single scanned field of view on the thumbnail as the block size, the thumbnail is divided into horizontal strips for the corresponding row and vertical strips for the corresponding column along both the row and column directions. The arithmetic mean of all pixels within each horizontal and vertical strip is taken to obtain a one-dimensional average brightness sequence along the row direction. P r [ j ] and column-direction one-dimensional average brightness sequence P c [ i ];in, j For the field of view line number, i For the field of view column number.

[0054] For the row-direction and column-direction one-dimensional average brightness sequences, a moving average with a window larger than two scanning fields is used to remove slow-varying trends. Fourier transforms are then performed on the row-direction and column-direction one-dimensional average brightness sequences after removing the slow-varying trends, and the amplitude at the normalized spatial frequency of 1 is extracted from the row-direction and column-direction one-dimensional average brightness sequences. A 1 and overall average amplitude A 0, take amplitude A 1 and amplitude A The ratio of 0 to 1 is taken as the periodic component, and the periodic component = A 1 / A 0. If the periodic component of the row-direction one-dimensional average brightness sequence or the column-direction one-dimensional average brightness sequence is greater than the preset periodic component threshold, then it is determined that a cell exists, and steps S4 to S6 are re-executed.

[0055] In the row-direction and column-direction one-dimensional average brightness sequences, the normalized spatial frequency of 1 indicates that the spatial period of brightness fluctuation is exactly equal to the width / height of one scanning field of view. This means that the brightness completes one full cycle of alternating light and dark after traversing the distance of one scanning field of view. The amplitude A1 is the Fourier amplitude corresponding to the frequency component with a normalized spatial frequency of 1. Its magnitude directly reflects the intensity of the brightness fluctuation within a period of one scanning field of view.

[0056] A sector illumination correction system for digital slice scanning includes: Thickness acquisition unit, used to acquire the thickness of the glass slide or the equivalent optical path as a thickness compensation amount; Flat field storage unit is used to store the light source driving quantity and flat field correction matrix in pairs according to thickness level; The blank field acquisition unit is used to acquire blank field images of the slide while the slide is held in the optical path. The light intensity ring control unit is used to adjust the light source drive amount or exposure parameters so that the average brightness of the blank field image falls into the unsaturated target brightness window. The shape ring correction unit is used to perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of the current image, if the brightness non-uniformity of the corrected blank field image does not exceed the preset non-uniformity threshold, the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image exceeds the preset non-uniformity threshold, the shape residual matrix of the current image is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. An image processing unit is used to apply a final flat-field correction matrix to the target scan image for correction. The stitching unit is used to stitch together images from different scanning fields.

[0057] The grid detection unit is used to perform grid detection on the stitched scanned image.

[0058] This invention is not limited to the preferred embodiments described above. Anyone can derive other products in various forms under the guidance of this invention. However, regardless of any changes in shape or structure, any technical solution that is the same as or similar to this application falls within the protection scope of this invention.

Claims

1. A method for sector illumination correction in digital slice scanning, characterized in that, Includes the following steps: S1. Obtain the glass slide thickness or equivalent optical path as the thickness compensation amount. S2. Determine the corresponding light source driving amount and flat field correction matrix based on the thickness compensation amount; S3. With the slide held in the optical path, acquire the blank field image of the slide; S4. Execute the light intensity ring adjustment so that the average brightness of the blank field image of this film falls into the unsaturated target brightness window; S5. Perform shape loop correction: Perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of this film, if the brightness non-uniformity of the corrected blank field image of this film does not exceed the preset non-uniformity threshold, then the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image of this film exceeds the preset non-uniformity threshold, then the shape residual matrix of this film is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. S6. Before nonlinear grayscale transformation, the target scan image is corrected by applying a final flat field correction matrix, and then scan stitching and grid detection are performed.

2. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S1, the thickness compensation amount is obtained by using the glass slide thickness measured by direct measurement method as the thickness compensation amount. If the thickness of the slide cannot be measured by direct measurement, the equivalent optical path is used as the thickness compensation; the equivalent optical path is the difference between the focusing height of the slide and the reference height at the current objective lens magnification. The reference height is the position encoder reading along the optical axis after focusing with a standard blank glass slide of known thickness at the corresponding objective magnification.

3. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S2, a lookup table arranged by thickness level is pre-established offline. For each thickness level in the lookup table, a pair of light source driving quantities and flat field correction matrices are stored. The corresponding parameter is retrieved from the lookup table based on the thickness compensation amount, or linear interpolation is performed between adjacent parameters to obtain the corresponding light source driving amount and flat field correction matrix. The interpolated flat field correction matrix is ​​then subjected to mean normalization.

4. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, The flat field correction matrix corresponding to each thickness level in the lookup table is generated in the following manner: For each color channel, spatial smoothing is performed on the blank field image corresponding to that thickness level; the arithmetic mean brightness of the pixels in the smoothed blank field image is calculated, and the ratio of the arithmetic mean brightness to the brightness of each pixel after smoothing is used as the unlimited gain of the corresponding pixel. If the brightness of a smoothed pixel is lower than a preset noise threshold, the unlimited gain of that pixel is set to 1 and it is not included in the arithmetic mean brightness calculation. The unconstrained gain of each pixel is limited to between a preset lower gain limit and a higher gain limit, and then divided by the spatial average gain of all pixels after constraining to obtain the flat field correction matrix of the color channel.

5. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S4, the light intensity loop adjustment adopts a closed-loop iterative method, specifically including: The initial light source driving value is obtained from the lookup table based on the thickness compensation amount. Under the current light source driving value, the transmitted light source is illuminated and a blank field image is acquired. The average brightness of all pixels in the blank field image and the maximum brightness of each color channel are calculated, and a saturation check is performed. The specific method for saturation check is as follows: The maximum brightness is compared with the preset saturation threshold. If the maximum brightness exceeds the preset saturation threshold, the current light source driving amount is reduced based on the ratio of the preset saturation threshold to the maximum brightness, and a blank field image is re-acquired for saturation verification until the maximum brightness does not exceed the preset saturation threshold. After the saturation check passes, perform the average brightness check; the specific method for the average brightness check is as follows: The average brightness of the blank field image is compared with the preset target brightness. If the absolute difference between the average brightness of the blank field image and the preset target brightness exceeds the preset brightness tolerance, the current light source driving amount is adjusted according to the ratio of the preset target brightness to the current average brightness of the blank field image, and the blank field image is re-acquired for average brightness verification until the absolute difference between the average brightness of the blank field image and the preset target brightness does not exceed the preset brightness tolerance. After saturation and average brightness checks, the current light source driving quantity is locked.

6. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S5, the shape residual matrix of the local image is generated based on the ratio of the average brightness of each color channel of the local blank field image to the brightness of each pixel of the corresponding color channel.

7. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S5, the flat field gain of each pixel during the flat field correction process is clamped and the proportion of the clamped pixels to the total number of pixels is counted as the clamping area. If the clamping area exceeds the preset area threshold, the process returns to step S4 and the light source driving amount is reduced to narrow the dynamic range of the illumination field. After the center region of the blank field image returns to the linear response region, the blank field image is re-acquired and shape loop correction is performed.

8. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S6, the specific method for scanning and stitching is as follows: Target scan images are acquired using a grid scanning method with overlapping stripes in each field of view. Linear weighting is applied to the brightness transition within the overlapping stripes of adjacent fields of view. The specific method is as follows: Weight values ​​are set sequentially along the direction away from the previous viewpoint, with the weight values ​​linearly decreasing from 1 to 0. The output pixel brightness value in the overlapping area is: ; in, The output pixel brightness value within the overlapping area. This represents the original pixel brightness value corresponding to the previous adjacent viewpoint in this overlapping region. This represents the original pixel brightness value corresponding to the current field of view in the overlapping area. This is the weight value.

9. The method for sector illumination correction in digital slice scanning according to claim 1, characterized in that, In step S6, the specific method for grid detection is as follows: After scanning and stitching to obtain a full slice image, a thumbnail is generated. The width and height of a single scan field of view on the thumbnail are used as the block size. The thumbnail is divided into horizontal strips of the corresponding field of view row and vertical strips of the corresponding field of view column along the row and column directions, respectively. The arithmetic mean of all pixels in each horizontal and vertical strip is taken to obtain the corresponding one-dimensional average brightness sequence in the row direction and the one-dimensional average brightness sequence in the column direction. For the row-direction one-dimensional average brightness sequence and the column-direction one-dimensional average brightness sequence, a moving average with a window larger than two scanning fields is used to remove the slow variation trend. Fourier transform is performed on the row-direction one-dimensional average brightness sequence and the column-direction one-dimensional average brightness sequence after removing the slow variation trend. The amplitude A1 at the normalized spatial frequency of 1 and the overall average amplitude A0 are extracted from the row-direction one-dimensional average brightness sequence and the column-direction one-dimensional average brightness sequence. The ratio of amplitude A1 to amplitude A0 is taken as the periodic component. If the periodic component of the row-direction one-dimensional average brightness sequence or the column-direction one-dimensional average brightness sequence is greater than the preset periodic component threshold, it is determined that there is a grid, and steps S4 to S6 are repeated.

10. A sector illumination correction system for digital slice scanning, used to implement the sector illumination correction method for digital slice scanning as described in any one of claims 1-8, characterized in that, include: Thickness acquisition unit, used to acquire the thickness of the glass slide or the equivalent optical path as a thickness compensation amount; Flat field storage unit is used to store the light source driving quantity and flat field correction matrix in pairs according to thickness level; The blank field acquisition unit is used to acquire blank field images of the slide while the slide is held in the optical path. The light intensity ring control unit is used to adjust the light source drive amount or exposure parameters so that the average brightness of the blank field image falls into the unsaturated target brightness window. The shape ring correction unit is used to perform mean normalization on the flat field correction matrix. After applying the mean normalized flat field correction matrix to the blank field image of the current image, if the brightness non-uniformity of the corrected blank field image does not exceed the preset non-uniformity threshold, the current flat field correction matrix is ​​used as the final flat field correction matrix; if the brightness non-uniformity of the corrected blank field image exceeds the preset non-uniformity threshold, the shape residual matrix of the current image is superimposed on the current flat field correction matrix, and mean normalization is performed again to obtain the final flat field correction matrix. An image processing unit is used to apply a final flat-field correction matrix to the target scan image for correction. The stitching unit is used to stitch together images from different scanning fields. The grid detection unit is used to perform grid detection on the stitched scanned image.