A gastrointestinal wall hierarchy edge extraction method based on ultrasound images

CN122948915APending Publication Date: 2026-10-20XIAN HONGHUI HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611121093.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0006]为了解决现有胃肠壁层次结构边缘提取方法因为胃肠壁组织异常导致边缘提取误差较大,以及边缘断裂区域无法科学平滑的技术问题,本发明的目的在于提供一种基于超声图像的胃肠壁层次结构边缘提取方法,所采用的技术方案具体如下:

Benefits of technology

本发明为了针对胃肠壁因病灶浸润导致组织异常增厚、相邻层级回声波峰空间偏移,传统局部梯度就近搜索易造成边缘交叉与拓扑顺序错乱的问题,本发明通过引入相邻帧运动走向与信号值融合构建组织权重矩阵,有效增强了真实组织结构的稳定性。在此基础上,沿列方向采用前一列邻域最大组织权重累计的方式确定全局连通的基准线,避免了局部噪声干扰。进一步地,对于每列,沿基准线法向提取组织权重的波峰点,并综合波峰点与基准线的距离以及波峰点自身的组织权重来判定其所属层级,使得偏离正常解剖位置或信号暗淡的波峰获得较低的归属置信度,再通过验证筛选剔除不可靠分配,从而确保最终各层级的有效波峰点在空间上严格遵循由内至外的解剖顺序,彻底排除了边缘交叉与层级误判现象。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_6
    Figure SMS_6
Patent Text Reader

Abstract

This invention relates to the field of image processing technology, specifically to a method for extracting the layered structure edges of the gastrointestinal wall based on ultrasound images. This method obtains the tissue weight of each pixel based on the motion direction and signal value of each pixel in adjacent frames of gastrointestinal wall ultrasound images. A connected path with the largest cumulative weight along the column direction is determined in the tissue weight matrix as the baseline of the gastrointestinal wall reference layer. Peak points of the tissue weights are determined along the normal vector direction on the baseline. The layer to which the peak point belongs is determined based on its distance from the baseline and its tissue weight, and valid peak points are verified and screened. A curve formed by the valid peak points is obtained along the column direction. For broken columns on the curve, they are filled in according to the curvature of the broken columns on the baseline to obtain smooth edge curves for each layer. This invention can stably output non-intersecting, naturally shaped layered edges of the gastrointestinal wall.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method for extracting the edge of the gastrointestinal wall hierarchical structure based on ultrasound images. Background Technology

[0002] Endoscopic ultrasound (EUS) is the primary method for assessing the morphology and depth of invasion of the various layers of the gastrointestinal wall. Under normal physiological conditions, the gastrointestinal wall appears as a continuous, multi-layered banded structure with alternating light and dark areas in ultrasound images. Accurately extracting the edge coordinates of these hierarchical structures is a prerequisite for quantitatively measuring the local thickness of the gastrointestinal wall.

[0003] In actual clinical practice, edge extraction from ultrasound images faces two prominent objective data interferences.

[0004] First, when lesions infiltrate the gastrointestinal wall, the local tissue thickens abnormally, causing the echo peaks of adjacent layers to deviate significantly from the normal anatomical spacing in spatial distribution. Most existing edge extraction algorithms rely on a greedy strategy of performing a nearest-threshold search based on local gradient mutations. When faced with abnormal tissue thickening, this local strategy is prone to misassigning spatially offset true peaks to neighboring layers, resulting in intersecting and topologically disordered multi-layered edge lines in the output.

[0005] Secondly, ultrasound probes often encounter obstruction from residual gas within the intestinal lumen during scanning, resulting in longitudinal, signal-deprived acoustic shadowing areas in localized areas of the image. Current techniques typically repair these signal-deficient fractures by connecting the endpoints with straight lines. This repair method ignores the naturally curved trajectory of the gastrointestinal wall, easily creating sharp angles at the fracture points that violate natural anatomical curvature, leading to significant errors in subsequent orthogonal projection calculations of thickness. Summary of the Invention

[0006] To address the technical problems of existing methods for extracting the edges of the gastrointestinal wall layered structure, which suffer from large extraction errors due to abnormalities in the gastrointestinal wall tissue and the inability to scientifically smooth broken edge regions, this invention aims to provide a method for extracting the edges of the gastrointestinal wall layered structure based on ultrasound images. The specific technical solution adopted is as follows: This invention proposes a method for edge extraction of the gastrointestinal wall hierarchical structure based on ultrasound images, the method comprising: Based on the motion direction and signal value of each pixel in adjacent frames of gastrointestinal wall ultrasound images, the tissue weight of each pixel position is obtained and a tissue weight matrix is ​​constructed. In the tissue weight matrix, a connected path with the largest cumulative weight along the column direction is determined as the baseline of the gastrointestinal wall reference layer; the cumulative weight of a pixel is obtained by accumulating the maximum tissue weight of the neighboring pixels in the previous column; For each column, determine the peak point of the organization weight along the normal vector direction on the baseline; based on the distance between the peak point and the baseline, and the organization weight of the peak point, determine a peak point corresponding to each level; verify and filter the results of the level to which the peak point belongs to obtain valid peak points; For each level, obtain the curve formed by the effective peak points along the column direction; for broken columns on the curve, fill in the gaps according to the curvature of the broken columns on the baseline to obtain the smooth edge curve of the current level.

