Method and system for shooting anterior segment structure and storage medium
By automatically identifying and judging the anterior segment structure in B-Scan images, the problem of long time consumption and unstable imaging caused by manual judgment in existing technologies has been solved, realizing efficient and accurate imaging of the anterior segment structure and improving the reliability and efficiency of diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZD MEDICAL (HANGZHOU) CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-05-12
AI Technical Summary
The current anterior segment imaging process relies on manual judgment, which results in long examination times, unstable image quality, and subjective differences between different operators, affecting diagnostic accuracy.
By acquiring B-Scan images from the front-segment optical coherence tomography (OCT) device during head movement, the anterior segment structure is identified based on grayscale distribution characteristics, the contrast distribution of column projections is calculated, and alignment is determined based on peak significance, automatically triggering the shooting operation.
It enables efficient and accurate imaging of the anterior segment structure, reduces examination time, improves imaging stability and diagnostic accuracy, and reduces reliance on manual intervention.
Smart Images

Figure CN122004747A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of imaging technology, and in particular to a method, system, and storage medium for imaging anterior segment structures. Background Technology
[0002] Frequency-sweeping anterior segment optical coherence tomography (OCT) is a key technology in ophthalmology for high-resolution imaging of anterior segment structures such as the cornea, anterior chamber, and lens. It obtains microscopic structural information of biological tissues through the principle of coherent light interference, providing important evidence for the diagnosis and efficacy evaluation of diseases such as corneal lesions, glaucoma, and cataracts.
[0003] In clinical examinations, the anterior segment imaging process typically relies on the operator manually controlling the movement of the imaging head and judging whether the imaging conditions are met by observing the imaging interface in real time before finally triggering the imaging operation. In the current imaging process, the determination of the presence and alignment of the anterior segment structure depends entirely on the operator's visual observation of the imaging interface. On the one hand, the operator needs to continuously observe image changes during the three-dimensional movement of the imaging head and frequently adjust the head position to find the appropriate imaging angle, resulting in a long examination time per case, especially in scenarios with low patient cooperation or batch screening. If the judgment is delayed, the optimal imaging opportunity may be missed, further increasing patient discomfort and examination time. On the other hand, different operators have different subjective judgments on alignment standards such as whether the corneal center is centered, which can easily lead to unstable image quality and affect the accuracy of subsequent diagnosis. Summary of the Invention
[0004] In order to efficiently and accurately capture images of the anterior segment structure, embodiments of this application provide a method, system, and storage medium for capturing images of the anterior segment structure.
[0005] In a first aspect, this embodiment provides a method for imaging anterior segment structures, the method comprising: Acquire B-Scan images from the front-segment optical coherence tomography (OCT) device during head movement; Based on the grayscale distribution features of each preset column in the B-Scan image, identify whether the anterior segment structure appears in the B-Scan image; After identifying the anterior segment structure, the potential region where the light beams may appear is extracted from the B-Scan image and the column projection of the region is calculated; The background of the region is determined based on multi-scale morphological operations, and the contrast distribution of the column projection relative to the background is calculated; The significance of the peak value of the contrast distribution is used to determine whether the B-Scan image is aligned with the anterior segment of the eye. When it is determined that the alignment is complete, the sweep frequency front-section optical coherence tomography device is triggered to perform the imaging operation.
[0006] In some embodiments, identifying whether an anterior segment structure appears in the B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image includes: Column analysis is performed on each preset column of pixel data in the B-Scan image to filter out target columns with strong reflective structures; Perform crest analysis on each target column to filter out double-peak columns containing two peaks; The presence of anterior segment structures in the B-Scan image is determined by whether the distribution of the first peak position of all double-peak columns in the image conforms to a preset arch pattern.
[0007] In some embodiments, performing column analysis on each preset column of pixel data in the B-Scan image to filter out target columns with strong reflective structures includes: For each preset column of pixel data in the B-Scan image, the grayscale peak value of the preset column and the binary threshold calculated by the maximum inter-class variance method are obtained. The pixels in the column are divided using the binary threshold to determine the average pixel value in the background region and the number of pixels in the foreground region; Determine whether the difference between the grayscale peak value and the average pixel value of the background area is greater than a preset grayscale difference threshold and whether the ratio of the number of pixels in the foreground area to the total number of pixels in the column is greater than a preset ratio threshold. If so, determine that the preset column is a target column with a strong reflection structure. If not, determine that the preset column is not the target column of the strong reflection structure; Traverse all preset columns of the B-Scan image to filter out all target columns.
[0008] In some embodiments, performing crest analysis on each target column to filter out double-peak columns containing two peaks includes: The pixel grayscale values of the corresponding target column are truncated based on the binary threshold to obtain the initial peak distribution; The initial peak distribution is processed to merge adjacent peaks and remove isolated noise peaks to obtain a processed peak distribution. Based on the processed peak distribution, the number of connected regions is determined, and the target column with two connected regions is selected as a double-peak column.
[0009] In some embodiments, determining whether the B-Scan image shows anterior segment structures based on whether the distribution of the first peak positions of all double-peak columns in the image conforms to a preset arch pattern includes: Obtain the ordinate position of the first peak of all double-peak columns in the B-Scan image, and take the maximum value of all ordinate positions as the coordinate of the arch vertex. An upward trend indicator is determined based on the ordinates of the points to the left of the arch apex coordinates, and a downward trend indicator is determined based on the ordinates of the points to the right of the arch apex coordinates. If both the upward trend indicator and the downward trend indicator meet the corresponding preset trend threshold, the distribution of the first peak of all double peak columns in the image conforms to the preset arch pattern, and the anterior segment structure appears in the B-Scan image; Otherwise, the anterior segment structure will not appear in the B-Scan image.
[0010] In some embodiments, extracting the region where the light beams may appear from the B-Scan image and calculating the column projection of the region includes: The lateral coordinate range of the light beam in the B-Scan image is determined based on the position of the identified anterior segment structure in the B-Scan image and a preset range. The image sub-region corresponding to the horizontal coordinate range is extracted from the B-Scan image, and the pixel grayscale average processing is performed on the image sub-region along the vertical direction to obtain the column projection of the region.
[0011] In some embodiments, calculating the contrast distribution of the column projection relative to the background includes: Calculate the difference between the grayscale value of each point in the column projection and the grayscale value of the corresponding point in the background based on the column projection and the background; Dividing the difference by the sum of the gray values of the corresponding points in the background and the unit offset yields the contrast distribution of the column projection relative to the background.
[0012] In some embodiments, determining whether the B-Scan image is aligned with the anterior segment based on the significance of the peak values of the contrast distribution includes: The contrast peak value is determined based on the contrast distribution, and the background mean and background standard deviation are calculated based on the background. The peak significance of the contrast distribution is calculated based on the contrast peak value, the background mean, and the background standard deviation. When the significance of the peak value is greater than a preset threshold, the B-Scan image is aligned with the anterior segment of the eye. When the significance of the peak value is not greater than a preset threshold, the B-Scan image is not aligned with the anterior segment of the eye.
[0013] Secondly, this embodiment provides a system for imaging anterior segment structures, the system comprising: an acquisition module, an identification module, and an imaging module; wherein, The acquisition module is used to acquire B-Scan images collected by the frequency sweep front-section optical coherence tomography device during the movement of the camera head; The recognition module is used to identify whether the anterior segment structure appears in the B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image; The imaging module is used to extract the potential area of the light column from the B-Scan image after recognizing the anterior segment structure and calculate the column projection of the area. It determines the background of the area based on multi-scale morphological operations and calculates the contrast distribution of the column projection relative to the background. It determines whether the B-Scan image is aligned with the anterior segment based on the significance of the peak value of the contrast distribution. When it is determined that the image is aligned, it triggers the frequency-sweeping anterior segment optical coherence tomography device to perform the imaging operation.
[0014] Thirdly, this embodiment provides a computer-readable storage medium having a computer program stored thereon that can run on a processor, wherein when the computer program is executed by the processor, it implements a method for imaging anterior segment structures as described in the first aspect.
[0015] By employing the above method, this application first acquires B-Scan images gathered by a swept-frequency anterior segment optical coherence tomography (OCT) device during head movement. Then, it identifies whether an anterior segment structure appears in the B-Scan image based on the grayscale distribution characteristics of each column. Next, after identifying the anterior segment structure, it extracts the potential area where the light column might appear from the B-Scan image and calculates the column projection of the area. Based on multi-scale morphological operations, it determines the background of the area and calculates the contrast distribution of the column projection relative to the background. Finally, it determines whether the B-Scan image is aligned with the anterior segment based on the peak significance of the contrast distribution; when alignment is determined, the swept-frequency anterior segment OCT device is triggered to perform the imaging operation. This allows for efficient and accurate imaging of the anterior segment structure. Attached Figure Description
[0016] Figure 1 This is a block diagram of a method for imaging anterior segment structures provided in this application.
[0017] Figure 2 This is a block diagram of the method provided in this application for identifying whether an anterior segment structure appears in a B-Scan image based on the gray-scale distribution features of each column in the B-Scan image.
[0018] Figure 3This is a block diagram of a method provided in this application for determining whether a B-Scan image is aligned with the anterior segment of the eye based on the peak significance of the contrast distribution.
[0019] Figure 4 This is a schematic diagram of the anterior segment alignment determination process provided in this application.
[0020] Figure 5 This is a schematic diagram of a system connection for imaging anterior segment structures provided in this application. Detailed Implementation
[0021] To better understand the purpose, technical solutions, and advantages of this application, it has been described and illustrated below with reference to the accompanying drawings and embodiments. However, those skilled in the art should understand that this application can be implemented without these details. It will be apparent to those skilled in the art that various modifications can be made to the embodiments disclosed in this application, and the general principles defined in this application can be applied to other embodiments and application scenarios without departing from the principles and scope of this application. Therefore, this application is not limited to the illustrated embodiments, but is consistent with the broadest scope claimed in this application.
[0022] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0023] Figure 1 This is a block diagram of a method for imaging anterior segment structures provided in this application. Figure 1 As shown, a method for imaging anterior segment structures includes the following steps: Step S100: Acquire B-Scan images from the scanning front-section optical coherence tomography device during the head movement.
[0024] This application describes the process from the perspective of the imaging end. Specifically, the acquisition of B-Scan images is performed in real time during the automatic movement of the scanning front section optical coherence tomography (OCT) device along a preset path. A B-Scan image is a two-dimensional cross-sectional image, with each column corresponding to an A-Scan line. An A-Scan line is a one-dimensional depth signal obtained by longitudinally scanning biological tissue using the principle of coherent light interference. Multiple consecutive A-Scan lines arranged in the transverse space constitute a B-Scan image.
[0025] During implementation, the camera head moves along a preset trajectory in three-dimensional space, continuously acquiring B-Scan images at a set sampling frequency. Each B-Scan image contains cross-sectional information of the anterior segment region corresponding to the current camera head position. The acquisition process requires no manual intervention from the operator; it is automatically executed by the equipment control system, thus providing a real-time and continuous image data source for subsequent automatic identification and alignment judgment. This achieves dynamic monitoring of the anterior segment structure during camera head movement, providing a data foundation for subsequent image analysis-based automatic identification and alignment judgment. Continuous acquisition reduces the occurrence of missing the optimal shooting opportunity, improving shooting efficiency and imaging stability.
[0026] Step S200: Identify whether the anterior segment structure appears in the B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image.
[0027] The anterior segment has specific physiological structures, consisting of the cornea, anterior chamber, iris, and lens from top to bottom. In B-Scan images, these structures exhibit a grayscale distribution of high reflectance, low reflectance, and high reflectance. Furthermore, the high reflectance areas of the corneal epithelium generally exhibit an arched shape. Based on this characteristic, by analyzing the grayscale distribution features of each column of the B-Scan image layer by layer, the presence of anterior segment structures can be accurately identified. Figure 2 This is a block diagram of the method provided in this application for identifying whether an anterior segment structure appears in a B-Scan image based on the grayscale distribution features of a preset column in the B-Scan image. For example... Figure 2 As shown, identifying whether an anterior segment structure appears in a B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image includes the following steps: Step S201: Perform column analysis on each preset column of pixel data in the B-Scan image to filter out target columns with strong reflective structures.
[0028] Step S202: Perform peak analysis on each target column to filter out double-peak columns containing two peaks.
[0029] Step S203: Determine whether the B-Scan image shows anterior segment structure based on whether the distribution of the first peak position of all double peak columns in the image conforms to the preset arch pattern.
[0030] To accurately identify target columns with strong reflective structures, multi-dimensional column analysis is required. This involves performing column analysis on each preset column of pixel data in the B-Scan image to identify target columns with strong reflective structures, including the following steps: Step S201-1: For each preset column of pixel data in the B-Scan image, obtain the grayscale peak value of the preset column and the binary threshold calculated by the maximum inter-class variance method.
[0031] Step S201-2: Use a binary threshold to divide the pixels in the column to determine the average pixel value in the background region and the number of pixels in the foreground region.
[0032] Step S201-3: Determine whether the difference between the grayscale peak value and the average pixel value of the background area is greater than a preset grayscale difference threshold and whether the ratio of the number of pixels in the foreground area to the total number of pixels in the column is greater than a preset ratio threshold. If so, determine that the preset column is a target column with a strong reflection structure.
[0033] Step S201-4: If not, determine that the preset column is not the target column of the strong reflection structure.
[0034] Step S201-5: Traverse all preset columns of the B-Scan image to filter out all target columns.
[0035] The aforementioned preset columns refer to columns determined based on actual conditions. These preset columns can be each column in the B-Scan image, or columns at fixed intervals in the B-Scan image, such as even-numbered columns. No further limitations are imposed on the preset columns here; they can be determined according to the actual situation. Specifically, first, all pixels in the preset column are traversed, and the gray value corresponding to the pixel with the largest gray value is recorded; this is the gray value peak of the preset column. The maximum inter-class variance method calculates the inter-class variance between the foreground and background at each possible gray value threshold, and selects the gray value corresponding to the largest inter-class variance as the binary threshold. This method can adaptively and effectively separate the foreground and background in the image, providing a reliable basis for subsequent region segmentation.
[0036] Then, pixels with grayscale values greater than or equal to the binary threshold in the preset column are classified as foreground regions, and pixels with grayscale values less than the binary threshold are classified as background regions. The total number of pixels in the foreground region is counted, which is the number of pixels in the foreground region. The average grayscale value of all pixels in the background region is calculated to obtain the average pixel value of the background region.
[0037] The preset grayscale difference threshold is derived statistically from a large number of anterior segment B-Scan image samples and is used to distinguish strong reflection signals from ordinary noise signals. For example, a preset threshold of 50 is used, with a grayscale value range of 0-255. A preset ratio threshold is used to ensure the foreground region has a certain scale, avoiding misjudging a small number of noise points as strong reflection structures. For example, a preset threshold of 0.1 is used. When both conditions are met simultaneously, it indicates that the preset column has a significant strong reflection structure, conforming to one of the grayscale characteristics of anterior segment structures. If either condition is not met, it indicates that the grayscale distribution of the preset column does not possess the characteristics of a strong reflection structure, and may be a pure noise column or a column that does not contain any anterior segment-related structures. Specifically, determining whether the difference between the grayscale peak value and the average pixel value of the background region is greater than the preset grayscale difference threshold and whether the ratio of the number of pixels in the foreground region to the total number of pixels in the column is greater than the preset ratio threshold means that |grayscale peak value - average pixel value of the background region| > the preset grayscale difference threshold, and the number of pixels in the foreground region / the total number of pixels > the preset ratio threshold.
[0038] Following the procedures of steps S201-1 to S201-4, each preset column of the B-Scan image is analyzed and judged sequentially. Finally, all target columns that meet the conditions are collected, laying the foundation for subsequent peak analysis. By adaptively determining the binary threshold using the maximum inter-class variance method, and combining the variance of the grayscale peak value and the background mean with the foreground pixel ratio as dual judgment conditions, target columns with strong reflective structures can be accurately screened, effectively eliminating interference from noise columns and providing reliable column data support for subsequent accurate identification of anterior segment structures.
[0039] The target column may contain peak breaks or noise peaks due to uneven reflection within the corneal or iris structures or eyelash interference, requiring optimization through peak analysis. Specifically, performing peak analysis on each target column to filter out double-peak columns containing two peaks includes the following steps: Step S202-1: Based on the binary threshold, the pixel grayscale values of the corresponding target column are truncated to obtain the initial peak distribution.
[0040] Step S202-2: Process the initial peak distribution to merge adjacent peaks and remove isolated noise peaks to obtain the processed peak distribution.
[0041] Step S202-3: Determine the number of connected regions based on the processed peak distribution, and select the target column with two connected regions as a double-peak column.
[0042] Specifically, firstly, the gray values of pixels in the target column whose gray values are greater than or equal to the binary threshold are retained, while the gray values of pixels whose gray values are less than the binary threshold are set to 0. Through this truncation process, the peak features of the foreground area are highlighted, and the initial peak distribution is obtained.
[0043] Then, a threshold for merging adjacent peaks is set. For example, when the distance between two peaks is less than 3 pixels, they are merged into one peak to solve the problem of peak breakage caused by discontinuous strong reflections within the corneal and iris structures. A threshold for identifying isolated noise peaks is set. For example, when the width of a peak is less than 2 pixels and the distance between it and other peaks is greater than 5 pixels, it is identified as an isolated noise peak and removed to eliminate misjudgment interference caused by strong reflections in the eyelash area.
[0044] Connected regions refer to areas in the processed peak distribution that are adjacent pixels with non-zero grayscale values. The number of connected regions in each target column is counted using a connected region detection algorithm. Adjacent regions include vertical and horizontal adjacency, as well as diagonal adjacency. Since the corneal epithelium and the upper iris of the anterior segment correspond to two highly reflective regions, a target column with two connected regions is a double-peak column containing a high-reflectance-low-reflectance-high-reflectance structure. By using threshold truncation to highlight peak features, combined with optimizations such as merging adjacent peaks and removing isolated noise peaks, the double-peak structure in the target column can be identified more accurately. This effectively solves the misjudgment problems caused by peak breaks and noise interference, providing accurate peak data for subsequent anterior segment structure identification based on the arch pattern.
[0045] The highly reflective areas of the corneal epithelium exhibit an arched shape in B-Scan images, a key feature distinguishing anterior segment structures from other structures. Determining the presence of anterior segment structures in a B-Scan image based on whether the distribution of the first peak position in all double-peak columns conforms to a pre-defined arched pattern includes the following steps: Step S203-1: Obtain the ordinate position of the first peak of all double-peak columns in the B-Scan image, and use the maximum value among all ordinate positions as the coordinates of the arch vertex.
[0046] Step S203-2: Determine the upward trend indicator based on the ordinates of the points to the left of the arch apex coordinates, and determine the downward trend indicator based on the ordinates of the points to the right of the arch apex coordinates.
[0047] Step S203-3: If both the upward trend indicator and the downward trend indicator meet the corresponding preset trend thresholds, the distribution of the first peak of all double peak columns in the image conforms to the preset arch pattern, and the anterior segment structure appears in the B-Scan image.
[0048] Step S203-4: Otherwise, the anterior segment structure does not appear in the B-Scan image.
[0049] First, iterate through each double-peak column and record the ordinate of the first peak. Then, select the maximum value among all recorded ordinates; the position corresponding to this maximum value is the ordinate of the arch apex. Combined with the abscissa of the double-peak column, determine the coordinates of the arch apex. The first peak corresponds to strong reflection in the corneal epithelium.
[0050] Then, for the double-peak column to the left of the arch apex, calculate the difference in the ordinate of the first peak of each adjacent double-peak column from left to right on the horizontal axis. The average of all differences is used as the indicator for the rising trend on the left; a positive value indicates an upward trend on the left. For the double-peak column to the right of the arch apex, calculate the difference in the ordinate of the first peak of each adjacent double-peak column from left to right on the horizontal axis. The average of all differences is used as the indicator for the downward trend on the right; a negative value indicates a downward trend on the right.
[0051] This application pre-sets a left-side upward trend threshold greater than 0.5 and a right-side downward trend threshold less than -0.5. When the left-side upward trend index is greater than 0.5 and the right-side downward trend index is less than -0.5, it indicates that the first peak of all double-peak columns exhibits a distinct arched distribution with a high center and low sides, consistent with the physiological structural characteristics of the corneal epithelium. Therefore, the anterior segment structure is determined to be present in the B-Scan image. If any trend index does not meet the corresponding pre-set threshold, it indicates that the peak distribution does not possess arched characteristics and may be due to strong reflection from other structures such as skin. Therefore, the anterior segment structure is determined not to be present. Thus, based on the arched distribution characteristic of high reflectivity of the corneal epithelium, by calculating the trend indices at the apex of the arch and on both sides, the anterior segment structure can be more accurately distinguished from other similar strongly reflective structures, further improving the accuracy of anterior segment structure identification and reducing misjudgments. In addition, by using a three-level progressive recognition logic of target column screening, dual-peak column recognition, and arch pattern determination, combined with the gray-scale distribution characteristics corresponding to the anterior segment physiological structure, accurate and automatic recognition of the anterior segment structure is achieved, reducing manual intervention and effectively solving the problems of low efficiency and strong subjectivity in traditional manual observation and recognition, laying the foundation for subsequent automatic alignment and imaging.
[0052] After identifying the anterior segment structure in the B-Scan image, if no anterior segment structure is found in the current image, it indicates that the current position of the imaging head is not aligned with the target eye region or is located in a non-target structure region. To ensure continuous and automatic searching and locating of the anterior segment structure, this application controls the imaging head to continue moving along a preset path and re-acquire images for identification when no anterior segment structure is identified, until the anterior segment structure is identified. Specifically, when no anterior segment structure is identified in the current B-Scan image, a command is immediately sent to the motion control module of the frequency-scanned anterior segment optical coherence tomography (OCT) device to control the imaging head to continue moving step by step according to a preset three-dimensional movement path. The preset movement strategy includes the movement direction, step size, and speed, which are set based on the spatial relationship between the device's initial position and the eye structure to ensure systematic coverage of the possible areas where the anterior segment may appear within a reasonable range. During the movement, the device continues to acquire B-Scan images at the same sampling frequency as before to ensure the continuity and real-time nature of the image data. Each time a new B-Scan image is acquired, the recognition process in step S200 is immediately invoked to determine whether an anterior segment structure appears based on the grayscale distribution characteristics of each column. This repeated recognition process continues during the movement of the scanner head, combining dynamic scanning with real-time judgment. The recognition results are continuously monitored during movement. Once an anterior segment structure is identified in a B-Scan image, the scanner head movement is immediately stopped, and the process jumps to step S300 to execute the subsequent light beam region extraction and alignment judgment process. If the scanner head has completed the full traversal of the preset path but still has not identified an anterior segment structure, it is determined that the eye cannot be automatically located. At this time, a prompt message is issued through the user interface, and the scanner head movement is paused, awaiting operator intervention. This allows for automatic and continuous adjustment of the scanner head position and re-acquiring images when an anterior segment structure is not identified, achieving active searching and localization of eye structures in three-dimensional space. This mechanism avoids interruptions caused by a single recognition failure, significantly improving robustness and automation. Meanwhile, by combining preset paths with real-time recognition, the anterior segment structure can be located in a short time, further shortening the overall examination time and improving imaging efficiency and patient comfort.
[0053] Step S300: After identifying the anterior segment structure, extract the potential area where the light beam may appear from the B-Scan image and calculate the column projection of the area.
[0054] After identifying the anterior segment structures, it was confirmed that the image contains core structures such as the cornea and iris. The light beam, as a key indicator of successful alignment, has a fixed physiological positional correlation with the anterior segment structures. Therefore, it is necessary to accurately locate the potential area of the light beam based on this correlation, providing a focusing analysis range for subsequent alignment judgment. The steps involved in extracting the potential area of the light beam from the B-Scan image and calculating the column projection of the area are as follows: Step S301: Determine the allowed lateral coordinate range of the light column in the B-Scan image based on the position of the identified anterior segment structure in the B-Scan image and a preset range.
[0055] Step S302: Extract the image sub-region corresponding to the horizontal coordinate range from the B-Scan image, and perform pixel gray-level averaging on the image sub-region along the vertical direction to obtain the column projection of the region.
[0056] Specifically, after anterior segment structure recognition is completed, it is clear that the image contains core structures such as the cornea and iris. Based on the physiological positional relationship of the anterior segment structures, the light beam, as a sign of successful alignment, typically appears in the image area corresponding to the central optical zone of the cornea. Therefore, based on the position of the identified anterior segment structures in the B-Scan image, combined with a preset allowable error range, the possible lateral coordinate range of the light beam in the image is determined. That is, taking the horizontal coordinate of the arch apex extracted during anterior segment structure recognition as the center, a preset lateral offset is extended to the left and right. This offset is set based on the maximum tolerable range of the light beam deviating from the center in clinical experience, such as setting it to 10% of the total image width, thereby defining the allowable lateral coordinate range of the light beam, ensuring that subsequent analysis focuses on the possible areas and eliminates interference from irrelevant areas.
[0057] After determining the horizontal coordinate range, a sub-region corresponding to this range is extracted from the original B-Scan image. This sub-region is then subjected to vertical pixel gray-level averaging, meaning the average of the pixel gray-level values in each column of the sub-region is calculated vertically, resulting in a one-dimensional column projection sequence. This process compresses two-dimensional image information into a one-dimensional signal, highlighting the gray-level distribution characteristics of the light pillars in the horizontal direction while suppressing random noise in the vertical direction. This provides concise and representative input data for subsequent background estimation and contrast calculation. This not only avoids computational redundancy in full-image analysis and improves processing efficiency, but also ensures the fault tolerance of light pillar detection through a preset error range, enhancing the robustness of alignment judgment. Simultaneously, the generation of column projections effectively suppresses vertical noise in the image, providing stable and clear input for subsequent background estimation and contrast calculation, thus laying the foundation for accurate and efficient alignment judgment.
[0058] Preferably, in some embodiments, pixels may be selected for calculation in a skip manner during each column calculation, such as calculating only even numbers or only calculating a segment of the stronger signal in the entire column, in order to reduce the amount of calculation or avoid discontinuity in the intensity of the light column signal.
[0059] Step S400: Determine the background of the region based on multi-scale morphological operations, and calculate the contrast distribution of column projection relative to the background.
[0060] After extracting the potential region of the light pillar and calculating its column projection, it is necessary to further separate the light pillar signal from the background signal from the column projection for accurate alignment judgment. To achieve this goal, this application employs multi-scale morphological operations to process the column projection of the region to robustly estimate the background component. Specifically, determining the background of the region based on multi-scale morphological operations involves first defining a set of morphological structural elements with different scales to simulate light pillar profiles of varying thicknesses. That is, the structural element is a one-dimensional line segment, and its scale is represented by the length of the line segment. For example, the scale set can be defined as R={r1,r2,…,rk}, where ri represents the i-th scale and k is the number of scales. The values of each scale are determined based on the statistical distribution range of the light pillar width in clinical images, such as R={1,3,5,7,9} pixels, to cover typical light pillar profiles from thin to thick.
[0061] Then, for each scale *ri*, its corresponding structuring element is applied to the column projection *colProj*, performing a morphological opening operation to obtain the background estimate at that scale. Specifically, the morphological opening operation is defined as erosion followed by dilation: *open(colProj,ri) = dilate(erode(colProj,ri),ri). The erosion operation uses a line segment structuring element of length *ri*, which eliminates bright details (latent light pillars) with a width smaller than *ri*, preserving wider or smoother background structures. The subsequent dilation operation restores the original morphology of the background region as much as possible. Through this operation, the background estimate sequence *bgi* after filtering out light pillar signals at scale *ri* is obtained.
[0062] Then, by iterating through all scales, a set of multi-scale background estimation sequences {bg1,bg2,…,bgk} is obtained, where bgi is the background estimate corresponding to the i-th size.
[0063] After background estimation, to accurately assess the significance of the light column signal relative to the background, it is necessary to further calculate the contrast distribution between the column projection and the background. This involves normalizing the contrast to highlight the signal intensity in the light column region, thus providing a quantitative basis for subsequent alignment judgments. The calculation of the contrast distribution between the column projection and the background includes the following steps: Step S401: Calculate the difference between the gray values of each point in the column projection and the corresponding gray values in the background based on the column projection and the background.
[0064] Step S402: Divide the difference by the sum of the gray values of the corresponding points in the background and the unit offset to obtain the contrast distribution of the column projection relative to the background.
[0065] Specifically, the column projection sequence colProj is first aligned point-by-point with the background sequence bg, and the gray-level difference at each horizontal position x is calculated as diff(x) = colProj(x) - bg(x). This difference directly reflects the absolute enhancement of the signal relative to the background at that position. Since the light pillar region usually exhibits a significantly higher local gray level than the background, the difference diff(x) will show a clear positive peak at the location of the light pillar, while it will be close to zero or negative in non-light pillar regions.
[0066] To avoid instability or over-amplification in contrast calculation when the background grayscale value is low, this application adopts a normalized contrast calculation formula: contrast(x) = diff(x) / (bg(x) + 1), where 1 in the denominator is a unit offset used to prevent division by zero when the background grayscale is zero and to smooth contrast fluctuations in low grayscale areas. This normalization operation makes the contrast value contrast(x) a unitless relative quantity, which can more robustly reflect the prominence of the signal relative to the local background, unaffected by global brightness changes. The final contrast sequence is the contrast distribution of the column projection relative to the background, where the position corresponding to the light column will show a significantly higher contrast peak than the surrounding area. Through the above contrast calculation process, the recognizability of the light column signal can be effectively enhanced, and interference caused by background fluctuations can be suppressed, thereby providing a stable and reliable quantitative indicator for subsequent alignment judgment, significantly improving the accuracy and robustness of alignment judgment.
[0067] Step S500: Determine whether the B-Scan image is aligned with the anterior segment of the eye based on the significance of the peak value of the contrast distribution.
[0068] After calculating the contrast distribution, a quantized sequence representing the prominence of the light column signal relative to the background has been obtained. To achieve accurate and reliable alignment judgment, it is necessary to further analyze the significance of its peak features based on this contrast distribution, thereby objectively determining whether the current B-Scan image meets the precise alignment conditions required for shooting. Figure 3 This is a block diagram of the method provided in this application for determining whether a B-Scan image is aligned with the anterior segment of the eye based on the peak significance of the contrast distribution. (Example) Figure 3 As shown, determining whether a B-Scan image is aligned with the anterior segment of the face based on the significance of the peak values in the contrast distribution includes the following steps: Step S501: Determine the contrast peak based on the contrast distribution, and calculate the background mean and background standard deviation based on the background.
[0069] Step S502: Calculate the peak significance of the contrast distribution based on the contrast peak, background mean, and background standard deviation.
[0070] Step S503: When the peak significance is greater than the preset judgment threshold, the B-Scan image is aligned with the anterior segment of the eye.
[0071] Step S504: When the significance of the peak value is not greater than the preset judgment threshold, the B-Scan image is not aligned with the anterior segment of the eye.
[0072] First, a global maximum value is searched from the contrast distribution sequence. This maximum value is the contrast peak value (contrastMax), which corresponds to the column with the most prominent signal in the potential region of the light pillar. Simultaneously, a statistical analysis is performed on the background sequence bg estimated in step S400. Specifically, the arithmetic mean of all elements in the background sequence is calculated to obtain the background mean μBack, and the standard deviation of the background sequence is calculated to obtain the background standard deviation σBack. Here, the background mean μBack reflects the overall brightness level of the background region, and the background standard deviation σBack quantifies the grayscale fluctuations or noise intensity of the background region.
[0073] To eliminate the influence of overall brightness differences and background fluctuations between different images and achieve adaptive judgment, this application uses a normalized peak prominence index for quantitative evaluation. Specifically, peak prominence is calculated using the formula peakProminence = (contrastMax - μBack) / σBack. The physical meaning of this formula is to measure the deviation of the contrast peak value (contrastMax) from the average background level (μBack), using the inherent fluctuation amplitude of the background (σBack) as the normalization benchmark. When the light bar signal is clear and well-aligned, contrastMax is significantly higher than μBack and exceeds the range of random background fluctuations, resulting in a larger peakProminence value. Conversely, if the light bar signal is weak or missing, contrastMax is close to μBack, and the peakProminence value is smaller.
[0074] Next, the calculated peak significance (peakProminence) is compared with a preset judgment threshold (Th_judge). This threshold (Th_judge) is an empirical value derived from statistical analysis of a large number of clinical aligned and misaligned image samples, used to define the quantization boundary where the signal is significantly prominent. If peakProminence > Th_judge, the beam signal in the current B-Scan image is determined to be sufficiently significant relative to the background, consistent with the characteristics of vertical alignment to the central optical zone of the cornea, meaning the B-Scan image is aligned with the anterior segment. If peakProminence ≤ Th_judge, it indicates that there is no peak signal in the current contrast distribution that significantly exceeds the fluctuations in background noise, and the beam feature is not obvious or completely missing. This situation corresponds to misalignment states such as the beam not being incident on the central cornea, beam offset, or blurring, therefore the B-Scan image is determined not to be aligned with the anterior segment. By calculating the peak significance based on background statistical normalization and comparing it with the preset threshold, objectivity, quantification, and adaptability of alignment judgment are achieved, effectively overcoming misjudgments caused by differences in overall image brightness or fluctuations in background noise, significantly improving the accuracy and robustness of alignment judgment, and providing a reliable basis for ultimately triggering high-quality imaging.
[0075] When misalignment is detected, the system automatically enters the alignment adjustment phase to continue the automated closed loop of anterior segment recognition, dynamic alignment, and precise imaging. Specifically, this phase includes the following steps: First, based on the lateral position of the identified contrast peak in the contrast distribution, the lateral offset information of the current actual position of the beam relative to the preset ideal alignment position is determined. Then, based on this offset information and the pre-stored calibration relationship between the camera head movement and image coordinates, the lateral fine-tuning command for the camera head, including the fine-tuning direction and step size, is calculated and sent to the motion control module of the scanned anterior segment optical coherence tomography (OCT) device to correct the offset. Next, the camera head is driven to perform a small-range position adjustment according to the fine-tuning command. After adjustment, steps S200 to S500 are immediately re-executed, i.e., anterior segment structure recognition and alignment judgment are performed again based on the newly acquired B-Scan image. If alignment is still not achieved, this iterative process of judgment-offset calculation-fine-tuning-re-recognition-re-judgment is repeated until alignment is determined and imaging is triggered, or until the preset maximum number of attempts is reached, prompting manual intervention. This method utilizes the beam offset information reflected by the contrast peak position to precisely guide the movement compensation of the camera head, rather than relying on human visual observation and manual operation. It achieves active, closed-loop correction even in cases of misalignment, significantly shortening the time required from detecting misalignment to achieving accurate alignment again. This avoids interrupting the examination process due to a single failed judgment, further reducing reliance on manual intervention in the overall examination, and improving the robustness, consistency, and overall efficiency of fully automated imaging. Especially in scenarios with limited patient cooperation or requiring continuous screening, it enables more stable and rapid acquisition of high-quality images.
[0076] Step S600: When it is determined that the alignment is complete, the sweep frequency front-segment optical coherence tomography device is triggered to perform the imaging operation.
[0077] Figure 4 This is a schematic diagram of the anterior segment alignment determination process provided in this application. For example... Figure 4As shown, firstly, based on the position of the identified anterior segment structure in the B-Scan image, the allowable error range of the image is determined. Then, a sub-region corresponding to this range is cropped from the B-Scan image, and pixel gray-level averaging is performed on this sub-region along the horizontal direction to obtain the column projection of the region. Next, a multi-scale radius scheme is adopted, such as scales r=1, r=3, r=5, r=7, r=9, and morphological processing operations are used to estimate the background of the column projection to obtain the background excluding the light pillars. Then, the contrast distribution of the column projection relative to the background is calculated based on the column projection and the background, i.e., the relative contrast is calculated. The contrast peak is extracted from the contrast distribution, and the background mean and variance are calculated simultaneously, i.e., the mean and variance of the non-light pillar region. Then, the peak prominence of the contrast distribution is calculated based on the contrast peak, the background mean, and the mean and variance, i.e., the peak significance at the contrast peak. Finally, the peak significance with the largest peak under the multi-scale light pillar radius is selected as the final judgment criterion, and the result is output.
[0078] Figure 5 This is a schematic diagram of a system connection for imaging anterior segment structures provided in this application. Figure 5 As shown, a system for imaging anterior segment structures includes: an acquisition module, an identification module, and an imaging module.
[0079] The system comprises several modules: an acquisition module for obtaining B-Scan images captured by the scanned front-segment optical coherence tomography (OCT) device during head movement; an identification module for identifying the presence of anterior segment structures in the B-Scan images based on the grayscale distribution characteristics of each column; and an imaging module for extracting potential areas for light pillars from the B-Scan images after identifying anterior segment structures, calculating the column projection of these areas, determining the background of the areas based on multi-scale morphological operations, calculating the contrast distribution of the column projection relative to the background, and determining whether the B-Scan image is aligned with the anterior segment based on the significance of the peak values in the contrast distribution. If alignment is confirmed, the scanned front-segment OCT device is triggered to perform an imaging operation.
[0080] The other functions performed by the acquisition module, recognition module, and imaging module, as well as the technical details of each function, are the same as or similar to the corresponding features in the previously described method for imaging anterior segment structures, so they will not be repeated here.
[0081] This application also provides a computer storage medium storing a computer program that, when run on a computer, enables the computer to perform the steps in the previously described method for imaging anterior segment structures.
[0082] It should be understood that although the steps in the flowcharts in the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be performed in other orders.
[0083] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for imaging anterior segment structures, characterized in that, The method includes: Acquire B-Scan images from the front-segment optical coherence tomography (OCT) device during head movement; Based on the grayscale distribution features of each preset column in the B-Scan image, identify whether the anterior segment structure appears in the B-Scan image; After identifying the anterior segment structure, the potential region where the light beams may appear is extracted from the B-Scan image and the column projection of the region is calculated; The background of the region is determined based on multi-scale morphological operations, and the contrast distribution of the column projection relative to the background is calculated; The significance of the peak value of the contrast distribution is used to determine whether the B-Scan image is aligned with the anterior segment of the eye. When it is determined that the alignment is complete, the sweep frequency front-section optical coherence tomography device is triggered to perform the imaging operation.
2. The method according to claim 1, characterized in that, The step of identifying whether an anterior segment structure appears in the B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image includes: Column analysis is performed on each preset column of pixel data in the B-Scan image to filter out target columns with strong reflective structures; Perform crest analysis on each target column to filter out double-peak columns containing two peaks; The presence of anterior segment structures in the B-Scan image is determined by whether the distribution of the first peak position of all double-peak columns in the image conforms to a preset arch pattern.
3. The method according to claim 2, characterized in that, The step of performing column analysis on each preset column of pixel data in the B-Scan image to filter out target columns with strong reflective structures includes: For each preset column of pixel data in the B-Scan image, the grayscale peak value of the preset column and the binary threshold calculated by the maximum inter-class variance method are obtained. The pixels in the column are divided using the binary threshold to determine the average pixel value in the background region and the number of pixels in the foreground region; Determine whether the difference between the grayscale peak value and the average pixel value of the background area is greater than a preset grayscale difference threshold and whether the ratio of the number of pixels in the foreground area to the total number of pixels in the column is greater than a preset ratio threshold. If so, determine that the preset column is a target column with a strong reflection structure. If not, determine that the preset column is not the target column of the strong reflection structure; Traverse all preset columns of the B-Scan image to filter out all target columns.
4. The method according to claim 3, characterized in that, The step of performing peak analysis on each target column to filter out double-peak columns containing two peaks includes: The pixel grayscale values of the corresponding target column are truncated based on the binary threshold to obtain the initial peak distribution; The initial peak distribution is processed to merge adjacent peaks and remove isolated noise peaks to obtain a processed peak distribution. Based on the processed peak distribution, the number of connected regions is determined, and the target column with two connected regions is selected as a double-peak column.
5. The method according to claim 4, characterized in that, The step of determining whether the B-Scan image shows anterior segment structures based on whether the distribution of the first peak position of all double-peak columns in the image conforms to a preset arch pattern includes: Obtain the ordinate position of the first peak of all double-peak columns in the B-Scan image, and take the maximum value of all ordinate positions as the coordinate of the arch vertex. An upward trend indicator is determined based on the ordinates of the points to the left of the arch apex coordinates, and a downward trend indicator is determined based on the ordinates of the points to the right of the arch apex coordinates. If both the upward trend indicator and the downward trend indicator meet the corresponding preset trend threshold, the distribution of the first peak of all double peak columns in the image conforms to the preset arch pattern, and the anterior segment structure appears in the B-Scan image; Otherwise, the anterior segment structure will not appear in the B-Scan image.
6. The method according to claim 1, characterized in that, The step of extracting the potential region of light pillars from the B-Scan image and calculating the column projection of the region includes: The lateral coordinate range of the light beam in the B-Scan image is determined based on the position of the identified anterior segment structure in the B-Scan image and a preset range. The image sub-region corresponding to the horizontal coordinate range is extracted from the B-Scan image, and the pixel grayscale average processing is performed on the image sub-region along the vertical direction to obtain the column projection of the region.
7. The method according to claim 6, characterized in that, The calculation of the contrast distribution of the column projection relative to the background includes: Calculate the difference between the grayscale value of each point in the column projection and the grayscale value of the corresponding point in the background based on the column projection and the background; Dividing the difference by the sum of the gray values of the corresponding points in the background and the unit offset yields the contrast distribution of the column projection relative to the background.
8. The method according to claim 7, characterized in that, The step of determining whether the B-Scan image is aligned with the anterior segment of the face based on the significance of the peak value of the contrast distribution includes: The contrast peak value is determined based on the contrast distribution, and the background mean and background standard deviation are calculated based on the background. The peak significance of the contrast distribution is calculated based on the contrast peak value, the background mean, and the background standard deviation. When the significance of the peak value is greater than a preset threshold, the B-Scan image is aligned with the anterior segment of the eye. When the significance of the peak value is not greater than a preset threshold, the B-Scan image is not aligned with the anterior segment of the eye.
9. A system for imaging anterior segment structures, characterized in that, The system includes: a data acquisition module, a recognition module, and a shooting module; wherein... The acquisition module is used to acquire B-Scan images collected by the frequency sweep front-section optical coherence tomography device during the movement of the camera head; The recognition module is used to identify whether the anterior segment structure appears in the B-Scan image based on the grayscale distribution features of each preset column in the B-Scan image; The imaging module is used to extract the potential area of the light column from the B-Scan image after recognizing the anterior segment structure and calculate the column projection of the area. It determines the background of the area based on multi-scale morphological operations and calculates the contrast distribution of the column projection relative to the background. It determines whether the B-Scan image is aligned with the anterior segment based on the significance of the peak value of the contrast distribution. When it is determined that the image is aligned, it triggers the frequency-sweeping anterior segment optical coherence tomography device to perform the imaging operation.
10. A computer-readable storage medium having a computer program stored thereon that can run on a processor, characterized in that, When the computer program is executed by the processor, it implements a method for imaging anterior segment structures as described in any one of claims 1 to 8.