A pathological section scanning control method and system

CN122883352APending Publication Date: 2026-10-09KUORAN MEDICAL LAB (XUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0003]然而,上述爬山对焦算法的对焦步长与相机曝光参数均按预设值恒定执行,无法随当前视野的切片表面状态、组织厚度及染色透光特性自适应调整

Benefits of technology

在本发明实施例中,获取当前视野的聚焦评价值序列、图像平均灰度值以及相邻视野间聚焦评价值的变化量;基于聚焦评价值序列计算综合伪峰指数,依据综合伪峰指数识别并排除伪峰,锁定真实焦平面;基于相邻视野间聚焦评价值的变化量判断切片表面状态,自适应切换对焦步长;基于图像平均灰度值和对焦步长联动计算曝光补偿系数,依据曝光补偿系数和基准曝光时间确定对焦曝光时间;基于真实焦平面、对焦步长以及对焦曝光时间执行对焦与图像采集。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122883352A_ABST
    Figure CN122883352A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image processing, in particular to a pathological section scanning control method and system, wherein the pathological section scanning control method comprises: identifying and excluding false peaks according to a comprehensive false peak index, and locking a real focal plane; judging a section surface state based on a change amount of a focusing evaluation value between adjacent fields of view, and adaptively switching a focusing step length; calculating an exposure compensation coefficient based on an image average gray value and the focusing step length linkage, and determining a focusing exposure time according to the exposure compensation coefficient and a reference exposure time; and performing focusing and image acquisition based on the real focal plane, the focusing step length and the focusing exposure time. The present application realizes progressive control through false peak interference exclusion, adaptive switching of a focusing strategy and coordinated adjustment of exposure focusing, so that the focusing process dynamically adapts to the section surface state, tissue thickness and staining light transmission characteristics of the current field of view, and the focusing accuracy and scanning efficiency of pathological section scanning are taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method and system for controlling the scanning of pathological slides. Background Technology

[0002] Digital scanning of pathological slides involves acquiring images field-by-field using a microscope camera on an X / Y axis moving platform, and then stitching these images together to create a panoramic digital slide for interpretation. Focusing is the most critical step in the scanning process; each field of view requires vertical movement along the Z-axis to find the sharpest focal plane, and this step accounts for the largest portion of the overall scanning time. Most existing pathological slide scanners employ a fixed-step hill-climbing focusing algorithm, where the Z-axis moves sequentially within the search range at a preset step size. The camera acquires images at each position and calculates a focus evaluation value. When the focus evaluation value exceeds its peak and begins to decline, the previous position is locked as the focal plane.

[0003] However, the aforementioned hill-climbing focusing algorithm executes both the focusing step size and camera exposure parameters at fixed preset values, failing to adaptively adjust to the surface condition of the slice, tissue thickness, and staining transmittance characteristics of the current field of view. Microscopic anomalies such as air bubbles and adhesive residue on the edges of coverslips within the tissue area can cause the focusing curve to exhibit a multi-peak shape. The hill-climbing algorithm stops searching upon encountering the first peak, easily mistaking the surface of air bubbles or adhesive residue as the focal plane, resulting in the tissue being out of focus in that field of view. The thickness varies significantly between different tissue regions; densely cellular areas have thicker tissue and steeper focusing evaluation curves, while areas of fat or loose connective tissue are thinner and have flatter focusing curves. A fixed step size consumes excessive search time in flat areas and easily crosses the true focal plane in steep areas. The low transmittance of deeply stained areas, coupled with independent adjustments to focusing and exposure, leads to a decrease in the signal-to-noise ratio due to underexposure, requiring repeated retries after focusing failures, severely hindering scanning efficiency. Summary of the Invention

[0004] This invention provides a method and system for controlling the scanning of pathological slides to solve the above-mentioned problems.

[0005] The pathological slide scanning control method and system of the present invention adopts the following technical solution: In a first aspect, one embodiment of the present invention provides a pathological slide scanning control method, the method comprising: acquiring a focus evaluation value sequence of the current field of view, an average image gray value, and the change in focus evaluation values ​​between adjacent fields of view; calculating a comprehensive pseudo-peak index based on the focus evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane; determining the slide surface state based on the change in focus evaluation values ​​between adjacent fields of view, and adaptively switching the focus step size; calculating an exposure compensation coefficient based on the average image gray value and the focus step size, and determining the focus exposure time based on the exposure compensation coefficient and a reference exposure time; and performing focusing and image acquisition based on the true focal plane, the focus step size, and the focus exposure time.

[0006] Further, the step of calculating a comprehensive pseudo-peak index based on the focused evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane includes: if the number of effective local peaks in the focused evaluation value sequence is not less than a preset number threshold, then extracting the highest peak evaluation value, the second highest peak evaluation value, and the half-peak width of the highest peak at half-peak height from the focused evaluation value sequence; wherein, the effective local peak is a local peak whose local peak value is higher than the effective peak value threshold; determining the comprehensive pseudo-peak index based on the closeness between the second highest peak evaluation value and the highest peak evaluation value and the deviation between the half-peak width and the typical tissue peak width; wherein, the comprehensive pseudo-peak index is used to quantify the probability that the highest peak is a pseudo-peak; when the comprehensive pseudo-peak index does not exceed the pseudo-peak determination threshold, the highest peak is locked as the true focal plane; when the comprehensive pseudo-peak index exceeds the pseudo-peak determination threshold, the second highest peak is locked as the true focal plane.

[0007] Furthermore, the step of calculating a comprehensive pseudo-peak index based on the focus evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane further includes: if the number of effective local peaks is greater than zero and less than the preset number threshold, then determining whether the peak width of the local peaks in the focus evaluation value sequence exceeds a preset peak width threshold; when the peak width of the local peak exceeds the peak width threshold, marking the current field of view as a low-confidence field of view, and switching to a small step fine focus mode; wherein, the small step fine focus mode includes: expanding the Z-axis search range to a value greater than a preset search range, and setting the focus step size to a value less than the initial step size; when the peak width of the local peak does not exceed the peak width threshold, locking the local peak as the true focal plane.

[0008] Furthermore, the step of calculating the comprehensive pseudo-peak index based on the focus evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane also includes: when there are no valid local peaks in the focus evaluation value sequence, determining that the current field of view is an invalid region, and skipping the focusing process for the current field of view.

[0009] Further, the step of judging the slice surface state based on the change in focus evaluation value between adjacent fields of view and adaptively switching the focus step size includes: determining a slice surface state judgment value based on the change in focus evaluation value between adjacent fields of view and the current field of view focus evaluation value; when the slice surface state judgment value is not greater than a first surface state threshold, determining that the slice surface is flat and adaptively switching to a large step size fast focus mode; wherein, the large step size fast focus mode includes: reducing the Z-axis search range to less than a preset search range and increasing the focus step size to greater than the initial step size; when the slice surface state judgment value is greater than the first surface state threshold and not greater than a second surface state threshold, determining that the slice surface has moderate undulations and maintaining a standard step size focus mode; wherein, the second surface state threshold is greater than the first surface state threshold; when the slice surface state judgment value is greater than the second surface state threshold, determining that the slice surface has a steep change and adaptively switching to a small step size fine focus mode.

[0010] Further, the step of calculating the exposure compensation coefficient based on the average gray value of the image and the focus step size, and determining the focus exposure time based on the exposure compensation coefficient and the reference exposure time, includes: acquiring a standard gray value, a reference focus step size, the focus step size, and the average gray value of the image at the initial Z-axis position of the current field of view; determining the exposure compensation coefficient based on the deviation between the average gray value of the image and the standard gray value and the deviation between the focus step size and the reference focus step size; determining the focus exposure time based on the reference exposure time and the exposure compensation coefficient; and writing the focus exposure time into the camera controller.

[0011] Furthermore, the step of obtaining the focus evaluation value sequence of the current field of view includes: controlling the Z-axis focusing motor to move within a preset search range with an initial step size; acquiring an image frame at each Z-axis position and calculating the focus evaluation value of the image; and obtaining the focus evaluation value sequence of the current field of view based on the focus evaluation values ​​at each Z-axis position.