[0007] Furthermore, the method for obtaining the organizational weight includes: The gastrointestinal wall ultrasound image is obtained by scanning in a direction perpendicular to the tube wall; the gradient vector of each pixel in the current frame of the gastrointestinal wall ultrasound image is obtained; the optical flow direction of each pixel is obtained based on the current frame and adjacent frames; the directional similarity between the gradient vector and the optical flow direction is obtained; and the tissue weight is obtained based on the directional similarity and the signal value of the pixel in the current frame of the gastrointestinal wall ultrasound image.

[0008] Furthermore, the method for obtaining the cumulative weight includes: The cumulative weight of the first column in the column direction is set to the corresponding organizational weight; for any target pixel in any column other than the first column, the neighboring pixels of the target pixel in the previous column are obtained, the neighboring pixel with the largest cumulative weight is taken as the relevant point, and the sum of the cumulative weight of the relevant point and the organizational weight of the target pixel is taken as the cumulative weight of the target pixel.

[0009] Furthermore, the method for obtaining the baseline includes: The pixel corresponding to the maximum cumulative weight of the last column along the column direction is taken as the endpoint of the baseline. Starting from the endpoint of the baseline, the corresponding relevant points are traced back to form the baseline.

[0010] Furthermore, the method for obtaining the normal vector direction at each position on the baseline includes: Construct a sliding window to be analyzed based on a preset neighborhood size; take the pixels on the baseline as the center point of the sliding window to be analyzed, connect the endpoints on both sides of the baseline inside the sliding window to be analyzed with the center point of the sliding window to be analyzed to form a local analysis curve and perform tangent slope analysis to obtain the tangent at the center point of the sliding window to be analyzed, and take the direction perpendicular to the tangent as the direction of the normal vector. If there is only one endpoint within the sliding window to be analyzed, then the slope direction between the center point of the sliding window to be analyzed and the adjacent pixel point is taken as the direction of the tangent and the direction of the normal vector is obtained.

[0011] Furthermore, the method for obtaining the degree of curvature on the baseline includes: If the local analysis curve is in a state of collinearity of three points, the curvature at the center point of the sliding window to be analyzed is set to a preset minimum value; otherwise, the circumradius of the endpoint and the center point of the sliding window to be analyzed is obtained, and the reciprocal of the circumradius is taken as the curvature.

[0012] Furthermore, determining the level to which the peak point belongs includes: The distance between the peak point and the baseline is taken as the first distance; the preset standard distance between the target level and the baseline level is taken as the second distance; the distance difference between the first distance and the second distance is obtained, and the matching cost between the peak point and the target level is obtained according to the distance difference and the organization weight of the peak point; The matching cost between each peak point and each level is obtained and a matching degree matrix is ​​constructed. The matching degree matrix is ​​solved using the Hungarian algorithm to obtain the optimal matching pair. Based on the matching relationship of the optimal matching pair, the level to which the peak point belongs is obtained.

[0013] Furthermore, the method for obtaining the effective peak point includes: If the matching cost of the optimal matching pair is greater than the preset cost threshold, the peak point corresponding to the optimal matching pair is removed. For the remaining peak points, the corresponding first distances are sorted according to the hierarchical order to obtain the first distance sequence. Elements in the first distance sequence that do not meet the standard change trend are detected and removed. The peak points corresponding to the remaining elements in the sequence are valid peak points.

[0014] Furthermore, the method for obtaining the smooth edge curve includes: The columns on both sides of the broken column on the curve are respectively used as reference columns; the basic modulus of the cubic Bézier curve algorithm is attenuated according to the curvature of the reference column on the baseline to obtain the controlled modulus of the reference column; the broken column is filled using the cubic Bézier curve algorithm based on the normal vector direction of the reference column on the baseline and the controlled modulus to obtain the smooth edge curve.

[0015] Furthermore, after obtaining the smooth edge curve, the process further includes: On the baseline, thickness detection lines are constructed along the normal vector direction at each position; for any two layers, the line segment of the thickness detection line between the smooth edge curves of the two layers is taken as the detection thickness, and the average detection thickness of all thickness detection lines is taken as the thickness between the two layers.

[0016] The present invention has the following beneficial effects: To address the issues of abnormal tissue thickening and spatial shift of echo peaks between adjacent layers caused by lesion infiltration in the gastrointestinal wall, which are prone to edge crossing and topological order disorder in traditional local gradient-based search, this invention constructs a tissue weight matrix by fusing the motion direction of adjacent frames with signal values, effectively enhancing the stability of the actual tissue structure. Furthermore, a baseline for global connectivity is determined along the column direction by accumulating the maximum tissue weight in the neighboring column, avoiding local noise interference. Further, for each column, the peak points of the tissue weights are extracted along the normal direction of the baseline, and their layer is determined by combining the distance between the peak point and the baseline, as well as the peak point's own tissue weight. This ensures that peaks deviating from normal anatomical positions or with weak signals receive lower assignment confidence. Unreliable assignments are then filtered and eliminated through verification, ensuring that the effective peak points of each layer strictly follow the anatomical order from the inside out in space, completely eliminating edge crossing and layer misjudgment.

