Microscope image automatic acquisition and heat map generation method

CN122962779APending Publication Date: 2026-10-23GUANGZHOU MICRO INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

这种方案存在三个核心缺陷:第一,硬件依赖性强,必须配备价格昂贵的电动调焦平台,不利于教学场景的大规模部署;第二,基于位置反馈的调焦判定无法感知画面内容的微小漂移,例如操作者在调焦完成后的手部抖动或标本缓慢移动均无法被检测;第三,采用固定阈值判定焦点稳定性的方法对不同倍率、不同标本的适应性差,不同倍率及成像条件下的焦点测度数值量级存在明显差异,固定低阈值容易受到轻微波动影响,固定高阈值则可能造成漏触发,难以同时兼顾误触发和漏触发

Benefits of technology

[0033](1)本发明提出的基于三态状态机的自动拍照方法,不依赖电动平台硬件,仅需分析摄像头采集的画面内容即可判断调焦状态。通过自适应双阈值机制(绝对阈值+相对阈值取较大值),自动适配不同倍率和不同标本的焦点特性;通过EMA平滑焦点处理和噪声容忍机制,有效滤除帧间抖动和短暂波动导致的误触发;通过漂移检测机制,能够检测到缓慢的焦点漂移,避免了基于位置反馈的方案无法感知画面内容变化的缺陷;通过首拍回落机制,确保用户在初始调焦完成后能立即获得照片。综合上述措施,经4×物镜下50组和40×物镜下41组、合计91组调焦序列的对比测试验证,相较固定C=6.0方案,误触发次数由11次降至8次(误触发率由12.0%降至8.8%),停止检测平均延迟由2128毫秒缩短至1758毫秒;相较固定C=20.0方案,漏触发次数由14次降至2次(漏触发率由15.2%降至2.2%)。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure SMS_1
    Figure SMS_1
Patent Text Reader

Abstract

The application provides a microscope image automatic acquisition method and a heat map generation method. The microscope image automatic acquisition method models a focusing process by using a three-state state machine, including an idle state, a focal point change state and a focal point stable state, and realizes automatic photographing trigger control through a Laplacian variance focal point measurement, EMA smoothing, an adaptive double threshold, drift detection and a noise tolerance mechanism. The heat map generation method adopts an improved Laplacian operator, adaptive down-sampling and JET color map mapping, and realizes clarity visualization of a returned image through a stateless single-frame HTTP interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method for automatic acquisition of microscope images and generation of heatmaps. Background Technology

[0002] Microscopes are indispensable observation tools in fields such as biology, medicine, and materials science. In recent years, with the development of digital teaching, traditional optical microscopes have gradually evolved into intelligent microscopes. However, existing teaching microscopes have significant shortcomings in the following aspects:

[0003] (1) Automatic photo-taking triggering. Existing automatic photo-taking solutions mainly rely on position feedback data from an electric platform to determine whether focusing is complete. This solution has three core drawbacks: First, it is highly dependent on hardware and requires an expensive electric focusing platform, which is not conducive to large-scale deployment in teaching scenarios; Second, focusing based on position feedback cannot detect minute shifts in the image content, such as hand tremors of the operator after focusing or slow movement of the specimen; Third, the method of using a fixed threshold to determine focus stability has poor adaptability to different magnifications and different specimens. The magnitude of the focus measurement values ​​varies significantly under different magnifications and imaging conditions. A fixed low threshold is easily affected by slight fluctuations, while a fixed high threshold may cause missed triggers, making it difficult to simultaneously address both false triggers and missed triggers.

[0004] (2) Heatmap generation. Existing technologies typically use offline batch processing to generate clarity heatmaps, requiring users to manually upload images and wait for the background calculations to complete before downloading the results. This fails to meet the real-time requirements of "observing and demonstrating simultaneously" in teaching demonstration scenarios. Furthermore, traditional methods calculate the clarity response at full resolution, resulting in high computational overhead and making it difficult to return the results immediately after each photo is taken. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, this invention provides a method for automatic acquisition of microscope images and generation of heat maps, the technical solution of which is as follows:

[0006] refer to Figure 1 An automatic image acquisition method for microscopes, which uses a three-state machine to model and monitor the focusing process based on the focus measurement of the image content, and is used to automatically trigger image acquisition during microscope focusing, includes the following steps:

[0007] S1. Acquire real-time preview image frames from the microscope, and initialize the three-state machine to the idle state; the three-state machine includes three states: Idle, FocusChanging, and FocusStable.