[0012] Furthermore, before obtaining the focus evaluation value sequence of the current field of view, the method further includes: quickly scanning the entire image in slice preview mode to obtain a low-resolution panoramic thumbnail; coarsely segmenting the low-resolution panoramic thumbnail using a grayscale threshold to determine the tissue coverage area; and generating a scanning path based on the tissue coverage area.

[0013] Furthermore, after performing focusing and image acquisition based on the true focal plane, the focusing step size, and the focusing exposure time, the method further includes: stitching the images acquired from each field of view into a panoramic digital slice; identifying the slice surface state of each field of view in the form of a heat map, and displaying the trend of the focusing step size change and the exposure compensation amount for each field of view; and storing scanning parameters, focusing records, and image quality indicators by field of view number and timestamp to support post-event playback and quality traceability.

[0014] Secondly, another embodiment of the present invention provides a pathological slide scanning control system, including an industrial control computer and an X / Y axis moving platform, a Z axis focusing motor, and a microscopic digital camera communicatively connected to the industrial control computer, wherein: The X / Y axis moving platform is used to carry the pathological slides and drive the pathological slides to move in the X / Y axis direction during scanning; The Z-axis focusing motor is used to drive the microscope objective to move along the Z-axis within a preset search range in order to perform focusing search; The digital microscope camera is used to acquire field-of-view images when the Z-axis focusing motor drives the microscope objective to move to each Z-axis position, and to transmit the images to the industrial control computer. The industrial control computer is used to acquire the focus evaluation value sequence of the current field of view, the average gray value of the image, and the change in focus evaluation value between adjacent fields of view; calculate a comprehensive pseudo-peak index based on the focus evaluation value sequence, identify and eliminate pseudo-peaks based on the comprehensive pseudo-peak index, and lock the true focal plane; determine the slice surface state based on the change in focus evaluation value between adjacent fields of view, and adaptively switch the focus step size; calculate the exposure compensation coefficient based on the average gray value of the image and the focus step size, and determine the focus exposure time based on the exposure compensation coefficient and the reference exposure time; and perform focusing and image acquisition based on the true focal plane, the focus step size, and the focus exposure time.

[0015] The beneficial effects of the technical solution of the present invention are: In this embodiment of the invention, the focus evaluation value sequence of the current field of view, the average gray value of the image, and the change in focus evaluation value between adjacent fields of view are obtained; a comprehensive pseudo-peak index is calculated based on the focus evaluation value sequence, and pseudo-peaks are identified and eliminated based on the comprehensive pseudo-peak index to lock the true focal plane; the surface state of the slice is judged based on the change in focus evaluation value between adjacent fields of view, and the focus step size is adaptively switched; the exposure compensation coefficient is calculated based on the image average gray value and the focus step size, and the focus exposure time is determined based on the exposure compensation coefficient and the reference exposure time; focusing and image acquisition are performed based on the true focal plane, the focus step size, and the focus exposure time.

[0016] This invention employs a progressive control mechanism—including spurious peak interference elimination, adaptive switching of focusing strategies, and coordinated adjustment of exposure and focus—to dynamically adapt the focusing process to the surface condition, tissue thickness, and staining transmittance of the slide within the current field of view, balancing focusing accuracy and scanning efficiency in pathological slide scanning. Furthermore, it identifies and eliminates spurious peaks based on the peak height and width characteristics of the focusing curve, preventing microscopic anomalies such as bubbles and adhesive residue from being mistakenly identified as focal planes, thus ensuring accurate locking of the true tissue layer's focal plane. Additionally, it adaptively adjusts the focusing step size based on the variation in focusing evaluation values ​​between adjacent fields of view, enabling faster focusing in flat areas and more precise searching of the focal plane in undulating areas, achieving a dynamic balance between scanning speed and focusing accuracy. Moreover, this invention uses a linked compensation adjustment of exposure based on the image's average grayscale value and the focusing step size, ensuring sufficient exposure in deeply stained, low-transmittance areas to improve the signal-to-noise ratio of the focused image, avoiding repeated retries after focusing failures and shortening the overall scan time. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic flowchart of the pathological slide scanning control method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the architecture of the pathological slide scanning control system provided in an embodiment of the present invention. Detailed Implementation

[0019] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following detailed description, in conjunction with the accompanying drawings and preferred embodiments, provides a detailed account of the specific implementation methods, structures, features, and effects of the method proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The specific details of a pathological slide scanning control method and system provided by this invention are described below with reference to the accompanying drawings.

[0021] like Figure 1 As shown, an embodiment of the present invention provides a method for controlling the scanning of pathological sections, including: Step S110: Obtain the current field of view's focus evaluation value sequence, the image's average gray value, and the change in focus evaluation values ​​between adjacent fields of view.

[0022] The average grayscale value mentioned above is the arithmetic mean of the grayscale values ​​of all pixels in a single frame image, used to characterize the overall brightness of the image. After acquiring an image at each Z-axis position in the current field of view, the average grayscale value of all pixels in that frame image is calculated to obtain the average grayscale value corresponding to that Z-axis position. The average grayscale values ​​corresponding to each Z-axis position constitute the average grayscale value sequence of the current field of view. The magnitude of the average grayscale value is related to the staining and light transmittance characteristics of the tissue: darkly stained areas have low light transmittance, the acquired image is generally dark, and the average grayscale value is small; lightly stained areas have high light transmittance, the acquired image is generally bright, and the average grayscale value is large. Among them, the average grayscale value of the image at the initial Z-axis position in the current field of view serves as the basic characterization of the tissue's light transmittance characteristics and is used for the calculation of the subsequent exposure compensation coefficient.

[0023] The aforementioned focus evaluation value is used to quantify the sharpness of a single frame image. The larger the value, the sharper the image and the closer the corresponding Z-axis position is to the true focal plane. The following describes an optional method for obtaining the focus evaluation value sequence: Optionally, obtaining the focus evaluation value sequence of the current field of view includes: controlling the Z-axis focusing motor to move within a preset search range with an initial step size; acquiring one frame image at each Z-axis position and calculating the focus evaluation value of the image; and obtaining the focus evaluation value sequence of the current field of view based on the focus evaluation values ​​at each Z-axis position.

[0024] The focusing process of pathological slide scanning relies on the hardware architecture of the scanner. The X / Y axis moving platform carries the pathological slide and moves it field by field according to the scanning path. The Z-axis focusing motor drives the microscope objective to move up and down along the optical axis. The microscope digital camera is responsible for acquiring images of each field of view. The X / Y axis moving platform, Z-axis focusing motor, and microscope digital camera are all connected to an industrial control computer, which coordinates the collaborative work of all hardware components and completes data processing.

[0025] Optionally, before obtaining the focus evaluation value sequence of the current field of view, the above-mentioned pathological slide scanning control method further includes: quickly scanning the entire slide in slide preview mode to obtain a low-resolution panoramic thumbnail; coarsely segmenting the low-resolution panoramic thumbnail using a grayscale threshold to determine the tissue coverage area; and generating a scanning path based on the tissue coverage area.

[0026] Understandably, before the formal scan begins, the industrial control computer controls the scanner to quickly scan the entire image in slice preview mode, acquiring a low-resolution panoramic thumbnail. The panoramic thumbnail is then coarsely segmented using a grayscale threshold to determine the tissue coverage area. A scan path is then generated based on this tissue coverage area, ensuring that subsequent formal scans focus and acquire images only within the tissue coverage area, avoiding invalid scans of blank areas. The grayscale threshold can be a fixed threshold or an adaptive threshold determined based on the grayscale distribution of the panoramic thumbnail. Before scanning begins, scan parameters must be preset, including the initial focus step size, baseline exposure time, and focus evaluation algorithm.

[0027] After the scanning path is planned, focusing data acquisition is performed for each field of view along the scanning path. The Z-axis focusing motor moves up and down within a preset search range with an initial focusing step size. The preset search range is the interval along the Z-axis that covers the position range where the true focal plane may appear in the current field of view. The initial focusing step size is the distance between two adjacent image acquisition positions along the Z-axis, usually set in micrometers in engineering implementation. Each time the Z-axis moves by one initial focusing step size, it reaches an acquisition position, and the microscopic digital camera acquires one frame of image at that acquisition position. The value of the initial focusing step size directly affects the resolution and time of the focus search: the larger the step size, the fewer image frames need to be acquired within the same search range, and the faster the search speed, but the more coarse the change in focus evaluation value between adjacent acquisition positions, and the easier it is to cross the true focal plane; the smaller the step size, the more precise the focal plane positioning, but the more frames are acquired, and the longer the search time is.