[0017] Furthermore, after obtaining the curves formed by the effective peak points at each level, for the broken columns on the curves, the original curvature information of the baseline at that broken column is directly reused for completion. Since the curvature of the baseline reflects the macroscopic morphology of the arc-shaped direction of the gastrointestinal wall, the completion curve generated by using it as a constraint can conform to the natural anatomical curvature of the target tissue, avoiding the distortion and angles caused by straight line connections.

[0018] In summary, this invention can stably and continuously output independent and smooth edge curves at each level, providing a reliable data basis for subsequent accurate quantification of gastrointestinal wall thickness and significantly improving the robustness of ultrasound morphology-assisted diagnosis. Attached Figure Description

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

[0020] Figure 1 This is a flowchart of a method for extracting the edge of the gastrointestinal wall hierarchical structure based on ultrasound images, provided as an embodiment of the present invention. Detailed Implementation

[0021] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a method for extracting the edge of the gastrointestinal wall layer structure based on ultrasound images proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0023] The following describes in detail, with reference to the accompanying drawings, a specific scheme for the edge extraction method of the gastrointestinal wall hierarchical structure based on ultrasound images provided by the present invention.

[0024] Please see Figure 1 The diagram illustrates a flowchart of a method for extracting the edge of the gastrointestinal wall hierarchical structure based on ultrasound images, according to an embodiment of the present invention. The method includes: Step S1: Based on the motion direction and signal value of each pixel in adjacent frames of gastrointestinal wall ultrasound images, obtain the tissue weight of each pixel position and construct a tissue weight matrix.

[0025] This invention addresses the video stream used in ultrasound examination of the gastrointestinal wall. This video stream consists of multiple consecutive frames of ultrasound images. By analyzing these consecutive frames, the motion characteristics of individual pixels can be determined. Because the motion characteristics of continuous gastrointestinal wall tissue exhibit clear regularity and conform to the distribution direction of tissue edges, and the tissue texture should have a significantly higher signal relative to the background (i.e., higher brightness in the image), a pixel with regular motion characteristics and high brightness is more likely to belong to the gastrointestinal wall tissue. Based on this principle, this invention first analyzes the motion direction of each pixel in adjacent frames of gastrointestinal wall ultrasound images, and further combines this with signal values ​​to obtain the tissue weight of each pixel's position. A tissue weight matrix can be constructed to replace the original pixel value information of the ultrasound image for analysis. Since the original ultrasound image contains irrelevant influences such as noise, artifacts, and gas occlusion, this invention constructs a tissue weight matrix of the same size as the original ultrasound image. This tissue weight enhances the features of the real tissue structure in the image and suppresses other background noise. Subsequent analysis steps use the tissue weight matrix as a basis for peak extraction and other operations, resulting in stronger anti-interference capabilities and more stable extracted edge information.

[0026] In one specific implementation of this invention, three frames are analyzed as a single unit, with the middle frame serving as the target frame. Based on the preceding and following frames, the Lucas-Kanade optical flow estimation algorithm is used to calculate the spatial displacement distance and direction of any pixel in the target frame. These displacement features are then synthesized to obtain the optical flow vector of the pixel. Subsequent data processing only requires analysis of the optical flow direction.

[0027] Preferably, considering that the regularity of gastrointestinal wall tissue movement is reflected in the clear angle between the direction of movement and the gradient direction at the edge, in order to achieve effective directional comparison, a scanning mode is specified during the ultrasound image scanning of the gastrointestinal wall, allowing the probe to scan along the normal direction of the gastrointestinal wall, that is, perpendicular to the wall direction. Under this scanning method, the direction of movement of the gastrointestinal wall tissue in the video will be consistent with the gradient direction of the layer boundary. Therefore, the tissue weight can be obtained by further comparative analysis of the direction, which may specifically include: The gradient vector of each pixel in the current frame of the gastrointestinal wall ultrasound image is obtained; the optical flow direction of each pixel is obtained based on the current frame and adjacent frames; the directional similarity between the gradient vector and the optical flow direction is obtained; and the tissue weight is obtained based on the directional similarity and the signal value of the pixel in the current frame of the gastrointestinal wall ultrasound image. That is, the greater the directional similarity and the greater the signal value, the more the pixel conforms to the normal gastrointestinal wall tissue characteristics, and the greater the corresponding tissue weight should be.

[0028] In one specific implementation of this invention, cosine similarity is chosen to quantify the directional similarity. Cosine similarity, in its calculation and analysis, treats both the gradient vector and the optical flow direction as a unit vector. Because the cosine similarity value ranges from -1 to 1, to avoid the influence of negative numbers, a non-negative truncation is performed, setting negative results to 0 to obtain the directional similarity. After obtaining the directional similarity, multiplying it by the pixel value of the pixel on the gastrointestinal wall ultrasound image yields the tissue weight.

[0029] It should be noted that the aforementioned gradient direction, optical flow direction, cosine similarity, and other techniques are all existing technologies known to those skilled in the art, and will not be elaborated upon here.