[0008] S2. Calculate the smooth focus measure value of the preview image frame, take the smooth focus measure value of the first image frame as the baseline value, and calculate the offset of the smooth focus measure value of the current frame relative to the baseline value. When the offset exceeds the drift detection threshold, it is determined that the focus has started to change, and the three-state machine switches to the focus change state; at the same time, update the baseline value to the smooth focus measure value of the current frame.

[0009] S3. Calculate the change in the smooth focus metric value of adjacent frames. When the change is lower than the change detection threshold, start recording the duration. When the duration exceeds the stabilization time threshold, it is determined that the focus has stabilized. The three-state machine switches to the focus stabilization state and sends an image acquisition signal to the image acquisition terminal.

[0010] S4. After the image acquisition terminal acquires the image, the three-state machine is reset to the idle state, waiting for the next focusing process.

[0011] Furthermore, in step S2, the calculation of the smoothed focus measure value employs an exponential moving average (EMA) smoothing method on the original focus measure value to eliminate the effects of inter-frame noise and transient fluctuations. The formula is as follows:

[0012] F smoothed (t) = α × F raw (t) + (1-α) × F smoothed (t-1)

[0013] China F raw (t) is the original focus measure of the t-th frame, F smoothed (t-1) represents the smoothed focus measure for frame t-1, where α is a preset smoothing coefficient, preferably 0.2. A larger α value allows the smoothing response to follow the actual changes more quickly, while effectively filtering out high-frequency noise. The focus measure uses the Laplacian variance method: the Laplacian transform of the current frame's grayscale image is calculated, and its variance is taken as the original focus measure value F. raw (t).

[0014] In step S3, the change detection threshold (Threshold) adopts an adaptive dual threshold, the mechanism of which is: calculate the smooth focus measure change ΔF = |F| in the current frame. smoothed (t)-F smoothed (t-1)|, when ΔF is less than the change detection threshold, it is determined that the focus has not changed. The change detection threshold is taken as the larger value of the following formula:

[0015]

[0016] Where T abs The preset absolute threshold is 6.0, with a preferred value of 6.0; T relThe preset relative threshold coefficient is preferred, with a value of 0.02; F smoothed The current smooth focus measure is defined by `max()`, which represents taking a larger value. This design allows for an absolute threshold to dominate at low focus measures and a relative threshold to dominate at high focus measures, thus achieving adaptive adaptation to different depths of focus and magnification conditions.

[0017] In step S2, the drift detection threshold also adopts a dual-threshold structure, the mechanism of which is: calculate the offset of the current smooth focus measure value relative to the baseline, drift = |F smoothed (t)-F baseline When the drift exceeds the drift detection threshold (DriftThreshold), it is considered a significant change in focus. The formula for calculating the drift detection threshold is:

[0018] DriftThreshold = max(T) abs’ F baseline ×D rel )

[0019] Where T abs The preset absolute threshold is 6.0, with a preferred value of 6.0; D rel The preset drift relative threshold coefficient is preferably 0.035, which is greater than the relative threshold coefficient in the change detection threshold formula, ensuring that the state transition is triggered only when the focus undergoes a substantial change; max() indicates taking a larger value.

[0020] The method also includes a noise tolerance mechanism, which sets up a counting module (which can be a pulse counter) to record the number of frames of the image in the focus-stable state. Only when the K value of the counting module is greater than or equal to 2 is it confirmed as a true focus-stable state, thus avoiding false triggering caused by single-frame noise.

[0021] This method also includes a first-shot fallback mechanism: when focus stabilization is first detected in the idle state, the photo is taken directly (without going through a complete state transition cycle). After taking the photo, the system enters the idle state, and subsequent photos must go through a complete three-state transition cycle of "idle state → focus change state → focus stabilization state". This mechanism ensures that the user can immediately obtain a photo after the initial focus adjustment, while preventing accidental triggering due to short pauses in subsequent operations.

[0022] In step S3, the stabilization time threshold is set to 1300 milliseconds, meaning that when the focus measurement remains below the change detection threshold for 1300 milliseconds, the focus is considered to be sufficiently stable.

[0023] refer to Figure 2 A method for generating a heatmap, used to process images acquired by the aforementioned automatic microscope image acquisition method, includes the following steps:

[0024] A1. The image acquired by the front end is downsampled according to the preset downsampling ratio to obtain a downsampled image; the preset downsampling ratio is 0.25, and the region interpolation method is used during downsampling to reduce the number of image pixels to 1 / 16 of the original.