[0028] For each captured image frame, the focus evaluation value of that frame is calculated in real time and denoted as... ,in This indicates the acquisition position along the Z-axis. The focus evaluation value is a quantitative indicator of image sharpness; a higher value indicates a sharper image and a acquisition position closer to the true focal plane. Focus evaluation algorithms can employ either the Brenner gradient method or the Laplacian variance method. The Brenner gradient method characterizes image sharpness by summing the squared differences in gray levels between adjacent pixels. The Laplacian variance method characterizes image sharpness by applying a Laplacian operator to the image and calculating the variance of the response; sharper image edges result in a larger variance. Since the dimensions and numerical ranges of focus evaluation values ​​obtained from different algorithms differ, the same focus evaluation algorithm is used for calculation in the same scanning task to ensure the comparability of focus evaluation values ​​between different Z-axis positions and different fields of view. It should be noted that both the Brenner gradient method and the Laplacian variance method are mature algorithms in existing technologies; their specific implementation methods and working principles can be found in related technologies, and will not be elaborated upon in this embodiment.

[0029] The focus evaluation values ​​at each Z-axis position are arranged sequentially according to their Z-axis positions, forming a focus evaluation value sequence for the current field of view. The change in focus evaluation values ​​with Z-axis position constitutes the focus curve for the current field of view. While calculating the focus evaluation values ​​frame by frame, the average grayscale value of each frame is simultaneously recorded. This forms an average grayscale value sequence for the current field of view, providing characterization data of tissue light transmittance for subsequent exposure compensation.

[0030] The shape of the focusing curve reflects the surface condition of the tissue in the current field of view. When the tissue surface in the field of view is smooth and there are no abnormal structures, the focusing curve usually shows a single peak, and the Z-axis position corresponding to the peak is the candidate position of the true focal plane. When there are microscopic abnormal structures such as air bubbles, adhesive residue at the edge of the coverslip, or tissue folds in the field of view, the surface of the abnormal structure and the true tissue layer each form local peaks on the focusing curve, making the focusing curve show a double-peak or multi-peak shape. The above-mentioned differences in the shape of the focusing curve constitute the physical basis for subsequent identification and elimination of spurious peak interference.

[0031] After focusing is completed in the current field of view, record the final locked focal plane position. and the corresponding focus evaluation value and will Focus evaluation value relative to the previous adjacent field of view that has already been focused By comparing the two values ​​and taking the absolute value of the difference, the change in focus evaluation value between adjacent fields of view is obtained. This change reflects the smoothness or thickness variation of tissue between adjacent fields of view. A small change indicates a relatively flat slice surface in the area where the adjacent field of view is located; a large change indicates undulations in the slice surface or a sudden change in tissue thickness. The change in the focus evaluation value between adjacent fields of view serves as the basis for subsequent judgment of the slice surface condition and adaptive switching of the focus step size.

[0032] Step S120: Calculate the comprehensive pseudo-peak index based on the focus evaluation value sequence, identify and eliminate pseudo-peaks based on the comprehensive pseudo-peak index, and lock the true focal plane.

[0033] Understandably, during pathological section scanning, microscopic anomalies such as air bubbles, adhesive residue on coverslip edges, or tissue folds within the tissue area can cause the focusing curve of the current field of view to exhibit a bimodal or multimodal shape. That is, the real tissue layer corresponds to one focusing peak, while the surface of the air bubble or adhesive residue corresponds to another. Traditional hill-climbing focusing algorithms stop at the first peak encountered during the search, easily mistaking the surface of the anomaly as the focal plane, resulting in a blurred tissue image in that field of view. More importantly, the focusing evaluation value corresponding to a false peak may be close to or even higher than the peak value of the real tissue layer. Relying solely on peak height is insufficient to reliably distinguish between false peaks and real tissue peaks. However, there are identifiable differences between false peaks and real tissue peaks in two dimensions: the focusing peak of the real tissue layer usually has a certain peak width, while the false peaks formed by air bubbles or adhesive residue, although similar in height to the real peak, are often abnormally sharp and narrow. Based on this, this embodiment of the invention combines the peak height ratio and peak width into a comprehensive pseudo-peak index. This single quantitative indicator characterizes the probability that the highest peak is a pseudo-peak, so that the determination of pseudo-peaks no longer relies on manual experience or isolated judgment of a single feature. Instead, it can still identify and exclude pseudo-peaks in multi-peak scenarios with evidence, thereby ensuring accurate locking of the focal plane of the real tissue layer and avoiding localized defocusing in the current field of view. An optional implementation of step S120 above is described below: Optionally, step S120 includes: if the number of effective local peaks in the focused evaluation value sequence is greater than zero and not less than a preset number threshold, then extract the highest peak evaluation value, the second highest peak evaluation value, and the half-peak width of the highest peak at half-peak height from the focused evaluation value sequence; wherein, an effective local peak is a local peak whose local peak value is higher than the effective peak value threshold; based on the closeness between the second highest peak evaluation value and the highest peak evaluation value and the deviation between the half-peak width and the typical tissue peak width, determine the comprehensive pseudo-peak index; wherein, the comprehensive pseudo-peak index is used to quantify the probability that the highest peak is a pseudo-peak; when the comprehensive pseudo-peak index does not exceed the pseudo-peak judgment threshold, the highest peak is locked as the true focal plane; when the comprehensive pseudo-peak index exceeds the pseudo-peak judgment threshold, the second highest peak is locked as the true focal plane.

[0034] Local peak detection is performed on the focusing curve of the current field of view. A local peak is an extreme point on the focusing curve where the focusing evaluation value is higher than the focusing evaluation values ​​of its two adjacent positions. It can be determined by comparing the focusing evaluation values ​​at each Z-axis position with the focusing evaluation values ​​at its adjacent Z-axis positions. After detecting a local peak, a preset effective peak value threshold is applied. Each local peak is filtered, and only the local peak value is higher than that of the peak value. The local peaks are defined as effective local peaks. Its function is to filter out local peaks with excessively low focus evaluation values, corresponding blank or unorganized coverage areas, thus avoiding meaningless focus determination on fields without effective organization. It counts the number of effective local peaks; when the number of effective local peaks is greater than zero and not less than a preset threshold, it indicates that the focus curve exhibits a multi-peak pattern, suggesting the possibility of spurious peak interference, and thus enters the spurious peak identification process. The preset threshold is typically set to 2, meaning that if the focus curve has two or more effective local peaks within the search range, subsequent spurious peak identification is performed.

[0035] After entering the pseudo-peak identification process, three types of feature quantities are extracted from the focused evaluation value sequence: the highest peak evaluation value. Second peak evaluation value And the half-peak width at the highest peak halfway up the peak Peak rating Compared with the second peak evaluation value These are the peak values ​​with the largest and second largest focused evaluation values ​​among all effective local peaks; half-peak width To focus on evaluation values ​​from peak values Descending to The corresponding Z-axis range width can be found on both sides of the highest peak, where the focus evaluation value is equal to... The Z-axis position is taken as the distance between two positions along the Z-axis, which is used as the half-peak width. In engineering implementation, the half-peak width... Typically measured in micrometers. Since spurious peaks and real tissue peaks exhibit identifiable morphological differences in both peak height and peak width, the three types of features described above characterize the morphological attributes of the highest peak in terms of both peak height and peak width, providing a data basis for the quantitative determination of spurious peaks.

[0036] Based on the extracted feature values, the comprehensive pseudo-peak index is calculated. :