[0030] In a further specific implementation of this invention, after obtaining the organizational weights, in order to map the values ​​to a standard percentage range and eliminate extreme value interference, all organizational weights are arranged in descending order, and the 95th percentile value is selected as the normalization denominator benchmark. Using this benchmark as the denominator, all organizational weights are normalized through maximum normalization. If an organizational weight is greater than the benchmark, it is directly set to 1. Through normalization, the interference of extreme bright spots on the overall data distribution can be eliminated.

[0031] Step S2: In the tissue weight matrix, determine a connected path with the largest cumulative weight along the column direction as the baseline of the gastrointestinal wall baseline layer; the cumulative weight of a pixel is obtained by accumulating the maximum tissue weight of the neighboring pixels in the previous column.

[0032] In ultrasound images of the gastrointestinal wall, the layering refers to the multi-layered, parallel band-like structure of alternating light and dark areas that appears during ultrasound examination. Each layer corresponds to a different histological level and has specific echogenic characteristics. There are typically five layers, with the third layer, the middle layer, serving as the baseline for analysis. This layer corresponds to the submucosal tissue and is usually the brightest and most continuous layer. Due to its prominent features, it can be easily extracted from the image and used as the processing benchmark for various steps. This invention aims to use the third layer as the baseline layer and identify a clear edge curve for each of the other layers. This ensures accurate layer classification while exhibiting continuous and smooth characteristics for convenient tissue analysis.

[0033] Because the third layer serves as the baseline layer, its organizational characteristics are obvious, resulting in larger values ​​in the organizational weight matrix. However, directly selecting larger values ​​for connection as the baseline would lead to higher errors. This embodiment of the invention uses a column-wise cumulative method to determine the baseline for global connectivity. This column-wise cumulative approach enhances the numerical representation in the baseline layer; positions with high organizational weights will have even higher weights after accumulation. Since it's column-wise cumulative, the cumulative weight of a pixel is obtained by accumulating the maximum organizational weight of its neighboring pixels in the previous column. During the accumulation process, the maximum neighboring pixels in the previous column are continuously determined, resulting in a clear correspondence between points. Based on this correspondence, relevant points can be connected in the column direction to determine the baseline. This yields a continuous, uninterrupted path with clearly defined organizational characteristics, which can serve as a reference for subsequent steps.

[0034] In one specific implementation of this invention, the column direction is from left to right.

[0035] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the cumulative weight includes: Since the first column of the organization weight matrix does not have a preceding column, the cumulative weight of the first column in the column direction is set to the corresponding organization weight. For any target pixel in any column other than the first column, the neighboring pixels of the target pixel in the preceding column are obtained. The neighboring pixel with the largest cumulative weight is taken as the relevant point, and the sum of the cumulative weight of the relevant point and the organization weight of the target pixel is taken as the cumulative weight of the target pixel.

[0036] In one specific implementation of this invention, the selection rule for neighboring pixels is based on a preset height range. This implementation uses a range of length 7, meaning selection is performed at the positions of three pixels above and three pixels below the target pixel. Furthermore, to prevent array out-of-bounds errors that could cause computational crashes at the top or bottom of the image, the system truncates the upper and lower boundary coordinates of this range, forcibly limiting the search range to within the image boundaries. This means that a target pixel may only have neighboring pixels at the positions of the three pixels below it in the previous column.

[0037] Furthermore, since the correlation between points has been determined during the cumulative calculation, the baseline can be determined quickly by using a reverse backtracking method. Specifically, this includes: taking the pixel corresponding to the maximum cumulative weight of the last column along the column direction as the endpoint of the baseline, and tracing back from the endpoint of the baseline to form the baseline by corresponding related points.

[0038] Preferably, in some implementations of this invention, subsequent steps require determining the normal vector direction corresponding to each column position using a baseline as a reference. To suppress local jagged edges and noise, directly using adjacent points to calculate the tangent would cause these microscopic jagged edges to severely interfere with the stability of the normal vector direction, resulting in severe column-by-column jitter in the normal vector. Subsequent sampling along the normal vector would further amplify this jitter, introducing unnecessary edge errors. Therefore, this invention employs a sliding window analysis method, using a sliding window as a large span for normal vector analysis, specifically including: A sliding window to be analyzed is constructed according to a preset neighborhood size; the pixels on the baseline are used as the center point of the sliding window to be analyzed; the endpoints on both sides of the baseline inside the sliding window to be analyzed are connected to the center point of the sliding window to be analyzed to form a local analysis curve and the tangent slope is analyzed to obtain the tangent at the center point of the sliding window to be analyzed; the direction perpendicular to the tangent is used as the normal vector direction.

[0039] In one specific implementation of this invention, the neighborhood size can be set to 11, that is, a window with a length of 11 is constructed in the column direction. If the point on the baseline is in the middle position, it is used as the center point of the sliding window to be analyzed, and 5 baseline points on the left and right sides will be included. The endpoints on both sides are selected for analysis. Similarly, there may be cases where there are less than 5 on one side.

