A method and device for rib detection in DR chest images

Through the lung field area segmentation and rib edge detection method based on grayscale distribution characteristics and Sobel convolution operator, the problem of rib detection in chest image is solved, and the accurate identification and supplementation of rib boundary lines is achieved, and medical diagnosis is supported.

CN115661020BActive Publication Date: 2025-08-05LIAONING KAMPO MEDICAL SYST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110776486.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-09
Publication Date
2025-08-05
Estimated Expiration
2041-07-09

AI Technical Summary

Technical Problem

Existing medical image processing technology is difficult to effectively segment and detect ribs in chest images, resulting in information aliasing and affecting the confirmation and localization of lesions.

Method used

The lung field region segmentation based on grayscale distribution characteristics was used, combined with the Sobel convolution operator, threshold method, and direction edge screening operator, the rib gradient image was detected, and the complete rib boundary line was fitted through rib edge screening and curve growth.

Benefits of technology

Accurate detection of the rib boundary line is achieved, and the upper and lower boundary lines of the ribs in the chest image are identified to ensure that the length of the rib boundary line is complete and without missing, providing reliable rib information for subsequent medical diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115661020B_ABST
    Figure CN115661020B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting DR thoracic rib images, comprising the following steps: data preprocessing, lung field region segmentation, obtaining rib gradient images, detecting rib lower boundary lines, and detecting rib upper boundary curves. The original DR image is downsampled to a reasonable size and preprocessing is completed; next, the left and right lung field regions in the image are segmented; then, the upper and lower edges of the ribs are detected respectively within the lung field regions, thereby achieving rib contour detection. The method adopted by the present invention can effectively identify the ribs in the chest cavity. This invention is an important basis for realizing rib extraction and rib suppression in chest radiographs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of X-ray digital image processing, and particularly to a method and device for detecting ribs in DR chest images. Background Art

[0002] With the development of image processing technology, computer automatic processing of medical images has become a major branch in the field of image processing applications. As one of the mainstream imaging diagnostic methods, X-ray imaging provides the most important basis for the research and diagnosis of lung diseases, cardiovascular pathology, and bone injuries. X-ray imaging uses the different absorption amounts of X-rays in human tissues to project three-dimensional information onto a two-dimensional X image, forming an image with different contrasts to complete medical auxiliary diagnosis. Such an imaging principle results in the loss of the third-dimensional spatial information, causing the soft tissue information and bone tissue information of the human body to be mixed together, thus causing information interference and affecting the doctor's confirmation of the lesion. The extracted rib information can detect abnormal conditions of the ribs (such as rib fractures or absences) and infer the possible causes of such conditions; or serve as a good reference positioning system to indicate the location of the lesion area. Since there is still little research in this area in the current medical image processing field, there is no ready-made image processing algorithm. Summary of the Invention

[0003] In view of the above problems, a method for detecting DR chest ribs. The feature is that first, the lung field area is segmented based on the cumulative gray distribution features in different directions, then convolution calculation is performed using the designed directional Sobel convolution operator to obtain a gradient image, then a preliminary lower edge is obtained using a rib edge screening operator, and then the rib boundary curve is grown. Next, the complete rib boundary curve is fitted according to the grown curve, and then the rib boundary line detection is performed. Finally, the upper boundary line is detected using the lower boundary line, thus completing the detection of the chest ribs.

[0004] The technical solution adopted by the present invention to achieve the above object is: a method for detecting ribs in DR chest images, including the following steps:

[0005] S1. Data preprocessing: Downsample and denoise the original DR chest image to obtain the preprocessed image YCL;

[0006] S2. Lung field area segmentation: Perform gray processing to obtain candidate boundaries of the lung field image, and fit the median line of the lung field image according to the midpoints of the image row pixels, thereby determining the boundary BG of the lung field area;

[0007] S3. Obtain the rib gradient image: Perform gradient processing within the boundary BG of the lung field area in the original DR chest image using a Sobel convolution factor to obtain the rib gradient image TD;

[0008] S4. Detection of the lower rib boundary line: Noise reduction is carried out using the threshold method and the directional edge screening operator method. The lower edge of the boundary line is discriminated according to the rib morphology, and then the rib boundary curve is grown and the fitting curve is carried out to find and fill the missing rib boundary line, so as to obtain the complete lower rib boundary curve LGXBG;