[0025] A2. Convert the downsampled image to a grayscale image, and apply a modified Laplacian operator to perform two-dimensional convolution filtering on the grayscale image to obtain a pixel-level sharpness response map. The horizontal kernel of the modified Laplacian operator is K. h =[-1,0,2,0,-1], vertical kernel is ;

[0026] A3. Perform box filtering (3×3 kernel size) smoothing on the sharpness response map to obtain a smoothed sharpness map; the formula for calculating the smoothed sharpness response map FM is as follows:

[0027] FM(x,y) = BoxFilter(|I*K) h |+|I*K v |).

[0028] A4. Normalize the smoothed resolution map and apply pseudo-color mapping to generate a heatmap; normalization uses Min-Max normalization to the range [0, 255] and maps it to an 8-bit unsigned integer, and pseudo-color mapping uses JET color maps. Low-resolution areas are mapped to blue, and high-resolution areas are mapped to red.

[0029] A5. Encode the heatmap into a Base64 string in JPEG format and embed it in the JSON response body to return to the front end.

[0030] The heatmap generation method generates and transmits heatmaps in real-time, frame-by-frame. The heatmap generation interface employs a stateless, single-frame processing mode: after each photomicrograph is taken, the front-end immediately calls the heatmap generation interface, passing in the current frame image. The server then performs sharpness calculations and color mapping, encodes the heatmap as a Base64 JPEG string, and embeds it directly into the JSON response body before returning it to the front-end. Optionally, the heatmap can be uploaded to an object storage service, and an access URL can be returned.

[0031] Depth heatmap extension. For multi-layer stacked images along the Z-axis, the Laplacian sharpness response is calculated for each layer. The index of the sharpest layer at each location is determined as the pseudo-depth value through a pixel-wise argmax operation. After normalization to [0,255], a configurable colormap (viridis / jet / hot / inferno) is applied for mapping, outputting statistical information such as minimum depth, maximum depth, average depth, depth standard deviation, and number of layers.

[0032] Compared with the prior art, the present invention has the following beneficial technical effects:

[0033] (1) The automatic shooting method based on a three-state machine proposed in this invention does not rely on motorized platform hardware and only needs to analyze the content of the image captured by the camera to determine the focus state. Through an adaptive dual threshold mechanism (absolute threshold + relative threshold, whichever is larger), it automatically adapts to the focus characteristics of different magnifications and different specimens; through EMA smoothing focus processing and noise tolerance mechanism, it effectively filters out false triggers caused by inter-frame jitter and short-term fluctuations; through a drift detection mechanism, it can detect slow focus drift, avoiding the defect of position feedback-based schemes that cannot perceive changes in image content; through the first shot fallback mechanism, it ensures that the user can obtain the photo immediately after the initial focus is completed. In summary, through comparative testing of 91 focusing sequences (50 sets under 4× objectives and 41 sets under 40× objectives), compared to the fixed C=6.0 scheme, the number of false triggers decreased from 11 to 8 (false trigger rate decreased from 12.0% to 8.8%), and the average delay for stopping detection was shortened from 2128 milliseconds to 1758 milliseconds; compared to the fixed C=20.0 scheme, the number of missed triggers decreased from 14 to 2 (missed trigger rate decreased from 15.2% to 2.2%).

[0034] (2) The real-time heatmap generation method based on the improved Laplacian operator and adaptive downsampling proposed in this invention has the following advantages compared with the traditional offline batch processing scheme: First, by downsampling to 25%, the amount of pixel processing is reduced to 1 / 16, and the generation time of a single heatmap is reduced from hundreds of milliseconds to tens of milliseconds; Second, by designing a stateless single-frame HTTP interface, a real-time interactive experience of "taking a picture and receiving a picture" is realized, and the end-to-end latency is controlled within a single HTTP request-response cycle; Third, by using the intuitive mapping of JET color maps, it is easy for students to quickly identify the focus state in teaching scenarios. Attached Figure Description

[0035] Figure 1 This is a flowchart of an automatic microscope image acquisition method according to the present invention.

[0036] Figure 2 This is a flowchart of a heat map generation method according to the present invention. Detailed Implementation

[0037] Numerous specific details are set forth in the following description to provide a full understanding of the invention. However, the invention can be practiced in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0038] Example 1

[0039] An automatic acquisition method for microscope images, applicable to low-magnification (4×) automatic photography scenarios.

[0040] Onion epidermal cell slides were observed under a 4x objective lens. A total of 50 4× focusing sequences were collected for this experiment, with a peak resolution of approximately 3200.