[0040] If there is only one endpoint within the sliding window to be analyzed, it indicates that the boundary information is insufficient and only a more local estimation can be used. The slope direction between the center point of the sliding window to be analyzed and the adjacent pixel point can be directly used as the direction of the tangent and the direction of the normal vector can be obtained.

[0041] It should be noted that the above-described methods for analyzing the tangent slope are all techniques well-known to those skilled in the art. In the first case with three complete points, the three points can be connected and smoothed into a curve, and the tangent slope at the center point of the sliding window to be analyzed can be obtained through the derivative method. The specific methods for smoothing the curve and obtaining the tangent slope are all techniques well-known to those skilled in the art, and will not be elaborated here.

[0042] Furthermore, in subsequent processes of this embodiment of the invention, fracture filling is also required based on the degree of curvature at each column position on the baseline. Therefore, the degree of curvature on the baseline should be quantified, specifically including: First, it's necessary to determine if the three points corresponding to the local analysis curve are completely collinear. If they are completely collinear, it indicates that there is no curvature at that location, and for ease of subsequent processing, a minimum value can be set. Conversely, if they are not completely collinear, the radius of the circumscribed circle between the endpoint and the center point of the sliding window to be analyzed can be obtained, and the reciprocal of the circumscribed circle radius can be used as the degree of curvature. That is, the degree of curvature is quantified by the circumscribed circle; the smaller the circumscribed circle radius, the more pronounced the bend, and the greater the corresponding degree of curvature. It should be noted that since the radius cannot be 0, the degree of curvature can be normally quantified as a value between 0 and 1.

[0043] It should be noted that the method for determining whether three points on a local analysis curve are completely collinear can be to connect the three points. If the connection is a straight line with a fixed slope, it means that the three points are completely collinear. This is a technique well known to those skilled in the art and will not be elaborated here.

[0044] In one specific implementation of this invention, the minimum value of the degree of bending can be set to 0.

[0045] Step S3: For each column, determine the peak point of the organization weight along the normal vector direction on the baseline; determine a peak point corresponding to each level based on the distance between the peak point and the baseline, and the organization weight of the peak point; verify and filter the level results to which the peak point belongs to obtain valid peak points.

[0046] The present invention aims to find the tissue edge corresponding to each layer in the image, except for the base layer. The present invention uses columns as the analysis unit and determines the layer assignment result corresponding to each column step by step along the column direction.

[0047] For each column, the peak points of the tissue weights can first be determined along the normal vector direction on the baseline. Since the normal vector direction can be considered as the direction of hierarchical distribution, there is a baseline point on the baseline for each column. A straight line extending along the normal vector direction from the baseline point can be constructed on both sides, and the tissue weight sequence on this line can be determined. Each peak point can be determined using existing maximum value analysis methods. Because the boundaries between the layers of the gastrointestinal wall appear as transitional zones of light and dark on the image, these boundaries usually correspond to the peak values ​​of the tissue weights when scanning along a direction perpendicular to the wall (normal vector direction). Therefore, finding the peak point is equivalent to finding the possible layer boundary locations under the current column. Since there are multiple peak points under the analysis of the current column, which may correspond to different levels, it is necessary to determine the level to which the peak point belongs.

[0048] Because the different layers of the gastrointestinal wall follow a fixed interval distribution on ultrasound images, the closer the distance between a peak and the baseline is to the standard interval of a layer, the better the match. Furthermore, considering the tissue weight of the peak, which serves as a confidence level during the matching process, a higher tissue weight indicates a more reliable assessment of the proximity. By combining these two features, peaks can be matched with various layers to determine the layer to which the peak belongs. It should be noted that since there are typically only four layers (excluding the third layer in a five-layer model), while there may be more peaks, the matching process must ensure that one layer corresponds to only one peak. That is, the resulting matching relationship should be one-to-one, representing a single tissue point corresponding to the target layer in the current column of analysis.

[0049] Although the matching process can obtain a one-to-one relationship, the directly obtained matching relationship may actually have the problem of forced assignment. Therefore, the results of the level to which the peak point belongs need to be further verified and filtered, deleting matching results that are obviously inconsistent with common sense, and retaining the valid peak points for analysis.

[0050] It should be noted that, in one specific implementation of this invention, considering that the normal vector direction is usually at an angle, the sampling coordinate points on the extended straight line cannot be perfectly aligned with the discrete integer pixel grid in the image. Therefore, along this straight line, probe points are marked every pixel step. For each probe point with decimal coordinates, the weight values ​​at the four adjacent integer grid coordinates are retrieved, and the precise pixel weight value of the decimal coordinate point is calculated using a bilinear interpolation algorithm. Through the above sub-pixel resampling operation, the system extracts a smooth, continuous, and perfectly aligned one-dimensional numerical sequence on the tilted ray. The specific interpolation algorithm is a well-known technique and will not be described in detail here.

[0051] Preferably, in this embodiment of the invention, determining the level to which the peak point belongs includes: The distance between the peak point and the baseline is taken as the first distance; the preset standard distance between the target level and the baseline level is taken as the second distance; the distance difference between the first distance and the second distance is obtained, and the matching cost between the peak point and the target level is obtained based on the distance difference and the organizational weight of the peak point. That is, the smaller the distance difference and the larger the organizational weight, the better the peak point matches the target level, and the smaller the matching cost should be.