[0009] S5. Detection of the upper rib boundary curve: For any detected lower rib boundary curve, it is translated upward within a preset range according to a set step size, and the gradient cumulative value of all rib boundary curve pixels is calculated each time it moves. The rib boundary curve corresponding to the maximum cumulative value of the movement is used as the upper rib boundary curve LGSBG;

[0010] According to the above steps, the rib contour boundary line LGBG of any unilateral or bilateral side can be obtained.

[0011] The segmentation of the lung field area includes:

[0012] S2.1. Divide the left and right lung lobe areas according to the gray-scale cumulative value and the target morphology;

[0013] S2.2. Binary processing, boundary morphological erosion operation, and inverse binary processing;

[0014] S2.3. Obtain the midpoint of the row pixels of the lung field image, and fit the midpoints into the median line of the lung field image;

[0015] S2.4. Eliminate the interfering boundary points according to the difference amplitude of the distances between the two side boundary points and the midpoint;

[0016] S2.5. Draw the minimum bounding box of the lung field with the boundary points within the left and right lung lobe areas.

[0017] The gradient processing using the Sobel convolution factor includes:

[0018] Design the Sobel convolution factor for unilateral rib detection, and the gradient calculation formula is as follows:

[0019] G Lx = Lx * A, G Lx = 0, if G Lx (i,j) > 0 (1)

[0020] G Ly = Ly * A, G Ly = 0, if G Ly (i,j) > 0 (2)

[0021]

[0022] where, A represents the image data to be processed, and Lx and Ly are the convolution factors in the x and y directions of the left rib respectively; GLx and G Ly are the gradient matrices in the x - direction and y - direction of the left rib respectively; G Lxy is the gradient matrix of the unilateral rib.

[0023] The detection of the lower boundary line of the rib includes:

[0024] S4.1. Noise reduction by threshold method: Delete the interfering rib edge pixel points in the rib gradient image TD according to the threshold;

[0025] S4.2. Noise reduction by direction edge screening operator method: Use the direction edge screening operator to screen the rib gradient image to obtain several lower edges XBY of the unilateral rib;

[0026] S4.3. Discrimination of the lower edge of the rib boundary curve: Let the curve equation of one of the lower edges of the unilateral rib be L i (x,y), P L and P R are the left - hand endpoint and right - hand endpoint of the curve L i (x,y) respectively. Determine whether the current curve is the lower boundary line of the rib according to the rib morphology experience;

[0027] S4.4. Growth of the rib boundary curve: Since the length of the alternative rib boundary curve may not be sufficient to fit an accurate boundary line, search for suspected rib line segments to grow the rib boundary curve;

[0028] S4.5. Fitting of the lower boundary line of the rib: Select the quadratic polynomial parabola model as the mathematical model of the rib edge line, and use the least - squares method to complete each curve fitting to obtain the fitting curves of the lower edges of each unilateral rib;

[0029] S4.6. Search for missing rib boundary lines: Combining the morphological characteristics of the ribs, the distance d between each rib is approximately the same. Judge whether there is a missing rib. If so, further search for the missing rib line in the rib - missing area by using steps 4.1 - 4.5;

[0030] The threshold calculation formula is as follows:

[0031]

[0032] where the threshold n and m are the width and height of the gradient image respectively, and G xy is the rib gradient image; Set the gradient values less than V T to zero in the gradient image.

[0033] The rib edge direction screening operator is: In the range of the surrounding 8 - neighborhood pixels centered on the current pixel, screen the vertical direction of the rib edge morphology trend;

[0034] The function of the screening process is to refine and remove the interfering pixel points of scattered points, line segments, heart boundaries, and tissue boundaries.

[0035] Judging whether the current curve is the lower boundary line of the rib according to the rib morphological experience includes:

[0036] Taking the ribs in the left lung field as an example, if point P L is in the left 1 / 3 area of the left lung field and point P R is in the right 1 / 2 area of the left lung field, then the current curve L i (x, y) is considered the lower boundary line of the rib; since the rib orientation is symmetric left and right, the right side is judged according to this principle.

[0037] Performing the growth of the rib boundary curve includes:

[0038] a. Taking the curve equation of one of the rib boundary lines in the XBY image of the lower edge of the left rib as L i (x, y), the right endpoint P R is used to take a rectangular area upward and to the right from the left lower endpoint; the height of the rectangular area is the vertical distance from point P R to the previous rib curve, and the length is the distance from point P R to the right boundary of the left lung field;