[0041] The user aligns the image acquisition terminal with the microscope eyepiece and activates the automatic image capture mode. The system initializes its three-state machine to the idle state, acquires the first image frame as the baseline frame, and calculates its Laplacian variance focal measure F. raw (0) = 45.2, F after EMA smoothing smoothed (0) = 45.2, set as the baseline value F baseline =45.2.

[0042] The user begins to slowly rotate the coarse adjustment knob. As the offset of the smooth focus measure relative to the baseline value exceeds the drift detection threshold, the state transitions to the focus changing state, while the baseline value is updated.

[0043] The user continued to focus, and the image gradually became clearer. The peak sharpness of this 4x test sequence was approximately 3200; at F... smoothed Taking a value of approximately 3200 as an example, the change detection threshold Threshold = max(6.0, 3200 × 0.02) = max(6.0, 64.0) = 64.0, at which point the relative threshold plays a dominant role.

[0044] After the user stops focusing, when the change in smooth focus measurement between adjacent frames remains below the current change detection threshold for 1300 milliseconds and meets the noise tolerance condition, the state transitions to the focus stable state, the system automatically triggers the photo capture, and the state is reset to the idle state after the photo capture is completed.

[0045] In this study of 50 4× focusing sequences, the adaptive scheme was triggered 50 times, with a false trigger rate of 0.0%, a missed trigger rate of 2.0%, an average stop detection delay of 1368 milliseconds, and a median delay of 1332 milliseconds. These results indicate that the dominant factor in the change detection threshold depends on the actual focus measurement level, rather than solely on the objective magnification.

[0046] Example 2

[0047] An automatic microscope image acquisition method is applied to high-magnification (40×) automatic photography scenarios.

[0048] Microscopic specimens were observed under a 40x objective lens. A total of 41 sets of 40× focusing sequences were collected in this experiment, with a peak resolution of approximately 400.

[0049] The system initializes to an idle state. When the user rotates the focus knob, the system continuously calculates the offset of the smooth focus measure relative to the baseline value; when the offset exceeds the drift detection threshold, the state transitions to the focus change state.

[0050] After the user finds the focus position and stops rotating, the smooth focus measurement gradually stabilizes. (F) smoothed Taking a value of approximately 400 as an example, the change detection threshold Threshold = max(6.0, 400 × 0.02) = max(6.0, 8.0) = 8.0. When the change in adjacent frames remains below the current change detection threshold for 1300 milliseconds and meets the noise tolerance condition, the system triggers automatic image capture.

[0051] In this embodiment, the adaptive dual threshold can be automatically adjusted according to the actual focus measurement level in a 40× scene. In this 41 sets of 40× focus sequences, the adaptive scheme was triggered 41 times, with 8 false triggers (19.5%) and 1 missed trigger (2.4%), with an average stop detection delay of 2349 milliseconds and a median delay of 2333 milliseconds; the false trigger rate of the fixed C=6.0 scheme was 26.2%, and the missed trigger rate of the fixed C=20.0 scheme was 29.3%.

[0052] Example 3

[0053] An automatic acquisition method for microscope images, applied to slow drift detection scenarios.

[0054] When users observe live paramecium specimens, the paramecium swims slowly on the slide, causing the image content to drift slowly.

[0055] The system is in an idle state, F baseline =320.0. The slow movement of the paramecium causes the image content to gradually change, F smoothed It rises slowly at a rate of approximately 1.5 per frame.

[0056] At frame t=8, F smoothed (8) = 332.0. drift = |332.0 - 320.0| = 12.0, DriftThreshold = max(6.0, 320.0 × 0.035) = max(6.0, 11.2) = 11.2. Since drift = 12.0 > 11.2 = DriftThreshold, drift detection is triggered, and the state transitions to the focus change state.

[0057] At this point, the system will not accumulate drift in an idle state without triggering a photo, but will instead promptly detect changes in the image content. Once the paramecium stops moving, F... smoothed Once the system reaches a stable state, it automatically takes a picture after completing a full cycle of focal change state to focal stable state transition.

[0058] Without a drift detection mechanism, relying solely on change detection (comparing adjacent frames), each frame ΔF≈1.5<6.0=Threshold will always assume the focus is stable, failing to detect slow drift. This results in taking pictures even when the specimen position has significantly shifted, obtaining images with suboptimal focus.

[0059] This embodiment verifies the drift detection mechanism (D rel =0.035) sensitivity to slow changes in the image and applicability to live specimen observation scenarios.