[0037] In the formula, The typical peak width reference value for normal tissue peaks can be obtained by statistically calibrating the peak widths of focusing curves from several normal tissue fields in advance. Units and The units are consistent; and The extremely small positive number introduced to prevent the denominator from being zero. Units and The units are consistent. Units and The units are consistent. and The values ​​are all much smaller than the typical values ​​of the corresponding physical quantities, and do not affect the order of magnitude of the calculation results. The above-mentioned comprehensive pseudo-peak index... The first factor in the calculation formula The ratio of the peak height of the second-highest peak to the peak height of the highest peak reflects the degree of proximity between the two peaks. The closer the second-highest peak is to the highest peak, the closer this factor is to 1, indicating that the two peaks are of similar height and the highest peak is more likely to be a false peak. The second factor... The ratio of the typical peak width reference value to the half-peak width reflects the sharpness of the highest peak. The narrower the peak width and the smaller the denominator, the larger this factor, indicating a sharper peak shape and a higher probability of a false peak; the comprehensive false peak index... As a dimensionless parameter, when the secondary peak is close to the highest peak and the peak width is small, The difference is significantly increased, thus converging the differences between the two dimensions of peak height and peak width into a single quantitative indicator, which is used to characterize the degree of probability that the highest peak is a false peak.

[0038] After obtaining the comprehensive pseudo-peak index, it is compared with a preset pseudo-peak judgment threshold. The pseudo-peak judgment threshold can be obtained, for example, by pre-calculating the comprehensive pseudo-peak index for known sample focusing curves containing pseudo-peaks and sample focusing curves without pseudo-peaks, and determining the pseudo-peak judgment threshold based on the index distribution of the two types of samples. When the threshold for identifying false peaks is not exceeded, it indicates that the morphological characteristics of the highest peak conform to the attributes of a true tissue peak, and the Z-axis position corresponding to the highest peak is locked as the true focal plane; when When the threshold for identifying false peaks is exceeded, the highest peak is identified as a false peak and excluded. The Z-axis position corresponding to the second highest peak is then locked for re-examination. After confirmation, this position is taken as the true focal plane. Once the true focal plane is locked, its position is... With the corresponding focus evaluation value Transmitted to subsequent processing stages, among which The current focus evaluation value is used to determine the surface state of the slice, ensuring that the adaptive switching of the subsequent focusing strategy is based on the peak value of the real tissue layer.

[0039] The embodiments of the present invention can also obtain the comprehensive pseudo-peak index through the following scheme. (1) The peak height ratio of the second peak evaluation value to the highest peak evaluation value and the peak width ratio of the typical organization peak width to the half-peak width are assigned preset weights and then weighted and summed. The sum of the two weight coefficients is 1. The weight values ​​reflect the weight of the peak height dimension and the peak width dimension in the identification of false peaks. The result of the weighted sum is used as the comprehensive false peak index. (2) The peak height ratio and peak width ratio are normalized respectively, and then the two are mapped to a unified numerical range before being weighted and summed to eliminate the imbalance of contributions caused by the difference in the range of the two ratios. The result of the normalized weighted summation is used as the comprehensive pseudo-peak index. (3) The peak height ratio and peak width ratio are respectively raised to a preset positive exponent and then multiplied. The exponent is used to adjust the sensitivity of the corresponding factor to the probability. The product after the exponentiation is used as the comprehensive pseudo-peak index. .

[0040] Optionally, step S120 further includes: if the number of effective local peaks is greater than zero and less than a preset number threshold, then determine whether the peak width of the local peak in the focus evaluation value sequence exceeds a preset peak width threshold; when the peak width of the local peak exceeds the peak width threshold, mark the current field of view as a low-confidence field of view and switch to a small step fine focus mode; wherein, the small step fine focus mode includes: expanding the Z-axis search range to a value greater than a preset search range and setting the focus step size to a value less than the initial step size; when the peak width of the local peak does not exceed the peak width threshold, lock the local peak as the true focal plane.

[0041] It should be noted that the aforementioned preset threshold number is generally set to 2. When the number of effective local peaks is greater than zero and less than the preset threshold number, there is only one identifiable effective local peak in the focusing curve. It is impossible to construct a comprehensive pseudo-peak index using the secondary peak evaluation value for pseudo-peak identification, and the reliability of the single peak's shape needs to be evaluated separately. The evaluation is based on the peak width of the effective local peak: when the tissue surface in the field of view is tilted or uneven, the distance from different regions of the tissue to the microscope objective varies, and each region enters a clear focusing state successively. The focusing evaluation value remains at a high level within a relatively wide Z-axis range, and the peak shape is thus broadened. Conversely, when the tissue surface is smooth, the focusing evaluation value is concentrated in a narrow range near the true focal plane, and the peak shape maintains a normal width. Therefore, the peak width of a single effective local peak can reflect the smoothness of the current tissue surface in the field of view, thus indicating the reliability of the focal plane locking result corresponding to that peak.

[0042] During evaluation, the peak width of the effective local peak is measured. The measurement method is consistent with the aforementioned half-peak width, i.e., the width of the Z-axis range corresponding to the decrease in the focused evaluation value from the peak value to half the peak value. In engineering implementation, this is typically measured in micrometers. The measured peak width of the effective local peak is then... The peak width is compared with a preset peak width threshold, which can be set based on a typical peak width reference value. One optional implementation is to take a typical peak width reference value. Twice that, i.e., the judgment condition is ,in The peak width threshold is the half-maximum width of the single effective local peak. The peak width threshold can also be determined in advance by statistically analyzing the peak widths of the single-peak focusing curves of several normal tissue fields and based on the upper limit of the peak width distribution, so as to ensure that the threshold setting is consistent with the actual imaging characteristics of the slice.

[0043] When the peak width exceeds the peak width threshold, it indicates that the tissue surface may be tilted or uneven, and the reliability of the current focusing result is low. The current field of view is marked as a low-confidence field of view, and the system switches to a small-step fine focusing mode to perform a detailed review of the field of view. In the small-step fine focusing mode, the Z-axis search range is expanded to a size greater than the preset search range. One optional implementation is to expand it to 1.5 times the preset search range to ensure that the true focal plane of the tilted or uneven surface does not fall outside the original search range. The focusing step size is set to a size smaller than the initial step size. One optional implementation is to take half of the initial step size to improve the resolution of the focusing search and ensure that the true focal plane is not missed when crossing areas of abrupt changes in tissue thickness.

[0044] When the peak width does not exceed the peak width threshold, it indicates that the peak shape of the single effective local peak is within the normal width range, and its corresponding focal plane position is reliable. The Z-axis position corresponding to this effective local peak is directly locked as the true focal plane, eliminating the need for further fine-tuning and avoiding redundant fine-tuning searches for fields with normal peak shapes. Through the above differentiation process, single-peak fields with abnormal peak shapes receive a higher-precision verification opportunity, while single-peak fields with normal peak shapes maintain an efficient focusing process. Thus, the reliability of focal plane locking and scanning efficiency are balanced. After locking the true focal plane, the position of the true focal plane and the corresponding focusing evaluation value are also passed to subsequent processing stages as the data basis for determining the surface condition of the slice.

[0045] Optionally, step S120 further includes: when there is no valid local peak in the focus evaluation value sequence, determining the current field of view as an invalid region and skipping the focusing process for the current field of view.

[0046] The absence of effective local peaks in the focused evaluation value sequence means that the peak value of all local peaks in the sequence is not higher than the effective peak value threshold. This condition, or the case where no local peaks are detected on the focusing curve, is based on the physical principle that in a field of view covered by tissue, the texture of the tissue cells allows the image to present clear details near the focal plane, and the focusing evaluation value forms a distinct peak as the Z-axis position changes. In contrast, in a blank area, only the slide and coverslip exist, and the acquired image content is simple and the texture is weak. Regardless of the Z-axis position, the focusing evaluation value remains at a low level and cannot form a peak exceeding the effective peak threshold. Therefore, when there are no effective local peaks in the focusing evaluation value sequence, it can be determined that there is no effective tissue structure available for focusing in the current field of view, and the current field of view is a blank or invalid area.

[0047] The aforementioned field-by-field determination, along with the preview segmentation before scanning, forms a coherent verification relationship. In the preview stage, coarse segmentation based on low-resolution panoramic thumbnails can only delineate tissue coverage areas with low precision. Transitional zones at tissue edges, small tissue fragments, and deviations caused by segmentation thresholds can all result in some fields of view along the scanning path actually containing no effective tissue. Performing a complete focus search on such fields indiscriminately would incur unnecessary time overhead. The field-by-field determination of the existence of effective local peaks during the formal scanning stage is equivalent to verifying the tissue effectiveness of each field of view before fine imaging, compensating for the accuracy deficiencies of low-resolution coarse segmentation.