[0052] In one specific implementation of this invention, the matching cost is expressed by the formula: in, The matching cost between the target level u and the k-th peak point. The first distance from the crest point k, The second distance corresponding to the target level u. Let k be the organizational weight of the peak point.

[0053] In the above formula, the distance difference is quantified by the absolute value of the difference, and the second distance is used as the denominator, so that the final distance difference represents a deviation ratio. The smaller the absolute value of the difference, the smaller the deviation ratio, and the lower the corresponding matching cost. Because the organization weights have been normalized, negative correlation can be achieved directly by subtraction, so that the larger the organization weight, the lower the final matching cost. The setting of the standard distance needs to be considered in conjunction with multiple factors such as camera field of view parameters and ultrasonic detection equipment, and can be set accordingly before the implementation of the scheme. The details will not be elaborated here.

[0054] The matching cost between each peak point and each level is obtained, and a matching degree matrix is ​​constructed. The matching degree matrix is ​​then solved using the Hungarian algorithm to obtain the optimal matching pairs. Based on the matching relationship of the optimal matching pairs, the level to which the peak point belongs is determined. It should be noted that the Hungarian algorithm is a well-known technique in the art, and steps such as matrix preprocessing will not be elaborated further. The gastrointestinal wall has five levels, and after removing the baseline level, four optimal matching pairs can be obtained.

[0055] Preferably, in some implementations of the embodiments of the present invention, in order to achieve accurate verification of matching results and avoid the final effective peak point results having topological inversions that violate the common sense of human tissue anatomy, the specific acquisition method includes: If the matching cost of the optimal matching pair is greater than a preset cost threshold, it indicates that the matching result is a forced matching method and not a normal physiological matching result. The peak point corresponding to the optimal matching pair is then removed. For the remaining peak points, the corresponding first distances are sorted according to hierarchical order to obtain a first distance sequence. The first distance sequence should meet a normal trend of change; for example, from the first level to the third level, the distances should decrease, and from the third level to the fifth level, the distances should increase. Elements in the first distance sequence that do not meet the standard trend of change are detected and removed. The peak points corresponding to the remaining elements in the sequence are valid peak points.

[0056] It should be noted that if the first distance sequence does not meet the standard trend, it can be determined directly by the difference between adjacent elements in the sequence. For example, the trend from the first level to the second level should be downward. This can be achieved by subtracting the element corresponding to the first level from the element corresponding to the second level in the sequence. If the result is negative and its absolute value is greater than the preset normal interval distance, then the trend is met; otherwise, it is not. The normal interval distance and the standard distance are both predefined prior values. These types of data need to be specifically set in conjunction with specific image field of view and other parameters, which will not be elaborated or limited here.

[0057] In one specific implementation of this invention, the cost threshold can be set to 1.5. The specific setting can be determined according to the specific scenario, and will not be elaborated here.

[0058] Step S4: For each level, obtain the curve formed by the effective peak points along the column direction; for broken columns on the curve, fill in the gaps according to the curvature of the broken columns on the baseline to obtain the smooth edge curve of the current level.

[0059] Through the extraction steps described above, in the iterative analysis process with each column as a unit, each analysis process will obtain hierarchical relevant valid peak points. It should be noted that the valid peak point may not be located in the current column, because the selection of the peak point is based on the normal vector direction of the column on the baseline. Therefore, the column index of the valid peak point may not be the same as that of the current column. However, after iterative analysis, traversing all columns can obtain multiple valid peak points corresponding to each level. Connecting these peak points along the column direction and smoothing them will yield the curve formed by the valid peak points.

[0060] Since the effective peak points have been verified and screened, the obtained curves may have breaks. The breaks are also analyzed in columns, and each column is treated as a break column. Then, the breaks on the curve are filled in based on the curvature of the break column at the baseline position. Finally, the smooth edge curve of the current level can be obtained, thus completing the extraction of the edge of each layer of the gastrointestinal wall structure.

[0061] Preferably, in this embodiment of the invention, the method for obtaining the smooth edge curve includes: The columns on both sides of the break on the curve are taken as reference columns, that is, there are two reference columns; the basic modulus of the cubic Bézier curve algorithm is attenuated according to the curvature of the reference columns on the baseline to obtain the controlled modulus of the reference columns.

[0062] Based on the normal vector direction of the reference column on the baseline, and the controlled modulus, the broken column is filled using a cubic Bézier curve algorithm to obtain the smooth edge curve.

[0063] Cubic Bézier curves are parametric curves commonly used for smoothing interpolation, shape control, and local support. In image processing, they are often used to connect broken edges or generate naturally transitioning shapes. This approach encounters edge breaks caused by gas obstruction in gastrointestinal wall ultrasound images. Traditional straight-line connections would produce sharp angles that violate the natural curvature of the tissue. The main reasons for using cubic Bézier curves are as follows: (1) It needs to conform to the original curvature of the tissue. Because the two ends of the fracture point already have corresponding degrees of curvature on the baseline as a reference, the Bézier curve can inherit this curvature by adjusting the control point modulus, so that the filled curve smoothly continues the curved direction of the tissue at both ends, rather than a rigid straight line.