[0039] b. Judging whether there is a suspected curve segment in the selected rectangular area that is the extension line of the current rib boundary line. If so, connect the current rib boundary curve and the suspected curve segment to make the rib boundary line grow; the judgment of whether there is a suspected curve segment that is the extension line of the current rib boundary line is as follows: screen several suspected curve segments with the longest length in the rectangle, calculate the slopes of each suspected curve segment and compare them with the slope of the right segment of the current rib boundary curve. If the difference is within the threshold range, it is judged that the current suspected curve segment is the extension line of the current rib boundary line;

[0040] c. Update the right endpoint P R , continue to plan the rectangle to iteratively search for the extension line, and finally find the complete lower boundary curve of the left rib.

[0041] Searching for the missing rib boundary line includes:

[0042] a. Combining the morphological characteristics of the ribs to judge whether there is a missing rib; if so, execute the subsequent steps b and c; the morphological characteristics of the ribs include, for example, the number of ribs, the left or right rib direction, and the rib spacing is roughly the same;

[0043] b. Taking the midpoint coordinates of all detected lower edge boundary lines of the ribs to fit a straight line Lc as the midline of the current unilateral lower edge boundary line image of the ribs;

[0044] c. Translate the lower boundary line of the rib near the rib missing area along the direction of Lc by a distance D, and further search within the range of the vertical distance D' using steps 4.1 - 4.5 to obtain the missing rib line; the distance D is the average value of the distances between adjacent intersection points P'i, the distance D' is the average value of the vertical distances between adjacent intersection points P'i, and the adjacent intersection points P'i are the intersection points of the median line Lc and the detected lower edge boundary line of the rib.

[0045] A rib detection device for DR chest images includes: a processor and a memory. The memory stores the following program modules, and the processor loads the program modules to execute the method steps to implement rib detection of the rib contour boundary line LGBG on any unilateral or bilateral side of the DR chest image;

[0046] A data preprocessing module for downsampling and denoising the original DR chest image to obtain a preprocessed image YCL;

[0047] A lung field region segmentation module for performing gray-scale processing to obtain candidate boundaries of the lung field image, fitting the median line of the lung field image according to the mid-points of the image row pixels, and thus determining the boundary BG of the lung field region;

[0048] A rib gradient image acquisition module for performing gradient processing using the Sobel convolution factor within the boundary BG of the lung field region in the original DR chest image to obtain a rib gradient image TD;

[0049] A rib lower boundary line detection module for denoising using the threshold method and the directional edge screening operator method, discriminating the lower edge of the boundary line according to the rib morphology, then growing the rib boundary curve, fitting the curve, searching for and filling the missing rib boundary line to obtain a complete rib lower boundary curve LGXBG;

[0050] A rib upper boundary curve detection module for, for any detected rib lower boundary curve, translating it upward within a preset range according to a set step length, and calculating the cumulative gradient value of all rib boundary curve pixels each time it moves, and taking the rib boundary curve corresponding to the maximum cumulative value of the movement as the rib upper boundary curve LGSBG.

[0051] The beneficial effects of the present invention are:

[0052] 1. Lung field region segmentation: Utilize the gray-scale accumulation values in the horizontal and vertical directions and the anatomical structure characteristics of the chest radiograph to segment the left and right lung lobe regions.

[0053] 2. Detection of the lower rib boundary line: Use the Sobel convolution factor to perform gradient processing on the image to obtain the gradient image of the ribs; then use the threshold method and the directional edge screening operator to obtain the lower boundary line of the ribs; then perform rib boundary growth according to the length of the boundary line, and use the boundary information after growth to complete rib curve fitting; finally, based on the detected rib information and combined with the biological characteristics of the rib lines in the chest radiograph, determine whether there are missing ribs and further complete the supplementation of the missing ribs.

[0054] 3. Detection of the upper rib boundary curve: On the premise of knowing the lower rib boundary line, since the morphological features of the upper and lower rib boundary lines are similar and parallel, the lower rib boundary line is translated upward by a fixed step length, and the gradient of the curve after each translation is calculated, and the curve with the optimal gradient is selected as the upper boundary line of this rib.