[0048] After determining that the current field of view is an invalid region, the focusing process for the current field of view is skipped. That is, the search and locking of the focal plane is no longer performed for the current field of view, and the focusing process of the next field of view is directly entered according to the scanning path, so that the scanning time is concentrated on the field of view containing effective tissue. In an optional implementation, the determination of the absence of effective local peaks can be achieved by comparing the maximum value of the focus evaluation value sequence with the effective peak threshold. When the maximum value of the sequence is lower than the effective peak threshold, it is equivalent to the absence of effective local peaks in the sequence. The value of the effective peak threshold can be determined in advance by statistically analyzing the focus evaluation values ​​of several known blank fields of view and known fields of tissue, and based on the distribution range of the focus evaluation values ​​of the two types of fields of view, so that the blank field of view and the field of tissue form a clear boundary on both sides of the threshold.

[0049] Step S130: Determine the surface state of the slice based on the change in the focus evaluation value between adjacent fields of view, and adaptively switch the focus step size.

[0050] It is understandable that the surface condition of a slide is an attribute characterizing the smoothness of the pathological slide surface and the changes in tissue thickness. Pathological slide surfaces are not completely smooth; densely cellular tumor areas have thicker tissue, resulting in a steeper change in the focus evaluation value along the Z-axis during focusing; areas of adipose tissue or loose connective tissue are thinner, with a gentler focus curve, and significant thickness fluctuations often exist between different regions. Differences in slide surface condition directly correspond to different focusing requirements: in areas with abrupt changes in tissue thickness and a steep change in the focus evaluation value curve, the clear range near the true focal plane is narrow, requiring a smaller focusing step size for precise searching to avoid crossing the true focal plane; in areas with a flat surface and a gentle focus curve, the clear range is wider, allowing for rapid location of the focal plane using a larger focusing step size. If a fixed step size is used uniformly without considering the differences in slide surface condition, excessive search time will be consumed in flat areas due to a small step size, while excessively large step sizes will cross the true focal plane in areas with abrupt changes in thickness. Therefore, in this embodiment of the invention, the surface state of the slice in the current field of view is determined before focusing, so that flat areas can be focused with high efficiency and areas with abrupt changes in thickness can lock the focal plane with high reliability, thereby achieving a dynamic balance between scanning speed and focusing accuracy.

[0051] The following describes an optional implementation of step S130: Optionally, step S130 includes: determining a slice surface state determination value based on the change in focus evaluation values ​​between adjacent fields of view and the current field of view focus evaluation value; when the slice surface state determination value is not greater than a first surface state threshold, determining that the slice surface is flat, and adaptively switching to a large step size fast focusing mode; wherein, the large step size fast focusing mode includes: reducing the Z-axis search range to less than a preset search range, and increasing the focusing step size to greater than the initial step size; when the slice surface state determination value is greater than the first surface state threshold and not greater than a second surface state threshold, determining that the slice surface has moderate undulations, and maintaining a standard step size focusing mode; wherein, the second surface state threshold is greater than the first surface state threshold; when the slice surface state determination value is greater than the second surface state threshold, determining that the slice surface has a steep change, and adaptively switching to a small step size fine focusing mode.

[0052] In the above embodiments, the determination of the slice surface state is based on a comparison of the focusing results of the current field of view and adjacent fields of view. After the current field of view locks onto the true focal plane, its corresponding focus evaluation value is... Focus evaluation value relative to the previous adjacent field of view that has already been focused absolute difference between This difference reflects the variation in tissue smoothness or thickness between adjacent fields of view; a larger difference indicates more pronounced surface undulations. However, the absolute difference is also affected by the tissue's own contrast: for tissue areas with rich texture and high contrast, the overall level of the focusing evaluation value is higher, resulting in a larger absolute difference for the same thickness variation; conversely, for tissue areas with low contrast, the absolute difference is generally smaller. If the surface condition is directly determined by the absolute difference, there will be a lack of comparability between tissue areas with different contrasts. Therefore, it is necessary to normalize the absolute difference using the focusing evaluation value of the current field of view to construct a surface condition determination value for the section.

[0053] In the formula, The extremely small positive number introduced to prevent the denominator from being zero. Units and The units are consistent. The value is much smaller than the typical value of the focused evaluation value; the surface condition judgment value of the slice The parameter is dimensionless, and the value for determining the surface condition of the slice is given above. In the calculation formula, the molecule part It can reflect the range of changes in tissue smoothness or thickness between adjacent fields of view, the denominator part This reflects the contrast strength of the tissue itself within the current field of view. When the numerator is large and the denominator is small, it indicates that the tissue itself has low contrast but there are drastic changes between adjacent fields of view. The current field of view may be at the edge or transition area of ​​the tissue, requiring fine focusing. When the numerator is small and the denominator is large, it indicates that the tissue has high contrast and a flat surface, allowing for rapid scanning with a large stride. After normalization, the judgment value eliminates the interference of tissue contrast differences and only represents the relative change in the focusing evaluation value, making the surface state of different tissue regions comparable at the same scale.

[0054] After obtaining the surface state determination value of the slice, it is compared with the preset first surface state threshold. Second surface state threshold The comparison results classify the surface states, among which Greater than One possible implementation is as follows: Take 0.1, Using a threshold of 0.3, the two thresholds divide the surface state into three levels: flat, moderately undulating, and steeply varied, each corresponding to a different focusing strategy.

[0055] When the surface condition of the slice is determined Not greater than , that is When the slice surface is determined to be flat, the system switches to a large step size fast focus mode. In this mode, the Z-axis search range is reduced to less than a preset search range (optionally, half the preset search range); and the focus step size is increased to greater than the initial step size (optionally, twice the initial step size). The working principle is that the focus curve in flat areas is gentle, and the sharp range near the true focal plane is wider. Even with an increased step size, it is less likely to cross the true focal plane. Reducing the search range and increasing the step size reduces the number of Z-axis positions requiring image acquisition in two directions, thus significantly shortening the focusing time in flat areas.

[0056] When the surface condition of the slice is determined Greater than and not greater than , that is When the slice surface is determined to have moderate undulations, the standard step size focusing mode is maintained, that is, the initial step size and the preset search range are kept unchanged when focusing. The focusing difficulty in the moderately undulating area is moderate, and the preset initial parameters can take into account both focusing accuracy and search speed. No additional adjustment is required, and parameter fluctuations caused by frequent switching of focusing strategies can also be avoided.

[0057] When the surface condition of the slice is determined Greater than , that is When a steep change is detected on the slice surface, the system switches to a fine focus mode with small step sizes. This mode expands the Z-axis search range and reduces the focus step size to ensure that the true focal plane is not missed when traversing areas of abrupt changes in tissue thickness. The parameter settings for this mode are consistent with the aforementioned fine focus processing for low-confidence fields of view. After switching the focus strategy, the current field of view's focus step size setting is transmitted to the Z-axis motor controller, and the tissue transmittance characteristics of the current field of view are transmitted to the exposure linkage circuit as input for subsequent exposure compensation coefficient calculations.

[0058] The embodiments of the present invention can also obtain the surface state of the slice through the following scheme: (1) The distance between the real focal plane position locked in the current field of view and the focal plane position locked in the adjacent field of view in the Z-axis direction is used as the characterization quantity of the surface state of the slice. This distance directly reflects the height fluctuation of the slice surface and has a clear physical meaning. The larger the distance, the more severe the surface fluctuation. (2) Extract the half peak width of the current field of view focusing curve and use the deviation of the half peak width from the peak width of typical tissue as the characterization quantity of the surface state of the slice. The larger the peak width, the smoother the change of the focusing evaluation value and the lower the surface corresponding focusing accuracy requirement. The smaller the peak width, the steeper the change. (3) Perform sliding window statistics on the changes of multiple consecutive fields of view that have been focused before the current field of view. Use the mean or variance of the changes within the window as the characterization quantity of the surface state of the slice. Use the statistical information of multiple fields of view to smooth the random fluctuation of a single field of view and improve the stability of the surface state determination.