[0064] (2) The control point modulus can be dynamically constrained. This invention does not allow for free adjustment of control points, but rather calculates the controlled modulus length using the degree of curvature of a reference column on a baseline. When the curvature is large, the modulus length is further reduced to limit the curve from bulging outwards; when the curvature is small, a relatively gentle transition is allowed. This controlled modulus length constraint, which is sensitive to the degree of curvature, is a unique and convenient characteristic of Bézier curves.

[0065] (3) Implicit function solution, aligning the integer column grid The x-coordinate of a Bézier curve is a function of the parameter t, and the image requires that the points on the final curve must fall on integer column j. This embodiment of the invention establishes a standard cubic Bézier curve parametric equation. This equation is expressed as B(t)=(X(t),Y(t)), where the control parameter t ranges from [0,1], X(t) represents the column coordinate of the point corresponding to parameter t on the curve, and Y(t) is the row coordinate. Since the cubic Bézier curve is directly related to the control parameter t rather than the column coordinate j, the column index of the broken column cannot be directly substituted into the equation for calculation. To ensure that the interpolation curve perfectly aligns with the discrete column grid of the image, for each broken column, the column coordinate is substituted into X(t)=j, and a binary search algorithm is used to iteratively optimize within the range of [0,1] until the t that makes the x-coordinate equation true is found. Then, substituting this into the equation yields the corresponding smooth interpolation row coordinate i. All the calculated interpolation coordinates are then incorporated into the set of valid peak nodes with missing values. By traversing and filling each target level across the entire image, the final output is a multi-layered smooth edge curve with complete column closure and independent, continuous flow across each layer. It should be noted that during filling, the connecting line direction must be perpendicular to the normal vector direction. Because there are two reference columns, in one implementation of this invention, the normal vector direction of the latter reference column in the column direction is selected as the reference direction, and filling must ensure that it is perpendicular to this reference direction.

[0066] The specific cubic Bézier curve algorithm is a well-known technique in the art. The basic modulus is used to determine the pixel length of the baseline segment of the interpolation curve in the fracture zone, which is referenced to the average span of the lesion. It can be preset. In some implementations of this invention, it can be set to a range of 15 to 50 pixels, specifically 30, which will not be elaborated here.

[0067] In one specific implementation of this invention, the attenuation method of the controlled modulus can be implemented using a ratio, specifically expressed by the formula: in, For a reference column, the controlled modulus length, Based on the basic module length, This is the bending amplification factor. The degree of curvature is listed as a reference on the baseline.

[0068] The above formula amplifies the degree of curvature by a factor of several times. Since the degree of curvature is a normalized data in some embodiments of the present invention, the amplification can make the change in the degree of curvature produce a significant quantitative difference. If the degree of curvature is 0, the positive integer 1 in the denominator can prevent the denominator from being 0 and reject the attenuation of the basic modulus, which is in line with the expected effect of the embodiments of the present invention.

[0069] Preferably, in some implementations of the present invention, after obtaining the smooth edge curve, the method further includes: On the baseline, thickness detection lines are constructed along the normal vector direction at each position; for any two layers, the line segment of the thickness detection line between the smooth edge curves of the two layers is taken as the detection thickness, and the average detection thickness of all thickness detection lines is taken as the thickness between the two layers.

[0070] The setting of the probe line can effectively quantify the thickness because the gastrointestinal wall exhibits a connected, curved arc shape in its spatial distribution. If the vertical difference between the vertical coordinates of different levels is directly calculated at the same coordinate column, the calculated thickness in tilted or curved areas of the image will be significantly greater than its actual normal vertical thickness. Therefore, by constructing a probe line and determining its intersection with the smooth edge curve, the probe thickness can be quantified by further calculating its length. This is a conventional geometric analysis and will not be elaborated or limited here.

[0071] Quantifying the thickness can further reveal the distribution characteristics of the gastrointestinal wall structure. It should be noted that the thickness obtained above is calculated under the image field of view and can be further converted into a length unit in the real coordinate system based on the pixel size ratio constant of the ultrasound image. This is a technical means well known to those skilled in the art and will not be elaborated here.

[0072] In summary, this invention obtains the tissue weight of each pixel based on the motion direction and signal value of each pixel in adjacent frames of gastrointestinal wall ultrasound images, forming a tissue weight matrix. Then, a connected path with the largest cumulative weight along the column direction is determined as the baseline of the gastrointestinal wall reference layer. The cumulative weight is obtained by statistically analyzing the maximum tissue weight of the neighboring pixels in the previous column. Next, for each column, the peak point of the tissue weight is determined along the normal vector direction on the baseline. The layer to which the peak point belongs is determined based on its distance from the baseline and its tissue weight, and valid peak points are verified and screened. Finally, for each layer, a curve formed by the valid peak points is obtained along the column direction. For broken columns on the curve, they are filled in according to the curvature of the broken columns on the baseline to obtain smooth edge curves for each layer. This invention can stably output non-intersecting, naturally shaped gastrointestinal wall layered edges.

