Cross-slide microscopic imaging rapid automatic focusing method

By using a global focal plane matrix and a narrow focusing range, combined with a clear error identification and defocusing identification mechanism, the problems of long focusing time and poor stability across glass slides in traditional methods are solved, achieving fast and accurate autofocus and improving experimental efficiency.

CN122018135APending Publication Date: 2026-05-12NINGBO INVIEW INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO INVIEW INTELLIGENT TECH CO LTD
Filing Date
2026-03-11
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Traditional autofocus methods for microscopic imaging are time-consuming and unstable in experiments involving multiple slides and slides. They lack intelligent references and effective misfocus identification and emergency handling mechanisms, resulting in unstable focusing results and low efficiency.

Method used

It uses a global focal plane matrix to record the position information of the climbed film that has been focused. By utilizing the focal plane position of adjacent focused climbed films within a narrow focusing range, and combining sharpness evaluation and misfocusing identification mechanisms, it can achieve rapid automatic focusing within the same glass slide and between glass slides, and is equipped with an emergency handling mechanism.

Benefits of technology

It significantly improves focusing speed and stability, enabling rapid continuous focusing within the same glass slide and accurate focusing across glass slides. The data archiving function enhances the efficiency of batch experiments and ensures the accuracy and stability of focusing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018135A_ABST
    Figure CN122018135A_ABST
Patent Text Reader

Abstract

The invention discloses a quick and automatic focusing method for cross-slide microscopic imaging, and relates to the technical field of microscopic imaging. According to the invention, the global focal plane matrix is introduced to record the position information of the focused slide and the focal plane position, rapid automatic focusing in the same slide and between cross slides is realized, when continuous focusing is carried out in the same slide, the focal plane position of the adjacent focused slide on the upper side or the left side is preferentially utilized to set a narrow-width focusing range, and the focusing accuracy is improved. Compared with the prior art, the method has the advantages that the focusing interval is obviously reduced, the focusing speed is increased, during cross-slide focusing, quick focusing is also realized by referring to the position information of the slide which finishes focusing on the adjacent slide, and in addition, the data archiving and multiplexing functions enable repeated experiments of the same batch and the same specification to directly utilize the archived focal plane matrix data, so that the accuracy and the accuracy of the cross-slide focusing are improved. And the initial focusing step is skipped, so that the focusing efficiency of batch experiments is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microscopic imaging technology, specifically to a rapid autofocus method for cross-slide microscopic imaging. Background Technology

[0002] In the field of microscopic imaging, especially in biomedical research, rapid and accurate autofocusing of biological samples on glass slides is a crucial step in acquiring high-quality microscopic images. With the continuous development of microscopic imaging technology, researchers often need to process large numbers of glass slide samples and perform multiple imaging operations under different experimental conditions.

[0003] Traditional autofocus methods for microscopic imaging suffer from several significant drawbacks when handling experiments involving multiple slides or multiple slides. First, traditional methods often require independent full-range focus searches for each slide, which is not only time-consuming but also susceptible to factors such as uneven sample distribution and variations in slide thickness, leading to unstable focusing results. Second, traditional methods lack effective utilization of the positional information of successfully focused slides, failing to achieve rapid and intelligent focusing references within the same slide or across slides, thus limiting the improvement of focusing speed. Furthermore, traditional methods often lack effective misfocus identification and emergency handling mechanisms during the focusing process. If focusing fails, manual intervention or restarting the focusing process is required, further reducing experimental efficiency.

[0004] In view of the shortcomings of traditional microscopic imaging autofocus methods, such as long time consumption, poor stability, lack of intelligent reference, and insufficient ability to handle misfocusing when handling cross-slide and multi-slide experiments, this invention proposes a fast autofocus method for cross-slide microscopic imaging, which is of great importance. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a rapid autofocus method for cross-slide microscopy imaging, which can achieve this.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a rapid autofocus method for cross-slide microscopy imaging, the specific steps of which are as follows: S1. Initial Focusing: For the first slide of the first slide at the start of the experiment, autofocus is performed using the user-preset Z-axis focus range to obtain the focal plane position of the slide. S2. Focal plane recording and matrix update: After a single climbing film is focused, the focal plane position of the climbing film is recorded, and the global focal plane matrix is ​​updated synchronously. The focal plane matrix records the position information and corresponding focal plane positions of all climbing films that have been focused. S3. Continuous Focusing within the Same Slide: For the slides to be focused within the same slide, excluding the first slide, prioritize selecting the focal plane position of the adjacent slide above that has already been focused, and set a narrow focus range for autofocus; if the adjacent slide above has not been focused, select the focal plane position of the adjacent slide to the left that has already been focused, and set a narrow focus range for autofocus; if neither the adjacent slides above nor to the left has been focused, use the user-preset Z-axis focus range for autofocus. S4. Focusing across glass slides: After switching to a new glass slide, for the slide to be focused, prioritize the focal plane position of the adjacent slide that has already been focused above it, and set a narrow focus range to perform autofocus; if the adjacent slide above has not been focused, select the focal plane position of the adjacent slide on the left that has already been focused at the same position, and set a narrow focus range to perform autofocus; if none of the above adjacent slides have been focused, then use the user-preset Z-axis focus range to perform autofocus. S5. Data Archiving: After all slides have been focused and imaged, the global focal plane matrix is ​​archived in a preset format.