[0055] 4. The present invention can effectively identify the upper and lower boundary lines of the ribs in the chest cavity image, detect the clear boundaries of the unilateral or bilateral rib contours in the chest cavity image, with the rib boundary line lengths being complete, not missing, and not distorted, which is an important basis for subsequent realization of rib extraction and rib suppression in chest radiographs.

[0056] 5. The present invention can effectively extract the rib boundary line in the chest cavity image. The determination of the rib boundary line is a prerequisite for subsequent medical image analysis and understanding such as chest cavity rib extraction and rib suppression. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flowchart of the method;

[0058] Figure 2 Original DR chest cavity data;

[0059] Figure 3 The range between and on both sides of the two lungs;

[0060] Figure 4 The upper and lower ranges of the two lungs;

[0061] Figure 5 Preliminarily demarcated lung field area;

[0062] Figure 6 Schematic diagram of the midlines of the left and right lung field areas;

[0063] Figure 7 Final lung field area;

[0064] Figure 8 Left lung field area;

[0065] Figure 9 Right lung field area;

[0066] Figure 10 Gradient image of the left lung field area;

[0067] Figure 11 Gradient image of the right lung field region;

[0068] Figure 12 Initial lower edge curve of the left rib;

[0069] Figure 13 Initial lower edge curve of the right rib;

[0070] Figure 14 Curve of the left rib lower edge after growth;

[0071] Figure 15 Curve of the right rib lower edge after growth;

[0072] Figure 16 Fitted curve of the left rib lower edge;

[0073] Figure 17 Fitted curve of the right rib lower edge;

[0074] Figure 18 Missing detection process of the left rib lower edge;

[0075] Figure 19 Missing detection process of the right rib lower edge;

[0076] Figure 20 Missing detection result of the left rib lower edge;

[0077] Figure 21 Missing detection result of the right rib lower edge;

[0078] Figure 22 Detection result of the left rib upper edge curve;

[0079] Figure 23 Detection result of the right rib upper edge curve;

[0080] Figure 24 Thoracic rib detection result finally shown by this method;

[0081] Figure 25 Sobel convolution factors for left and right rib detections;

[0082] Figure 26 Left and right rib edge direction screening operators;

[0083] Figure 27 Schematic diagram of rib boundary line growth;

[0084] Figure 28 Schematic diagram of rib boundary line missing and filling; Detailed implementation manner

[0085] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and the corresponding drawings. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the scope of protection of the present invention.

[0086] The present invention will be further described in detail below in conjunction with the drawings and embodiments.

[0087] The technical solution of the present invention is as follows:

[0088] 1. Data preprocessing

[0089] It mainly includes downsampling and median filtering. Since general medical data is relatively large, considering the timeliness of the algorithm, the image is downsampled to a reasonable size without losing the edge information of the image. In this method, the image is downsampled to a size of 512*512, but it is not limited to this size. The purpose of median filtering is to remove noise.

[0090] 2. Segmentation of the lung field area

[0091] The lung field segmentation mainly uses the gray accumulation value and anatomical structure to divide the general areas of the left and right lung lobes. First, the middle and both sides of the two lungs are divided. The gray values of the preprocessed image are accumulated horizontally (accumulating column pixel values). The corresponding relationship between the curve and the position of the lung lobe is as Figure 3 shown. Then, the upper and lower ranges of the two lungs are divided. The gray values of the image are accumulated vertically (accumulating row pixel values). The corresponding relationship between the curve and the position of the lung lobe is as Figure 4 shown. The lung field area that can be initially determined through these two steps is as Figure 5 shown (left and right rectangular lung field areas).

[0092] The next step is to further divide the lung field area. The specific method is to first perform binarization on the above results, and use, for example, morphological erosion operations to remove the border-connected areas, and then perform inverse binarization. Next, the midpoints of the marked areas are statistically calculated row by row in the 1 / 4 to 3 / 4 area in the vertical direction of the lung field area (the midpoint is the median value point of the left and right boundary points of each row), forming the position of the red line in the figure. The least squares linear fitting is performed on these midpoints, and the result of the green line in the figure can be obtained as Figure 6 shown. The distances from the lung lobe boundaries marked on both sides of the green center line to the green center line are statistically calculated, and the boundary points with a difference of more than 3 times the distance on both the left and right sides are removed. The maximum distance d max from the remaining boundary points to the center line is calculated, and then two parallel lines with a distance of d max are drawn on both sides of the center line, asFigure 6 As shown, the final marking effect of the lung field is as Figure 7 shown. Select the maximum value from the lung field boundary line to the median line, and draw the minimum bounding box of the lung field area.

