Active focusing system and method based on double-color off-axis illumination coupled small target surface high-speed detection
By employing dual-color off-axis illumination coupled with small target surface detection technology, and utilizing chromatographic separation and multi-ROI weighted cross-correlation algorithms, high-speed and stable focusing was achieved, solving the problems of slow focusing speed and insufficient robustness in existing technologies, and improving the efficiency and accuracy of pathological scanning.
Patent Information
- Application Number
- CN202511796108.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2025-12-30
AI Technical Summary
Existing microscope autofocus technology suffers from problems such as slow focusing speed, low accuracy, susceptibility to changes in the reflectivity of biological sample surfaces, and insufficient algorithm robustness during high-speed continuous scanning. In particular, the single-channel autocorrelation method cannot directly determine the defocus direction, leading to trial movements that increase focusing time. Furthermore, the coupling between focus measurement and the main imaging optical path causes data processing delays.
A dual-channel optical path structure with a shared objective lens is adopted. The image is acquired in a high-speed detection channel on a small target surface using dual-color off-axis illumination. The signed pixel displacement is directly calculated through chromatographic separation and multi-ROI weighted cross-correlation algorithm, realizing one-time closed-loop focus compensation without the need for trial directions.
It achieves millisecond-level focusing time, improves system throughput, enhances algorithm robustness, enables stable focusing under complex sample conditions, and supports real-time continuous focusing, significantly improving the efficiency of pathological scanning.
Smart Images