[0007] Furthermore, the initial focusing process in step S1 is specifically implemented according to the following steps: First, before the experiment begins, after the user completes the optical path calibration of the slide loading and microscopic imaging system, the user first locates the center area of ​​the first slide's first climbing section through the preview interface, ensuring that the preview image completely covers the biological sample area on the climbing section, eliminating interference from the climbing section edges, blank areas of the slide, and solution bubble areas; Second, based on the objective lens magnification, sample type, and climbing section thickness used in this experiment, the user sets the corresponding initial Z-axis focusing range, and simultaneously sets the Z-axis stepping accuracy and single-step image acquisition parameters during the focusing process, ensuring that the sample can be completely covered during the initial focusing process. The system identifies all existing focal plane positions. The third step involves initiating initial focusing, where the system acquires images point-by-point within the initial focus range according to a preset stepping accuracy, calculates the sharpness evaluation value for each frame, and locates the Z-axis coordinate corresponding to the peak sharpness evaluation value as the initial focal plane position. The fourth step involves automatically performing a secondary verification of the focal plane position after initial positioning. Within a 10μm range above and below this position, the system repeatedly acquires and calculates sharpness with higher stepping accuracy to confirm the accuracy of the peak position. Simultaneously, the system automatically adjusts the focus range to ensure the verified focal plane position is centered within the adjusted focus range, providing a stable reference for focusing on subsequent adjacent frames.

[0008] Furthermore, during the focal plane recording and matrix update process in step S2, the system assigns a corresponding confidence weight to the focal plane data of each crawling film. The weight is assigned using the focal plane confidence weight calculation formula, and the weight value is synchronously stored in the global focal plane matrix. This provides a quantitative basis for selecting the focusing reference for subsequent adjacent crawling films. The focal plane confidence weight calculation formula is as follows: ,in For the first On the first glass slide Line 1 The credibility weight of the focal plane data of the climbing film is fixed in the range of [0, 1]. The higher the weight value, the higher the accuracy and reference value of the focal plane data of the climbing film. The sharpness contribution coefficient is fixed at 0.5. This value was obtained through statistical analysis of 1200 sets of cell microscopy imaging focusing experiments. The experimental results show that the image sharpness accounts for 50% of the impact on the accuracy of focal plane positioning. Therefore, this coefficient value was determined. The normalized sharpness evaluation value corresponding to the completion of focusing on the film is [0, 1]. It is obtained by normalizing the gradient variance of the focal plane image acquired during the focusing process. The focus range contribution coefficient is fixed at 0.3. This value was obtained through experimental statistics. The size of the focus range directly affects the reliability of the focusing result. This factor accounts for 30% of the reliability of the focus area, so this coefficient value was determined. This is the normalized confidence value corresponding to the focus range of the film crawling, with a value range of [0, 1], and is calculated as follows: ,in The total Z-axis length of the initial focus range preset by the user. This is the total Z-axis length of the focusing range actually used by the climbing film; The contribution coefficient for positional continuity is fixed at 0.2. This value was obtained through experimental statistics. The higher the positional continuity between the crawling film and the already focused crawling film, the better the stability of the focusing result. This factor accounts for 20% of the influence, so this coefficient value was determined. The position continuity normalization value is the corresponding climbing slide position, with a value range of [0, 1]. The calculation method is the ratio of the number of climbing slides that have completed focusing in the four adjacent positions of the climbing slide (up, down, left, right) to 4. After the weight calculation is completed, the system synchronously stores the climbing slide's slide number, row and column position, focal plane Z-axis coordinate, and confidence weight value into the global focal plane matrix to complete the real-time update of the matrix.

[0009] Furthermore, the continuous focusing process within the same glass slide in step S3 is specifically implemented according to the following steps: First, the system pre-plans the scanning path of all climbing slides within the same glass slide, adopting a row-first, line-by-line scanning method. Starting from the first row and first column position of the first climbing slide, it sequentially completes the focusing of climbing slides from left to right within the same row, then switches to the next row and completes the focusing of all climbing slides in that row from left to right, ensuring that the adjacent climbing slides above or to the left of each climbing slide to be focused have completed the focusing operation before focusing is performed; Second, for the climbing slide to be focused, the system first retrieves the global focal plane matrix, queries the focusing completion status and focal plane data of the climbing slides in the same column above the climbing slide. If the climbing slide has completed focusing, the focal plane position of the climbing slide is directly used as the focusing reference, and the corresponding narrow focusing range is set to perform automatic focusing; Third, if the adjacent climbing slides above... If a frame is not yet focused, the system queries the focusing status and focal plane data of the frame in the previous column of the same row to the left of the frame. If the frame is already focused, the focal plane position of that frame is used as the focusing reference, and the corresponding narrow focusing range is set for autofocus. Fourth, if neither the frame above nor to the left is in focus, the system automatically retrieves the user-preset initial focusing range and performs full-range autofocus. After focusing, the frame is marked as the starting reference frame for its row or column. Fifth, after each frame is focused, the system verifies the validity of the focal plane position obtained. If the deviation between the current focal plane position and the reference position exceeds the preset maximum allowable deviation, the focusing range is automatically expanded and focusing is re-executed to avoid focusing errors. After successful verification, the focal plane recording and matrix update operations are performed.