[0093] 3. Calculate the gradient image

[0094] Design the directional Sobel convolution factor. The traditional Sobel convolution factor calculates the image gradient in the x and y directions respectively. Since the boundary of the rib is approximately a quadratic curve equation, and the left rib edge is approximately monotonically increasing while the right rib edge is monotonically decreasing. Therefore, design the convolution factors for detecting the left and right ribs respectively, as Figure 25 . The gradient calculation formula is as follows:

[0095] G Lx = Lx * A, G Lx = 0, if G Lx (i, j)>0 (1)

[0096] G Ly = Ly * A, G Ly = 0, if G Ly (i, j)>0 (2)

[0097]

[0098] G Rx = Rx * A, G Rx = 0, if G Rx (i, j)>0 (4)

[0099] G Ry = Ry * A, G Ry = 0, if G Ry (i, j)<0 (5)

[0100]

[0101] where, A represents the image data, Lx and Ly are the convolution factors in the x and y directions of the left rib respectively, and Rx and Ry are the convolution factors in the x and y directions of the right rib respectively. G Lx and G Ly are the gradient matrices in the x and y directions of the left rib respectively, G Rx and G Ry are the gradient matrices in the x and y directions of the right rib respectively. G Lxy is the gradient matrix of the left rib, G Lxy is the gradient matrix of the right rib. (The results are as Figure 10 , Figure 11 )

[0102] 4. Detection of rib boundary lines

[0103] 4.1 Initialize the lower edge of the rib

[0104] First, use a threshold to delete interfering edges. The threshold calculation formula is as follows:

[0105]

[0106] Where, V T is the threshold, n and m are the width and height of the gradient image respectively, and G xy is the gradient image; set the gradient values less than V T in the gradient image to zero:

[0107]

[0108] 4.2 Define the left and right rib edge direction screening operators as Figure 26 shown. Set the center point P of the operator as the origin, and within the range of the surrounding 8-neighborhood pixels centered on the current pixel, screen and process the vertical direction of the rib edge morphology. Only retain the maximum gradient value in the three directions shown in the figure:

[0109] As Figure 26 , then use the two defined screening operators (the left direction edge screening operator and the right direction edge screening operator) to screen and process the gradient image to obtain the lower edges of the left and right ribs respectively. Using the two defined screening operators is to refine the gradient image, remove the interference of scattered points, line segments, heart boundaries and tissue boundaries, and better extract the rib line information. (The results are as Figure 12 , Figure 13 )

[0110] 4.3 Growth and fitting of the lower edge of the rib

[0111] Count the curves in the gradient image and screen out the curves that conform to the rib edge as the initial boundary line. Taking the left rib boundary line as an example, the method is as follows. Let the curve equation be L i (x, y), P L and P R be the left and right endpoints of the curve L i (x, y) respectively. If the point P L is in the left 1 / 3 area of the left lung field and the point P R is in the right 1 / 2 area of the left lung field, then the curve L i (x, y) is considered to be the lower boundary line of the rib.

[0112] 4.4 Rib boundary curve growth. The length of the set of alternative rib line segments may not be sufficient to fit an accurate boundary line. Therefore, it is necessary to continue to extend and connect small boundary lines (that is, find available extension lines and supplement the selected extension lines into the rib boundary curve). Taking the left rib boundary line as an example, the specific method is as follows: Taking the right endpoint P of the curve equation L i (x, y) as the left lower endpoint to take a rectangular area. The height of the rectangle is the vertical distance from point P R to the previous rib curve, and the length is the right boundary of the left lung field from point P R . Screen the 5 longest curve segments within the selected rectangular area, and then judge whether there is an extension line of the current rib lower edge curve in each curve segment. If so, connect the rib lower edge curve L R (x, y) with this curve segment to make the rib boundary line grow, and update the right endpoint P of the rib lower edge curve i , and continue to plan the steps of iterative search and growth in the rectangular area. The specific method is as follows: R

