Microcirculation image acquisition control method and system based on auto-focusing logic
By constructing an autofocus process driven by vascular features and multi-scale vascular enhancement filtering, the problem of multi-peak misjudgment caused by the small size and low contrast of capillary structures in microcirculation images was solved, and accurate autofocus of microcirculation images was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-26
AI Technical Summary
The capillary structures in microcirculation images are small and have low overall contrast, which makes traditional sharpness evaluation functions prone to multiple peaks or misjudgments, affecting the accuracy of autofocus.
A microcirculation image acquisition and control method based on autofocus logic is adopted. By constructing an autofocus process driven by vascular features, multi-scale vascular enhancement filtering is activated to enhance capillary structure and improve the grayscale difference between edges and background. A sharpness evaluation system is constructed by combining multi-dimensional indicators, and the focus driving components are dynamically adjusted to achieve accurate autofocus.
It effectively suppresses the multi-peak and misjudgment problems of traditional sharpness functions in low-contrast scenes, improves the accuracy and stability of focus positioning, and realizes precise autofocus for micro-circulation images.
Smart Images

Figure CN122289206A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, in particular to a microcirculation image acquisition control method and system based on automatic focusing logic. BACKGROUND
[0002] Microcirculation refers to the circulation process of blood in microarteries, capillaries and microveins, and its state can directly reflect the perfusion and metabolic conditions of the body tissue, thus having important clinical value in the fields of critical care medicine, anesthesia monitoring, shock assessment and vascular disease diagnosis. In order to realize the visual observation of the microcirculation state, the microcirculation detection equipment based on the dark field illumination principle is commonly used in the clinical and scientific research fields at present, and the video of the microvascular network on the human sublingual or skin surface is collected through the optical imaging system, so as to obtain the capillary structure and red blood cell flow condition.
[0003] However, the capillary structure in the microcirculation image is small and has low overall contrast, and the blood vessel edge feature is not obvious, which leads to the phenomenon that the traditional sharpness evaluation function is prone to multiple peaks or misjudgment, thereby reducing the accuracy of automatic focusing. SUMMARY
[0004] The present application aims to solve the problem that the capillary structure in the microcirculation image is small and has low overall contrast, and the blood vessel edge feature is not obvious, which leads to the phenomenon that the traditional sharpness evaluation function is prone to multiple peaks or misjudgment, and provides a microcirculation image acquisition control method and system based on automatic focusing logic.
[0005] The present application solves the technical problem by using the following technical means: The present application provides a microcirculation image acquisition control method based on automatic focusing logic, comprising: Based on the optical axis direction preset by the microcirculation detector, a plurality of frames of microcirculation images are collected at the preset focal length position, and a corresponding blood vessel image sequence is constructed according to the microcirculation images; determining whether the blood vessel image sequence has a preset blood vessel feature, wherein the blood vessel feature is specifically that the capillary structure is small and has low contrast; If yes, a preset multi-scale blood vessel enhancement filter is activated, the elongated structure of the capillary is extracted in the blood vessel image sequence, the capillary is subjected to contrast stretching processing, the gray difference between the blood vessel edge and the background is identified, and the blood vessel edge feature of the blood vessel image sequence is detected according to the gray difference; determining whether the blood vessel edge feature can construct a preset sharpness evaluation index; If possible, based on the index type of the clarity evaluation index, image data at each focal length position during the focusing scan is obtained. According to the image data, a corresponding clarity curve is established, and the position with the highest clarity in the clarity curve is taken as the optimal focus position. Based on the optimal focus position, the focusing drive component of the microcirculation detector is dynamically adjusted. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high-frequency information energy index.
[0006] Furthermore, after the step of activating the preset multi-scale vascular enhancement filter and extracting the elongated structure of capillaries from the vascular image sequence, the method further includes: Based on the pre-identified vascular feature parameters in the capillaries, the change values of the degree of vascular structure change between consecutive frames are collected. The vascular feature parameters specifically include vascular length, vascular density, vascular edge gradient and vascular continuity index. Determine whether the change value is less than a preset stability threshold; If not, the principal direction distribution of the vascular structure is calculated. Based on the principal direction distribution, the real vascular structure and background texture in the vascular image sequence are dynamically divided to generate the clarity of each region of the vascular image sequence. Based on the clarity of each region, the out-of-focus region of the vascular image sequence is obtained.
[0007] Furthermore, the step of identifying the grayscale difference between the blood vessel edge and the background, and detecting the blood vessel edge features of the blood vessel image sequence based on the grayscale difference, further includes: Based on the distribution information of the gray-level differences, image gradient parameters of the blood vessel image sequence are generated, and corresponding candidate edge pixels are extracted from the image gradient parameters. Specifically, the image gradient parameters include gradient magnitude and gradient direction. Determine whether the candidate edge pixels can reach a preset pixel threshold; If possible, an initial edge set is constructed based on the response values of the candidate edge pixels, the aspect ratio of the edge regions of the initial edge set is collected, and edge segments that do not meet the elongated structural features are dynamically removed based on the aspect ratio of the edge regions. Specifically, the initial edge set includes strong edge pixels and weak edge pixels.
[0008] Furthermore, the step of acquiring image data at each focal length position during the focusing scan and establishing a corresponding sharpness curve based on the image data further includes: Based on a preset focal length position, corresponding sharpness evaluation features are collected from the focal length position. Specifically, the sharpness evaluation features include the gradient intensity of blood vessel edges, the continuity of blood vessel structure, the high-frequency information energy of the image, and the texture features of the blood vessel region. Determine whether the sharpness evaluation features meet the preset validity conditions; If so, then based on the effective sharpness data of the sharpness evaluation features, each focal length position is associated with the effective sharpness data to construct a corresponding discrete data point set. Based on the discrete data point set, the sharpness value is fitted to the change of focal length to generate an initial sharpness change curve.
[0009] Furthermore, the step of determining whether the vascular image sequence contains preset vascular features also includes: Based on the vascular structure pre-detected by the microcirculation detector, structural information of the vascular structure is obtained; Determine whether the structural information meets the preset morphological constraints; If so, then identify blood vessel images in which the blood vessel structure is continuously distributed in at least two regions, detect the discrete state of the blood vessel images, and dynamically divide the blood vessel images into valid blood vessel images and invalid blood vessel images according to the discrete state, wherein the discrete state specifically includes local existence and discrete distribution.
[0010] Furthermore, the step of determining whether the blood vessel edge features can construct a preset clarity evaluation index also includes: Based on the edge fundamental parameters of the blood vessel edge features, the length distribution information of the edge connected region is identified, wherein the edge fundamental parameters specifically include the number of edge pixels, the average gradient intensity, and the edge distribution density; Determine whether the length distribution information has continuous blood vessel characteristics; If so, spatial distribution analysis is performed on the blood vessel edge features to obtain the distribution information of different edges in the image. Based on the distribution information, the structural representativeness of the blood vessel edge features is dynamically divided. Specifically, the distribution information includes edges that are evenly distributed and cover multiple regions, and edges that are concentrated in local regions and sparsely distributed.
[0011] Furthermore, the step of acquiring several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and constructing a corresponding vascular image sequence based on the microcirculation images, further includes: Based on the image acquisition at the focal length position by the microcirculation detector, corresponding multi-frame image data is obtained; Determine whether the multi-frame image data detects a preset blur feature; If not, multiple frames of images at the same focal length position are filtered to generate a reference image at the focal length position. According to the preset focal length size rule, the reference images corresponding to each focal length position are sorted to construct the blood vessel image sequence. The filtering process specifically includes multi-frame averaging, clear frame filtering, and key frame extraction.
[0012] This invention also provides a micro-circulation image acquisition and control system based on autofocus logic, comprising: The construction module is used to acquire several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and to construct a corresponding blood vessel image sequence based on the microcirculation images; The judgment module is used to determine whether the vascular image sequence has preset vascular features, wherein the vascular features are specifically small capillary structures with low contrast. The execution module is used to activate a preset multi-scale vascular enhancement filter if the condition is met, extract the slender structure of capillaries from the vascular image sequence, perform contrast stretching on the capillaries, identify the grayscale difference between the vascular edge and the background, and detect the vascular edge features of the vascular image sequence based on the grayscale difference. The second judgment module is used to determine whether the blood vessel edge features can construct a preset clarity evaluation index; The second execution module is used to, if possible, acquire image data at each focal length position during the focusing scan based on the index type of the sharpness evaluation index, establish a corresponding sharpness curve based on the image data, take the position with the highest sharpness in the sharpness curve as the optimal focus position, and dynamically adjust the focusing drive component of the microcirculation detector based on the optimal focus position. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high-frequency information energy index.
[0013] Furthermore, it also includes: The acquisition module is used to acquire the change value of the degree of change of blood vessel structure between consecutive frames based on the pre-identified blood vessel feature parameters in the capillaries. The blood vessel feature parameters specifically include blood vessel length, blood vessel density, blood vessel edge gradient and blood vessel continuity index. The third judgment module is used to determine whether the change value is less than a preset stable threshold. The third execution module is used to calculate the main direction distribution of the vascular structure if not, dynamically divide the real vascular structure and background texture in the vascular image sequence according to the main direction distribution, generate the clarity of each region of the vascular image sequence, and obtain the out-of-focus region of the vascular image sequence based on the clarity of each region.
[0014] Furthermore, the execution module also includes: An extraction unit is used to generate image gradient parameters of the blood vessel image sequence based on the distribution information of the gray-level differences, and extract corresponding candidate edge pixels from the image gradient parameters, wherein the image gradient parameters specifically include gradient magnitude and gradient direction; The judgment unit is used to determine whether the candidate edge pixels can reach a preset pixel threshold. An execution unit is configured to, if possible, construct a corresponding initial edge set based on the response values of the candidate edge pixels, collect the aspect ratio of the edge regions of the initial edge set, and dynamically remove edge segments that do not meet the elongated structural characteristics based on the aspect ratio of the edge regions. Specifically, the initial edge set includes strong edge pixels and weak edge pixels.
[0015] This invention provides a micro-loop image acquisition control method and system based on autofocus logic, which has the following beneficial effects: This invention addresses the issues of small capillary structures, low overall contrast, and indistinct edge features in microcirculation images by constructing a "vascular feature-driven" autofocus process. First, it performs feature determination on the vascular image sequence, activating multi-scale vascular enhancement filtering only when microvascular characteristics are met. This effectively enhances the slender vascular structure and improves the grayscale difference between the edges and the background. By assessing the usability of vascular edge features, it avoids low-quality or false edges from participating in sharpness evaluation. Simultaneously, it constructs a sharpness evaluation system by combining multi-dimensional indicators such as vascular edge gradient intensity, boundary continuity, texture energy, and high-frequency information energy, making the sharpness curve smoother and exhibiting single-peak characteristics. This effectively suppresses the multi-peak and misjudgment problems generated by traditional sharpness functions in low-contrast scenes, improving the accuracy and stability of focus positioning and achieving precise autofocus for microcirculation images. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an embodiment of the micro-circulation image acquisition control method based on autofocus logic of the present invention. Figure 2 This is a structural block diagram of an embodiment of the micro-circulation image acquisition and control system based on autofocus logic of the present invention. Detailed Implementation
[0017] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The realization of the purpose, functional features, and advantages of the invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings.
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Reference Appendix Figure 1 The micro-circulation image acquisition control method based on autofocus logic in one embodiment of the present invention includes: S1: Based on the preset optical axis direction of the microcirculation detector, acquire several frames of microcirculation images at the preset focal length position, and construct a corresponding blood vessel image sequence based on the microcirculation images; S2: Determine whether the vascular image sequence has preset vascular features, wherein the vascular features are specifically small capillary structures with low contrast; S3: If so, activate the preset multi-scale blood vessel enhancement filter, extract the slender structure of capillaries from the blood vessel image sequence, perform contrast stretching on the capillaries, identify the grayscale difference between the blood vessel edge and the background, and detect the blood vessel edge features of the blood vessel image sequence based on the grayscale difference. S4: Determine whether the blood vessel edge features can construct a preset clarity evaluation index; S5: If possible, based on the index type of the clarity evaluation index, obtain image data at each focal length position during the focusing scan, establish a corresponding clarity curve according to the image data, take the position with the highest clarity in the clarity curve as the optimal focus position, and dynamically adjust the focusing drive component of the microcirculation detector according to the optimal focus position. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high frequency information energy index.
[0020] In this embodiment, the system acquires several frames of microcirculation images at a pre-set focal length position based on a pre-defined direction in Guangzhou using a microcirculation detector. Based on these microcirculation images, a corresponding vascular image sequence is constructed. The system then determines whether these vascular image sequences contain pre-defined vascular features to execute corresponding steps. For example, if the system determines that the vascular image sequence does not contain pre-defined vascular features, it considers the currently acquired image to not effectively reflect the microcirculation capillary structure. The system then classifies the current vascular image sequence as invalid data, stops focusing calculations based on this sequence, and simultaneously controls the focusing drive component to adjust along the optical axis to a new focal length position, and restarts the process. The system acquires microcirculation images; during reacquisition, it can adaptively adjust the focal length step size or expand the scanning range to increase the probability of detecting vascular structures. For example, when the system determines that a pre-defined vascular feature exists in the vascular image sequence, it considers the currently acquired image to effectively reflect the microcirculation capillary structure. The system then activates a pre-defined multi-scale vascular enhancement filter to extract the slender structure information of capillaries from the vascular image sequence, performs contrast stretching on the capillaries, identifies the grayscale difference between the vascular edge and the background, and detects the vascular edge features of the vascular image sequence based on different grayscale differences. The system performs contrast stretching on the enhanced capillaries. This method can further amplify the grayscale difference between the vascular region and the background region, making the transition of vascular edges more obvious, effectively suppressing the interference of background noise and non-vascular textures, thereby improving the recognition of vascular regions and avoiding the problem of vascular information loss or false detection caused by insufficient contrast in traditional methods. Simultaneously, vascular edge feature detection is performed based on grayscale differences, making the extraction process more dependent on the real structural information of blood vessels, rather than a single image gradient change. This allows for more accurate acquisition of continuous, slender, and physiologically consistent vascular edges, effectively reducing false edges and multi-peak interference caused by noise, improving the stability and reliability of edge features, and providing support for constructing a more unimodal clarity evaluation index. The system improves the accuracy of autofocus; then it determines whether these vascular edge features can construct a pre-set sharpness evaluation index and executes the corresponding steps. For example, when the system determines that these vascular edge features cannot construct a pre-set sharpness evaluation index, the system will consider that the quality of the currently extracted edge information is insufficient or does not have stable representation ability. The system will stop the sharpness calculation process based on the feature and trigger an adaptive adjustment mechanism, such as re-executing the vascular enhancement and edge extraction steps, adjusting the multi-scale filtering parameters or contrast enhancement intensity to improve the quality of edge features. At the same time, it controls the imaging components to re-acquire image data or fine-tune the focal length position to obtain a clearer and more stable vascular structure.For example, when the system determines that these vascular edge features can construct a pre-set sharpness evaluation index, the system will consider that the currently extracted edge information has stable representation capabilities. Based on the index type of the sharpness evaluation index (specifically including vascular edge gradient intensity index, vascular boundary continuity index, vascular region texture energy index, and high-frequency information energy index), the system will acquire image data at each focal length position during the focusing scan. According to different image data, corresponding sharpness curves will be established, and the position with the highest sharpness in these sharpness curves will be taken as the optimal focus position. Based on this optimal focus position, the focusing drive component of the microcirculation detector will be dynamically adjusted. The system uses a multi-index fusion method to evaluate the sharpness at different focal length positions. Analyzing the image data allows for the construction of a smoother, more distinct single-peak sharpness curve. This creates a more stable correlation between changes in focal length and sharpness, effectively suppressing the multi-peak phenomenon and local abnormal fluctuations common in traditional methods. This improves the reliability of optimal focus position identification. Furthermore, after determining the optimal focus position corresponding to the maximum value of the sharpness curve, the system can dynamically adjust the focusing drive components to achieve closed-loop control of the focusing process. This enables the imaging system to converge quickly and accurately to the optimal focal plane. Moreover, this method can adaptively adjust the focusing process based on actual image quality, improving adaptability to different detection environments and individual differences, thereby enhancing the overall stability and imaging quality of microcirculation image acquisition.
[0021] It should be noted that, by activating a preset multi-scale vascular enhancement filter, the slender structures of capillaries are extracted from the vascular image sequence. Contrast stretching is then applied to the capillaries to identify the grayscale difference between the vascular edges and the background. Based on this grayscale difference, the vascular edge features of the vascular image sequence are detected, specifically as follows: First, the vascular image sequence is preprocessed to reduce noise interference in subsequent processing, for example, by using smoothing filters or denoising algorithms to weaken the influence of random noise and background texture. Then, a preset multi-scale vascular enhancement filter is activated, performing convolution operations on the image at multiple scales to ensure that elongated structures within different diameter ranges produce significant responses, thereby highlighting the continuous linear features of capillaries and suppressing blocky or irregular texture structures in non-vascular areas. After obtaining the enhanced vascular response map, contrast stretching is performed on the capillary region, expanding the grayscale dynamic range linearly or non-linearly to further amplify the grayscale distribution difference between the vascular region and the background region, thereby enhancing the clarity of boundary transitions. Based on this, local gray-level differences are calculated for the enhanced image. Gray-level changes in the neighborhood of each pixel can be obtained through a sliding window method, and gray-level gradients or differential responses are extracted to identify abrupt changes between the vessel edge and the background. Furthermore, the detected edge candidate regions are screened and optimized. For example, weak response regions are removed based on edge intensity thresholds, isolated noise points are removed by combining connectivity analysis, and the continuity and integrity of the edges are enhanced through morphological processing. Finally, the screened edge information is uniformly integrated in the entire vessel image sequence to form a stable and structurally consistent set of vessel edge features, providing high-quality input data for subsequent sharpness evaluation and autofocus. Specific examples are as follows: For example, in actual microcirculation detection, in a set of sublingual microcirculation images acquired, because the diameter of capillaries is usually only a few micrometers, and the imaging environment is affected by uneven illumination and tissue scattering, the blood vessels in the original image often appear as thin, weak lines with slow grayscale changes, and some areas are even close to the background grayscale, making them difficult to distinguish directly. First, the image is denoised, then a multi-scale vascular enhancement filter is applied to highlight the fine capillaries at a smaller scale and enhance the slightly thicker vascular structures at a larger scale, so that blood vessels at different levels receive a response enhancement. At this point, the originally indistinct blood vessels gradually appear as brighter, continuous linear areas. Subsequently, contrast stretching is performed to transform the blood vessels that were originally concentrated in the middle grayscale range (e.g., grayscale values 80–120). The pixel range is expanded to a wider range (e.g., 40-200), making the blood vessel area significantly brighter while the background is relatively darker, thus creating a significant grayscale difference. Then, the grayscale difference is calculated within a local window. For example, the grayscale difference between adjacent pixels at the edge of the blood vessel can reach more than 20, while the background area is only about 5, which can be used to identify the location of the blood vessel edge. Furthermore, weak edges below the threshold are filtered out by setting a threshold, and scattered noise is removed by using connected component analysis, retaining only the thin and continuously distributed edge structure. The final blood vessel edge feature is presented as a continuous curve running through the image, which not only clearly depicts the outline of the capillaries, but also effectively avoids the interference of background texture and noise, making the subsequent sharpness evaluation based on this edge feature more stable and reliable.
[0022] It should be added that, based on the index type of the aforementioned sharpness evaluation index, image data at each focal length position during the focusing scan process is acquired. Based on the image data, a corresponding sharpness curve is established. The position with the highest sharpness in the sharpness curve is taken as the optimal focus position. Based on the optimal focus position, the focusing drive component of the microcirculation detector is dynamically adjusted, specifically as follows: The system first initializes the focusing and scanning parameters based on the established sharpness evaluation index types, setting the scanning range, focal length step size, and sampling strategy. It then controls the focusing drive component to scan point-by-point along the optical axis at multiple discrete focal length positions. At each focal length position, corresponding image data is acquired, and the images are preprocessed (e.g., denoising, normalization) to ensure comparability between data at different focal length positions. Subsequently, for each frame, the corresponding sharpness evaluation value is calculated. This evaluation value can be calculated individually or through weighted fusion based on indicators such as blood vessel edge gradient intensity, boundary continuity, texture energy, and high-frequency information energy, thereby obtaining the sharpness evaluation value for that focal length position. The system calculates the overall sharpness response at all focal lengths. After completing the sharpness calculation for all focal lengths, it constructs a sharpness curve by using the focal length as the abscissa and the sharpness evaluation value as the ordinate. Further, the sharpness curve is smoothed or denoised to eliminate interference from local fluctuations, ensuring a stable overall trend. Then, the system searches for the focal length position corresponding to the maximum sharpness within the curve and determines it as the optimal focus position. Finally, based on this optimal focus position, the system controls the focusing drive component to perform fine adjustments, enabling the imaging system to quickly move to and maintain that position, thereby achieving closed-loop control of the autofocus process and providing optimal imaging conditions for subsequent image acquisition. Specific examples are as follows: For example, during a microcirculation detection process, the system sets the focal length scanning range to 0–100 units and scans in steps of 5, obtaining data at 21 focal length positions. At each focal length position, the system acquires one or more frames of images and calculates their sharpness evaluation value. For example, at focal lengths of 10, 20, and 30, the edges of the blood vessels are blurred because they are not yet aligned with the vascular layer, resulting in low sharpness values (e.g., 0.2–0.4). As the focal length gradually approaches the target layer (e.g., around 50), the edges of the blood vessels become clearer, the gradient intensity and texture energy increase significantly, and the corresponding sharpness value increases significantly (e.g., reaching 0). (Above 8); When the focal length exceeds the optimal position (e.g., 60, 70), the sharpness value gradually decreases again due to the deviation from the focal plane; eventually forming a sharpness curve similar to a single peak distribution, with the maximum value (e.g., 0.92) reaching at a focal length of 50; the system determines that a focal length of 50 is the optimal focus position and controls the focus drive component to move quickly to this position, while performing fine adjustments (e.g., fine search within ±1 range) to ensure the optimal imaging state is achieved; through this process, not only can the focus be accurately located, but also misjudgments caused by local noise or false edges in traditional methods can be avoided, thereby achieving stable and reliable autofocus control.
[0023] In this embodiment, after step S3, which involves activating a preset multi-scale vascular enhancement filter and extracting the elongated structure of capillaries from the vascular image sequence, the method further includes: S301: Based on the pre-identified vascular feature parameters in the capillaries, collect the change values of the degree of vascular structure change between consecutive frames, wherein the vascular feature parameters specifically include vascular length, vascular density, vascular edge gradient and vascular continuity index. S302: Determine whether the change value is less than a preset stability threshold; S303: If not, calculate the main direction distribution of the vascular structure, dynamically divide the real vascular structure and background texture in the vascular image sequence according to the main direction distribution, generate the clarity of each region of the vascular image sequence, and obtain the out-of-focus region of the vascular image sequence based on the clarity of each region.
[0024] In this embodiment, the system collects the changes in the degree of vascular structure change between consecutive frames based on pre-identified vascular feature parameters in capillaries. These parameters specifically include vessel length, vessel density, vessel edge gradient, and vessel continuity indicators. The system then determines whether these changes are less than a pre-set stability threshold to execute corresponding steps. For example, if the system determines that the changes in the degree of vascular structure change between consecutive frames are indeed less than the pre-set stability threshold, the system considers the currently acquired microcirculation image to have good stability in the time dimension. The system then classifies the current vascular image sequence as stable and valid data and further executes subsequent processing steps based on this stable sequence. For example, the system directly uses the vascular feature parameters to construct a sharpness evaluation index or to calculate and optimize a sharpness curve. Simultaneously, to improve processing efficiency and reduce redundant frame calculations, stable frames are filtered or fused (e.g., representative frames are selected or multi-frame averaging is performed), thereby reducing computational complexity. For example, when the system determines that the changes in the degree of vascular structure change between consecutive frames... If the change value is not less than the preset stability threshold, the system will consider the currently acquired microcirculation image to be unstable in the time dimension. The system will calculate the principal direction distribution of the vascular structure, and dynamically divide the real vascular structure and background texture in the vascular image sequence according to different principal direction distributions, generating the clarity of each region of the vascular image sequence. Based on the different clarity of each region, the system will obtain the out-of-focus areas of the vascular image sequence. By dividing the image into regions according to the principal direction distribution, the system distinguishes the vascular region from the background region and calculates the clarity of each region separately. This avoids misjudgment problems caused by local anomalies or noise interference in the overall evaluation. It can independently evaluate the imaging quality of different regions, making the clarity analysis more refined and targeted, thus more realistically reflecting the focus status of each part of the image. At the same time, the system can adjust the focusing strategy or perform local optimization in a targeted manner according to the distribution of out-of-focus areas, making the focusing process more efficient and accurate, reducing the risk of misfocusing caused by inaccurate overall evaluation, and improving the imaging quality and stability of microcirculation detection.
[0025] It should be noted that the calculation of the principal directional distribution of the vascular structure, the dynamic segmentation of the real vascular structure and background texture in the vascular image sequence based on the principal directional distribution, the generation of the sharpness of each region in the vascular image sequence, and the acquisition of the out-of-focus regions of the vascular image sequence based on the sharpness of each region, specifically: First, based on the extracted vascular structure features, directional analysis is performed on the vascular image sequence. By calculating the gradient direction distribution of each pixel or local region in the image, the main direction information of the vascular structure is statistically obtained. For example, the dominant direction component in the image can be extracted using methods such as orientation histograms or structure tensors. Since real capillaries usually present as continuous and relatively consistent slender structures, while background textures often exhibit chaotic directions or no obvious main direction, the image can be dynamically partitioned according to the main direction distribution. Regions that conform to the continuous main direction feature are classified as candidate vascular regions, and regions with discrete or disordered directions are classified as background textures. After dividing the image into regions, the corresponding sharpness indicators are calculated for each region. For example, edge gradient intensity and continuity are calculated in the vascular region, and high-frequency noise response is evaluated in the background region, thereby obtaining the sharpness distribution of different regions in the vascular image sequence. Subsequently, the sharpness of each region is comprehensively analyzed. By comparing the sharpness differences and trends between different regions, regions with significantly lower sharpness than the surrounding areas or below a preset threshold are identified and marked as out-of-focus regions. Furthermore, multi-frame information can be combined to verify the out-of-focus regions to ensure their consistency in the time dimension, thereby improving the stability and accuracy of out-of-focus detection. Specific examples are as follows: For example, in a set of microcirculation images with slight jitter, capillaries in some areas are distributed along roughly the same direction (e.g., from the upper left to the lower right). The system first identifies this direction as the dominant direction through gradient direction statistics and identifies multiple slender structures extending continuously along this direction in the image, classifying these areas as vascular regions. At the same time, some background tissue areas in the image have complex textures, and their gradient directions are distributed in multiple directions. The system classifies these as background texture areas. Subsequently, in clear areas (e.g., areas near the focal point), the edges of blood vessels are clear and the gradient values are high, resulting in a high calculated regional sharpness (e.g., above 0.85). In some areas that are off-focus, although blood vessel structures still exist, the edges become blurred and the gradient weakens, significantly reducing the regional sharpness (e.g., 0.4–0.5). By comparing and analyzing the sharpness of each region, the system marks these areas with low sharpness and significant differences from the surrounding areas as out-of-focus areas, and based on this, it determines that the current image has a localized out-of-focus phenomenon in space, thus providing an accurate basis for subsequent focus adjustment or image optimization.
[0026] In this embodiment, step S3, which identifies the grayscale difference between the blood vessel edge and the background and detects the blood vessel edge features of the blood vessel image sequence based on the grayscale difference, further includes: S31: Based on the distribution information of the grayscale difference, generate image gradient parameters for the blood vessel image sequence, and extract corresponding candidate edge pixels from the image gradient parameters, wherein the image gradient parameters specifically include gradient magnitude and gradient direction; S32: Determine whether the candidate edge pixels can reach a preset pixel threshold; S33: If possible, construct a corresponding initial edge set based on the response value of the candidate edge pixels, collect the aspect ratio of the edge region of the initial edge set, and dynamically remove edge segments that do not meet the slender structure characteristics based on the aspect ratio of the edge region. The initial edge set specifically includes strong edge pixels and weak edge pixels.
[0027] In this embodiment, the system generates image gradient parameters for the vascular image sequence based on the distribution information of grayscale differences. These gradient parameters specifically include gradient magnitude and gradient direction. Corresponding candidate edge pixels are extracted from these gradient parameters. The system then determines whether these candidate edge pixels can reach a preset pixel threshold to execute corresponding steps. For example, if the system determines that these candidate edge pixels cannot reach the preset pixel threshold, it considers the grayscale differences in the current image insufficient to form a stable and continuous vascular edge structure. The system then deems the current edge detection result invalid and stops subsequent sharpness evaluation processing based on this result. Simultaneously, it triggers an adaptive optimization mechanism, such as enhancing grayscale contrast (e.g., increasing contrast stretching intensity or using adaptive histogram equalization), adjusting multi-scale vascular enhancement filter parameters to improve the response of small vessels, or appropriately lowering the gradient threshold to re-extract candidate edge pixels. Conversely, if the system determines that these candidate edge pixels can reach the preset pixel threshold, it considers the grayscale differences in the current image sufficient to form a stable and continuous vascular edge structure. For stable and continuous vascular edge structures, the system constructs an initial edge set based on the response values of candidate edge pixels. This initial edge set includes strong and weak edge pixels. The aspect ratio of the edge regions in this initial edge set is collected, and edge fragments that do not meet the elongated structural characteristics are dynamically removed based on different aspect ratios. By analyzing the aspect ratio of the initial edge set and utilizing the elongated shape of capillaries, the system performs geometric constraint screening on the edge regions. This effectively distinguishes vascular edges from background textures or noise edges, and removes blocky, short, or irregularly distributed pseudo-edge fragments. This significantly improves the accuracy of vascular structure recognition and reduces false detections. Furthermore, after removing edge fragments that do not conform to the elongated structural characteristics, the remaining edge set is closer to the real capillary structure, making the edge features more consistent in spatial distribution and morphology. This is beneficial for subsequently constructing a stable and unimodal sharpness evaluation index, thereby reducing the interference of noise and pseudo-structures on sharpness calculation and improving the accuracy and robustness of focus determination during autofocus.
[0028] It should be noted that, based on the response values of the candidate edge pixels, a corresponding initial edge set is constructed. The aspect ratio of the edge regions in the initial edge set is collected. Based on the aspect ratio of the edge regions, edge segments that do not meet the elongated structural characteristics are dynamically removed. Specifically: First, based on the candidate edge pixels and their response values (such as gradient magnitude or edge strength) obtained in the previous step, the pixels are classified. Two thresholds, high and low, are set according to the response value magnitude. Pixels with higher response values are classified as strong edge pixels, and pixels with response values in the middle range are classified as weak edge pixels. Adjacent edge pixels are then aggregated through connectivity analysis to construct an initial edge set. Strong edge pixels are used to determine the main structural skeleton, while weak edge pixels are used to supplement connections, maintaining the overall continuity of the edges. Subsequently, region analysis is performed on each connected region in the initial edge set to extract the minimum bounding rectangle or bounding box of each edge region, and... The lengths of the major and minor axes are calculated to obtain the corresponding aspect ratio parameters. Based on the prior characteristic that capillaries have a slender structure, morphological constraints are applied to each edge region. When the aspect ratio of a certain region is greater than a preset threshold (e.g., greater than 3 or 5), the region is determined to conform to the slender blood vessel structure characteristics and is retained. When the aspect ratio is small (close to 1 or below the threshold), the region is considered to be more likely to originate from noise, tissue texture, or false edges, and is thus removed from the edge set. After the screening is completed, the retained edges can be further refined or connected to optimize their continuity and structural consistency, ultimately obtaining an edge feature set that better conforms to the true morphology of blood vessels. Specific examples are as follows: For example, in an enhanced micro-circulation image, a large number of candidate edge pixels are obtained through gradient calculation. Some pixels with high response values (e.g., gradient magnitude greater than 80) are marked as strong edge pixels, while others with medium response values (e.g., between 40 and 80) are marked as weak edge pixels. The system aggregates these pixels into multiple edge regions through connected component analysis, such as forming several thin, elongated curves and some scattered block-like regions. Then, the aspect ratio of each edge region is calculated. For example, if a thin, elongated edge region has a length of 50 pixels and a width of 5 pixels, its length... An aspect ratio of 10 clearly matches the slender structure of blood vessels and is therefore retained. Another blocky region, with a length of 12 pixels and a width of 10 pixels (an aspect ratio of approximately 1.2), is identified as a non-vascular structure and removed. Some short, noisy regions (such as those with a length of 8 pixels and a width of 6 pixels) are also filtered out due to their low aspect ratio. After this screening process, the edges that are ultimately retained mainly exhibit continuous, slender linear structures, which can better reflect the true distribution of capillaries, thus providing a more accurate and stable feature basis for subsequent sharpness evaluation and focus control.
[0029] In this embodiment, step S5, which involves acquiring image data at each focal length position during the focusing scan and establishing a corresponding sharpness curve based on the image data, further includes: S51: Based on the preset focal length position, collect the corresponding sharpness evaluation features from the focal length position, wherein the sharpness evaluation features specifically include the gradient intensity of blood vessel edges, the continuity of blood vessel structure, the high-frequency information energy of the image, and the texture features of the blood vessel region. S52: Determine whether the sharpness evaluation feature meets the preset validity conditions; S53: If so, then based on the effective sharpness data of the sharpness evaluation feature, associate each focal length position with the effective sharpness data to construct a corresponding discrete data point set, and based on the discrete data point set, perform fitting processing on the sharpness value as a function of focal length to generate an initial sharpness change curve.
[0030] In this embodiment, the system acquires corresponding sharpness evaluation features from a pre-set focal length position. These features specifically include the gradient intensity of blood vessel edges, the continuity of blood vessel structures, the high-frequency information energy of the image, and the texture features of the blood vessel region. The system then determines whether these sharpness evaluation features meet pre-set validity conditions to execute corresponding steps. For example, if the system determines that these sharpness evaluation features cannot meet the pre-set validity conditions, the system considers the image data acquired at the current focal length position to lack reliable sharpness representation capabilities. The system marks the data at the current focal length position as invalid samples, stops its participation in sharpness curve construction, and triggers an adaptive optimization mechanism. This includes readjusting image enhancement parameters (improving blood vessel contrast or edge response), optimizing feature extraction algorithm parameters (such as adjusting gradient or texture calculation windows), or re-acquiring image data at that focal length position to improve quality. If multiple adjustments still fail to meet the validity conditions, the system can further skip that focal length position and perform encrypted sampling or expand the scanning range in adjacent focal length regions to re-acquire valid features. For example, if the system determines that these sharpness evaluation features can meet the pre-set validity conditions... Under certain conditions, the system assumes that the image data acquired at the current focal length position has reliable sharpness representation capabilities. Based on the effective sharpness data of these sharpness evaluation features, the system associates each focal length position with the effective sharpness data, constructing a corresponding discrete data point set. Using different discrete data point sets, the system fits the sharpness value to the focal length variation, generating an initial sharpness variation curve. By associating each focal length position with the corresponding effective sharpness data to construct a discrete data point set, the system can clearly reflect the discrete distribution of sharpness variation with focal length. Fitting this data transforms the originally discrete, potentially fluctuating data into a continuous trend, thus establishing a smoother sharpness variation relationship that conforms to actual imaging laws. This improves the interpretability and stability of focus positioning. Simultaneously, by fitting discrete data points to generate the initial sharpness variation curve, the system effectively reduces the impact of local abnormal fluctuations on the overall trend, making the curve more unimodal. This facilitates accurate identification of the focal length position corresponding to maximum sharpness, improving not only the accuracy of optimal focus search but also enhancing the robustness and convergence efficiency of the autofocus process, which is beneficial for achieving fast and stable focus control.
[0031] It should be noted that, based on the effective sharpness data of the aforementioned sharpness evaluation features, each focal length position is associated with the effective sharpness data to construct a corresponding discrete data point set. Based on this discrete data point set, the sharpness value is fitted to the change in focal length to generate an initial sharpness change curve, specifically as follows: First, the sharpness evaluation features that have passed the validity assessment are screened to extract the effective sharpness data corresponding to each focal length position. Each set of data is then assigned a corresponding focal length parameter, establishing a one-to-one mapping relationship between "focal length position and sharpness value." Next, all data meeting the criteria are sorted according to the focal length, constructing a discrete data point set. Each data point consists of a focal length position and a corresponding comprehensive sharpness value. After obtaining the discrete data point set, preprocessing can be performed to address potential local fluctuations or outliers, such as removing outliers or performing simple smoothing, to improve overall data consistency. Based on this, the discrete data points are fitted using methods such as polynomial fitting, curve interpolation, or weighted smoothing to transform the originally discrete sharpness data into a continuously changing function, thus obtaining a trend curve of sharpness changing with focal length. This fitting process not only reduces the impact of single-point noise on the overall trend but also enhances the continuity and unimodal characteristics of the curve, providing a stable basis for the accurate search of the optimal focal position. The final generated initial sharpness change curve can realistically reflect the sharpness change pattern of the imaging system at different focal length positions. Specific examples are as follows: For example, during a single focusing scan, the system calculates the corresponding effective sharpness values at focal lengths of 10, 20, 30, 40, 50, 60, and 70, such as 0.25, 0.38, 0.55, 0.78, 0.92, 0.81, and 0.60. The system first arranges these data in order of focal length, forming a set of discrete data points, such as (10, 0.25), (20, 0.38), (30, 0.55), (40, 0.78), (50, 0.92), (60, 0.81), and (70, 0.60). (0.60); Subsequently, if abnormal fluctuations are found in individual points (such as a point that deviates significantly from the overall trend), appropriate smoothing can be performed; on this basis, through quadratic or cubic polynomial fitting, these discrete points are connected into a continuous curve, so that the sharpness gradually increases from low to high, reaches a peak near a focal length of 50, and then gradually decreases; the final generated initial sharpness change curve shows a clear single-peak shape, which not only clearly reflects the relationship between focal length change and sharpness, but also provides an intuitive and stable data foundation for accurately locating the best focus position in the future.
[0032] In this embodiment, step S2, which determines whether the vascular image sequence contains preset vascular features, further includes: S21: Based on the vascular structure pre-detected by the microcirculation detector, obtain the structural information of the vascular structure; S22: Determine whether the structural information meets the preset morphological constraints; S23: If so, identify the vascular images in which the vascular structure is continuously distributed in at least two regions, detect the discrete state of the vascular images, and dynamically divide the vascular images into valid vascular images and invalid vascular images according to the discrete state, wherein the discrete state specifically includes local existence and discrete distribution.
[0033] In this embodiment, the system acquires the structural information of blood vessels based on the pre-detected vascular structures by the microcirculation detector. The system then determines whether this structural information meets pre-set morphological constraints to execute corresponding steps. For example, if the system determines that the structural information of these blood vessels does not meet the pre-set morphological constraints, the system considers the blood vessel structure in the currently acquired image to be abnormal or not conforming to the physiological characteristics of capillaries. The system will then classify the current blood vessel structure as invalid, stop its use in subsequent processing, and trigger an adaptive optimization mechanism. For example, it may adjust image enhancement or blood vessel enhancement filter parameters to improve the visibility of blood vessel structures, or control the microcirculation detector to re-acquire image data. If necessary, it may also fine-tune the focal length or expand the scanning range to obtain blood vessel structure information that meets the morphological constraints. Conversely, if the system determines that the structural information of these blood vessels meets the pre-set morphological constraints, the system considers the blood vessel structure in the currently acquired image to conform to the physiological characteristics of capillaries. The system will then identify these blood vessel structures in at least two regions. The system analyzes continuously distributed vascular images and detects their discrete states, including local presence and discrete distribution. Based on these discrete states, it dynamically classifies the vascular images into valid and invalid vascular images. By detecting these discrete states, the system can further distinguish between the continuity and integrity of blood vessels. Continuous and uniformly distributed vascular regions are identified as valid vascular images, while broken or scattered regions are identified as invalid. This effectively eliminates false blood vessels or noise interference under complex backgrounds or image jitter conditions, ensuring that only vascular structures with real physiological significance are retained during the analysis process, thus improving feature extraction accuracy. Furthermore, by dynamically classifying valid and invalid vascular images, the system ensures that subsequent clarity evaluation indicators based on vascular features depend only on valid vascular regions, thereby generating a more stable and unimodal clarity curve. This not only improves the accuracy of optimal focus determination during autofocus but also enhances the robustness of microcirculation imaging under different individuals or acquisition conditions, ultimately improving overall imaging quality and the reliability of vascular analysis.
[0034] It should be noted that the process involves identifying vascular images where the vascular structures are continuously distributed across at least two regions, detecting the discrete state of the vascular images, and dynamically classifying the vascular images into valid and invalid vascular images based on the discrete state. Specifically: The system first divides the image into regions based on the extracted vascular structure information, dividing the entire vascular image into several spatially continuous sub-regions to analyze the distribution of blood vessels in different regions. Then, within each region, the system identifies whether the vascular structure is continuously distributed, determining whether the blood vessels exhibit continuous vascular distribution characteristics in at least two regions. This avoids misclassifying locally occurring blood vessels or noise as valid blood vessels. Next, the system calculates discrete state indices for each vascular image, including local presence (whether the blood vessel exists in a small region) and distribution discreteness (whether the blood vessel is broken or scattered), comprehensively evaluating the continuity and integrity of the blood vessels in the entire image. Based on the discrete state analysis results, the system dynamically divides the vascular image into valid and invalid vascular images: valid vascular images are those that present a spatially continuous and reasonably distributed vascular structure, suitable for subsequent sharpness evaluation and autofocus; invalid vascular images are those with overly scattered blood vessel distribution, local breaks, or images that are difficult to distinguish from background noise, and will be discarded to avoid interfering with subsequent analysis. This division process can be verified using multi-frame information to ensure stability and robustness. Specific examples are as follows: For example, in sublingual microcirculation imaging, a vascular image is divided into upper and lower regions, each containing multiple pixel grids. The system detects that the upper region's blood vessels extend continuously for approximately 40 pixels, and the lower region's blood vessels extend continuously for approximately 35 pixels. The blood vessels in both regions have similar morphologies and consistent orientations, satisfying the condition of continuous distribution in at least two regions. Simultaneously, by analyzing the local pixel distribution, the system identifies a small number of isolated, short vascular fragments in the image. These fragments are less than 10 pixels long, have random orientations, and are in a discrete distribution state. Based on the discrete state analysis, the system classifies the continuous blood vessels in the upper and lower regions as valid vascular images, while the isolated short fragments are classified as invalid and discarded. Ultimately, the retained valid vascular images exhibit continuous, slender vascular structures, providing a reliable vascular basis for subsequent sharpness evaluation and autofocus, while reducing the interference of background noise and false blood vessels on the analysis results.
[0035] In this embodiment, step S4, which determines whether the blood vessel edge features can construct a preset clarity evaluation index, further includes: S41: Based on the edge basic parameters of the blood vessel edge features, identify the length distribution information of the edge connected region, wherein the edge basic parameters specifically include the number of edge pixels, the average gradient intensity, and the edge distribution density; S42: Determine whether the length distribution information has continuous blood vessel characteristics; S43: If so, perform spatial distribution analysis on the blood vessel edge features to obtain the distribution information of different edges in the image. Based on the distribution information, dynamically classify the structural representativeness of the blood vessel edge features. Specifically, the distribution information includes edges that are evenly distributed and cover multiple regions, and edges that are concentrated in local regions and sparsely distributed.
[0036] In this embodiment, the system identifies the length distribution information of the edge connected region based on the edge basic parameters of the blood vessel edge features. These parameters specifically include the number of edge pixels, average gradient intensity, and edge distribution density. The system then determines whether this length distribution information possesses continuous blood vessel features to execute corresponding steps. For example, if the system determines that the length distribution information of the edge connected region does not possess continuous blood vessel features, the system considers the blood vessel edge extraction result in the current image to be discontinuous or broken. The system will then classify the current edge connected region as an invalid region, stopping its participation in subsequent blood vessel feature analysis and sharpness calculation. Simultaneously, an adaptive optimization mechanism is triggered, such as enhancing image contrast or edge response, adjusting multi-scale blood vessel enhancement filter parameters to improve edge continuity, or re-acquiring image data to obtain a clearer blood vessel structure, and fine-tuning the focal length or expanding the scanning range to increase the probability of obtaining continuous blood vessel edges. Conversely, if the system determines that the length distribution information of the edge connected region possesses continuous blood vessel features, the system will consider that the blood vessel edge extraction result in the current image may possess discontinuities or breaks. The system will then perform spatial distribution analysis on the blood vessel edge features to obtain the distribution of different edges in the image. The information, specifically the distribution information, includes whether the edges are evenly distributed and cover multiple regions or concentrated in local areas with sparse distribution. Based on this distribution information, the system dynamically classifies the structural representativeness of vascular edge features. After determining that the vascular features are continuous by analyzing the length distribution information of the edge connected regions, the system further performs spatial distribution analysis on the vascular edges. This clarifies the area range and distribution status of the blood vessels in the image, distinguishing whether the edges are evenly distributed and cover multiple regions or concentrated in local areas. This allows for accurate assessment of the spatial representativeness of vascular edges, avoiding bias in the overall analysis results caused by concentrated local vascular areas. Simultaneously, by utilizing the edge distribution information, the system can dynamically classify the structural representativeness of vascular edge features. Edges that are evenly distributed and cover multiple regions are classified as highly representative features, while edges that are concentrated in local areas and sparsely distributed are classified as low-representative features. This effectively eliminates false blood vessels or local edges caused by random noise, improving the ability of the extracted edge features to reflect the real vascular structure. Furthermore, by retaining vascular edge features with high structural representativeness, the system can use more stable and reliable edge information in subsequent sharpness evaluation and autofocus processes, thereby constructing a sharpness curve with stronger unimodality and improving the accuracy of optimal focus determination.
[0037] It should be noted that spatial distribution analysis is performed on the blood vessel edge features to obtain the distribution information of different edges in the image. Based on the distribution information, the structural representativeness of the blood vessel edge features is dynamically divided, specifically as follows: The system first performs spatial distribution analysis on the features of blood vessel edges to more accurately assess the spatial structure and continuity of blood vessels in the image. Specifically, the system divides the image into several regular grids or adaptive sub-regions, the size of which can be preset according to the image resolution and blood vessel scale. For each sub-region, the system counts the number of edge pixels, edge length, edge pixel connectivity, and edge density in that region. Through these statistics, the distribution of edges in each region can be quantified, including which regions have dense and continuous edge distribution, and which regions have sparse or broken edges. In addition, the system can also analyze the directional distribution and extension direction consistency of the edges to determine the spatial continuity and integrity of the edges. Based on the above statistical information, the system dynamically classifies the vascular edge features into different structural representativeness categories. Specifically, if the edges of a region are continuous, uniformly distributed, cover multiple adjacent regions, and the edge length and density reach a preset threshold, then the region and its edge pixels are marked as highly structurally representative. Conversely, if the edges appear only sporadically in a region, are short in length, discontinuous in direction, or have low density, they are marked as low structurally representative and can be excluded or have their weight reduced in subsequent analysis. This classification not only considers the number of edge pixels but also combines spatial distribution, continuity, and directional consistency, so that the edge features ultimately retained can more accurately reflect the true spatial structure of capillaries, providing a stable and reliable feature basis for subsequent clarity evaluation, autofocus, and microcirculation analysis. Specific examples are as follows: For example, in a sublingual microcirculation imaging study, the system acquired vascular images that were divided into a 4×4 grid, with each grid measuring 50×50 pixels. Statistical analysis revealed that continuous blood vessels in the upper half of the image had edge pixels in the upper left, middle left, and upper right grids, with an average edge length of 45 pixels, an edge density of 85%, and high directional consistency. In contrast, the vascular edges in the lower half of the image only appeared sporadically in the lower right and lower left grids, with an average length of only 10 pixels, a density of less than 25%, and a chaotic orientation. Based on this distribution information, the system classifies the continuous and uniform vessel edges in the upper half as having high structural representativeness and retains them for sharpness evaluation and autofocus calculation; while the scattered and sparse vessel edges in the lower half are marked as having low structural representativeness and are excluded in subsequent analysis. In this way, the system can focus on continuous and uniformly distributed vessel regions, reduce interference from local noise and false vessels, thereby generating a more stable and more unimodal sharpness curve, improving the accuracy of autofocus and the overall quality of microcirculation imaging.
[0038] In this embodiment, step S1, which involves acquiring several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and constructing a corresponding vascular image sequence based on the microcirculation images, further includes: S11: Based on the image acquisition of the focal position by the microcirculation detector, obtain the corresponding multi-frame image data; S12: Determine whether the multi-frame image data detects a preset blur feature; S13: If not, then the multiple frames of images at the same focal length position are filtered to generate a reference image at the focal length position. According to the preset focal length size rule, the reference images corresponding to each focal length position are sorted to construct the blood vessel image sequence. The filtering process specifically includes multi-frame averaging, clear frame filtering, and key frame extraction.
[0039] In this embodiment, the system acquires multi-frame image data based on the micro-circulation detector at the focal length position. The system then determines whether these multi-frame image data detects pre-defined blur features, and executes corresponding steps accordingly. For example, if the system determines that these multi-frame image data can detect pre-defined blur features, the system considers the imaging state at the current focal length position to be below optimal focus, and there may be significant defocusing in the image. The system will mark the current multi-frame image data as low-resolution or out-of-focus data, stopping its direct participation in the final focus determination. Simultaneously, the system determines an adjustment strategy for the current focal length position based on the degree of blur. For example, when the blur level is high, the focusing drive component is controlled to move a large step along the optical axis to quickly approach the sharp area; when the blur level is low, small step fine adjustments are used to gradually approach the optimal focus position. Conversely, if the system determines that these multi-frame image data do not detect pre-defined blur features, the system considers the imaging state at the current focal length position to be in optimal focus. In this process, the system filters multiple frames of images at the same focal length position. This filtering process includes multi-frame averaging, clear frame selection, and keyframe extraction to generate reference images for each focal length position. Based on a pre-defined focal length rule, the reference images corresponding to each focal length position are sorted to construct a vascular image sequence. By uniformly filtering and generating reference images for each focal length position and sorting them according to a pre-defined focal length rule, the system establishes a standardized "focal length-image" mapping relationship. This ensures consistency in image data quality and representation across different focal length positions, accurately reflecting the impact of focal length changes on image sharpness and improving the reliability of subsequent sharpness curve construction. Furthermore, by constructing an ordered vascular image sequence, the system can obtain stable and high-quality image data support during continuous focal length changes, making subsequent vascular feature extraction, sharpness evaluation, and optimal focus positioning more accurate. It also reduces noise and abnormal frames from interfering with the overall sequence, improving the robustness and accuracy of the autofocus process, thereby enhancing the overall quality of microcirculation imaging.
[0040] It should be noted that multiple frames of images at the same focal length position are filtered to generate reference images at that focal length position. Based on a preset focal length size rule, the reference images corresponding to each focal length position are sorted to construct the blood vessel image sequence. Specifically: The system first filters multiple consecutively acquired images at the same focal length position to eliminate the impact of random noise, instantaneous jitter, and local illumination fluctuations on image quality. Specifically, the system performs preprocessing on multiple images (such as grayscale normalization and mild denoising), followed by multi-frame averaging to improve the signal-to-noise ratio. Simultaneously, it scores each image using sharpness evaluation metrics (such as edge gradient strength and high-frequency energy), selecting several frames with higher sharpness. Based on this, a reference image for that focal length position can be generated using keyframe extraction strategies (e.g., selecting the frame with the highest sharpness score or the most stable structure). This ensures that the reference image possesses both high-resolution detail and good stability and representativeness. After generating reference images for each focal length position, the system sorts all reference images according to a pre-defined focal length order (such as optical axis order from near to far or from far to near) and establishes a one-to-one correspondence between focal length positions and reference images. During the sorting process, consistency checks can be performed by incorporating focal length step information or sharpness change trends to ensure that the sequence is physically continuous and ordered. Finally, the system constructs a vascular image sequence from the sorted reference images. This sequence reflects the sharpness change process of vascular structures at different focal length positions, providing a stable and reliable data foundation for subsequent sharpness curve fitting, optimal focus positioning, and automatic focus control. Specific examples are as follows: For example, the system acquires 5 frames of images at three different focal length positions, F1, F2, and F3. At position F1, one frame is blurred due to slight shaking, while the other four frames are relatively clear. The system selects three frames based on their clarity score and performs a weighted average to generate reference image R1. At position F2, the edges of the blood vessels are the clearest, and the system directly selects the frame with the highest clarity as the keyframe to generate reference image R2. At position F3, the image is slightly blurred overall due to its proximity to the out-of-focus area. The system generates reference image R3 by averaging multiple frames to enhance details. Subsequently, the system sorts the reference images R1, R2, and R3 according to the focal length (e.g., from near to far: F1→F2→F3) to construct a blood vessel image sequence [R1,R2,R3]. In this sequence, the image corresponding to R2 has the highest sharpness and the most obvious blood vessel edges, while R1 and R3 are located on both sides of the focal point, with sharpness gradually decreasing. Through this ordered sequence, the system can intuitively reflect the trend of sharpness changing with focal length, thus providing a reliable basis for determining the optimal focal position, while reducing the impact of noisy frames and abnormal frames on the overall analysis and improving the accuracy and stability of autofocus.
[0041] Reference Appendix Figure 2 This invention provides a micro-circulation image acquisition and control system based on autofocus logic, comprising: The construction module 10 is used to acquire several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and to construct a corresponding blood vessel image sequence based on the microcirculation images. The judgment module 20 is used to determine whether the blood vessel image sequence has preset blood vessel characteristics, wherein the blood vessel characteristics are specifically small capillary structures with low contrast. The execution module 30 is used to activate a preset multi-scale vascular enhancement filter if the condition is met, extract the slender structure of capillaries from the vascular image sequence, perform contrast stretching on the capillaries, identify the grayscale difference between the vascular edge and the background, and detect the vascular edge features of the vascular image sequence based on the grayscale difference. The second judgment module 40 is used to determine whether the blood vessel edge features can construct a preset clarity evaluation index; The second execution module 50 is used to, if possible, acquire image data at each focal length position during the focusing scan based on the index type of the sharpness evaluation index, establish a corresponding sharpness curve based on the image data, take the position with the highest sharpness in the sharpness curve as the optimal focus position, and dynamically adjust the focusing drive component of the microcirculation detector based on the optimal focus position. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high-frequency information energy index.
[0042] In this embodiment, the construction module 10 acquires several frames of microcirculation images at a pre-set focal length position based on the pre-set Guangzhou direction of the microcirculation detector. Based on these microcirculation images, a corresponding vascular image sequence is constructed. Then, the judgment module 20 determines whether these vascular image sequences contain pre-defined vascular features, and executes corresponding steps accordingly. For example, if the system determines that the vascular image sequence does not contain pre-defined vascular features, the system considers the currently acquired image to not effectively reflect the microcirculation capillary structure. The system will then classify the current vascular image sequence as invalid data, stop the focusing calculation based on the sequence, and simultaneously control the focusing drive component to adjust along the optical axis. The system moves to a new focal length position and reacquires microcirculation images. During the reacquisition process, the focal length step size can be adaptively adjusted or the scanning range expanded to increase the probability of detecting vascular structures. For example, when the system determines that there are pre-defined vascular features in the vascular image sequence, the execution module 30 will consider that the currently acquired image can effectively reflect the microcirculation capillary structure. The system will activate the pre-defined multi-scale vascular enhancement filter, extract the slender structure information of capillaries from the vascular image sequence, perform contrast stretching on the capillaries, identify the gray-level difference between the vascular edge and the background, and detect the vascular edge features of the vascular image sequence based on different gray-level differences. The second judgment module 40 determines whether these vascular edge features can construct a pre-set sharpness evaluation index, and executes the corresponding steps accordingly. For example, when the system determines that these vascular edge features cannot construct a pre-set sharpness evaluation index, the system will consider that the quality of the currently extracted edge information is insufficient or lacks stable representation ability. The system will stop the sharpness calculation process based on this feature and trigger an adaptive adjustment mechanism, such as re-executing the vascular enhancement and edge extraction steps, adjusting multi-scale filtering parameters or contrast enhancement intensity to improve the quality of edge features, and simultaneously controlling the imaging component to re-acquire image data or fine-tune the focal length position to obtain a clearer and more stable vascular structure. When the system determines that these vascular edge features can construct a pre-set clarity evaluation index, the second execution module 50 will consider that the currently extracted edge information has stable representation capabilities. The system will acquire image data at each focal length position during the focusing scan based on the index type of the clarity evaluation index, which specifically includes vascular edge gradient intensity index, vascular boundary continuity index, vascular region texture energy index, and high-frequency information energy index. According to different image data, corresponding clarity curves are established, and the position with the highest clarity in these clarity curves is taken as the optimal focus position. Based on the optimal focus position, the focusing drive component of the microcirculation detector is dynamically adjusted.
[0043] In this embodiment, it also includes: The acquisition module is used to acquire the change value of the degree of change of blood vessel structure between consecutive frames based on the pre-identified blood vessel feature parameters in the capillaries. The blood vessel feature parameters specifically include blood vessel length, blood vessel density, blood vessel edge gradient and blood vessel continuity index. The third judgment module is used to determine whether the change value is less than a preset stable threshold. The third execution module is used to calculate the main direction distribution of the vascular structure if not, dynamically divide the real vascular structure and background texture in the vascular image sequence according to the main direction distribution, generate the clarity of each region of the vascular image sequence, and obtain the out-of-focus region of the vascular image sequence based on the clarity of each region.
[0044] In this embodiment, the system collects the variation values of the degree of vascular structural changes between consecutive frames based on pre-identified vascular feature parameters in capillaries. These parameters specifically include vessel length, vessel density, vessel edge gradient, and vessel continuity indicators. The system then determines whether these variation values are less than a pre-set stability threshold to execute corresponding steps. For example, if the system determines that the variation value of the degree of vascular structural changes between consecutive frames is indeed less than the pre-set stability threshold, the system considers the currently acquired microcirculation image to have good stability in the time dimension. The system then classifies the current vascular image sequence as stable and valid data and further executes subsequent processing steps based on this stable sequence, such as directly utilizing the vascular feature parameters. The construction of sharpness evaluation metrics can be used for the calculation and optimization of sharpness curves. At the same time, in order to improve processing efficiency and reduce the repeated calculation of redundant frames, stable frames are screened or fused (such as selecting representative frames or averaging multiple frames), thereby reducing computational complexity. For example, when the system determines that the change in the degree of vascular structure change between consecutive frames is not less than the preset stability threshold, the system will consider that the currently acquired microcirculation image is not stable in the time dimension. The system will calculate the main direction distribution of vascular structure, dynamically divide the real vascular structure and background texture in the vascular image sequence according to different main direction distributions, generate the sharpness of each region of the vascular image sequence, and obtain the out-of-focus areas of the vascular image sequence based on the different sharpness of each region.
[0045] In this embodiment, the execution module further includes: An extraction unit is used to generate image gradient parameters of the blood vessel image sequence based on the distribution information of the gray-level differences, and extract corresponding candidate edge pixels from the image gradient parameters, wherein the image gradient parameters specifically include gradient magnitude and gradient direction; The judgment unit is used to determine whether the candidate edge pixels can reach a preset pixel threshold. An execution unit is configured to, if possible, construct a corresponding initial edge set based on the response values of the candidate edge pixels, collect the aspect ratio of the edge regions of the initial edge set, and dynamically remove edge segments that do not meet the elongated structural characteristics based on the aspect ratio of the edge regions. Specifically, the initial edge set includes strong edge pixels and weak edge pixels.
[0046] In this embodiment, the system generates image gradient parameters for the blood vessel image sequence based on the distribution information of grayscale differences. These gradient parameters specifically include gradient magnitude and gradient direction. Corresponding candidate edge pixels are extracted from these gradient parameters. The system then determines whether these candidate edge pixels can reach a pre-set pixel threshold to execute corresponding steps. For example, if the system determines that these candidate edge pixels cannot reach the pre-set pixel threshold, it considers the grayscale differences in the current image insufficient to form a stable and continuous blood vessel edge structure. The system then deems the current edge detection result invalid and stops subsequent sharpness evaluation processing based on this result. Simultaneously, it triggers an adaptive optimization mechanism, such as enhancing grayscale. Contrast ratio (e.g., increasing contrast stretching intensity or using adaptive histogram equalization), adjusting multi-scale vascular enhancement filter parameters to improve the response of small blood vessels, or appropriately reducing the gradient threshold to re-extract candidate edge pixels; for example, when the system determines that these candidate edge pixels can reach a preset pixel threshold, the system will consider that the gray-level differences in the current image can form a stable and continuous vascular edge structure. The system will construct a corresponding initial edge set based on the response values of these candidate edge pixels. The initial edge set specifically includes strong edge pixels and weak edge pixels. The aspect ratio of the edge region of the initial edge set is collected, and edge segments that do not meet the characteristics of a slender structure are dynamically removed according to different aspect ratios of the edge regions.
[0047] In this embodiment, the second execution module further includes: The acquisition unit is used to acquire corresponding sharpness evaluation features from the preset focal length position, wherein the sharpness evaluation features specifically include the gradient intensity of blood vessel edges, the continuity of blood vessel structure, the high-frequency information energy of the image, and the texture features of the blood vessel region. The second judgment unit is used to determine whether the sharpness evaluation feature meets the preset validity conditions; The second execution unit is configured to, if so, associate each focal length position with the effective sharpness data of the sharpness evaluation feature to construct a corresponding discrete data point set, and perform fitting processing on the sharpness value as a function of focal length based on the discrete data point set to generate an initial sharpness change curve.
[0048] In this embodiment, the system collects corresponding sharpness evaluation features from a pre-set focal length position. These features specifically include the gradient intensity of blood vessel edges, the continuity of blood vessel structures, the high-frequency information energy of the image, and the texture features of the blood vessel region. The system then determines whether these sharpness evaluation features meet pre-set validity conditions to execute corresponding steps. For example, if the system determines that these sharpness evaluation features do not meet the pre-set validity conditions, it considers the image data acquired at the current focal length position to lack reliable sharpness representation capabilities. The system marks the data at the current focal length position as invalid samples, stops its participation in sharpness curve construction, and triggers an adaptive optimization mechanism, such as readjusting image enhancement parameters (improving blood vessel contrast or edge response) and optimizing... Feature extraction algorithm parameters (such as adjusting gradient or texture calculation window), or re-acquiring image data at the focal length position to improve quality. If multiple adjustments still fail to meet the validity conditions, the focal length position can be skipped further, and adjacent focal length regions can be sampled more densely or the scanning range expanded to re-acquire valid features. For example, when the system determines that these sharpness evaluation features can meet the pre-set validity conditions, the system will consider that the image data acquired at the current focal length position has reliable sharpness representation capabilities. The system will associate each focal length position with the valid sharpness data based on the valid sharpness data of these sharpness evaluation features, construct corresponding discrete data point sets, and perform fitting processing on the sharpness value as a function of focal length based on different discrete data point sets to generate an initial sharpness change curve.
[0049] In this embodiment, the determination module further includes: The acquisition unit is used to acquire structural information of the vascular structure based on the vascular structure pre-detected by the microcirculation detector; The third judgment unit is used to determine whether the structural information meets the preset morphological constraint conditions; The third execution unit is configured to, if so, identify blood vessel images in which the blood vessel structure is continuously distributed in at least two regions, detect the discrete state of the blood vessel images, and dynamically divide the blood vessel images into valid blood vessel images and invalid blood vessel images based on the discrete state, wherein the discrete state specifically includes local existence and discrete distribution.
[0050] In this embodiment, the system acquires the structural information of blood vessels based on the pre-detected vascular structures by the microcirculation detector. The system then determines whether this structural information meets pre-set morphological constraints to execute corresponding steps. For example, if the system determines that the structural information of these blood vessels does not meet the pre-set morphological constraints, the system considers the blood vessel structure in the currently acquired image to be abnormal or not conforming to the physiological characteristics of capillaries. The system will then classify the current blood vessel structure as invalid, stop its use in subsequent processing, and trigger an adaptive optimization mechanism. For example, it may adjust image enhancement or blood vessel enhancement filter parameters to improve the visibility of blood vessel structures, or control the microcirculation detector to re-acquire image data. If necessary, it may also fine-tune the focal length or expand the scanning range to obtain blood vessel structure information that meets the morphological constraints. Conversely, if the system determines that the structural information of these blood vessels meets the pre-set morphological constraints, the system considers the blood vessel structure in the currently acquired image to conform to the physiological characteristics of capillaries. The system will then identify these blood vessel structures in at least two regions. The system analyzes continuously distributed vascular images and detects their discrete states, including local presence and discrete distribution. Based on these discrete states, it dynamically classifies the vascular images into valid and invalid vascular images. By detecting these discrete states, the system can further distinguish between the continuity and integrity of blood vessels. Continuous and uniformly distributed vascular regions are identified as valid vascular images, while broken or scattered regions are identified as invalid. This effectively eliminates false blood vessels or noise interference under complex backgrounds or image jitter conditions, ensuring that only vascular structures with real physiological significance are retained during the analysis process, thus improving feature extraction accuracy. Furthermore, by dynamically classifying valid and invalid vascular images, the system ensures that subsequent clarity evaluation indicators based on vascular features depend only on valid vascular regions, thereby generating a more stable and unimodal clarity curve. This not only improves the accuracy of optimal focus determination during autofocus but also enhances the robustness of microcirculation imaging under different individuals or acquisition conditions, ultimately improving overall imaging quality and the reliability of vascular analysis.
[0051] In this embodiment, the second determination module further includes: The recognition unit is used to identify the length distribution information of the edge connected region based on the edge basic parameters of the blood vessel edge features, wherein the edge basic parameters specifically include the number of edge pixels, the average gradient intensity, and the edge distribution density; The fourth judgment unit is used to determine whether the length distribution information has continuous blood vessel characteristics; The fourth execution unit is configured to perform spatial distribution analysis on the blood vessel edge features if the condition is met, obtain the distribution information of different edges in the image, and dynamically classify the structural representativeness of the blood vessel edge features based on the distribution information. Specifically, the distribution information includes edges that are evenly distributed and cover multiple regions, and edges that are concentrated in local regions and sparsely distributed.
[0052] In this embodiment, the system identifies the length distribution information of the edge connected region based on the edge basic parameters of the blood vessel edge features. These parameters specifically include the number of edge pixels, average gradient intensity, and edge distribution density. The system then determines whether this length distribution information possesses continuous blood vessel features to execute corresponding steps. For example, if the system determines that the length distribution information of the edge connected region does not possess continuous blood vessel features, the system considers the blood vessel edge extraction result in the current image to be discontinuous or broken. The system will then classify the current edge connected region as an invalid region, stop its participation in subsequent blood vessel feature analysis and sharpness calculation, and trigger an adaptive optimization mechanism, such as enhancing image contrast or edge response. To improve edge continuity, the system may adjust multi-scale vascular enhancement filtering parameters or re-acquire image data to obtain clearer vascular structures. Furthermore, it may fine-tune the focal length or expand the scanning range to increase the probability of obtaining continuous vascular edges. For example, if the system determines that the length distribution information of the edge-connected region has continuous vascular features, it may consider that the vascular edge extraction results in the current image may have discontinuities or breaks. The system will then perform spatial distribution analysis on the vascular edge features to obtain the distribution information of different edges in the image. Specifically, the distribution information includes edges that are evenly distributed and cover multiple regions, and edges that are concentrated in local regions and sparsely distributed. Based on this distribution information, the system dynamically classifies the structural representativeness of the vascular edge features.
[0053] In this embodiment, the construction module further includes: The second acquisition unit is used to acquire corresponding multi-frame image data based on the image acquisition of the focal position by the microcirculation detector. The fifth judgment unit is used to determine whether the multi-frame image data detects a preset blur feature; The fifth execution unit is used to, if not, perform filtering processing on multiple frames of images at the same focal length position to generate a reference image at the focal length position, and sort the reference images corresponding to each focal length position according to a preset focal length size rule to construct the blood vessel image sequence. The filtering processing specifically includes multi-frame averaging processing, clear frame filtering, and key frame extraction.
[0054] In this embodiment, the system acquires multi-frame image data based on the image acquisition of the focal position using a micro-circulation detector. The system then determines whether these multi-frame image data detects pre-defined blur features, and executes corresponding steps accordingly. For example, if the system determines that these multi-frame image data can detect pre-defined blur features, the system considers that the imaging state at the current focal position has not reached the optimal focus state, and there may be obvious defocusing in the image. The system will mark the current multi-frame image data as low-resolution or out-of-focus data, stopping its direct participation in the final focus determination. Simultaneously, the system will determine an adjustment strategy for the current focal position based on the degree of blur features. For example, when the blur degree is high... At the same time, the focusing drive component is controlled to move in large steps along the optical axis to quickly approach the clear area. When the blur is slight, small steps are used for fine adjustment to gradually approach the optimal focus position. For example, when the system determines that no pre-set blur features are detected in these multi-frame image data, the system will consider the imaging state at the current focal length position to be the optimal focus state. The system will then perform screening processing on the multi-frame images at the same focal length position. The screening processing specifically includes multi-frame averaging, clear frame screening, and key frame extraction to generate reference images for the focal length position. According to the pre-set focal length size rules, the reference images corresponding to each focal length position are sorted to construct a blood vessel image sequence.
[0055] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A micro-loop image acquisition control method based on autofocus logic, characterized in that, Includes the following steps: Based on the preset optical axis direction of the microcirculation detector, several frames of microcirculation images are acquired at a preset focal length position, and a corresponding blood vessel image sequence is constructed based on the microcirculation images. Determine whether the vascular image sequence has preset vascular features, wherein the vascular features are specifically small capillary structures with low contrast; If so, then activate the preset multi-scale vascular enhancement filter, extract the slender structure of capillaries from the vascular image sequence, perform contrast stretching on the capillaries, identify the grayscale difference between the vascular edge and the background, and detect the vascular edge features of the vascular image sequence based on the grayscale difference. Determine whether the blood vessel edge features can be used to construct a preset clarity evaluation index; If possible, based on the index type of the clarity evaluation index, image data at each focal length position during the focusing scan is obtained. According to the image data, a corresponding clarity curve is established, and the position with the highest clarity in the clarity curve is taken as the optimal focus position. Based on the optimal focus position, the focusing drive component of the microcirculation detector is dynamically adjusted. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high-frequency information energy index.
2. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, After activating the preset multi-scale vascular enhancement filter and extracting the elongated capillary structure from the vascular image sequence, the method further includes: Based on the pre-identified vascular feature parameters in the capillaries, the change values of the degree of vascular structure change between consecutive frames are collected. The vascular feature parameters specifically include vascular length, vascular density, vascular edge gradient and vascular continuity index. Determine whether the change value is less than a preset stability threshold; If not, the principal direction distribution of the vascular structure is calculated. Based on the principal direction distribution, the real vascular structure and background texture in the vascular image sequence are dynamically divided to generate the clarity of each region of the vascular image sequence. Based on the clarity of each region, the out-of-focus region of the vascular image sequence is obtained.
3. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, The step of identifying the grayscale difference between the blood vessel edge and the background, and detecting the blood vessel edge features of the blood vessel image sequence based on the grayscale difference, further includes: Based on the distribution information of the gray-level differences, image gradient parameters of the blood vessel image sequence are generated, and corresponding candidate edge pixels are extracted from the image gradient parameters. Specifically, the image gradient parameters include gradient magnitude and gradient direction. Determine whether the candidate edge pixels can reach a preset pixel threshold; If possible, an initial edge set is constructed based on the response values of the candidate edge pixels, the aspect ratio of the edge regions of the initial edge set is collected, and edge segments that do not meet the elongated structural features are dynamically removed based on the aspect ratio of the edge regions. Specifically, the initial edge set includes strong edge pixels and weak edge pixels.
4. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, The step of acquiring image data at each focal length position during the focusing scan and establishing a corresponding sharpness curve based on the image data further includes: Based on a preset focal length position, corresponding sharpness evaluation features are collected from the focal length position. Specifically, the sharpness evaluation features include the gradient intensity of blood vessel edges, the continuity of blood vessel structure, the high-frequency information energy of the image, and the texture features of the blood vessel region. Determine whether the sharpness evaluation features meet the preset validity conditions; If so, then based on the effective sharpness data of the sharpness evaluation features, each focal length position is associated with the effective sharpness data to construct a corresponding discrete data point set. Based on the discrete data point set, the sharpness value is fitted to the change of focal length to generate an initial sharpness change curve.
5. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, The step of determining whether the vascular image sequence contains preset vascular features further includes: Based on the vascular structure pre-detected by the microcirculation detector, structural information of the vascular structure is obtained; Determine whether the structural information meets the preset morphological constraints; If so, then identify blood vessel images in which the blood vessel structure is continuously distributed in at least two regions, detect the discrete state of the blood vessel images, and dynamically divide the blood vessel images into valid blood vessel images and invalid blood vessel images according to the discrete state, wherein the discrete state specifically includes local existence and discrete distribution.
6. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, The step of determining whether the blood vessel edge features can construct a preset clarity evaluation index further includes: Based on the edge fundamental parameters of the blood vessel edge features, the length distribution information of the edge connected region is identified, wherein the edge fundamental parameters specifically include the number of edge pixels, the average gradient intensity, and the edge distribution density; Determine whether the length distribution information has continuous blood vessel characteristics; If so, spatial distribution analysis is performed on the blood vessel edge features to obtain the distribution information of different edges in the image. Based on the distribution information, the structural representativeness of the blood vessel edge features is dynamically divided. Specifically, the distribution information includes edges that are evenly distributed and cover multiple regions, and edges that are concentrated in local regions and sparsely distributed.
7. The micro-circulation image acquisition control method based on autofocus logic according to claim 1, characterized in that, The step of acquiring several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and constructing a corresponding vascular image sequence based on the microcirculation images, further includes: Based on the image acquisition at the focal length position by the microcirculation detector, corresponding multi-frame image data is obtained; Determine whether the multi-frame image data detects a preset blur feature; If not, multiple frames of images at the same focal length position are filtered to generate a reference image at the focal length position. According to the preset focal length size rule, the reference images corresponding to each focal length position are sorted to construct the blood vessel image sequence. The filtering process specifically includes multi-frame averaging, clear frame filtering, and key frame extraction.
8. A micro-circulation image acquisition and control system based on autofocus logic, characterized in that, include: The construction module is used to acquire several frames of microcirculation images at a preset focal length position based on the preset optical axis direction of the microcirculation detector, and to construct a corresponding blood vessel image sequence based on the microcirculation images; The judgment module is used to determine whether the vascular image sequence has preset vascular features, wherein the vascular features are specifically small capillary structures with low contrast. The execution module is used to activate a preset multi-scale vascular enhancement filter if the condition is met, extract the slender structure of capillaries from the vascular image sequence, perform contrast stretching on the capillaries, identify the grayscale difference between the vascular edge and the background, and detect the vascular edge features of the vascular image sequence based on the grayscale difference. The second judgment module is used to determine whether the blood vessel edge features can construct a preset clarity evaluation index; The second execution module is used to, if possible, acquire image data at each focal length position during the focusing scan based on the index type of the sharpness evaluation index, establish a corresponding sharpness curve based on the image data, take the position with the highest sharpness in the sharpness curve as the optimal focus position, and dynamically adjust the focusing drive component of the microcirculation detector based on the optimal focus position. The index type specifically includes the blood vessel edge gradient intensity index, blood vessel boundary continuity index, blood vessel region texture energy index, and high-frequency information energy index.
9. The micro-circulation image acquisition and control system based on autofocus logic according to claim 8, characterized in that, Also includes: The acquisition module is used to acquire the change value of the degree of change of blood vessel structure between consecutive frames based on the pre-identified blood vessel feature parameters in the capillaries. The blood vessel feature parameters specifically include blood vessel length, blood vessel density, blood vessel edge gradient and blood vessel continuity index. The third judgment module is used to determine whether the change value is less than a preset stable threshold. The third execution module is used to calculate the main direction distribution of the vascular structure if not, dynamically divide the real vascular structure and background texture in the vascular image sequence according to the main direction distribution, generate the clarity of each region of the vascular image sequence, and obtain the out-of-focus region of the vascular image sequence based on the clarity of each region.
10. The micro-circulation image acquisition and control system based on autofocus logic according to claim 8, characterized in that, The execution module further includes: An extraction unit is used to generate image gradient parameters of the blood vessel image sequence based on the distribution information of the gray-level differences, and extract corresponding candidate edge pixels from the image gradient parameters, wherein the image gradient parameters specifically include gradient magnitude and gradient direction; The judgment unit is used to determine whether the candidate edge pixels can reach a preset pixel threshold. An execution unit is configured to, if possible, construct a corresponding initial edge set based on the response values of the candidate edge pixels, collect the aspect ratio of the edge regions of the initial edge set, and dynamically remove edge segments that do not meet the elongated structural characteristics based on the aspect ratio of the edge regions. Specifically, the initial edge set includes strong edge pixels and weak edge pixels.