[0010] Furthermore, in steps S3 and S4, the setting of the narrow focusing range is calculated using a dynamic adaptive adjustment formula. The focusing range of the film to be focused is adjusted in real time based on the focal plane data of the already focused film, maximizing the reduction of the focusing interval while ensuring a high focusing success rate and improving focusing speed. The dynamic calculation formula for the half-width range of the narrow focusing range is as follows: ,in This is the value of half the Z-axis interval of the narrow focusing range of the film to be focused on. The final focusing range is centered on the reference focal plane position. interval; The basic half-frame focusing range is fixed at 50μm. This value was obtained through statistical analysis of 150 sets of film mounting accuracy experiments. The experimental results show that the height error of 99.2% of the film mounting is within ±50μm. Therefore, this basic value was determined. The deviation response coefficient is fixed at 0.8. This value was optimized through 600 sets of continuous focusing experiments across glass slides. Under this coefficient, the focusing range can accurately cover the focal plane deviation, and the focusing speed will not decrease due to the excessively large range, thus balancing the focusing success rate and focusing efficiency. This refers to the Z-axis coordinate value of the focal plane of the adjacent already focused film used in this focusing process; It is the arithmetic mean of the focal plane Z-axis coordinates of all focused climbing pieces within the same glass slide. If it is a scene of focusing across glass slides, it is the arithmetic mean of the focal plane Z-axis coordinates of all focused climbing pieces in the same column within the adjacent glass slide on the left. The maximum allowable focal plane deviation in the same batch of experiments is fixed at 200 μm. This value comes from the multi-slide scanning experimental scenario targeted by this method, in which the maximum difference in focal plane between the first and last slides can reach 200 μm; (Completed) After calculation, the system automatically generates the corresponding narrow focus range and performs subsequent autofocus operations.

[0011] Furthermore, the cross-slide focusing process in step S4 is implemented according to the following steps: First, after the system completes the focusing and imaging of all the slides on the previous slide, it drives the displacement stage to complete the slide switching action, moving the new slide into the objective lens field of view of the microscopic imaging system. At the same time, it completes the coordinate calibration of the slide position to ensure that the coordinates of the slide array on the new slide match the coordinates of the slide array on the previous slide, avoiding position matching errors caused by slide loading deviations. Second, for the first slide to be focused on on the new slide, the system first retrieves the global focal plane matrix and queries the focusing completion status and focal plane data of the adjacent slide in the same column above the slide. If the slide has been focused, the focal plane position of the slide is directly used as the focusing reference, and the corresponding narrow focusing range is set to perform autofocus. Third, if the adjacent slide above has not been focused, the system then queries the adjacent slide on the left. The system first checks the focusing status and focal plane data of adjacent slides at the same position as the slide to be focused. If the slide has already been focused, its focal plane position is used as the focusing reference, and a corresponding narrow focusing range is set for autofocus. If neither of the two adjacent slides has been focused, the system automatically retrieves the user-preset initial focusing range and performs full-range autofocus, marking the slide as the starting reference slide for the new slide. After the first slide on the new slide is focused, subsequent slides are focused according to the continuous focusing rules within the same slide in step S3. The global focal plane matrix is ​​updated synchronously after each slide is focused. Simultaneously, the system compares the focal plane data of the new slide with the focal plane deviation of the previous slide at the same position. If the deviation exceeds a preset threshold, the focusing range of subsequent slides is automatically adjusted to ensure the stability and success rate of cross-slide focusing.

[0012] Furthermore, the data archiving and reuse process in step S5 is implemented according to the following steps: First, after the system completes the focusing and microscopic imaging operations for all slides, it first performs integrity verification on all data within the global focal plane matrix. This involves checking whether fields such as slide number, row and column position, focal plane Z-axis coordinate, focusing completion status, and confidence weight value are complete for each slide, and removing invalid focusing failure data to ensure the integrity and validity of the archived data. Second, the system converts the verified global focal plane matrix into a CSV file. The file arranges the focusing data of all slides sequentially according to the slide number as the first index, the slide row number as the second index, and the slide column number as the third index. Simultaneously, the header of the CSV file records the experimental time, objective magnification, slide specifications, number of slides, initial focusing range, and maximum focusing range. The system allows for basic parameters of focal plane deviation experiments, facilitating subsequent data backtracking and reuse. Third, the system saves the focal plane matrix file in CSV format to the local storage path of the microscopic imaging device, while simultaneously generating a corresponding backup file to prevent data loss. Fourth, for repeated experiments of the same batch and specifications, users can directly retrieve the archived focal plane matrix file. The system automatically reads the focal plane data within the file as the focusing reference for this experiment, skipping the initial focusing step and performing focusing according to the archived focal plane data to set a narrow focusing range, further improving the focusing efficiency of batch experiments. Fifth, the system performs statistical analysis on the archived focal plane matrix data from multiple experiments of the same specifications, generating a focal plane deviation statistical report for similar experiments. This provides data reference for setting the initial focusing range and adjusting the narrow focusing interval in subsequent experiments, continuously optimizing the adaptability and efficiency of the focusing strategy.

[0013] Furthermore, the autofocus operations in steps S1, S3, and S4 all employ a sharpness evaluation and misfocus identification mechanism optimized for climbing biological samples. Specifically, this is implemented as follows: First, during autofocus image acquisition, the system first extracts the region of interest for each frame, automatically identifying the effective region of the climbing biological sample within the image and shielding invalid regions such as glass areas at the edges of the climbing slide, blank areas on the slide, solution bubble areas, and areas obscured by impurities. Sharpness evaluation values ​​are calculated only for the effective sample region, avoiding errors in sharpness calculation caused by interference from invalid regions. Second, the system uses the gradient variance method to calculate the image sharpness evaluation value within the effective region. Optimizing the convolution kernel size for gradient calculation based on the microscopic image characteristics of cellular biological samples, it prioritizes identifying gradient changes in cell nuclei and cytoskeleton sample features to improve sharpness. The evaluation value's sensitivity to the sample's focal plane ensures the accuracy of focal plane positioning. Third, after locating the Z-axis coordinate corresponding to the peak value of the sharpness evaluation value, the system automatically performs a focus error detection check. First, it compares the deviation between the peak position and the reference focal plane position, then analyzes the sharpness evaluation value change curve before and after the peak position. If the curve shows multiple peaks, and the width and height of the current peak do not conform to the characteristics of the cell sample's focal plane, it is determined to be a focus error, and the peak is automatically excluded. The correct focal plane position is then repositioned to avoid incorrect focusing on the upper or lower surface of the slide. Fourth, after completing the focal plane positioning, the system re-acquires an image of that position, identifies the cell sample features within the image, and confirms that the sample's microstructure can be clearly distinguished within the image. Only after passing the check is the position confirmed as a valid focal plane position, ensuring the accuracy of the focusing result.