[0113] As shown in Figure 27 , where L i is the current rib boundary curve, the rectangular frame is the area to be extended, l1...l5 are the first five longest curve segments in the extended area (the longest is the distance between the two starting endpoints of the curve segment), and k1...k5 are the slopes of the lines connecting the left endpoints of the curve segments l1...l5 and the right endpoint of the rib curve L i . k d is the average slope of the curve segment with a length of d (d takes an empirical value of 10) on the right side of the rib curve L i (the average slope is the average value of the slopes of several pixel points with a length of d). Select the curve segment closest to k d from k1...k5. If the difference in inclination angles between the two is less than 5°, it is used as the extension line of the rib curve to make the rib boundary line grow. (The results are as shown in Figure 14 , Figure 15 )

[0114] 4.5 Select the quadratic polynomial parabola model as the mathematical model of the rib edge line, and use the least squares method to complete the curve fitting. Complete the curve fitting according to the edge information of different ribs obtained above. (The results are as shown in Figure 16 , 17 )

[0115] 4.6 Judge whether there are missing rib boundary lines

[0116] ​Combined with the anatomical morphological characteristics of the ribs, the spacing between each rib is approximately the same. The main idea of the algorithm for filling the missing rib lines is as follows: Take the midpoint coordinates of all existing ribs, then fit a straight line, and then recalculate the intersection points of the straight line and each rib. Then analyze the distances between the intersection points to determine whether there are missing rib boundary lines. If there are missing ribs, rib filling is performed. The specific method is as follows:

[0117] As Figure 28 shown, L1…L5 are the original rib boundary curves, P1…P5 are the midpoints of the original rib boundary curves, Lc is the straight line fitted by points P1…P5, and P'1…P'5 are the intersection points of the straight line Lc and each rib curve. First is the determination of the target area. The method is as follows. First, determine the center point P of the rib to be filled. Then translate the rib curve closest to the center point through the midpoint, and select the area with a height of d above and below the translated curve as the target area. d is the average vertical distance between points P1…P5. Next, perform rib lower edge curve detection within this target area. The method is the same as 4.1~4.5. If the obtained curve equation is similar to the adjacent rib curve equation (the bending degree and curvature of each point are the same), then this curve is considered the rib boundary curve. (The results are as Figure 18 、 19 、20, 21)

[0118] 5. Detection of upper rib boundary line

[0119] The lower boundary line of the rib is obtained by the above method. The detection method of the upper boundary line of the rib is simple and easy: Combined with the anatomical morphological characteristics of the rib - the upper and lower edges of the rib are basically parallel. Therefore, translate the lower rib boundary curve upward with a step size of 1. According to the gradient image obtained by the convolution factor, find the curve of the maximum gradient value of all pixels, which is the corresponding upper boundary line of the rib (the results are as Figure 22 、 23 ), and the gradient calculation formula is as follows:

[0120] G Lx =Lx*A, G Lx =0, if G Lx (i, j)<0 (9)

[0121] G Ly =Ly*A, G Ly =0, if G Ly (i, j)<0 (10)

[0122]

[0123] G Rx =Rx*A, G Rx =0, if G Rx (i, j)<0 (12)

[0124] G Ry = Ry*A,G Ry = 0, if G Ry (i,j) > 0 (13)

[0125]

[0126] Figure 2 It is a chest X-ray of a patient taken by a Quantong DR device. Figure 8 and Figure 9 are the segmentation results of the left and right lung fields respectively, and the subsequent boundary line detection process is carried out within these two lung field regions; Figure 10 and Figure 11 are the gradient images of the left and right lung field regions respectively obtained after passing through the directional Sobel convolution factor; Figure 12 and Figure 13 After passing through the directional edge screening operator respectively, the curves that meet the conditions are selected as the initial boundary curves. Next, boundary curve growth is carried out, and the growth results on the left and right sides are as Figure 14 and Figure 15 shown. Figure 16 and Figure 17 are the quadratic polynomial fitting results of the lower edge lines of the left and right ribs respectively. Next, it is to judge whether there are missing rib boundary lines, calculate the midpoint coordinates of the existing rib curves, and fit the midline according to the midpoint coordinates, calculate the intersection points of the center and each curve, and then preliminarily determine the regional center point coordinates according to the method of the present invention, as Figure 18 and Figure 19 shown. Then, edge line detection is carried out again in the target area, and quadratic polynomial fitting is carried out, and the fitting results are as Figure 20 and Figure 21 shown.