[0059] It should be noted that, in addition to the three focusing strategies mentioned above, the following focusing strategies can also be adopted in the embodiments of the present invention: (1) A continuous gradual focusing strategy is adopted, which does not divide discrete focusing modes, but establishes a continuous mapping relationship between the slice surface state judgment value and the focusing step size and Z-axis search range. The focusing step size decreases continuously as the judgment value increases, and the Z-axis search range increases continuously as the judgment value increases, so that the focusing parameters are steplessly adjusted according to the slice surface state, avoiding parameter jumps caused by discrete level switching near the threshold boundary. (2) A multi-level subdivision focusing strategy is adopted, which adds more surface state thresholds on the basis of the three focusing modes, divides the surface state into four or more levels, and each level corresponds to a different combination of focusing step size and search range, so that the matching between the focusing strategy and the slice surface state is more delicate. (3) A predictive focusing strategy is adopted, which uses the focal plane positions of multiple completed focusing fields around the current field of view to fit the tilted plane of the slice surface, and uses the position of the fitted plane at the current field of view as the predicted focal plane, and performs focusing search only in a narrow range near the predicted focal plane, greatly compressing the search interval of each field of view.

[0060] Step S140: Calculate the exposure compensation coefficient based on the image average gray value and the focus step size, and determine the focus exposure time based on the exposure compensation coefficient and the reference exposure time.

[0061] It is understandable that different tissue regions in pathological sections exhibit significant differences in their light transmittance. Taking hematoxylin-eosin staining (HE staining) as an example, areas with dense cell nuclei are deeply stained and have low transmittance. If the exposure time is insufficient, the overall focused image will be dark, and the image details relied upon for focusing evaluation will be submerged by noise, resulting in a significant decrease in the signal-to-noise ratio and consequently, a reduction in focusing accuracy. Conversely, lightly stained cytoplasmic regions have high transmittance, and the same exposure time may result in an overly bright image. The average gray value of the image can characterize the tissue transmittance characteristics of the current field of view, thus forming the basic basis for determining exposure requirements. However, adjusting exposure solely based on the average gray value of the image cannot perceive the focusing difficulty of the current field of view: the focusing step size is the output result of the determination of the section surface state and the switching of focusing strategies. It can reflect the complexity of the tissue. The smaller the focusing step size, the greater the surface undulation of the section, the more complex the tissue morphology, the higher the focusing difficulty, and the more urgent the need for a high signal-to-noise ratio in the focused image. Therefore, exposure compensation should be strengthened accordingly. Therefore, this embodiment of the invention calculates the exposure compensation coefficient based on the average gray value of the image and the focusing step size as a correction factor. This ensures that the exposure adjustment matches the staining and light transmission characteristics of the tissue and adaptively adjusts according to the focusing difficulty. Deeply stained areas with high focusing difficulty receive more sufficient exposure, and the calculation of the focus evaluation value maintains a reliable signal-to-noise ratio. This avoids focusing failures in deeply stained areas due to excessively dark images, preventing repeated retries. Exposure and focusing thus work synergistically to improve scanning efficiency. An optional implementation of step S140 is described below: Optionally, step S140 includes: acquiring a standard grayscale value, a reference focus step size, a focus step size, and the average grayscale value of the image at the initial Z-axis position of the current field of view; determining an exposure compensation coefficient based on the degree of deviation between the average grayscale value and the standard grayscale value and the degree of deviation of the focus step size from the reference focus step size; determining a focus exposure time based on the reference exposure time and the exposure compensation coefficient; and writing the focus exposure time into the camera controller.

[0062] The above exposure compensation calculation first requires gathering two types of input parameters. The first type is a characterization of tissue light transmittance: the average gray value of the image at the initial Z-axis position of the current field of view. The initial Z-axis position is the starting acquisition position for focus search. The image at this position has been acquired before the focus strategy is switched, and its average grayscale value can reflect the basic light transmittance level of the current field of view without increasing additional acquisition overhead; standard grayscale value The first category is the preset desired gray level, which characterizes the brightness and darkness that a focused image should have to achieve a reliable signal-to-noise ratio. This can be calibrated based on the image signal-to-noise ratio requirements of a sharpness evaluation algorithm. The second category is a quantity representing the focusing difficulty: focusing step size. The focus step size is the set value determined after the focus strategy is switched for the current field of view; the reference focus step size. As a preset reference value, one optional implementation is to take an initial step size, which is usually in micrometers in engineering implementation.

[0063] Based on the above parameters, using the average gray value of the image as the basis and the focus step size as the correction factor, the exposure compensation coefficient is calculated. :

[0064] In the formula, and The extremely small positive number introduced to prevent the denominator from being zero. Units and The units are consistent. Units and The units are consistent. and The values ​​of these values ​​are all much smaller than the typical values ​​of the corresponding physical quantities; exposure compensation coefficient It is a dimensionless parameter; in the above exposure compensation coefficient In the calculation formula, the first factor It can reflect the basic requirements of tissue transmittance for exposure: The smaller the value, the deeper the staining and the lower the light transmittance. The larger the value, the longer the exposure time needs to be. The larger the value, the lighter the tissue staining and the higher the light transmittance; the smaller the value, the shorter the exposure time needs to be. The second factor... It can reflect how focus precision affects exposure correction: The smaller the step size, the smaller the denominator, and the larger the factor, which further amplifies the exposure compensation. This is because a small step size means that the current area is complex and difficult to focus on, requiring more exposure to ensure the signal-to-noise ratio of the focused image. Conversely, a large step size corresponds to a flat area with relatively low exposure requirements, and the factor decreases accordingly.

[0065] After determining the exposure compensation factor, the focus exposure time is determined based on its comparison with the reference exposure time:

[0066] In the formula, The preset baseline exposure time, typically measured in milliseconds in engineering implementations, is the focus exposure time. Units and reference exposure time The units are consistent. Focusing exposure time The actual exposure time used by the camera to acquire images during the current field of view focusing phase is written into the camera controller and takes effect during the focusing process of the current field of view: the exposure time of the darker, low-transmittance areas is extended accordingly, and the image brightness and signal-to-noise ratio are improved; the exposure time of the lighter, high-transmittance areas is shortened accordingly to avoid image overexposure.

[0067] Understandably, adjusting the exposure time can further influence the focus step size. A longer exposure time improves the signal-to-noise ratio of the focused image, making the calculation of the focus evaluation value more reliable. The focus search can then distinguish more subtle differences in sharpness, allowing for a more precise reduction in the focus step size to obtain a more accurate focal plane. The final focus step size after the combined adjustment is as follows:

[0068] In the formula, This is the final focus step size; This is the focus step size; Units and The units are consistent. Exposure compensation factor The larger the value, the greater the reduction in the final focus step size, and the improved resolution brought by the increased signal-to-noise ratio is fully utilized for precise positioning of the focal plane. The final focus step size is written into the Z-axis motor controller and takes effect during the focusing process in the current field of view, achieving coordination between exposure and focus.

[0069] It should be noted that the exposure compensation coefficient can also be determined using the following scheme in the embodiments of the present invention. (1) The grayscale ratio of the standard grayscale value to the average grayscale value of the image and the step size ratio of the reference focus step size to the focus step size are normalized and then weighted and summed. The sum of the two weight coefficients is 1. The weight values ​​reflect the weight of light transmission characteristics and focusing difficulty in exposure compensation. The result of the weighted sum is used as the exposure compensation coefficient. (2) The average gray value of the image and the focus step size are divided into several levels in advance, and a two-dimensional mapping table of gray level and step size is established. The corresponding exposure compensation coefficient is obtained by looking up the table according to the two levels to which the current field of view belongs. This is to reduce online computing overhead.

[0070] Step S150: Perform focusing and image acquisition based on the true focal plane, focusing step size, and focusing exposure time.

[0071] Optionally, step S150 includes: stitching the images acquired from each field of view into a panoramic digital slice; identifying the surface state of each slice in the form of a heat map, and displaying the trend of focus step size change and exposure compensation amount for each field of view; and storing scanning parameters, focus records and image quality indicators by field of view number and timestamp to support post-view playback and quality traceability.