[0060] Comparative test cases

[0061] 1. Comparison scheme: The fixed threshold scheme uses the same Laplace variance sharpness measure, EMA smoothing (α=0.2), three-state machine and stable duration (1300ms) as the invention. The only difference is that the focus change judgment threshold uses a fixed constant C that does not change with sharpness. The comparison experiment uses two sets of boundary values: C=6.0 (low threshold) and C=20.0 (high threshold).

[0062] 2. Test conditions: A total of 91 focusing sequences were used with 4X and 40X objectives (50 sets for 4X and 41 sets for 40X). The focus naturally stopped after each user focused. The true stopping point was defined as "the image stops changing (the change in sharpness between adjacent samples δ < 8 for ≥ 1 second). The premature triggering (triggered while the user was still focusing), missed triggering (not triggered for ≥ 5 seconds after stopping), and the stop detection delay of each strategy were statistically analyzed.

[0063] 3. Actual test results (91 combinations): The adaptive scheme triggered 91 times, with 8 false triggers (false trigger rate 8.8%), 2 missed triggers (missed trigger rate 2.2%), and a stop detection delay of 1758ms. Its overall performance is better than the fixed threshold scheme: Fixed C=6.0 triggered 92 times, with 11 false triggers (12.0%), 2 missed triggers (2.2%), and a delay of 2128ms; Fixed C=20.0 triggered 78 times, with 8 false triggers (10.3%), 14 missed triggers (15.2%), and a delay of 1765ms. The differences were most significant in the 40X (low resolution, peak around 400) scene: with a fixed C=20.0 threshold, the image changes could not be detected due to the high threshold, resulting in 12 missed triggers (missed trigger rate of 29.3%); with a fixed C=6.0 threshold, slight fluctuations were misjudged due to the low threshold, resulting in 11 false triggers (false trigger rate of 26.2%); and with the adaptive threshold, there were 8 false triggers (19.5%) and 1 missed trigger (2.4%), both of which were the lowest.

[0064] 4. Conclusion: Compared to the fixed threshold scheme, the adaptive dual threshold θ=max(6.0, F×2%) of this invention is superior across different resolution metric classes. Compared to a fixed C=20.0, the number of missed triggers is reduced from 14 to 2 (missed trigger rate 15.2%→2.2%, a reduction of approximately 86%); compared to a fixed C=6.0, the number of false triggers is reduced from 11 to 8 (false trigger rate 12.0%→8.8%, a reduction of approximately 26.7%), and the stop detection latency is shortened from 2128ms to 1758ms. A fixed single threshold cannot simultaneously address both false and missed triggers in low / high resolution scenarios; this invention uses a set of adaptive parameters to cover the entire resolution range.

[0065] Example 4

[0066] A heatmap generation method, running on a cloud server, is used to process images collected by the front end in real time, generate heatmaps, and return them to the front end to display the focus of the images.

[0067] Users observe oral epithelial cell specimens in teaching experiments and need to check the focus distribution of the current image immediately after each manual focus adjustment.

[0068] After the user completes a focus adjustment, the front end acquires the current frame image (1920×1080 resolution, BGR format) and sends it to the heatmap generation interface of the cloud server via an HTTP POST request. The request body is in JSON format and contains Base64 encoded image data and optional parameters (kernel=3, scale=0.25).

[0069] After receiving the request, the cloud server performs the following processing:

[0070] (a) Image decoding: Decode the Base64 string into a 1920×1080 BGR image.

[0071] (b) Adaptive downsampling: The image is scaled to 480×270 by scale=0.25, and the region is averaged down using INTER_AREA interpolation. The number of pixels is reduced from 2,073,600 to 129,600, a reduction of 1 / 16 of the original.

[0072] (c) Grayscale conversion: Convert the 480×270 BGR image to a grayscale image, and then to float64 type.

[0073] (d) Improved Laplace filter: Constructing a horizontal kernel K h =[-1,0,2,0,-1] (shape 1×5) and its transpose vertical kernel K v(Shape 5×1), perform filter2D convolution on the grayscale image, sum the absolute values ​​pixel by pixel, and then smooth it locally with boxFilter (3×3 kernel) to obtain a 480×270 sharpness response map FM.

[0074] (e) Normalization and color map mapping: FM is normalized to the range [0,255] using Min-Max, converted to uint8 type, and COLORMAP_JET pseudo-color mapping is applied to obtain a 480×270 BGR heat map.