[0127] After obtaining the lower edge line of the rib, the detection of the upper edge line is much simpler. First, the gradient image is calculated, and then the corresponding lower rib boundary curve is translated upward by a step size of 1, and the maximum gradient curve is obtained, which is the upper boundary line of the corresponding rib, as Figure 22 and Figure 23 shown. Figure 24 is the final rib detection result.

[0128] This article invented an algorithm that can extract the rib lines relatively completely and display rib information on a computer on the premise of conforming to medical norms. Experiments show that the proposed algorithm has good results.

[0129] The above are only the preferred embodiments of the present invention, and do not impose any limitations on the present invention. Any simple modifications, changes, and equivalent structural changes made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.

Claims

1. A rib detection method for DR chest images, characterized in that: The steps include: S1. Data preprocessing: downsample and denoise the original DR chest image to obtain the preprocessed image YCL; S2. Lung field segmentation: Grayscale processing is performed to obtain candidate lung field image boundaries. The lung field image median line is fitted according to the midpoint of the image row pixels to determine the lung field region boundary BG. S3. Obtaining a rib gradient image: performing gradient processing using the Sobel convolution factor within the lung field region boundary BG in the original DR chest image to obtain a rib gradient image TD; S4. Detection of the lower rib boundary line: Use the threshold method and the directional edge screening operator method to reduce noise, identify the lower edge of the boundary line based on rib morphology, and then perform rib boundary curve growth and curve fitting to find missing rib boundary lines and fill in the gaps to obtain the complete rib lower boundary curve LGXBG; The rib lower boundary line detection includes: S4.1, threshold noise reduction: remove interfering rib edge pixels in the rib gradient image TD according to the threshold; S4.

2. Directional edge filtering operator method for noise reduction: The rib gradient image is filtered using a directional edge filtering operator to obtain several lower edges XBY of the ribs on one side; S4.

3. Identification of the lower edge of the rib boundary curve: Assume that the curve equation of one of the lower edges of a unilateral rib is L i (x,y),P L and P R They are curves L i The left and right endpoints of (x, y) are used to determine whether the current curve is the lower boundary line of the rib based on rib morphology experience; S4.4, rib boundary curve growth: Since the length of the candidate rib boundary curve may not be enough to fit the accurate boundary line, the rib boundary curve is grown by searching for the suspected rib line segment; S4.

5. Rib lower boundary line fitting: Select a quadratic polynomial parabola model as the mathematical model of the rib edge line, and use the least squares method to complete the curve fitting to obtain the fitting curve of each unilateral rib lower edge; S4.

6. Find missing rib boundary lines: Based on the morphological characteristics of the ribs and the roughly uniform spacing d between ribs, determine whether there are any missing ribs. If so, further search for missing rib lines in the missing rib area using steps 4.1-4.

5. S5. Detection of the rib upper boundary curve: For any detected rib lower boundary curve, translate it upward within a preset range according to a set step size, and calculate the cumulative gradient value of all rib boundary curve pixels during each movement. The rib boundary curve corresponding to the maximum cumulative value is designated as the rib upper boundary curve LGSBG. According to the above steps, any unilateral or bilateral rib contour boundary line LGBG can be obtained.

2. The rib detection method for DR chest images according to claim 1, characterized in that: The lung field region segmentation includes: S2.1, grayscale cumulative value and target morphology are used to divide the left and right lung lobes; S2.2, binarization processing, boundary morphological corrosion operation, and debinarization processing; S2.

3. Obtain the median points of the lung field image rows and fit each median point to the lung field image median line; S2.

4. Eliminate interfering boundary points based on the distance difference between the boundary points on both sides and the median point; S2.

5. Draw the minimum bounding box of the lung field using the boundary points within the left and right lung lobes.

3. The rib detection method for DR chest images according to claim 1, characterized in that: The gradient processing using the Sobel convolution factor includes: Design the Sobel convolution factor for unilateral rib detection, and the gradient calculation formula is as follows: G Lx =Lx*A,G Lx =0,if G Lx (i,j)>0 (1) G Ly =Ly*A,G Ly =0,if G Ly (i,j)>0 (2) Where A represents the image data to be processed, Lx and Ly are the convolution factors in the x-direction and y-direction of the left rib respectively; G Lx and G Ly are the gradient matrices in the x and y directions of the left rib respectively; G Lxy It is the gradient matrix of unilateral rib.