[0014] Furthermore, the method also includes an emergency handling and closed-loop optimization mechanism for focus failure. This mechanism runs through all focusing processes from steps S1 to S4, and is implemented according to the following steps: First, when the system performs automatic focusing for each climbing film, it monitors the status of the focusing process in real time. If no effective sharpness evaluation value peak is detected within the preset focusing range, or the sharpness evaluation value peak is lower than the preset effective threshold, or the misfocus identification verification fails, it is determined that the focus has failed. Second, after determining that the focus has failed, the system automatically triggers the first retry operation, expanding the current focusing range by 50% in both the positive and negative directions of the Z-axis, and re-executes the automatic focusing operation. At the same time, it expands the effective threshold range of the sharpness evaluation value to avoid focusing failure due to weak sample fluorescence signals. Third, if the first retry still fails to focus, the system automatically retrieves the global focal plane matrix and selects the 8 neighboring planes around the current climbing film to be focused. In the next step, the focal plane position of the already focused climbing film with the highest confidence weight value is used as the new reference benchmark. The focus range is reset and autofocus is performed. If there are no already focused climbing films nearby, the user-preset initial focus range is used to perform full-range focusing. In the fourth step, if all three focusing operations fail, the system automatically records the position information and focusing failure status of the climbing film and stores it in the global focal plane matrix. At the same time, the focusing and imaging operations of the climbing film are skipped, and the focusing process of subsequent climbing films is continued to avoid the entire experimental process being interrupted due to the focusing failure of a single climbing film. In the fifth step, after completing the focusing process of all climbing films, the system automatically generates a focusing failure statistics report, marks the positions of all climbing films that failed to focus, and calculates the focusing success rate of this experiment. The reasons for focusing failure are analyzed, and for areas where focusing failure occurs continuously, the focusing strategy and focus range settings of subsequent similar experiments are automatically optimized to form a closed-loop optimization.

[0015] Furthermore, the method adapts to imaging scenarios with different magnification objectives. Specifically, the adaptation logic is as follows: Before the experiment begins, the system automatically matches the corresponding Z-axis stepping accuracy, initial focus range, basic narrow focus interval, sharpness evaluation convolution kernel size, focal plane deviation threshold, and other focusing parameters based on the user-selected objective magnification. For high-magnification objective scenarios, the system narrows the basic narrow focus interval and improves the stepping accuracy of the secondary focal plane calibration. For low-magnification objective scenarios, the system optimizes the scanning path and expands the focal plane reference range of adjacent slides. For scenarios requiring switching objective magnifications within the same batch, the system automatically completes the focal plane coordinate transformation between different magnifications without needing to re-execute the full-range initial focusing. The system simultaneously records focusing experiment data under different objective magnifications and continuously optimizes the focusing parameters corresponding to each magnification.

[0016] Compared with existing technologies, this rapid autofocus method for cross-slide microscopy has the following advantages: I. This invention introduces a global focal plane matrix to record the position information of the focused climbing slides and the focal plane position, achieving rapid automatic focusing within the same slide and across slides. When focusing continuously within the same slide, the focal plane position of the adjacent focused climbing slide above or to the left is used to set a narrow focusing range, significantly reducing the focusing interval and improving the focusing speed. When focusing across slides, rapid focusing is also achieved by referring to the position information of the focused climbing slides on adjacent slides. In addition, the data archiving and reuse function allows repeated experiments of the same batch and specifications to directly use the archived focal plane matrix data, skipping the initial focusing step, further improving the focusing efficiency of batch experiments.

[0017] Second, this invention employs a sharpness evaluation and misfocus identification mechanism optimized for biological samples. By extracting the effective sample area from the image and masking the invalid area, the sharpness evaluation value is calculated only for the effective area, improving the accuracy of focusing. At the same time, the gradient variance method is used to calculate image sharpness, and the convolution kernel size for gradient calculation is optimized to better identify gradient changes in sample features such as cell nuclei and cytoskeleton, ensuring the accuracy of focal plane positioning. In addition, the system also has an emergency handling and closed-loop optimization mechanism for focusing failure, which can monitor the focusing process in real time and automatically trigger retry operations or adjust the focusing strategy to ensure the stability and success rate of focusing. These measures together improve the accuracy and stability of focusing during microscopic imaging.

[0018] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

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

[0020] Figure 1 A flowchart illustrating the process of a rapid autofocus method for cross-slide microscopy. Figure 2 This is a flowchart illustrating the continuous focusing refinement process within the same glass slide as a rapid autofocusing method for cross-slide microscopy. Figure 3 This is a flowchart illustrating the detailed execution of a rapid autofocus method for cross-slide microscopy. Detailed Implementation