[0072] During focusing and image acquisition for each field of view, the Z-axis focusing motor moves within the corresponding search range according to the focusing step size determined for the current field of view. The digital microscope camera exposes according to the set focusing exposure time. After locking the true focal plane during the focusing process, the camera acquires the final image of the current field of view at that position. Because the true focal plane undergoes false peak identification, the focusing step size is adaptively adjusted based on surface conditions, and the focusing exposure time is compensated for through the linkage of grayscale and step size, the clarity of the final image is guaranteed in various complex field-of-view scenarios. After the current field of view is acquired, the X / Y axis moving platform moves the slice to the next field of view according to the scanning path, repeating the above process until all fields of view within the tissue coverage area have been traversed.

[0073] After all fields of view have been acquired, the images from each field are stitched together to form a panoramic digital slide. A panoramic digital slide is a high-resolution digital image covering the entire tissue area. The stitching process is based on the spatial correspondence of each field of view along the scanning path: images from adjacent fields of view are aligned according to the positional information recorded by the X / Y axis movement platform; overlapping areas between adjacent images are fused to eliminate stitching seams, ensuring a continuous transition between images from field of view. The stitched panoramic digital slide allows pathologists to view the slide at any zoom level, replacing manual observation under a traditional microscope.

[0074] During the scanning process, control information for each field of view is visualized through the control interface. The interface uses a heatmap to identify the surface state of each field of view, overlaying the state attributes of each field of view onto its corresponding spatial location using color mapping: flat areas are displayed in green, areas with abrupt thickness changes are displayed in yellow, and areas where false peaks are excluded are marked in red. It also displays the focus step size change trend and exposure compensation amount for each field of view. Through the heatmap and trend display, operators can quickly locate areas where false peak interference or abrupt thickness changes occurred after scanning, intuitively assessing the distribution and execution of the focusing strategy across the entire slice, providing a basis for manual verification of scan quality.

[0075] All scanning parameters, focus records, and image quality metrics are stored by field of view (GLP) number and timestamp to support post-scan playback and quality traceability. The GLP number is a unique identifier for each GLP on the scanning path and can be arranged according to the scanning sequence. The timestamp records the moment the corresponding GLP completes focusing and acquisition. Image quality metrics can include the focus evaluation value when each GLP locks onto the true focal plane. When a sharpness issue occurs in a region of a panoramic digital tile, the complete parameter records, such as the comprehensive pseudo-peak index, tile surface condition judgment value, focus step size, and exposure compensation coefficient, can be traced back based on the GLP number to pinpoint the source of the problem. Data organized by timestamp can also recreate the entire scanning process, providing data support for optimizing the scanning workflow and defining quality responsibility.

[0076] like Figure 2 As shown, based on the same inventive concept, this embodiment of the invention also provides a pathological slide scanning control system 200, including an industrial control computer 210 and an X / Y axis moving platform 220, a Z axis focusing motor 230, and a microscopic digital camera 240 communicatively connected to the industrial control computer 210, wherein: X / Y axis moving platform 220 is used to carry pathological slides and drive the pathological slides to move in the X / Y axis direction during scanning; Z-axis focusing motor 230 is used to drive the microscope objective to move along the Z-axis within a preset search range to perform focusing search; The digital microscope camera 240 is used to acquire field-of-view images when the Z-axis focusing motor drives the microscope objective to move to various Z-axis positions, and transmit the images to the industrial control computer. The industrial computer 210 is used to acquire the focus evaluation value sequence of the current field of view, the average gray value of the image, and the change in focus evaluation value between adjacent fields of view; calculate the comprehensive pseudo-peak index based on the focus evaluation value sequence, identify and eliminate pseudo-peaks based on the comprehensive pseudo-peak index, and lock the true focal plane; judge the slice surface state based on the change in focus evaluation value between adjacent fields of view, and adaptively switch the focus step size; calculate the exposure compensation coefficient based on the image average gray value and the focus step size, and determine the focus exposure time based on the exposure compensation coefficient and the reference exposure time; and perform focusing and image acquisition based on the true focal plane, the focus step size, and the focus exposure time.

[0077] The aforementioned pathological slide scanning control system 200 adopts a centralized control architecture, with an industrial computer 210 serving as the control core. It interacts with the X / Y axis moving platform 220, the Z-axis focusing motor 230, and the digital microscope camera 240 via communication connections. The communication connections are used to transmit control commands and image data. Optional implementation methods include a universal serial bus interface, an Ethernet interface, and a camera-specific image transmission interface. Control commands for motor components can be issued via a motion control card. In terms of signal flow, the industrial computer 210 sends position and motion parameters to the X / Y axis moving platform 220 and the Z-axis focusing motor 230, sends exposure parameters to the digital microscope camera 240, and receives the field-of-view images returned by the digital microscope camera 240, constituting a bidirectional interaction of downward control commands and upward image data transmission. The industrial computer 210 stores preset scanning parameters, including the initial focusing step size, the reference exposure time, and the focus evaluation algorithm. The focus evaluation algorithm can employ the Brenner gradient method or the Laplacian variance method.

[0078] The X / Y axis moving platform 220 is used to carry the pathological slides and drive them to move along the mutually perpendicular X and Y axes in the horizontal plane during scanning, allowing the field of view of the microscope objective to switch point by point on the slide. The X / Y axis moving platform 220 can be a precision displacement platform driven by a stepper motor or a servo motor, and can be equipped with a position feedback element to record the actual position of the platform in real time. Precise position recording ensures the accuracy of field of view switching and provides spatial position correspondence for the alignment and stitching of images from each field of view after scanning.

[0079] The Z-axis focusing motor 230 drives the microscope objective to move along the Z-axis within a preset search range to perform focusing. The Z-axis focusing motor 230 can be driven by a stepper motor with a lead screw, or by a piezoelectric ceramic drive to achieve higher resolution displacement. Its minimum displacement step determines the physical lower limit of the focusing step size setting. The microscope digital camera 240 acquires field-of-view images when the Z-axis focusing motor 230 drives the microscope objective to each Z-axis position and transmits the images to the industrial control computer 210. It can be a digital camera using a complementary metal-oxide-semiconductor (CMOS) image sensor or a charge-coupled device (CCD) image sensor. Acquisition parameters such as exposure time are configured by the industrial control computer 210. The acquisition frame rate is coordinated with the Z-axis movement speed to ensure corresponding image output at each Z-axis position.

[0080] The industrial control computer 210 performs sharpness evaluation and control decisions on the received field-of-view images and sends the control parameters obtained from the decisions back to each hardware component. These four components thus form a closed loop of image acquisition, sharpness evaluation, parameter decision-making, and execution adjustment. Specifically, the microscopic digital camera 240 acquires and transmits images; the industrial control computer 210 completes evaluation and decisions based on the images; the Z-axis focusing motor 230 and the microscopic digital camera 240 perform focusing and acquisition according to the determined focusing step size and focusing exposure time; and the X / Y-axis moving platform 220 drives the slice to switch to the next field of view after completing the current field of view. This closed loop operates within each field of view and progresses along the scanning path, with hardware execution and software decision-making seamlessly integrated. This maps control logic such as false peak elimination, focusing strategy switching, and exposure linkage into specific mechanical movements and imaging parameters, ultimately completing the scanning of the entire image.

[0081] It should be noted that the above-mentioned industrial control computer 210 can realize any one of the functions of the pathological slide scanning control method provided in the embodiments of the present invention. For the method embodiments and working principles of realizing each function, please refer to the system embodiments.

[0082] This invention is now complete.

[0083] In summary, in this embodiment of the invention, the focus evaluation value sequence of the current field of view, the average gray value of the image, and the change in focus evaluation value between adjacent fields of view are obtained; a comprehensive pseudo-peak index is calculated based on the focus evaluation value sequence, and pseudo-peaks are identified and eliminated based on the comprehensive pseudo-peak index to lock the true focal plane; the surface state of the slice is judged based on the change in focus evaluation value between adjacent fields of view, and the focus step size is adaptively switched; the exposure compensation coefficient is calculated based on the image average gray value and the focus step size, and the focus exposure time is determined based on the exposure compensation coefficient and the reference exposure time; focusing and image acquisition are performed based on the true focal plane, the focus step size, and the focus exposure time.