[0073] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0074] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images, characterized in that, The method includes: Based on the motion direction and signal value of each pixel in adjacent frames of gastrointestinal wall ultrasound images, the tissue weight of each pixel position is obtained and a tissue weight matrix is ​​constructed. In the tissue weight matrix, a connected path with the largest cumulative weight along the column direction is determined as the baseline of the gastrointestinal wall reference layer; the cumulative weight of a pixel is obtained by accumulating the maximum tissue weight of the neighboring pixels in the previous column; For each column, determine the peak point of the organization weight along the normal vector direction on the baseline; based on the distance between the peak point and the baseline, and the organization weight of the peak point, determine a peak point corresponding to each level; verify and filter the results of the level to which the peak point belongs to obtain valid peak points; For each level, obtain the curve formed by the effective peak points along the column direction; for broken columns on the curve, fill in the gaps according to the curvature of the broken columns on the baseline to obtain the smooth edge curve of the current level.

2. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, The methods for obtaining the organizational weights include: The gastrointestinal wall ultrasound image is obtained by scanning in a direction perpendicular to the tube wall; the gradient vector of each pixel in the current frame of the gastrointestinal wall ultrasound image is obtained; the optical flow direction of each pixel is obtained based on the current frame and adjacent frames; the directional similarity between the gradient vector and the optical flow direction is obtained; and the tissue weight is obtained based on the directional similarity and the signal value of the pixel in the current frame of the gastrointestinal wall ultrasound image.

3. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, The method for obtaining the cumulative weight includes: The cumulative weight of the first column in the column direction is set to the corresponding organizational weight; for any target pixel in any column other than the first column, the neighboring pixels of the target pixel in the previous column are obtained, the neighboring pixel with the largest cumulative weight is taken as the relevant point, and the sum of the cumulative weight of the relevant point and the organizational weight of the target pixel is taken as the cumulative weight of the target pixel.

4. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 3, characterized in that, The method for obtaining the baseline includes: The pixel corresponding to the maximum cumulative weight of the last column along the column direction is taken as the endpoint of the baseline. Starting from the endpoint of the baseline, the corresponding relevant points are traced back to form the baseline.

5. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, The methods for obtaining the normal vector direction at each position on the baseline include: Construct a sliding window to be analyzed based on a preset neighborhood size; take the pixels on the baseline as the center point of the sliding window to be analyzed, connect the endpoints on both sides of the baseline inside the sliding window to be analyzed with the center point of the sliding window to be analyzed to form a local analysis curve and perform tangent slope analysis to obtain the tangent at the center point of the sliding window to be analyzed, and take the direction perpendicular to the tangent as the direction of the normal vector. If there is only one endpoint within the sliding window to be analyzed, then the slope direction between the center point of the sliding window to be analyzed and the adjacent pixel point is taken as the direction of the tangent and the direction of the normal vector is obtained.

6. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 5, characterized in that, The method for obtaining the degree of curvature on the baseline includes: If the local analysis curve is in a state of collinearity of three points, the curvature at the center point of the sliding window to be analyzed is set to a preset minimum value; otherwise, the circumradius of the endpoint and the center point of the sliding window to be analyzed is obtained, and the reciprocal of the circumradius is taken as the curvature.

7. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, Determine the level to which the peak point belongs, including: The distance between the peak point and the baseline is taken as the first distance; the preset standard distance between the target level and the baseline level is taken as the second distance; the distance difference between the first distance and the second distance is obtained, and the matching cost between the peak point and the target level is obtained according to the distance difference and the organization weight of the peak point; The matching cost between each peak point and each level is obtained and a matching degree matrix is ​​constructed. The matching degree matrix is ​​solved using the Hungarian algorithm to obtain the optimal matching pair. Based on the matching relationship of the optimal matching pair, the level to which the peak point belongs is obtained.

8. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 7, characterized in that, The method for obtaining the effective peak points includes: If the matching cost of the optimal matching pair is greater than the preset cost threshold, the peak point corresponding to the optimal matching pair is removed. For the remaining peak points, the corresponding first distances are sorted according to the hierarchical order to obtain the first distance sequence. Elements in the first distance sequence that do not meet the standard change trend are detected and removed. The peak points corresponding to the remaining elements in the sequence are valid peak points.

9. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, The method for obtaining the smooth edge curve includes: The columns on both sides of the broken column on the curve are respectively used as reference columns; the basic modulus of the cubic Bézier curve algorithm is attenuated according to the curvature of the reference column on the baseline to obtain the controlled modulus of the reference column; the broken column is filled using the cubic Bézier curve algorithm based on the normal vector direction of the reference column on the baseline and the controlled modulus to obtain the smooth edge curve.

10. The method for edge extraction of gastrointestinal wall hierarchical structure based on ultrasound images according to claim 1, characterized in that, After obtaining the smooth edge curve, the following steps are also included: On the baseline, thickness detection lines are constructed along the normal vector direction at each position; for any two layers, the line segment of the thickness detection line between the smooth edge curves of the two layers is taken as the detection thickness, and the average detection thickness of all thickness detection lines is taken as the thickness between the two layers.