[0021] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0022] Example This embodiment is applied to a high-throughput immunofluorescence imaging experiment in cell biology. An inverted fluorescence microscope with a 20x flat-field apochromatic objective lens was used. The experimental samples were cell slides seeded with HeLa cells and immunofluorescence stained. The slides used were standard 25mm×75mm slides, with 6 cell slides arranged in 2 rows and 3 columns on each slide. In this experiment, a batch focusing and imaging operation was completed on 8 consecutive slides. Before the experiment, the user preset the initial Z-axis focus range to -200μm to +200μm, the Z-axis step accuracy during the initial focusing process was 1μm, the single-step image acquisition exposure time was 50ms, the gain was 1×, the maximum allowable focal plane deviation in the same batch of experiments was 20μm, the basic half-frame focus interval was 30μm, the focal plane secondary verification interval was 10μm above and below the target position, and the step accuracy during the verification process was 0.2μm.

[0023] Before the initial focusing experiment begins, after the user completes the batch loading of 8 slides and the optical path calibration of the microscopic imaging system, they first locate the center area of ​​the first slide in the first row and first column of the first slide through the microscope preview interface. The field of view is adjusted to ensure the preview image completely covers the cell sample area on the slide, automatically shielding interference from the glass edges, blank areas without samples, and bubble areas in the solution. Then, the initial focusing program is started. The system acquires images point-by-point within the initial focusing range according to a preset step accuracy. For each frame, the region of interest is extracted first. Only for the effective cell sample area, the gradient variance method with optimized convolution kernel size is used to calculate the image sharpness evaluation value. The Z-axis coordinate corresponding to the peak sharpness evaluation value is used as the initial focal plane position. After completing the initial focal plane positioning, the system automatically performs a secondary verification of the focal plane position within the preset range. Within a 10μm calibration interval, image acquisition and sharpness calculation are repeated with higher step precision to confirm the accuracy of the peak position. At the same time, the focus range is automatically adjusted so that the calibrated focal plane position is at the center of the adjusted focus range, providing a stable benchmark for the focusing of subsequent adjacent slides. During the calibration process, misfocus identification and calibration are performed simultaneously, comparing the deviation between the peak position and the reference focal plane position, analyzing the change curve of sharpness evaluation value before and after the peak, eliminating multi-peak interference and invalid peaks that do not conform to the focal plane characteristics of cell samples. After the focal plane is located, the image at that position is acquired again to confirm that cell nuclei, cytoskeleton and other cellular microstructures can be clearly distinguished. After the calibration is passed, the position is confirmed as the effective focal plane position of the first slide. The entire focusing process synchronously triggers the emergency handling and closed-loop optimization mechanism for focusing failure, monitors the focusing status in real time and handles abnormal situations.

[0024] After focusing the first slide on the first slide, the system automatically records the slide number, row and column position information, and the finally confirmed focal plane position. Simultaneously, it updates the global focal plane matrix. This matrix records the position information and corresponding focal plane positions of all focused slides in real time. At the same time, the system assigns a corresponding confidence weight to the focal plane data of the slide using the following formula: ,in For the first On the first glass slide Line 1 The credibility weight of the focal plane data of the crawled images; Contribution factor to sharpness; This is the normalized sharpness evaluation value corresponding to the completion of focusing on the film. Contribution coefficient for focus range; This is the normalized confidence value corresponding to the focus range of the film crawling; Contribution coefficient to positional continuity; To provide a normalized value for the positional continuity of the corresponding climbing film, the calculated weight value is synchronously stored in the global focal plane matrix, providing data support for the selection of focusing references for subsequent adjacent climbing films.

[0025] The continuous focusing system within the same slide pre-plans the scanning path for all climbing slides within the same slide. It employs a row-first, line-by-line scanning method, starting from the first column of the first climbing slide and sequentially focusing on each climbing slide within the same row from left to right. Then, it switches to the next row and focuses on all climbing slides in that row from left to right. For the climbing slide currently to be focused, the system first retrieves the global focal plane matrix, prioritizing the focus completion status and focal plane data of the climbing slides in the adjacent column above it. If the climbing slide has already been focused, its focal plane position is directly used as the focusing reference. The corresponding narrow focusing range is calculated and set using a dynamic formula for the half-width interval of the narrow focusing range, and autofocus is then executed. The formula is as follows: ,in This is the half-width Z-axis interval value of the narrow focusing range of the film to be focused; The basic half-frame focusing range; The deviation response coefficient; This refers to the Z-axis coordinate value of the focal plane of the adjacent already focused film used in this focusing process; It is the arithmetic mean of the Z-axis coordinates of the focal plane of all the focused slides within the same glass slide; This represents the maximum allowable focal plane deviation within the same batch of experiments. If the adjacent climbing film above has not completed focusing, the system then queries the focusing status and focal plane data of the climbing film in the previous column of the same row to the left of that climbing film. If that climbing film has completed focusing, the focal plane position of that climbing film is used as the focusing reference. Similarly, the corresponding narrow focusing range is calculated and set using the dynamic calculation formula for the half-width range of the narrow focusing range, and autofocus is performed. If neither the adjacent climbing films above nor to the left has completed focusing, the system automatically retrieves the user-preset initial focusing range and performs full-range autofocus operation. Simultaneously, after focusing is complete, that climbing film is marked as the starting reference climbing film for its row or column. Each climbing film... During the focusing process, a sharpness evaluation and misfocus identification mechanism optimized for cellular biological samples is adopted. Sharpness evaluation values ​​are calculated only for valid sample areas. After the focal plane is located, misfocus verification and structure identification confirmation are performed. After each film is focused, the system verifies the validity of the focal plane position obtained in this focus. If the deviation between the current focal plane position and the reference position exceeds the preset maximum allowable deviation, the focusing range is automatically expanded and the focusing is re-executed. After focusing is completed, the focal plane data is recorded, the confidence weight is calculated, and the global focal plane matrix is ​​updated simultaneously. An emergency handling mechanism for focusing failure is provided throughout the process to respond to focusing anomalies in real time.