[0084] This invention employs a progressive control mechanism involving spurious peak interference elimination, adaptive switching of focusing strategies, and coordinated adjustment of exposure and focus. This allows the focusing process to dynamically adapt to the surface condition of the slide, tissue thickness, and staining transmittance characteristics of the current field of view, balancing focusing accuracy and scanning efficiency in pathological slide scanning. Furthermore, it identifies and eliminates spurious peaks based on the peak height and width characteristics of the focusing curve, preventing microscopic anomalies such as bubbles and adhesive residues from being mistakenly identified as focal planes, thus ensuring accurate locking of the true tissue layer's focal plane. Additionally, it adaptively adjusts the focusing step size based on the variation in focusing evaluation values ​​between adjacent fields of view, enabling faster focusing in flat areas and finer focusing in undulating areas, achieving a dynamic balance between scanning speed and focusing accuracy. Moreover, this invention uses a linked compensation adjustment of exposure based on the image's average grayscale value and the focusing step size, ensuring sufficient exposure in deeply stained, low-transmittance areas to improve the signal-to-noise ratio of the focused image, avoiding repeated retries after focusing failures and shortening the overall scan time.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for controlling the scanning of pathological sections, characterized in that, The method includes: Obtain the current field of view's focus evaluation value sequence, the image's average gray value, and the change in focus evaluation value between adjacent fields of view; Calculate the comprehensive pseudo-peak index based on the focused evaluation value sequence, identify and eliminate pseudo-peaks based on the comprehensive pseudo-peak index, and lock the true focal plane. The surface state of the slice is determined based on the change in the focus evaluation value between adjacent fields of view, and the focus step size is adaptively switched. The exposure compensation coefficient is calculated based on the average gray value of the image and the focus step size, and the focus exposure time is determined based on the exposure compensation coefficient and the reference exposure time. Focusing and image acquisition are performed based on the true focal plane, the focus step size, and the focus exposure time.

2. The pathological section scanning control method according to claim 1, characterized in that, The step of calculating a comprehensive pseudo-peak index based on the focused evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane includes: If the number of effective local peaks in the focused evaluation value sequence is not less than a preset number threshold, then the highest peak evaluation value, the second highest peak evaluation value, and the half-peak width of the highest peak at half-peak height are extracted from the focused evaluation value sequence; wherein, the effective local peak is a local peak whose local peak value is higher than the effective peak value threshold; Based on the degree of closeness between the evaluation value of the second peak and the evaluation value of the highest peak, and the degree of deviation between the half-peak width and the typical tissue peak width, a comprehensive pseudo-peak index is determined; wherein, the comprehensive pseudo-peak index is used to quantify the probability that the highest peak is a pseudo-peak. When the comprehensive pseudo-peak index does not exceed the pseudo-peak determination threshold, the highest peak is locked as the true focal plane; When the comprehensive pseudo-peak index exceeds the pseudo-peak determination threshold, the secondary peak is locked as the true focal plane.

3. The pathological section scanning control method according to claim 2, characterized in that, The step of calculating a comprehensive pseudo-peak index based on the focused evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane further includes: If the number of effective local peaks is greater than zero and less than the preset number threshold, then it is determined whether the peak width of the local peaks in the focused evaluation value sequence exceeds the preset peak width threshold. When the peak width of the local peak exceeds the peak width threshold, the current field of view is marked as a low-confidence field of view, and the focus is switched to a small step fine focus mode; wherein, the small step fine focus mode includes: expanding the Z-axis search range to a value greater than the preset search range, and setting the focus step size to a value less than the initial step size; When the peak width of the local peak does not exceed the peak width threshold, the local peak is locked as the true focal plane.

4. The pathological section scanning control method according to claim 2, characterized in that, The step of calculating a comprehensive pseudo-peak index based on the focused evaluation value sequence, identifying and eliminating pseudo-peaks based on the comprehensive pseudo-peak index, and locking the true focal plane further includes: If there is no valid local peak in the focus evaluation value sequence, the current field of view is determined to be an invalid region, and the focusing process for the current field of view is skipped.

5. The pathological section scanning control method according to claim 1, characterized in that, The step of determining the slice surface state based on the change in focus evaluation value between adjacent fields of view and adaptively switching the focus step size includes: Based on the change in the focusing evaluation value between adjacent fields of view and the current focusing evaluation value, the surface state judgment value of the slice is determined. When the surface state determination value of the slice is not greater than the first surface state threshold, the slice surface is determined to be flat, and the slice is adaptively switched to the large step size fast focusing mode; wherein, the large step size fast focusing mode includes: reducing the Z-axis search range to less than the preset search range, and increasing the focusing step size to greater than the initial step size; When the slice surface state determination value is greater than the first surface state threshold and not greater than the second surface state threshold, it is determined that the slice surface has moderate undulations, and the standard step size focusing mode is maintained; wherein, the second surface state threshold is greater than the first surface state threshold. When the surface state determination value of the slice is greater than the second surface state threshold, it is determined that the slice surface has a steep change, and the slice is adaptively switched to the small step fine focus mode.

6. The pathological section scanning control method according to claim 1, characterized in that, The step of calculating the exposure compensation coefficient based on the average gray value of the image and the focus step size, and determining the focus exposure time based on the exposure compensation coefficient and the reference exposure time, includes: Obtain the standard grayscale value, the reference focus step size, the focus step size, and the average grayscale value of the image at the initial Z-axis position of the current field of view; The exposure compensation coefficient is determined based on the degree of deviation between the average gray value of the image and the standard gray value, and the degree of deviation of the focus step size from the reference focus step size. The focus exposure time is determined based on the reference exposure time and the exposure compensation coefficient. The focus exposure time is written into the camera controller.

7. The pathological section scanning control method according to any one of claims 1-6, characterized in that, The process of obtaining the current field-of-view focus evaluation value sequence includes: Control the Z-axis focusing motor to move within a preset search range with an initial step size; One frame of image is acquired at each Z-axis position, and the focus evaluation value of the image is calculated; Based on the focus evaluation values ​​at each Z-axis position, obtain the focus evaluation value sequence for the current field of view.

8. The method for controlling the scanning of pathological sections according to any one of claims 1-6, characterized in that, Before obtaining the focus evaluation value sequence of the current field of view, the method further includes: Quickly scan the entire image in slice preview mode to obtain a low-resolution panoramic thumbnail; The low-resolution panoramic thumbnail is coarsely segmented using a grayscale threshold to determine the tissue coverage area. A scan path is generated based on the tissue coverage area.

9. The method for controlling the scanning of pathological sections according to any one of claims 1-6, characterized in that, After performing focusing and image acquisition based on the true focal plane, the focusing step size, and the focusing exposure time, the method further includes: Images acquired from each field of view are stitched together to form a panoramic digital slice; The surface condition of each slice in the field of view is identified in the form of a heat map, and the trend of focus step size change and exposure compensation amount of each field of view are displayed. Scanning parameters, focus records, and image quality metrics are stored by field of view number and timestamp to support post-processing playback and quality traceability.

10. A pathological slide scanning control system, characterized in that, It includes an industrial control computer and an X / Y axis moving platform, a Z axis focusing motor, and a digital microscope camera that are communicatively connected to the industrial control computer, wherein: The X / Y axis moving platform is used to carry the pathological slides and drive the pathological slides to move in the X / Y axis direction during scanning; The Z-axis focusing motor is used to drive the microscope objective to move along the Z-axis within a preset search range in order to perform focusing search; The digital microscope camera is used to acquire field-of-view images when the Z-axis focusing motor drives the microscope objective to move to each Z-axis position, and to transmit the images to the industrial control computer. The industrial control computer is used to acquire the focus evaluation value sequence of the current field of view, the average gray value of the image, and the change in focus evaluation value between adjacent fields of view; calculate a comprehensive pseudo-peak index based on the focus evaluation value sequence, identify and eliminate pseudo-peaks based on the comprehensive pseudo-peak index, and lock the true focal plane; determine the slice surface state based on the change in focus evaluation value between adjacent fields of view, and adaptively switch the focus step size; calculate the exposure compensation coefficient based on the average gray value of the image and the focus step size, and determine the focus exposure time based on the exposure compensation coefficient and the reference exposure time; and perform focusing and image acquisition based on the true focal plane, the focus step size, and the focus exposure time.