Figure CN121232401A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of optical microscopy imaging and automated control technology, specifically relating to an active focusing system and method based on dual-color off-axis illumination coupled with high-speed detection of a small target surface in a digital pathological slide scanning system. Background Technology
[0002] In the fields of digital scanning of pathological sections (WSI) and high-throughput microscopy, with the continuous improvement of scanning magnification (such as 20×, 40×) and throughput, the speed, accuracy and stability of the focusing system have become the core bottlenecks restricting the overall performance of the instrument.
[0003] Existing microscope autofocus technologies are mainly divided into two categories: passive and active. Passive autofocus is based on image sharpness evaluation, which requires acquiring images at multiple points along the optical axis and calculating the extreme values of the evaluation function. This results in problems such as multiple exposures, frequent mechanical actions, and long processing times, making it difficult to meet the needs of high-speed continuous scanning.
[0004] Active focusing techniques typically incorporate external measurement optical paths. Traditional laser triangulation or total internal reflection methods offer fast response times but are susceptible to interference from uneven reflectivity or refractive index variations on biological sample surfaces, resulting in poor signal stability. In recent years, focusing methods based on off-axis illumination have gained attention due to their simple optical paths. For example, existing technologies (such as CN117608070A) propose using symmetrical tilted light source illumination and calculating defocus by analyzing the autocorrelation characteristics of pixel-translated overlapping images in a single channel. However, such single-channel autocorrelation-based schemes have significant limitations: 1. Directional blur: Autocorrelation calculations typically only yield the "magnitude" of the defocus amount (i.e., the degree of image separation), but cannot directly distinguish the "direction" of the defocus (positive or negative focus). This forces the system to perform "trial movements" (moving a certain distance in a certain direction and then measuring again to determine whether the defocus amount has increased or decreased), and this back-and-forth trial and error greatly increases focusing time.
[0005] 2. Low coupling efficiency: Existing solutions often share optical paths and sensors with the main imaging camera. The main camera usually has a large target area, low frame rate, and slow data transmission, which severely limits the bandwidth of the focus measurement loop. Moreover, the focus measurement process will interrupt the main imaging process.
[0006] 3. Insufficient robustness of the algorithm: Traditional algorithms are mostly based on single-region evaluation. When faced with sparse tissue texture, uneven staining or large blank areas commonly found in pathological sections, they are prone to computational failure or misjudgment.
[0007] Therefore, there is an urgent need for a high-speed active focusing solution that can achieve parallel physical imaging and focus measurement, determine the defocus size and direction in a single acquisition, and has high robustness to complex samples. Summary of the Invention
[0008] This application provides an active focusing method based on dual-color off-axis illumination coupled with high-speed detection of a small target surface and its application. It addresses the problems of existing off-axis active focusing technology, which mainly relies on the autocorrelation calculation of a single-channel image, cannot directly determine the defocus direction, thus requiring time-consuming trial focusing, and often suffers from large data processing delays due to the coupling between focus measurement and the main imaging optical path, poor adaptability to complex texture samples, and difficulty in meeting the millisecond-level focusing requirements of high-throughput pathological scanning.
[0009] The core technology of this invention mainly adopts a dual-channel optical path structure with a shared objective lens. It uses simultaneous dual-color off-axis illumination to acquire an image containing dual-color information in a high-speed detection channel on an independent small target surface at one time. The signed pixel displacement is directly calculated through chromatographic separation and multi-ROI weighted cross-correlation algorithm, realizing one-time closed-loop focus compensation without the need for trial directions.
[0010] In a first aspect, this application provides an active focusing system based on dual-color off-axis illumination coupled with high-speed detection of a small target surface, comprising: The illumination module is configured to provide simultaneous dual-color off-axis illumination to the sample, the dual-color off-axis illumination including a first wavelength light and a second wavelength light, and the two beams of light are symmetrically off-axis relative to the optical axis of the sample; The objective lens and the Z-axis adjustment mechanism are used to collect the light signal of the sample, and the Z-axis adjustment mechanism is used to drive the objective lens or the sample to produce axial relative displacement. The beam-splitting element is placed in the optical path behind the objective lens, dividing the optical path into a main imaging channel and a detection channel. A scaling optical component, located in the detection channel, is configured to map a local area on the objective lens imaging plane to the detection end. A high-speed image sensor, located at the end of the detection channel, is used to acquire images mapped by the scaling optical components; The control and processing unit is connected to the lighting module, the high-speed image sensor, and the Z-axis adjustment mechanism, respectively. The control and processing unit is configured to perform the following operations: Control the high-speed image sensor to acquire a single-frame detection image containing information of the first wavelength light and the second wavelength light at once; Spectral separation is performed on a single-frame detection image to extract a first sub-image corresponding to the first wavelength of light and a second sub-image corresponding to the second wavelength of light. Perform cross-correlation operation on the first sub-image and the second sub-image to calculate the signed pixel displacement, with the sign indicating the defocus direction; Based on the signed pixel displacement and the pre-calibrated linear relationship model, the axial compensation value is calculated, and the Z-axis adjustment mechanism is controlled to perform a one-time displacement compensation.
[0011] Furthermore, the scaling optics assembly includes a bias lens group configured to project a reduced area onto the center or a predetermined off-center region on the objective lens imaging plane, such that the target surface of the high-speed image sensor only covers a portion of the main imaging channel field of view.
[0012] Furthermore, the control and processing unit is specifically configured to calculate the signed pixel displacement as follows: Divide the first and second sub-images into multiple regions of interest; Calculate the sub-pixel displacement for each region of interest; Weights are calculated based on image feature indices within each region of interest, and the sub-pixel displacements of multiple regions of interest are weighted and fused to obtain the final signed pixel displacement.
[0013] Furthermore, the image feature index is gradient energy; The specific method of weighted fusion is as follows: The gradient energy of each region of interest is calculated as a weighting factor, and the sub-pixel displacements of all regions of interest are normalized and weighted and summed.
[0014] Furthermore, the first wavelength light and the second wavelength light are different colors of light in the visible light band; the beam-splitting element is a semi-transparent and semi-reflective mirror; The active focusing system has a focus measurement mode and a bright field mode. In focus measurement mode, the illumination module illuminates the first wavelength light and the second wavelength light. After one-time displacement compensation is completed, the active focusing system switches to bright field mode, the illumination module switches to white light illumination, and the main camera located in the main imaging channel performs imaging.
[0015] Furthermore, the first wavelength light and the second wavelength light are light in the invisible light band, namely one or a combination of ultraviolet light and infrared light, respectively; the beam splitter is a dichroic mirror, configured to reflect the first wavelength light and the second wavelength light to the detection channel and transmit visible light to the main imaging channel; the illumination module is configured to keep the first wavelength light and the second wavelength light constantly lit during the operation of the main imaging channel, so as to achieve real-time continuous focusing.
[0016] Furthermore, the control and processing unit is also configured as follows: After the Z-axis adjustment mechanism performs a one-time displacement compensation, the high-speed image sensor is controlled to perform a rapid retest and calculate the residual pixel displacement. Determine whether the axial distance corresponding to the residual pixel displacement is less than a preset threshold; If the value is greater than the preset threshold, fine-tuning compensation is performed; if the value is less than the preset threshold, the focus is determined to be stable.
[0017] Secondly, this application provides an active focusing method based on high-speed detection of a small target surface using dual-color off-axis illumination coupling, comprising the following steps: S1. Illumination: Simultaneous dual-color off-axis illumination is projected onto the sample using an illumination module, including a first wavelength light and a second wavelength light; S2. Acquisition: The optical path is led out to the detection channel through the beam splitter, and the local area on the objective lens imaging surface is mapped to the high-speed image sensor using the scaling optical component. The sensor then acquires a single frame detection image containing dual-color information at once. S3. Separation: Perform spectral separation on the single-frame detection image to obtain the first sub-image and the second sub-image; S4. Calculation: Perform cross-correlation operation on the first sub-image and the second sub-image to determine the signed pixel displacement amount that indicates the defocus direction and magnitude; S5. Compensation: Calculate the axial defocus amount based on the signed pixel displacement and the preset linear model, and drive the Z-axis mechanism to perform one-time focus compensation.
[0018] Thirdly, this application provides an electronic device including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the above-described active focusing method based on dual-color off-axis illumination coupled small target surface high-speed detection.
[0019] Fourthly, this application provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the active focusing method based on dual-color off-axis illumination coupled small target surface high-speed detection as described above.
[0020] The main contributions and innovations of this invention are as follows: 1. Eliminating the trial-and-error process for ultra-fast focusing in a single operation: Unlike existing technologies where "autocorrelation" can only measure size and requires trial-and-error movement to measure direction, this invention utilizes a "dual-color off-axis illumination + cross-correlation / phase correlation" mechanism to separate two different chromatographic information signals from a single frame image. By calculating the relative displacement of the two images, the pixel displacement value with positive and negative signs is directly obtained. This sign directly indicates the defocus direction. Combined with a pre-calibrated linear model, the system only needs one measurement to calculate the accurate compensation position and drive the Z-axis to the correct position, completely eliminating the repetitive trial-and-error process and compressing the focusing delay to the millisecond level.
[0021] 2. Physical-level decoupling of the optical path enhances system throughput: An independent detection channel is introduced through a beam splitter, and the central area of the field of view is mapped onto a dedicated small-target high-speed detection CCD using an offset lens. This design enables the focusing process to have an independent high frame rate (200-1000Hz) and extremely short exposure time (0.2-5ms), with minimal data volume. This avoids occupying the high-resolution readout time of the main camera, achieving efficient parallelism (or minimal occupation) of focusing and main imaging in time and space, significantly improving the throughput of the entire scan.
[0022] 3. Multi-ROI weighted fusion enhances algorithm robustness: Addressing the challenge of uneven texture distribution in pathological slides, this invention introduces a multi-ROI weighted cross-correlation strategy at the algorithm layer. By dividing the detection field of view into multiple sub-regions and dynamically assigning weights based on the gradient energy or signal-to-noise ratio of each region, noise interference from blank or low-texture areas is effectively suppressed, ensuring stable focus commands are output even under complex sample conditions (such as tissue edges or lightly stained areas).
[0023] 4. Flexible illumination band configuration (supporting real-time continuous focusing): This invention provides two implementation paths: visible light (red / green) and invisible light (ultraviolet / infrared). In particular, the preferred scheme of using ultraviolet / infrared dual-color illumination in conjunction with a dichroic mirror achieves complete spectral separation between the focusing light and the main imaging visible light. This eliminates the need for the system to switch between "focusing mode" and "imaging mode," enabling real-time, seamless, full-time servo focusing during continuous exposure of the main camera, further improving scanning efficiency.
[0024] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of an active focusing method based on dual-color off-axis illumination coupled with high-speed detection of a small target surface according to an embodiment of this application; Figure 2 This is a structural diagram of an active focusing system using a 50 / 50 beam splitter according to an embodiment of this application; Figure 3 This is a structural diagram of an active focusing system using a bandpass dichroic mirror according to an embodiment of this application; Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0027] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0028] Example 1: Switching Active Focusing System Based on Visible Light Dual-Color Illumination like Figure 2 As shown, this embodiment provides a dual-color off-axis illumination-detection coupled active focusing system configured to operate in a pathological slide scanner. The system mainly includes an illumination module, a microscopic imaging optical path, a spectroscopic detection optical path, and a control and processing unit.
[0029] The illumination module is located below the sample and includes a full-brightness incoherent white LED for bright-field imaging. Figure 1 The system includes an illumination source and an off-axis LED array for focusing mode. The off-axis LED array comprises two groups of LEDs arranged symmetrically relative to the sample normal. The first group emits a first wavelength light λ1 (preferably green light in this embodiment, with a center wavelength of approximately 530 nm), and the second group emits a second wavelength light λ2 (preferably red light in this embodiment, with a center wavelength of approximately 625 nm). The tilt angle α of the two groups of off-axis LEDs relative to the optical axis is preferably 10~15° (approximately 12° in this embodiment).
[0030] The optical path for microscopic imaging includes a microscope objective (e.g., 20× / NA 0.50 or 40× / NA 0.75), a beam splitter, and a main optical path CCD arranged sequentially along the optical axis. The microscope objective is mounted on a Z-axis adjustment mechanism, which (such as a piezoelectric ceramic platform or a stepper motor platform with an encoder, preferably a stepper motor + lead screw + encoder, or a piezoelectric PIFOC platform) is used to drive the objective to move along the optical axis to change the position of the focusing plane.
[0031] The preferred beam-splitting element is a 50:50 (T:R, representing the ratio of transmission to reflection) non-polarized beam-splitting cube (BS), i.e. Figure 2 The 50 / 50 beam splitter, positioned behind the objective lens, divides the light beam passing through the objective lens into a main imaging channel (transmitted) and a detection channel (reflected). The CCD in the main imaging channel is located at the end of the main optical path and is used to acquire high-resolution bright-field pathological images.
[0032] The detection channel optical path includes a scaling optical component (Offset Lens) located at the reflective end of the beam splitter element. Figure 2 The system includes an adjustable lens and a high-speed detection CCD. A scaling optics assembly (e.g., a combination of f=50mm and f=150mm achromatic lenses) is configured to reduce the size of a small area (small target surface) centered or pre-determined off-center on the objective lens imaging plane and map it onto the high-speed detection CCD. In this embodiment, the scaling magnification is approximately 0.33 × (or M... det With a total magnification of approximately 3.40×, the high-speed detection CCD only covers an area of about 250µm at the center of the main image plane.
[0033] The high-speed detection CCD uses a low-pixel, high-frame-rate color image sensor (e.g., 640×480 resolution, frame rate ≥200fps, exposure 0.2~5ms, which is a color camera), which can respond to light in the λ1 and λ2 bands.
[0034] The control and processing unit is electrically connected to the lighting module, the Z-axis adjustment mechanism, the main optical path CCD, and the high-speed detection CCD, respectively.
[0035] Examples of specific parameters for this solution are as follows: 1. Specific parameters of component configuration Objective lens: 20× / NA0.50; Spectroscopic element: 50:50 (T:R) non-polarization-preserving spectroscopic cube; Adjustable lens group: A combination of f=50mm and f=150mm achromatic lenses is used, with an offset lens magnification of approximately 0.17×. Combined with a 20× objective lens, the total magnification of the detection channel is Mdet≈3.40×. Under this magnification condition, the detection CCD selects a 256×256 pixel ROI at its center for focusing, corresponding to an effective field of view of approximately 260µm×260µm on the sample plane, which is located in an area of approximately 250µm at the center of the main image plane. CCD detection: Color high-speed camera (e.g., 640×480, ≥200fps, 7.4µm pixel size, supports hardware ROI windowing output); Main optical path CCD: 20-megapixel color camera (2.4µm pixel); Off-axis LEDs (λ1 / λ2): Green approximately 530nm and Red approximately 625nm; Off-axis angle α≈12°; Z-axis mechanism: piezoelectric or stepper motor + encoder, minimum resolution ≤0.2µm; Control unit: An embedded controller with camera acquisition and cross-correlation / sub-pixel calculation capabilities, supporting Z-axis closed loop.
[0036] 2. Install the optical path structure The objective lens, beam splitter, and main optical path CCD are mounted along the main optical axis; the detection channel extends from the beam splitter side and is aligned with the detection CCD via an adjustable lens group. Two sets of off-axis LEDs are arranged symmetrically on both sides of the sample, providing uniform illumination to cover the small target area. Z-axis limit and safety protection settings are completed.
[0037] The system's workflow employs a "mode switching" mechanism: 1. Stage movement: Move the sample to the target field of view (FOV).
[0038] 2. Focusing Mode: The control and processing unit turns off the white LED while simultaneously illuminating the green LED (λ1) and the red LED (λ2). The high-speed detection CCD acquires a single-frame detection image containing both red and green information in a short exposure (typically 1.0ms).
[0039] 3. Calculation and Compensation: The control and processing unit processes the image (see the algorithm flow in Example 3 for details), calculates the signed axial defocus amount Δz, and drives the Z-axis adjustment mechanism to perform one-time compensation.
[0040] 4. Bright Field Mode: After focusing, turn off the off-axis LED and turn on the white light LED, and the main optical path CCD will perform imaging.
[0041] Example 2: Continuous Active Focusing System Based on Invisible Light Dual-Color Illumination This embodiment is a preferred solution based on Embodiment 1. The main difference lies in the illumination band and beam splitting method, aiming to achieve real-time continuous focusing without switching modes.
[0042] In this embodiment, as Figure 3 As shown, the off-axis LED array of the lighting module uses the invisible light band: the first wavelength λ1 is ultraviolet light (UV, e.g., 400nm), and the second wavelength λ2 is infrared light (IR, e.g., 750nm). The beam splitter is replaced with a bandpass dichroic mirror.
[0043] The spectral characteristics of the bandpass dichroic mirror are configured as follows: transmitting visible light (e.g., 420nm-700nm) and reflecting ultraviolet and infrared light.
[0044] During operation, the white light illumination in the main imaging channel and the CCD in the main optical path operate in the visible light band; simultaneously, the ultraviolet and infrared off-axis LEDs remain constantly lit. Due to the effect of the dichroic mirror, the ultraviolet / infrared light containing sample defocus information is reflected into the detection channel, while the visible light is transmitted into the main imaging channel.
[0045] The advantage of this embodiment is that the control and processing unit does not need to switch between "focus measurement mode" and "bright field mode" in a timely manner. The high-speed detection CCD can independently and continuously acquire dual-color off-axis images and calculate the defocus amount from the main optical path CCD, and drive the Z-axis adjustment mechanism for servo tracking in real time, which greatly improves the efficiency of high-throughput scanning. (This reduces one step of switching modes for shooting compared to the previous embodiment).
[0046] Example 3: High-speed focusing method and algorithm flow for small target surfaces like Figure 1 As shown, this embodiment describes in detail the core focus measurement algorithm executed by the control and processing unit in the above system. This algorithm is applicable to Embodiment 1 and Embodiment 2.
[0047] 1. Pre-calibration Before formal measurement, the linear relationship between pixel displacement p and axial defocus amount z needs to be calibrated to obtain key parameters such as pixel scale (optional), linear coefficient k (unit µm / pixel) and offset b (µm).
[0048] First, record all optical geometric parameters (such as LED spacing D, LED-to-sample distance H, and original pixel size p of the camera sensor). cam Magnification (offset mapping scaling ratio / total magnification of detection channels) M det ).
[0049] Select a sample point with good texture (center FOV) and keep the temperature / lamp current stable.
[0050] Calculate effective pixel size With theoretical coefficient (For comparison with the actual measurement data later):
[0051]
[0052] 2. Single-frame acquisition and spectral separation During focus measurement, a high-speed detection CCD acquires a single frame of raw image containing dual-color information. The control and processing unit separates this single frame image into two independent monochromatic sub-images based on the sensor's color filter array (Bayer pattern) or spectral response characteristics: a first sub-image I1 corresponding to the first wavelength of light (such as the green channel or UV channel) and a second sub-image I2 corresponding to the second wavelength of light (such as the red channel or IR channel).
[0053] Move the objective lens to the reference position Z=0 (denoted as the reference position), turn on the dual-color off-axis illumination (red + green), and acquire a single frame of dual-color information at this position. Then control the Z-axis to move within the range (e.g., -50µm to +50µm) at a fixed step size (e.g., 10µm), acquiring a single frame of dual-color information at each position, obtaining a series of (z... c ,p c ), where p c It is in z c A single-frame image of dual-color information acquired at the location. The image captured by the small target-surface detection CCD is input into the focusing program, which then processes each frame (p)... c Separate two monochrome images I red I gerrn , from I red I gerrn Each element in the same central region (e.g., 256×256 pixels) is denoted as A (from I). red ) and B (from I) gerrn ).
[0054] 3. Weighted cross-correlation calculation of multiple ROIs To improve robustness in the presence of uneven tissue textures or local blank areas, this invention employs a multi-ROI weighted strategy: (1) ROI Division: Divide the first sub-image I1 and the second sub-image I2 (e.g., 256×256 pixels) into M sub-regions (ROIs), for example, a 4×4 grid, denoted as... .
[0055] (2) Cross-correlation calculation: For each pair For each of the plots A from I1 i And tile B from I2 i Perform cross-correlation calculations. Frequency domain cross-correlation (phase correlation method) is preferred. The following uses any one of these methods... The plots, abbreviated as A(x,y) and B(x,y), are explained below, along with their calculation steps: First, perform DC processing on A and B (we'll use one as an example here, so we'll only write A and B):
[0056]
[0057] in, Let A be the average pixel value. Let B be the average pixel value. Next, we will use FFT to obtain the relative translation information between the two images, starting with a 2D Fourier transform:
[0058]
[0059] The cross-power spectrum was then calculated and normalized (to avoid the influence of amplitude):
[0060] in Representing complex conjugation, ε = eps (here, 1e-12 is chosen for numerical protection to avoid division by zero and extreme noise), followed by inverse FFT to obtain the phase correlation surface r of the ROI. i (x,y) (hereinafter, for simplicity, it will still be written as r(x,y)). Find the maximum value r in r. max The coordinates are obtained by sub-pixel fitting of a three-point parabola in the x-direction to obtain p (pixels).
[0061] (3) Displacement extraction: on the relevant surface Finding peak coordinates Due to the use of off-axis illumination, the two sub-images will have a relative displacement, the direction (sign) of which directly reflects the direction of defocus (in front of focus or behind focus). Sub-pixel fitting (such as three-point parabolic fitting) is performed using the peak value and its adjacent points to obtain the signed fine pixel displacement p for each ROI. i Unlike estimating displacement using the distance between the three peaks of autocorrelation intensity in a single pixel-translated overlapping image, this invention directly obtains the position and sign of the correlation peak through the cross-correlation / phase correlation of two off-axis images, thus obtaining a directional relative displacement estimate. Find the maximum point of r (x0, y0) = argmax(r), and read r(x0-1, y0), r(x0, y0), r(x0+1, y0) (note the boundary conditions; if the peak is on the boundary, consider zero-pad or expanding the ROI).
[0062] Calculate the subpixel correction for a one-dimensional parabola:
[0063] If the denominator is close to 0 (e.g., <1e-9), it is considered impossible to perform sub-pixel calculations. =0, final pixel offset (x component):
[0064] Here, p is in pixels, that is, p i And retain the positive and negative signs. (Only the x component is used because off-axis illumination causes the displacement to be mainly along one direction; if the off-axis illumination axis is y, then the y component is taken.) Based on the phase correlation and subpixel fitting of the above single ROI.
[0065] Finally, by doing each The pixel displacement p is obtained using the same procedure described above. i .
[0066] 4. Weighted fusion Calculate each Using image feature metrics as weights, this embodiment preferably uses gradient energy G. i :
[0067] Where A i (x,y) is Image blocks within.
[0068] Then, using gradient energy as weights, normalized weights are calculated. :
[0069] Calculate the weighted average displacement across the entire field of view (ultimately obtaining the pixel displacement estimate after weighting multiple ROIs):
[0070] The value 'p' serves as the input for subsequent defocus calculation, substituted into the axial linear model Δz = k·p + b. Then, using gradient energy as weights, normalization is performed to finally obtain the pixel displacement estimate after multi-ROI weighting. The above weighting method is merely an exemplary implementation; those skilled in the art can also set weights based on cross-correlation peaks, signal-to-noise ratio, or other image quality metrics, and this invention does not limit this. Through gradient energy weighting, textured regions are assigned higher weights, while blank or blurred regions are weighted lower, thereby significantly improving the stability and accuracy of the focus measurement results.
[0071] In this way, multiple sets of data pixels p can be obtained. j →Axial direction z j Data (p) j ,z j ), and use linear least squares fitting to find:
[0072]
[0073] in , The value is the sample mean. Calculate the quality of fit: Rfit 2 Example of judgment criteria: R 2 ≥ 0.99 is ideal (the value depends on the system).
[0074] Finally, this linear function is obtained. Measured coefficient k exp (µm / px), b(µm), and then calculate the relative difference between the measured coefficients and the theoretical coefficients:
[0075] If |Δ%| ≤ 10% (or an allowable range set according to the situation, such as 5–10%), then the theoretical test is passed, and k is saved. exp ,b.
[0076] If |Δ%| > 10%, then perform a quick check (in order: confirm p). cam M det (Check if H and D are recorded / input correctly; check if offset mapping has been incorrectly adjusted; check if exposure / ROI is consistent). After troubleshooting, you can resample or directly use the measured kJ / m². exp To ensure accuracy, mark "theoretical deviation" in the record, and if necessary, perform a full recalibration or check of the optical alignment.
[0077] 5. One-time compensation and stability assessment Substitute the calculated weighted displacement p into the calibration model: The control and processing unit directly sends commands to the Z-axis adjustment mechanism. The movement command enables one-time arrival compensation.
[0078] After compensation is completed, the system can perform rapid retesting: re-acquire images and calculate residual displacement. If the corresponding residual distance (threshold) For example, if the value is set to 0.3µm, fine-tuning is performed; otherwise, focusing is considered successful. Specifically, after theoretical verification, the calibration result k is saved. exp ,b,R 2 For the current field of view, take one frame (or resolve two colors from one frame), and then process it using the same image processing flow in multiple... The pixel offset p is calculated above. i The total pixel offset p is obtained by weighting the pixels according to the multi-ROI method described above, and the k obtained from the calibration is used directly. exp b, calculate Δz=k exp p+b then sends Δz to the Z controller for closed-loop movement. After the Z axis reaches its position, the detection channel quickly remeasures the residual pixel displacement p under the same exposure / ROI. res If |k·p res|>τ (If the threshold τ = 0.3 μm, perform one fine-tuning (limited to 1 time) and then determine stability; if the threshold is not exceeded or is met after fine-tuning, switch to bright field mode to complete the main CCD imaging. After moving to the correct position, switch back to bright field imaging and the main CCD acquires a high-resolution image.
[0079] Experimental verification data Using a set of parameters as shown in Table 1 below (objective lens 20×, On the prototype system, more than 3,000 pathological slide fields were tested.
[0080] Table 1
[0081] The detection parameters included a CCD ROI of 256×256; an exposure time of 1.0ms; a frame rate of 400fps; dual-color off-axis measurements of λ1=530nm and λ2=625nm; and Z-sampling from... 50µm to +50µm, step size 10µm. Linear model: z=k exp • p + b (z: µm; p: px). The experimental data are shown in Table 2 below: Table 2
[0082] In this embodiment, the detection channel uses a pixel size of p cam = 3.45 µm high-speed CMOS image sensor (detecting CCD), the total magnification of the detection channel of the offset lens group (adjustable lens) is approximately M. det = 3.40×. Substituting this into the formula yields the effective pixel scale of the sample plane:
[0083] In the off-axis illumination module, the center-to-center distance between the two LEDs is approximately D = 67 mm, and the distance from the LEDs to the sample plane is approximately H = 20 mm, which is a common geometric configuration for off-axis microscopy illumination. Based on the aforementioned theoretical model, the theoretical axial displacement corresponding to a unit pixel displacement can be obtained:
[0084] The calculated theoretical coefficient k theory The measured coefficients obtained by actual calibration in this invention The relative error of about 1% indicates that the geometric model of the present invention has good consistency with the actual optical system, providing a reliable physical basis for the subsequent one-time focus measurement strategy.
[0085] On a prototype system with the aforementioned optical and detection parameters, following the calibration procedure described above, multiple sets of data (p) were acquired in 10µm increments within the range of -50 µm to +50 µm.j ,z j The data was then subjected to least-squares linear fitting to obtain a set of calibration example parameters: k exp = 0.300 µm / px, b = 0.48 µm, R 2 = 0.995. The above value is used to illustrate the calibration accuracy achievable by the present invention. Those skilled in the art can recalibrate according to specific hardware configurations without affecting the principle of the present invention.
[0086] Statistical results show that the total focusing time (P50) per field of view is approximately 19.6 ms (including 1.0 ms for exposure, approximately 1.2 ms for algorithm processing, and approximately 16.0 ms for Z-axis movement), and the one-time compensation success rate (without needing reverse retry) reaches 99.3%. Compared with the traditional single-channel autocorrelation method that requires trial movement, this invention significantly shortens the focusing time and improves the scanning throughput.
[0087] Example 4 This embodiment also provides an electronic device, see reference. Figure 4 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0088] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0089] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0090] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.
[0091] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any of the small target high-speed focusing methods and algorithms in the above embodiments.
[0092] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.
[0093] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0094] Input / output device 408 is used to input or output information.
[0095] Example 5 This embodiment also provides a readable storage medium storing a computer program, which includes program code for controlling and executing a process, the process including the high-speed focusing method and algorithm flow for small target surfaces according to Embodiment 3.
[0096] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0097] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0098] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0099] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An active focusing system based on two-color off-axis illumination coupling small target high-speed detection, characterized in that, The application relates to an active focusing system, comprising: a lighting module configured to provide simultaneous dual-color off-axis illumination to a sample, the dual-color off-axis illumination comprising first wavelength light and second wavelength light, and the two beams of light being symmetrically off-axis relative to the optical axis of the sample; an objective and a Z-axis adjustment mechanism, the objective being used to collect light signals of the sample, and the Z-axis adjustment mechanism being used to drive the objective or the sample to produce axial relative displacement; a light splitting element arranged in the light path after the objective, and dividing the light path into a main imaging channel and a detection channel; a zoom optical assembly arranged in the detection channel, and configured to map a local area on the objective imaging surface to a detection end; a high-speed image sensor arranged at the end of the detection channel, and used to collect images mapped by the zoom optical assembly; a control and processing unit connected with the lighting module, the high-speed image sensor and the Z-axis adjustment mechanism respectively; the control and processing unit is configured to perform the following operations: controlling the high-speed image sensor to collect a single-frame detection image containing first wavelength light and second wavelength light information at one time; performing spectral separation on the single-frame detection image to extract a first sub-image corresponding to the first wavelength light and a second sub-image corresponding to the second wavelength light; performing cross-correlation operation on the first sub-image and the second sub-image to calculate a signed pixel displacement amount, and the sign indicates the defocusing direction; according to the signed pixel displacement amount and a pre-calibrated linear relationship model, calculating an axial compensation value, and controlling the Z-axis adjustment mechanism to perform one-time displacement compensation.
2. The active focusing system of claim 1, wherein, the zoom optical assembly comprises a bias lens group, and is configured to project the center or a predetermined eccentric area on the objective imaging surface in a reduced manner, so that the target surface of the high-speed image sensor only covers part of the field of view of the main imaging channel.
3. The active focusing system of claim 1, wherein, when calculating the signed pixel displacement amount, the control and processing unit is specifically configured to: divide the first sub-image and the second sub-image into a plurality of regions of interest; calculate the sub-pixel displacement in each region of interest respectively; calculate a weight according to the image feature index in each region of interest, and perform weighted fusion on the sub-pixel displacements of the plurality of regions of interest to obtain the final signed pixel displacement amount.
4. The active focusing system of claim 3, wherein, the image feature index is gradient energy; the specific manner of weighted fusion is: calculating the gradient energy of each region of interest as a weight factor, and performing normalized weighted summation on the sub-pixel displacements of all regions of interest.
5. The active focusing system of claim 1, wherein, the first wavelength light and the second wavelength light are different colors of light in the visible light band; and the light splitting element is a half-transmission half-reflection mirror. the active focusing system has a focusing mode and a bright field mode; in the focusing mode, the lighting module lights up the first wavelength light and the second wavelength light; after one-time displacement compensation is completed, the active focusing system is switched to the bright field mode, the lighting module is switched to white light illumination, and a main camera located in the main imaging channel is used for imaging.
6. The active focusing system of claim 1, wherein, The first wavelength light and the second wavelength light are light in the invisible light band, and are one or a combination of two of ultraviolet light and infrared light; the light splitting element is a dichroic mirror configured to reflect the first wavelength light and the second wavelength light to the detection channel and transmit visible light to the main imaging channel; the illumination module is configured to keep the first wavelength light and the second wavelength light constant during the operation of the main imaging channel to realize real-time continuous focusing.
7. The active focusing system of claim 1, wherein, The control and processing unit is further configured to: After the Z-axis adjustment mechanism performs one-time displacement compensation, the high-speed image sensor is controlled to perform rapid re-measurement, and residual pixel displacement is calculated; determine whether the axial distance corresponding to the residual pixel displacement is less than a preset threshold value; If greater than the preset threshold value, fine adjustment compensation is performed; if less than the preset threshold value, it is determined that the focusing is stable.
8. A method for active focusing based on two-color off-axis illumination coupling small target high-speed detection, characterized in that, The method comprises the following steps: S1. Illumination: using an illumination module to project simultaneous dual-color off-axis illumination to the sample, including first wavelength light and second wavelength light; S2. Acquisition: guiding the light path out of the detection channel through the light splitting element, mapping the local area on the objective lens imaging surface to the high-speed image sensor using the zoom optical assembly, and collecting a single frame of detection image containing dual-color information by the sensor; S3. Separation: performing spectral separation on the single frame of detection image to obtain a first sub-image and a second sub-image; S4. Calculation: performing cross-correlation operation on the first sub-image and the second sub-image to determine a signed pixel displacement amount indicating the defocus direction and size; S5. Compensation: calculating the axial defocus amount based on the signed pixel displacement amount and a preset linear model, and driving the Z-axis mechanism to perform one-time focusing compensation. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to execute the active focusing method of claim 8.
10. A readable storage medium, characterized by, The readable storage medium stores a computer program, and the computer program comprises program code for controlling a process to execute the process, and the process comprises the active focusing method according to claim 8.
Citation Information
Patent Citations
Microscopic imaging real-time focusing method and device
CN117608070A
Imaging apparatus and method for controlling the same
CN105991910A
Color double-hole modulation phase shift detection automatic focusing device and method
CN116774496A
Focusing method, device and equipment
CN120972356A
Image capturing apparatus, control method of same, and non-transitory computer-readable medium
US20170280057A1
Cited By
Real-time focusing device and method based on focusing height difference of ultraviolet light and near-infrared light
CN121454757A
