Bladder edge detection method for bladder B ultrasonic image
By determining the vertical scanning line and dynamic critical value in bladder ultrasound images, the accuracy problem of bladder edge detection is solved, and efficient and accurate bladder edge detection is achieved in low-quality images, which is suitable for primary medical scenarios.
Patent Information
- Application Number
- CN202510514560.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-05
AI Technical Summary
In the B-ultrasound image analysis of the prior art, the boundary detection accuracy is insufficient, especially under low-quality images and noise interference, which is difficult to accurately distinguish the bladder boundary, affecting bladder capacity measurement and tumor positioning. The performance of deep learning models in mobile devices is degraded, requiring a large amount of labeled data training.
By determining three equally spaced vertical scanning lines in the middle area of the bladder B-ultrasound image, the "bright-dark-bright" characteristics of the bladder area are used to search for the key points of the lower bladder wall, calculate the dynamic critical value, and obtain the left and right boundaries in combination with the boundary extension method, and complement the bladder profile by interpolation to adapt to morphological changes and noise interference.
It improves the accuracy and robustness of bladder edge detection, reduces manual intervention, improves diagnostic efficiency, and is suitable for clinical scenarios with low contrast and high noise.
Smart Images

Figure CN120431041A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a bladder edge detection method for bladder B-ultrasound images. Background Art
[0002] Bladder ultrasound image analysis is a crucial tool for diagnosing urinary diseases. The accuracy of its boundary detection directly impacts critical clinical decisions such as bladder volume measurement and tumor localization. Manual annotation requires outlining ultrasound images frame by frame, taking an average of 5-8 minutes per case, and can vary by up to 15%-20% between different healthcare providers. Existing automated algorithms face three major technical bottlenecks: First, the inferior bladder wall exhibits high brightness due to the near-field effect of the ultrasound probe, making it difficult for global threshold-based detection methods to distinguish it from surrounding tissue; second, the low contrast between the superior wall and surrounding tissue results in broken boundaries in traditional edge detection algorithms; third, bladder morphology exhibits highly nonlinear changes due to urine filling, leading to high matching errors for fixed-shape templates. Further complicating matters, clinical ultrasound images are often subject to bowel gas artifacts and probe shadowing. Current mainstream solutions, such as deep learning models, achieve over 90% accuracy on ideal datasets, but their performance plummets with low-quality images acquired by mobile ultrasound devices and require extensive training with labeled data. This current state of the art severely limits the prevalence and consistency of bladder disease screening, particularly in primary care settings. Therefore, developing a robust edge detection method that can overcome noise interference, adapt to morphological changes, and does not require large-scale training data has become a clinical engineering technology problem that needs to be solved urgently. Summary of the Invention
[0003] To address the problems of the above-mentioned prior art, the present invention proposes a bladder edge detection method for bladder B-ultrasound images, comprising: acquiring a bladder B-ultrasound image; determining three equally spaced vertical scanning lines in the middle area of the bladder B-ultrasound image, and searching for key points on the lower wall of the bladder based on the "bright-dark-bright" characteristics of the bladder area; calculating dynamic critical values of the inner and outer areas of the bladder based on the pixel values of the neighboring points of the key points, and simultaneously acquiring key points on the upper wall of the bladder vertically upward; acquiring the left and right boundaries of the bladder using a boundary extension method, and saving the left and right endpoints of the upper and lower boundaries of the bladder; and completing the bladder contour by interpolation based on the left and right endpoints of the upper and lower boundaries.
[0004] The present invention uses an innovative real-time interpolation method to effectively improve the accuracy and robustness of bladder edge detection in complex B-ultrasound images; reduce manual intervention and improve diagnostic efficiency; and is suitable for clinical scenarios with low contrast and high noise. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Figure 1 A flow chart of the method proposed in the present invention;
[0006] Figure 2 Schematic diagram of vertical scanning lines of key points on the lower wall of the present invention;
[0007] Figure 3 This is a schematic diagram of scanning key points on the upper wall of the present invention;
[0008] Figure 4 Schematic diagram of edge padding of the present invention. DETAILED DESCRIPTION
[0009] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0010] A bladder edge detection method for bladder B-ultrasound images, such as Figure 1 As shown, the method includes: obtaining a bladder B-ultrasound image; determining three equally spaced vertical scanning lines in the middle area of the bladder B-ultrasound image, searching for key points of the lower wall of the bladder according to the "bright-dark-bright" characteristics of the bladder area; calculating the dynamic critical value of the inner and outer areas of the bladder according to the pixel values of the neighboring points of the key points, and obtaining the key points of the upper wall of the bladder vertically upward; using the boundary extension method to obtain the left and right boundaries of the bladder, and saving the left and right endpoints of the upper and lower boundaries of the bladder; and completing the bladder contour by interpolation based on the left and right endpoints of the upper and lower boundaries.
[0011] In this embodiment, the present invention provides a bladder edge detection method for bladder B-ultrasound images, specifically: first, the bladder position is determined by three center scanning lines. For an image of size H×W, the three vertical lines are located at the first vertical line W / 2-10, the second vertical line W / 2, and the third vertical line W / 2+10, respectively. Figure 2 By sampling the pixel value of each vertical line, classifying the pixels into layers and smoothing them for denoising, the image is scanned upward from the bottom to detect vertical lines that meet the "bright-dark-bright" feature. Vertical lines with a reasonable length are screened, and the coordinates of the key points on the lower wall are finally determined.
[0012] Furthermore, pixels on vertical lines are layered, and the original image grayscale data of 0-255 levels represented by 8 bits are layered into 0-7 levels. Consistency filtering of adjacent pixels is used to eliminate noise interference, and vertical scan lines that conform to "bright-dark-bright" are detected, and the transition points from bright to dark are used as key points of the lower wall of the bladder.
[0013] Furthermore, for the original pixel point V on the vertical scanning line mid(i,j) The result of its grayscale division v mid(i,j) =V mid(i,j) / 32. For the scan lines after grayscale division, consistency filtering is used. If v mid(i-1,j) =v mid(i+1,j) Then v mid(i,j) =v mid(i-1,j) .
[0014] Furthermore, three vertical lines are detected from the bottom of the image upwards, and the grayscale division results of each vertical line are detected. and The surface preselects the point mid(i0,j) as the key point of the lower wall on the vertical line, and at the same time, the vertical line appears and And i0>i1, on the vertical coordinate of the vertical line between i0 and i1 v mid If all are 0, then the surface meets the characteristics of "bright-dark-bright". Select the vertical line with the largest i0-i1 among the three vertical lines. The coordinates of its mid(i0,j) are the key point bot_mid on the lower wall, and the coordinates of mid(i1,j) are the pre-selected upper wall point top_prec.
[0015] Furthermore, three vertical lines are detected from the bottom of the image upwards, and the grayscale division results of each vertical line are detected. and The surface preselects the point mid(i0,j) as the key point of the lower wall on the vertical line, and at the same time, the vertical line appears and And i0>i1, on the vertical coordinate of the vertical line between i0 and i1 v mid If all are 0, then the surface meets the characteristics of "bright-dark-bright". Select the vertical line with the largest i0-i1 among the three vertical lines. The coordinates of its mid(i0,j) are the key point bot_mid on the lower wall, and the coordinates of mid(i1,j) are the pre-selected upper wall point top_prec.
[0016] Furthermore, the dynamic critical values of the bladder internal and external regions are calculated based on the pixel values near the key points of the lower bladder wall, and the key points of the upper bladder wall are obtained by vertically searching upwards. The main steps are:
[0017] stp1: Dynamic critical value calculation steps:
[0018] Define a local neighborhood window centered on the lower wall key point and calculate the grayscale mean μ of the pixels in the window local and standard deviation σ local ; Generate an adaptive dynamic critical value based on local statistical characteristics, and its calculation formula is:
[0019] T bot_bound =μ local +k·σ local
[0020] Among them, T bot_bound is the dynamic critical value, k is the empirical coefficient, and the default value is 1.1. The value selection rule of the empirical coefficient k is optimized through clinical data set verification. The default value k=1.1 reaches the optimal balance in comprehensive testing; the value range is 0.5≤k≤2; the dynamic adjustment rule of k is: if the image average grayscale v aug <50, then k=0.8; if the local area noise intensity σ local >25, then k=min(1.1+0.1(σ local -25),2).
[0021] The size of the lower boundary local neighborhood window is N×N, where N is an odd number and satisfies 5≤N≤15. N=11 is preferred to balance computational efficiency and local feature sensitivity. If the image resolution W≥800, N is 15; if W≤400, N is 7. When the image signal-to-noise ratio (SNR) is less than 20dB, N is increased by 2 to improve noise suppression.
[0022] stp2: upper wall key point search steps:
[0023] From the left and right sides of the key point bot_mid on the lower wall, N vertical lines are emitted vertically upward with a spacing of SPACE, where SPACE = 9 pixels and N = 5. Figure 3 As shown; Scan from bottom to top along each vertical line and detect two consecutive pixel values greater than the preset threshold T bound The vertical distance between the position and the preselected upper wall point top_prec is no more than D max (D max ≤H / 6), for multiple vertical lines with a spacing of SPACE, the second largest value screening strategy is adopted: the candidate point with the second largest grayscale value is retained as the final upper wall key point top_mid.
[0024] stp3: Calculation steps for upper wall critical value:
[0025] With the new upper wall key point top_mid as the center, define a local neighborhood window and calculate the grayscale mean μ of the pixels in the window local and standard deviation σ local ; Generate an adaptive dynamic critical value based on local statistical characteristics, and its calculation formula is:
[0026] T bot_bound =μ local +k·σ local
[0027] Among them, T bot_bound is the dynamic critical value, k is the empirical coefficient, the default selection is 1.1, and the value range is 0.5≤k≤2; the dynamic adjustment rule of k is: if the image average grayscale v aug<50, then k=0.8; if the local area noise intensity σ local >25, then k=min(1.1+0.1(σ local -25),2), if artifacts are detected in the upper wall, k=1.5.
[0028] Noise intensity σ local Through local window grayscale calculation, intestinal gas artifacts are detected by the grayscale difference rate of adjacent pixels. The difference rate formula is:
[0029]
[0030] If the mutation rate is greater than 10%, it is considered an artifact, and k = 1.5.
[0031] The size of the upper boundary local neighborhood window is selected to be the same as that of the lower boundary.
[0032] stp4: Boundary verification step: The geometric consistency of the obtained upper and lower wall key points is verified, with the following requirements: the vertical coordinate of the upper wall key point top_mid is smaller than the vertical coordinate of the lower wall key point bot_mid, and the horizontal distance between the upper wall key point top_mid and the upper wall pre-selected point top_prec does not exceed W / 4. For candidate points that fail verification, the SPACE spacing is readjusted for iterative search, with the maximum number of iterations K_max = 3.
[0033] Furthermore, the parameters are adaptively adjusted according to the overall brightness level of the image. When the average grayscale V avg When <50, T top_bound Adjust downward in proportion; when V avg >200, D max Adjust upwards proportionally; the adjustment formula is:
[0034] T top_bound ′=T top_bound ×(1+(V avg -128) / 256)
[0035] D max ′=D max ×(1+(V avg -128) / 512)
[0036] Furthermore, the gradient descent method is used to search the left and right upper and lower walls column by column. The key points of the upper and lower walls, bot_mid and top_mid, are used as the starting points for the search. The starting point coordinates (x, y) are: x = bot_mid[i], y = bot_mid[j]. The search condition for the left boundary of the lower wall is:
[0037] f_bound(x,y)=V(i,j) <T bot_bound &&V(x+1,y)>Tbot_bound
[0038] If the conditions are met, the boundary point (x+1, y) is recorded as the l_bot sequence, and (x+1, y) is used as the new search starting point. If the left or right boundary of the image is reached, or if no valid points are found in m consecutive columns, the boundary is discontinuous. The boundary search for the lower left wall is complete. Similarly, the search for the lower right wall (r_bot), the upper left wall (l_top), and the upper right wall (r_top) is extended.
[0039] Furthermore, the left and right endpoints of the upper and lower walls of the bladder are obtained, and the characteristics thereof include: the left endpoint bot_L of the lower wall is: (min(l_bot), argmin(l_bot)), and the right endpoint bot_R of the lower wall is:
[0040] The left endpoint of the upper wall, top_L, is (min(l_bot), argmin(l_bot)), and the right endpoint of the upper wall, top_R, is (min(r_bot), argmin(r_bot)). Geometric verification: The horizontal distance between the endpoints is: |bot_L[j]-top_L[j]|≤W / 8, and the vertical distance is: bot_L[i]-top_L[i]≥H / 10.
[0041] Furthermore, the bladder contour is filled in by interpolation, which has the following characteristics: the left endpoint of the lower wall bot_L, the right endpoint of the lower wall bot_R, the left endpoint of the upper wall top_L and the right endpoint of the upper wall top_R are linearly interpolated to fill in the contour, such as Figure 4 To check whether the edge is reasonable by area, the following condition must be met: S ≥ W × H / 20.
[0042] Through the above specific implementation methods, the present invention effectively solves the image edge detection problem of B-ultrasound images, provides a more efficient and accurate solution, and has broad application prospects.
[0043] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation plans of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A bladder edge detection method for bladder B-ultrasound images, characterized in that: include: Acquire a bladder B-ultrasound image; determine three equally spaced vertical scan lines in the center region of the image and search for key points on the lower bladder wall based on the "bright-dark-bright" pattern of the bladder region; calculate dynamic thresholds for the inner and outer bladder regions based on the pixel values of the key points' neighbors, while simultaneously acquiring key points on the upper bladder wall vertically upward; use boundary extension to determine the left and right boundaries of the bladder, and save the left and right endpoints of the upper and lower boundaries; and interpolate the left and right endpoints of the upper and lower boundaries to complete the bladder contour.
2. The method for detecting bladder edges in bladder B-ultrasound images according to claim 1, wherein: Determining three equally spaced vertical scan lines involves: for an H×W image, the positions of the three vertical lines are W / 2-10 for the first vertical line, W / 2 for the second vertical line, and W / 2+10 for the third vertical line; sampling the pixel values of each vertical line, classifying the pixels into layers, and smoothing and denoising them; scanning from the bottom of the image upward to detect vertical lines that meet the "bright-dark-bright" feature, screening the vertical lines, and ultimately determining the coordinates of the key points on the lower wall.
3. The bladder edge detection method for bladder B-ultrasound images according to claim 2, characterized in that: The pixel stratification and smoothing denoising includes: performing pixel stratification on vertical lines, stratifying the original image grayscale data of 0-255 levels represented by 8 bits into 0-7 levels, and using consistency filtering of adjacent pixels to eliminate noise interference.
4. The method for detecting bladder edges in bladder B-ultrasound images according to claim 3, wherein: Using the consistency filter of adjacent pixels to eliminate noise interference includes: for the original pixel point V on the vertical scanning line mid(i,j) The result of its grayscale division v mid(i,j) =V mid(i,j) / 32; For the scan lines after grayscale division, use consistency filtering. If v mid(i-1,j) =v mid(i+1,j) Then v mid(i,j) =v mid(i-1,j) .
5. The method for detecting bladder edges in bladder B-ultrasound images according to claim 3, wherein: Determining the coordinates of the key points on the lower wall includes: detecting three vertical lines from the bottom of the image upwards, and detecting the grayscale division results in each vertical line. and The surface preselects the point mid(i0,j) as the key point of the lower wall on the vertical line, and at the same time, the vertical line appears and And i0>i1, on the vertical coordinate of the vertical line between i0 and i1 v mid If all are 0, then the vertical line satisfies the "bright-dark-bright" characteristic. Select the vertical line with the largest i0-i1 among the three vertical lines. The coordinates of its mid(i0,j) are the key point bot_mid on the lower wall, and the coordinates of mid(i1,j) are the pre-selected upper wall point top_prec.
6. The method for detecting bladder edges in bladder B-ultrasound images according to claim 1, wherein: Calculating the dynamic critical value of the bladder internal and external areas includes: defining a local neighborhood window centered on the key point of the lower wall, calculating the grayscale mean μ of the pixels in the local neighborhood window local and standard deviation σ local ; Set dynamic adjustment rules; Generate adaptive dynamic critical value according to dynamic adjustment rules, gray mean and standard deviation calculation characteristics, the calculation formula is: T bot_bound =μ local +k·s local Among them, T bot_bound is the dynamic critical value; k is the dynamic adjustment rule, that is, if the image average grayscale v aug <50, then k=0.8; if the standard deviation of the noise intensity in the local area σ local >25, then k=min(1.1+0.1(σ local -25),2).
7. The method for detecting bladder edges in bladder B-ultrasound images according to claim 6, wherein: The size of the local neighborhood window is N×N, where N is an odd number and satisfies 5≤N≤15.
8. The method for detecting bladder edges in bladder B-ultrasound images according to claim 1, wherein: The boundary extension method is used to obtain the left and right boundaries of the bladder, including: using the gradient descent method to search the left and right upper and lower walls column by column; using the upper and lower wall key points bot_mid and top_mid as starting points for searching; setting the left boundary search conditions, recording the boundary point (x+1, y) when the conditions are met, recording it as the l_bot sequence, and using (x+1, y) as the new search starting point; when the left and right boundaries of the image are reached or no valid points are found in m consecutive columns, it indicates that the boundaries are discontinuous; the boundary search of the left lower wall is completed; similarly, the extension search of the right lower wall r_bot, the left upper wall l_top, and the right upper wall r_top is completed.
9. The method for detecting bladder edges in bladder B-ultrasound images according to claim 8, wherein: The left boundary search conditions are: f_bound(x,y)=V(i,j)<T bot_bound &&V(x+1,y)>T bot_bound Where, f_bound(x,y) is, V(i,j) is the current boundary scan point, T bot_bound is the dynamic critical value, and V(x+1,y) is the pre-scan point for boundary extension.
10. The method for detecting bladder edges in bladder B-ultrasound images according to claim 1, characterized in that: The bladder contour is completed by interpolation, including: using linear interpolation to complete the contour of the four acquired coordinates: the left endpoint of the lower wall bot_L, the right endpoint of the lower wall bot_R, the left endpoint of the upper wall top_L, and the right endpoint of the upper wall top_R. When the completed area satisfies S≥W×H / 20, the completion is completed; otherwise, it is not completed.