4. The rib detection method for DR chest images according to claim 1, characterized in that: The threshold calculation formula is as follows: Among them, the threshold n and m are the width and height of the gradient image respectively, G xy is the rib gradient image; the gradient value in the gradient image is less than V T The gradient value is set to zero.

5. The rib detection method for DR chest images according to claim 1, characterized in that: The rib edge direction screening operator is as follows: within the 8-pixel area around the current pixel, the vertical direction of the rib edge shape is screened; The filtering process is used to refine and remove scattered points, line segments, heart boundaries, and interfering pixel points of tissue boundaries.

6. The rib detection method for DR chest images according to claim 1, characterized in that: The step of determining whether the current curve is the lower boundary line of the rib based on rib morphology experience includes: Taking the left lung field rib as an example, if point P L In the left 1 / 3 of the left lung field and point P R In the right 1 / 2 area of the left lung field, the current curve L is considered i (x,y) is the lower boundary line of the rib; since the ribs are symmetrical on the left and right, the right side is determined according to this principle.

7. The method for detecting ribs in DR chest images according to claim 1, wherein: The rib border curve growth includes: a. Take the curve equation of one of the rib boundary lines in the XBY image of the lower edge of the left rib as L i The right endpoint P of (x,y) R Take a rectangular area from the lower left endpoint to the upper right; The height of the rectangular area is point P R The vertical distance to the previous rib curve is point P R to the right border of the left lung field; b. Determine whether there is a suspected curve segment in the selected rectangular area that is an extension of the current rib boundary line. If so, connect the current rib boundary curve and the suspected curve segment to extend the rib boundary line; c. Update the right endpoint P R , continue planning the rectangle iterative search extension line, and finally find the lower boundary curve of the complete rib on the left.

8. The method for rib detection in DR chest images according to claim 1, characterized in that: The method of finding the missing rib boundary line includes: a. Determine whether there is rib missing based on the morphological characteristics of the ribs. If so, proceed to steps b and c. The morphological characteristics of the ribs include the number of ribs, the orientation of the ribs on the left or right side, and the spacing between the ribs being approximately the same; b. Take the midpoint coordinates of all detected rib lower edge boundary lines and fit a straight line Lc as the midline of the current unilateral rib lower edge boundary line image; c. Shift the lower boundary line of the rib near the missing rib area along the Lc direction by a distance D, and further search within the upper and lower distances D' using steps 4.1-4.5 to obtain the missing rib line. Distance D is the average distance between each adjacent intersection point P'i, and distance D' is the average vertical distance between each adjacent intersection point P'i, where each adjacent intersection point P'i is the intersection of the centerline Lc and the detected lower edge boundary line of the rib.

9. A DR chest image rib detection device, characterized in that: include: A processor and a memory, wherein the memory stores the following program module, the processor loads the program module, and executes the method steps according to any one of claims 1 to 8 to realize rib detection of the rib contour boundary line LGBG on any one side or both sides of the DR chest image; The data preprocessing module is used to downsample and denoise the original DR chest image to obtain the preprocessed image YCL; The lung field segmentation module is used to obtain the candidate boundary of the lung field image through grayscale processing, and fit the lung field image median line according to the midpoint of the image row pixels to determine the lung field region boundary BG; A rib gradient image acquisition module is used to perform gradient processing using the Sobel convolution factor within the lung field region boundary BG in the original DR chest image to acquire a rib gradient image TD; The rib lower boundary line detection module is used to reduce noise using the threshold method and the directional edge screening operator method, identify the lower edge of the boundary line based on rib morphology, and then perform rib boundary curve growth and curve fitting to find and fill in missing rib boundary lines to obtain the complete rib lower boundary curve LGXBG; The rib upper boundary curve detection module is used to translate any detected rib lower boundary curve upward within a preset range according to a set step size, and calculate the gradient cumulative value of all rib boundary curve pixels each time it moves. The rib boundary curve corresponding to the maximum cumulative value is the rib upper boundary curve LGSBG.

Citation Information

Patent Citations

  • Poisson model-based X-ray chest image rib inhibition method

    CN106023200A

  • Ultrasound imaging method and ultrasound imaging equipment

    CN111374712A