[0075] (f) Encoding return: Encode the heatmap as a Base64 string in JPEG format (quality 85) and embed it in the JSON response body to return to the front end.

[0076] Upon receiving the response, the front end immediately displays a heatmap overlay on the screen. The blue areas (cell edges, out-of-focus areas) are clearly visible, while the red areas (the cell center in focus) are highlighted. The end-to-end latency from taking the picture to displaying the heatmap is approximately 150 milliseconds (including network transmission).

[0077] Users continue to fine-tune the focus based on the heatmap feedback. Each time the focus is adjusted, the heatmap is generated again, realizing an iterative optimization cycle of "focusing → viewing the heatmap → refocusing" until the heatmap shows that the entire field of view is in a warm color tone (the focus is on the target), which is the best result.

[0078] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. However, any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatically acquiring microscope images, used to automatically trigger image acquisition during microscope focusing, characterized in that, Includes the following steps: S1. Acquire real-time preview image frames from the microscope, and initialize the three-state machine to the idle state; S2. Calculate the smooth focus measure value of the preview image frame, take the smooth focus measure value of the first image frame as the baseline value, and calculate the offset of the smooth focus measure value of the current frame relative to the baseline value. When the offset exceeds the drift detection threshold, the three-state machine switches to the focus change state. S3. Calculate the change in the smooth focus measure value between adjacent frames. When the change is lower than the change detection threshold, start recording the duration. When the duration exceeds the stable time threshold, the three-state machine switches to the focus stable state and sends an image acquisition signal to the image acquisition terminal. S4. After the image acquisition terminal acquires the image, the three-state machine is reset to the idle state.

2. The automatic microscope image acquisition method according to claim 1, characterized in that: The formula for calculating the smooth focus measure value is F. smoothed (t) = α × F raw (t) + (1-α) × F smoothed (t-1), where F raw (t) is the original focus measure of the t-th frame, F smoothed (t-1) is the smooth focus measure of the (t-1)th frame, and α is the preset smoothing coefficient.

3. The automatic microscope image acquisition method according to claim 2, characterized in that, The change detection threshold is taken as the larger value of the following formula: Threshold = max(T) abs’ F smoothed ×T rel ) Where T abs T is the preset absolute threshold. rel F is a preset relative threshold coefficient. smoothed The current smooth focus measure is max(), which indicates taking the larger value.

4. The automatic microscope image acquisition method according to claim 3, characterized in that, The drift detection threshold is taken as the larger value of the following formula: DriftThreshold = max(T) abs’ F baseline ×D rel ) Where T abs D is the preset absolute threshold. rel The preset drift relative threshold coefficient is greater than the relative threshold coefficient in the change detection threshold formula, and max() indicates taking the larger value.

5. The automatic microscope image acquisition method according to claim 4, characterized in that, Step S3 also includes a noise tolerance mechanism, which sets up a counting module to record the number of frames of the image in the focus-stable state. Only when the K value of the counting module is greater than or equal to 2 is it confirmed as a true focus-stable state.

6. A method for generating a heatmap, used to process images acquired by the automatic microscope image acquisition method according to any one of claims 1-5.

7. The heatmap generation method according to claim 6, characterized in that, Includes the following steps: A1. Downsample the image acquired by the front end according to the preset downsampling ratio to obtain a downsampled image; A2. Convert the downsampled image to a grayscale image, and filter the grayscale image using an improved Laplacian operator to obtain a pixel-level sharpness response map. The horizontal kernel of the improved Laplacian operator is K. h =[-1,0,2,0,-1], vertical kernel is A3. Perform box filtering smoothing on the sharpness response map to obtain a smoothed sharpness map; A4. Normalize the smoothness and clarity map and apply pseudo-color mapping to generate a heatmap; A5. Encode the heatmap into a Base64 string in JPEG format and embed it in the JSON response body to return to the front end.

8. The heatmap generation method according to claim 7, characterized in that: In step A1, the preset downsampling ratio is 0.

25. During downsampling, a region interpolation method is used to reduce the number of image pixels to 1 / 16 of the original.

9. The heatmap generation method according to claim 8, characterized in that: In step A3, the formula for calculating the smoothness and sharpness response map FM is FM(x,y) = BoxFilter(|I*K h |+|I*K v |).

10. The heatmap generation method according to claim 9, characterized in that: In step A4, normalization is performed using Min-Max normalization to the range [0, 255] and mapped to an 8-bit unsigned integer. The pseudo-color mapping uses the JET color map.