[0026] After the cross-slide focusing system completes focusing and imaging of all slides on the previous slide, it first drives the high-precision displacement stage to complete the slide switching action, moving the next new slide into the objective lens field of view of the microscopic imaging system. Simultaneously, it completes the coordinate calibration of the slide position. For the first slide to be focused on on the new slide, the system first retrieves the global focal plane matrix, prioritizing the focusing completion status and focal plane data of the adjacent slide in the same column above it. If the slide has already been focused, its focal plane position is directly used as the focusing reference. The corresponding narrow focusing range is calculated and set using a dynamic calculation formula for the half-width interval of the narrow focusing range, and autofocus is performed. If the adjacent slide above has not been focused, the system then queries the focusing completion status and focal plane data of the adjacent slide on the left side of the previous slide at the same position as the current slide to be focused. If the slide has already been focused, its focal plane position is used as the focusing reference. The system calculates and sets the corresponding narrow focus range using a dynamic formula for half-width intervals of the narrow focus range, and performs autofocus accordingly. If the two adjacent slides fail to focus, the system automatically retrieves the user-preset initial focus range and performs full-range autofocus, marking the slide as the starting reference slide for the new slide. After the first slide of the new slide is focused, all subsequent slides on that slide are focused according to the rule of continuous focusing within the same slide. The global focal plane matrix is ​​updated synchronously after each slide is focused. The system also compares the focal plane data of the new slide with the focal plane deviation of the previous slide at the same position in real time. If the deviation exceeds a preset threshold, the focus range of subsequent slides is automatically adjusted adaptively. All focusing processes simultaneously perform sharpness optimization calculations, misfocus identification, and focal plane position validity verification, and are equipped with emergency handling and closed-loop optimization mechanisms for focusing failures.

[0027] After the data archiving system completes the focusing and microscopic imaging operations for all eight slides, it first performs an integrity check on all data within the global focal plane matrix. This check verifies the completeness of fields such as slide number, row and column position, Z-axis coordinate of the focal plane, focusing completion status, and confidence weight value for each slide, removing invalid focusing failure data. The system then converts the verified global focal plane matrix into a CSV file. Within the file, the focusing data for all slides is arranged sequentially, with the slide number as the first index, the slide row number as the second index, and the slide column number as the third index. Simultaneously, the header of the CSV file records the experiment time, objective magnification, slide specifications, number of slides, initial focusing range, and maximum permissible focal length. Based on experimental parameters such as plane deviation, the system saves a CSV format focal plane matrix file to the local storage path of the microscope imaging device, and generates a corresponding backup file. For subsequent repeated experiments of the same batch and specifications, users can directly retrieve the archived focal plane matrix file. The system will automatically read the focal plane data in the file as the focusing reference for this experiment, skipping the initial focusing steps and performing focusing according to the archived focal plane data to set a narrow focusing range. At the same time, the system will perform statistical analysis on the archived focal plane matrix data of multiple experiments of the same specifications, generate a focal plane deviation statistical report for the same type of experiment, and automatically optimize the focusing strategy and focusing range settings for subsequent experiments of the same type for areas where focusing anomalies occur continuously, forming a closed-loop optimization.

[0028] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A rapid autofocus method for cross-slide microscopy imaging, characterized in that, The specific steps of this method are as follows: S1. Initial Focusing: For the first slide of the first slide at the start of the experiment, autofocus is performed using the user-preset Z-axis focus range to obtain the focal plane position of the slide. S2. Focal plane recording and matrix update: After a single climbing film is focused, the focal plane position of the climbing film is recorded, and the global focal plane matrix is ​​updated synchronously. The focal plane matrix records the position information and corresponding focal plane positions of all climbing films that have been focused. S3. Continuous Focusing within the Same Slide: For the slides to be focused within the same slide, excluding the first slide, prioritize selecting the focal plane position of the adjacent slide above that has already been focused, and set a narrow focus range for autofocus; if the adjacent slide above has not been focused, select the focal plane position of the adjacent slide to the left that has already been focused, and set a narrow focus range for autofocus; if neither the adjacent slides above nor to the left has been focused, use the user-preset Z-axis focus range for autofocus. S4. Focusing across glass slides: After switching to a new glass slide, for the slide to be focused, prioritize the focal plane position of the adjacent slide that has already been focused above it, and set a narrow focus range to perform autofocus; if the adjacent slide above has not been focused, select the focal plane position of the adjacent slide on the left that has already been focused at the same position, and set a narrow focus range to perform autofocus; if none of the above adjacent slides have been focused, then use the user-preset Z-axis focus range to perform autofocus. S5. Data Archiving: After all slides have been focused and imaged, the global focal plane matrix is ​​archived in a preset format.

2. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The initial focusing process in step S1 is implemented according to the following steps: First, before the experiment begins, after the user completes the optical path calibration of the slide loading and microscopic imaging system, the user first locates the center area of ​​the first slide through the preview interface to ensure that the preview image completely covers the biological sample area on the slide and eliminates interference from the edge of the slide, the blank area of ​​the slide, and the bubble area of ​​the solution. The second step is for the user to set the corresponding initial Z-axis focus range based on the objective lens magnification, sample type and slide thickness used in this experiment, and at the same time set the Z-axis stepping accuracy and single-step image acquisition parameters during the focusing process. The third step is to start the initial focus. After starting the initial focus, the system will acquire images point by point within the initial focus range according to the preset step accuracy, calculate the sharpness evaluation value of each frame, and locate the Z-axis coordinate corresponding to the peak of the sharpness evaluation value as the initial focal plane position. The fourth step involves the system automatically performing a secondary verification of the focal plane position after initial focal plane positioning. Within a 10μm range above and below this position, the system repeatedly acquires data and calculates sharpness with higher step precision to confirm the accuracy of the peak position. At the same time, the system automatically adjusts the focus range so that the verified focal plane position is at the center of the adjusted focus range, providing a stable reference for focusing on subsequent adjacent film climbers.

3. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, During the focal plane recording and matrix update process in step S2, the system assigns a corresponding confidence weight to the focal plane data of each crawling image. The weight is assigned using the focal plane confidence weight calculation formula, and the weight value is synchronously stored in the global focal plane matrix. The focal plane confidence weight calculation formula is as follows: ,in For the first On the first glass slide Line number The credibility weight of the focal plane data of the crawled images; Contribution factor to sharpness; This is the normalized sharpness evaluation value corresponding to the completion of focusing on the film. Contribution coefficient for focus range; This is the normalized confidence value corresponding to the focus range of the film crawling; Contribution coefficient to positional continuity; This is the normalized value for the positional continuity of the corresponding crawling slice.

4. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The continuous focusing process within the same glass slide in step S3 is implemented according to the following steps: First, the system pre-plans the scanning path for all climbing slides within the same glass slide, using a row-first, line-by-line scanning method. Starting from the first row and first column of the first climbing slide, the system sequentially completes the focusing of climbing slides from left to right within the same row, then switches to the next row and completes the focusing of all climbing slides in that row from left to right. Second, for the climbing slide to be focused, the system first retrieves the global focal plane matrix and queries the focusing completion status and focal plane data of the climbing slides in the same row above the current climbing slide. If the climbing slide has completed focusing, the system directly uses the focal plane position of the climbing slide as the focusing reference and sets the corresponding narrow focusing range to perform automatic focusing. Third, if the adjacent climbing slide above has not completed focusing... In the first step, the system queries the focus completion status and focal plane data of the previous column of the adjacent column to the left of the current climbing frame. If the climbing frame has completed focus, the focal plane position of the climbing frame is used as the focus reference, and the corresponding narrow focus range is set to perform autofocus. In the fourth step, if neither the upper nor the left adjacent climbing frames have completed focus, the system automatically retrieves the user-preset initial focus range and performs full-range autofocus. At the same time, after focusing, the climbing frame is marked as the starting reference climbing frame of its row or column. In the fifth step, after each climbing frame has completed focusing, the system will verify the validity of the focal plane position obtained in this focusing. If the deviation between the current focal plane position and the reference position exceeds the preset maximum allowable deviation, the focus range will be automatically expanded and focusing will be performed again.

5. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, In steps S3 and S4, the narrow focusing range is calculated using a dynamic adaptive adjustment formula. The focusing range of the film to be focused is adjusted in real time based on the focal plane data of the already focused film, minimizing the focusing interval while ensuring a high focusing success rate. The dynamic calculation formula for the half-width range of the narrow focusing range is as follows: ,in This is the half-width Z-axis interval value of the narrow focusing range of the film to be focused; The basic half-frame focusing range; The deviation response coefficient; This refers to the Z-axis coordinate value of the focal plane of the adjacent already focused film used in this focusing process; It is the arithmetic mean of the Z-axis coordinates of the focal plane of all the focused slides within the same glass slide; This represents the maximum allowable focal plane deviation in the same batch of experiments.

6. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The cross-slide focusing process in step S4 is implemented according to the following steps: First, after the system completes the focusing and imaging of all slides on the previous slide, it drives the displacement stage to complete the slide switching action, moving the new slide into the objective lens field of view of the microscopic imaging system, and simultaneously completing the coordinate calibration of the slide position; Second, for the first slide to be focused on on the new slide, the system first retrieves the global focal plane matrix and queries the focusing completion status and focal plane data of the adjacent slides in the same column above the current slide. If the slide has been focused, the focal plane position of the slide is directly used as the focusing reference, and the corresponding narrow focusing range is set to perform autofocus; Third, if the adjacent slide above has not been focused, the system then queries the adjacent slide on the left side of the previous slide, and the adjacent slide in the same position as the current slide to be focused. The system first checks the focus completion status and focal plane data. If the climbing slide has completed focusing, the focal plane position of the climbing slide is used as the focusing reference, and the corresponding narrow focusing range is set to perform autofocus. In the fourth step, if the climbing slides at the two adjacent positions have not completed focusing, the system automatically retrieves the user-preset initial focusing range and performs full-range autofocus operation, while marking the climbing slide as the starting reference climbing slide for the new slide. In the fifth step, after the first climbing slide of the new slide is focused, the focusing of subsequent climbing slides is performed according to the continuous focusing rules within the same slide in step S3. After each climbing slide is focused, the global focal plane matrix is ​​updated synchronously. At the same time, the system will compare the focal plane data of the new slide climbing slide with the focal plane deviation of the previous climbing slide at the same position in real time. If the deviation exceeds the preset threshold, the focusing range of subsequent climbing slides will be automatically adjusted adaptively.

7. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The data archiving and reuse process in step S5 is implemented according to the following steps: First, after the system completes the focusing and microscopic imaging operations for all slides, it first performs integrity verification on all data in the global focal plane matrix, checking whether the slide number, row and column position, focal plane Z-axis coordinate, focusing completion status, and confidence weight value of each slide are complete, and removing invalid focusing failure data; Second, the system converts the verified global focal plane matrix into a CSV file. In the file, the focusing data of all slides are arranged in the order of slide number as the first index, slide row number as the second index, and slide column number as the third index. At the same time, the experimental time, objective magnification, slide specifications, number of slides, initial focusing range, and maximum allowable focal plane deviation experimental basic parameters are recorded in the header of the CSV file. Third, the system saves the CSV format focal plane matrix file to the local storage path of the microscope imaging device and generates a corresponding backup file. Fourth, for repeated experiments of the same batch and specifications, the user directly retrieves the archived focal plane matrix file. The system automatically reads the focal plane data in the file as the focusing reference for this experiment, skipping the initial focusing step and performing focusing according to the archived focal plane data to set the narrow focusing range. Fifth, the system performs statistical analysis on the archived focal plane matrix data of multiple experiments of the same specifications and generates a focal plane deviation statistical report for the same type of experiment.

8. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The autofocus operations in steps S1, S3, and S4 all employ a sharpness evaluation and misfocus identification mechanism optimized for climbing biological samples. Specifically, they are implemented according to the following steps: First, when performing autofocus to acquire images, the system first extracts the region of interest for each frame of the acquired image, automatically identifies the effective area of ​​the climbing biological sample in the image, and blocks invalid areas such as glass areas at the edge of the climbing slide, blank areas of the slide, bubble areas of the solution, and areas obscured by impurities. The sharpness evaluation value is calculated only for the effective sample area. The second step involves the system using the gradient variance method to calculate the image sharpness evaluation value within the effective area. Optimizing the convolution kernel size for gradient calculation based on the microscopic image characteristics of cellular biological samples, the system prioritizes identifying gradient changes in cell nuclei and cytoskeleton sample features. The third step involves automatically performing a focus error detection check after locating the Z-axis coordinates corresponding to the peak sharpness evaluation value. This involves comparing the deviation between the peak position and the reference focal plane position, and then analyzing the sharpness evaluation value change curve before and after the peak position. If the curve shows multiple peaks, and the width and height of the current peak do not conform to the characteristics of the cell sample's focal plane, it is determined to be a focus error, and the peak is automatically excluded, allowing for the repositioning of the correct focal plane. The fourth step involves the system acquiring an image at that location again after completing the focal plane positioning. The system identifies the cell sample features within the image, confirming that the microscopic structure of the sample can be clearly distinguished within the image. Only after passing the check is the location confirmed as the effective focal plane position.

9. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The method also includes an emergency handling and closed-loop optimization mechanism for focus failure. This mechanism runs through all focusing processes from steps S1 to S4 and is implemented according to the following steps: First, when the system performs the autofocus operation for each film, it monitors the status of the focusing process in real time. If no effective sharpness evaluation value peak is detected within the preset focusing range, or the sharpness evaluation value peak is lower than the preset effective threshold, or the misfocus identification verification fails, it is determined that the focus has failed. Second, after the focus failure is determined, the system automatically triggers the first retry operation, expands the current focusing range by 50% in both the positive and negative directions of the Z-axis, re-executes the autofocus operation, and expands the effective threshold range of the sharpness evaluation value at the same time. Third, if the first retry still fails to focus, the system automatically retrieves the global focal plane matrix and selects the focal plane position of the already focused climbing film with the highest confidence weight value among the eight adjacent positions around the current climbing film as the new reference benchmark. The focus range is then reset and autofocus is performed. If there are no already focused climbing films around, the user-preset initial focus range is used to perform full-range focusing. Fourth, if all three focusing operations fail, the system automatically records the position information and focus failure status of the climbing film and stores it in the global focal plane matrix. At the same time, the focusing and imaging operations of the climbing film are skipped, and the focusing process of subsequent climbing films is continued. The fifth step involves completing the focusing process for all the film climbers. The system automatically generates a focusing failure statistics report, marks the locations of all film climbers that failed to focus, calculates the focusing success rate of this experiment, analyzes the reasons for focusing failure, and automatically optimizes the focusing strategy and focusing range settings for subsequent similar experiments in areas where focusing failures occur consecutively, forming a closed-loop optimization.

10. The rapid autofocusing method for trans-slide microscopy as described in claim 1, characterized in that, The method is adapted to imaging scenarios with different magnification objectives. The specific adaptation logic is as follows: Before the experiment begins, the system automatically matches the corresponding Z-axis step accuracy, initial focus range, basic narrow focus interval, sharpness evaluation convolution kernel size, focal plane deviation threshold, and other focusing parameters based on the objective magnification selected by the user. For high-magnification objective scenarios, the system narrows the basic narrow focus interval and improves the step accuracy of the secondary focal plane calibration. For low-magnification objective scenarios, the system optimizes the scanning path and expands the focal plane reference range of adjacent slides. For scenarios where objective magnification needs to be switched within the same batch, the system automatically completes the focal plane coordinate transformation between different magnifications without re-performing the full-range initial focusing. The system synchronously records focusing experiment data under different objective magnifications and continuously optimizes the focusing parameters corresponding to each magnification.