Joint image segmentation method based on watershed algorithm
Through the image segmentation method based on the watershed algorithm, the problems of blurred boundaries between bones and intermediate cartilage and cavity defects in joint medical image segmentation are solved, fast and accurate joint image segmentation is achieved, the segmentation surface is optimized, and high-quality image support is provided for joint surgery.
Patent Information
- Application Number
- CN202311168103.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-09-12
AI Technical Summary
Existing joint medical image segmentation methods have difficulty accurately segmenting the boundaries between joint bones and intermediate cartilage, especially when the joint is severely injured, due to fuzzy boundaries and low-density tissue interference, which often leads to void defects in the segmentation results.
An image segmentation method based on the watershed algorithm is adopted. By obtaining the image of the patient's affected area, the bone area is segmented and binarized, the geodesic distance is calculated to filter the seed point set, and the watershed algorithm is used for image segmentation. The joint gap position is determined by convex hull area screening and physiological position to optimize and correct it to ensure segmentation accuracy.
It achieves fast and accurate segmentation of joint bones and intermediate cartilage, optimizes and corrects the segmentation surface, avoids cavity defects, provides high-quality image segmentation results, and provides support for joint surgery.
Smart Images

Figure CN117197177B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a joint image segmentation method based on a watershed algorithm. Background Art
[0002] The surface of human joints is covered by cartilage. As people age, the cartilage gradually wears away, and the bones and ligaments around the joints also degenerate, eventually causing joint pain, deformity, and movement disorders, especially in the knee joints. Therefore, joint replacement surgery has become an important way to solve this medical problem. However, many people have a misunderstanding that joint replacement surgery means replacing the entire joint. However, this is not the case. Joint replacement surgery mainly replaces the cartilage on the surface of the joint that has been worn into pits with metal prostheses and wear-resistant gaskets made of high molecular polyethylene.
[0003] Before joint replacement surgery, CT 3D imaging of the patient's joints is required to accurately segment the joint bones, such as the femur, tibia, and cartilage in the middle of the knee joint. Therefore, high-quality image segmentation plays a vital role in medical image analysis. However, existing joint medical image segmentation has the following two difficulties: (1) The boundary between the joint bones and the middle cartilage is blurred, especially in patients with severe joint injuries, where the cartilage is severely worn and there is no clear segmentation boundary under the image, which is often called adhesion. (2) There is often low-density tissue around the joints of the human body, and the images segmented by common image segmentation methods often have defects such as holes. Summary of the Invention
[0004] Purpose of the invention: In response to the above-mentioned defects, the present invention provides a joint image segmentation method based on the watershed algorithm, which can accurately segment the joint bones and the cartilage in the middle.
[0005] Technical solution:
[0006] Joint image segmentation method based on watershed algorithm, including:
[0007] S1. Obtain an image of the patient's affected area, segment it to obtain an image of the bone area, and binarize it;
[0008] S2. Performing connected domain extraction on the binarized skeleton region image to obtain an image of the region to be segmented, calculating the geodesic distance between each point in the image of the region to be segmented and its nearest boundary, setting a distance threshold to filter and obtain multiple seed point sets, and selecting seed point sets from the multiple seed point sets that meet set conditions;
[0009] S3. Based on the seed point set selected in S2, a watershed algorithm is used to segment the image of the area to be segmented to obtain a segmentation result image.
[0010] Specifically, in S2, setting a distance threshold to filter and obtain multiple seed point sets of the image of the area to be segmented is specifically: filtering points in the image of the area to be segmented whose geodetic distance is greater than the distance threshold as seed points to obtain multiple seed point sets of the image of the area to be segmented.
[0011] More specifically, in S2, the step of selecting a seed point set that satisfies a set condition from the plurality of seed point sets is:
[0012] S21, calculating the convex hull area of the outer contour of the skeleton in each slice image along the head-to-foot direction of the human body in the image of the area to be segmented;
[0013] S22 , extracting slice images in which the convex hull area is greater than the area threshold, obtaining the bone regions corresponding to the slice images, and selecting the corresponding seed point sets.
[0014] Furthermore, the area threshold is determined as follows:
[0015] S221, sorting the convex hull areas obtained in S21 from small to large;
[0016] S222, starting from the convex hull area corresponding to the first slice image according to the sorting, traversing and accumulating, and calculating the ratio of the accumulated area to the sum of the convex hull areas corresponding to all slice images;
[0017] S223 , obtaining a slice image when the proportion reaches a set value, and the convex hull area corresponding to the slice image is the area threshold.
[0018] Furthermore, after the seed point set that satisfies the set conditions is selected in S22, the method further includes:
[0019] Other bone regions in the joint excluding each bone region obtained in S22 are determined by physiological position, and then corresponding seed point sets on other bone regions are screened and obtained.
[0020] Specifically, in said S3, after obtaining the segmentation result image, the following steps are further included:
[0021] S31, calculating the convex hull area of the bone contour in each slice image of the image to be segmented along the head-to-foot direction of the human body, and selecting the slice image corresponding to the minimum value between the two maximum values of the convex hull area as the joint gap position;
[0022] S32, obtaining a segmentation plane closest to the joint gap position according to the segmentation result image as an initial segmentation plane, and traversing the image of the area to be segmented to determine whether each point in the initial segmentation plane is a background point;
[0023] If so, keep the point;
[0024] Otherwise, the point is removed and, with the point as the reference, a traversal search is performed between the slice images corresponding to the maximum values of the two convex hull areas in the image of the area to be segmented in the direction of the head and feet of the human body; if the nearest background point is retrieved, the background point is added to the initial segmentation plane, otherwise the next point in the initial segmentation plane is traversed;
[0025] S33: After the traversal is completed, a final segmentation surface is obtained, and each bone in the segmentation result image is determined based on the final segmentation surface.
[0026] More specifically, in S33 , the distance between a certain segmentation plane among the segmentation planes obtained in the segmentation result image and the joint gap position is the average value of the distances between all points in the segmentation plane and the joint gap position.
[0027] Specifically, in S1, the segmentation to obtain the bone region image specifically includes: marking the bone region in the patient's affected area image, and processing the marked image by a graph cut algorithm to obtain the corresponding bone region image.
[0028] Specifically, the method further includes the steps of performing hole filling and morphological opening operations on the binarized skeleton region image.
[0029] Specifically, the connected domain extraction is as follows:
[0030] After connected domains are extracted from the skeleton image, connected domains whose areas meet set requirements are retained to obtain an image of the region to be segmented.
[0031] Beneficial Effects: This invention uses a watershed algorithm to quickly and accurately segment joint bones and intermediate cartilage, and provides optimized correction to ensure more accurate segmentation of joint images, providing support for subsequent joint surgery. Furthermore, this invention fills any voids, ensuring that the segmented image is free of void defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 Flowchart of the joint image segmentation method based on the watershed algorithm of the present invention;
[0033] Figure 2 is a schematic diagram of the seed point sets of each skeleton region obtained in the present invention;
[0034] Figure 3 Schematic diagram of a slice of an image to be segmented along the direction of the head and feet of a human body in the present invention;
[0035] Figure 4 Schematic diagram of the convex hull area curve of the bone contour of each slice image;
[0036] Figure 5A curve is drawn by sorting the convex hull areas of the bone contours of each slice image from small to large;
[0037] Figure 6 Flowchart for screening and optimizing the obtained segmentation result image. DETAILED DESCRIPTION
[0038] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.
[0039] The joint image segmentation method based on the watershed algorithm of the present invention is as follows Figure 1 As shown, the steps include:
[0040] S1. Obtain an image of the patient's affected area, segment it to obtain an image of the bone area, and binarize it;
[0041] Specifically include:
[0042] S11, obtaining an image of the patient's affected part, and marking the bone area in the image of the patient's affected part;
[0043] In the present invention, the bone region in the patient's affected area image can be roughly annotated manually or by an automatic algorithm, and the automatic algorithm can use a pre-trained segmentation model;
[0044] Specifically, the bone region can be marked on each cross section of the patient's affected area image, the bone and muscle regions can be roughly divided according to the bone and muscle tissues, or the bone region can be directly marked.
[0045] S12, processing the image annotated in S11 by a graph cut algorithm (3D graphcut) to obtain a binary image of bones that distinguishes the foreground and background;
[0046] In the present invention, after obtaining the corresponding binary image of the skeleton, hole filling and morphological opening operations may be performed on the obtained binary image of the skeleton.
[0047] S2, performing connected domain extraction on the image obtained in S1 to obtain an image of the region to be segmented, and screening multiple seed point sets in the image of the region to be segmented;
[0048] Specifically, the connected domain is extracted from the binary skeleton region image to obtain the region image to be segmented, the geodesic distance of each point in the connected domain is calculated, and a distance threshold is set to screen and obtain multiple seed point sets in the connected domain;
[0049] Specifically, the connected domain extraction is performed on the binary skeleton region image as follows: the area of each connected domain in the skeleton binary image is calculated respectively, and the connected domain corresponding to the largest area is obtained to obtain the image of the region to be segmented.
[0050] Specifically, the seed point set for screening each connected domain is as follows:
[0051] After calculating the geodesic distance of each point in the connected domain, the image of the segmented region can be processed by threshold segmentation to obtain multiple seed point sets of the connected domain, such as using Hconcave, Otsu's method, etc. The threshold used here is the geodesic distance threshold.
[0052] Specifically, the geodesic distance of a point in a connected domain is the distance between the point in the connected domain and the boundary of the connected domain closest to the point.
[0053] Among them, the points in various sub-point sets are seed point sets composed of points whose geodesic distance in the connected domain is greater than the set threshold. Generally, the geodesic distance of each bone is large, such as at the knee joint, there are seed point sets on the femur, patella, tibia and fibula. Figure 2 Points A, B, C, and D in .
[0054] In the present invention, after obtaining the corresponding seed point set, there may be interference points in the seed point set, so the step of removing the interference points is also included, that is, selecting a plurality of seed point sets that meet the set conditions in the seed point set, specifically:
[0055] S21, calculating the convex hull area of the outer contour of the skeleton in each slice image along the head-to-foot direction of the human body in the image of the area to be segmented, and sorting the convex hull areas from small to large;
[0056] Among them, the convex hull area of the outer contour of the skeleton in each slice image along the head and foot direction of the human body in the image of the area to be segmented is calculated as follows: Figure 3 As shown; wherein, in the direction of the head and feet of the human body, the joint has the characteristic that the middle part has the smallest area and the two outer bone parts have the largest area. Therefore, in each slice image, the slice image corresponding to the peak value of the convex hull area of the two bone contours (i.e., the maximum value of the two convex hull areas) and the slice image with the smallest convex hull area of the bone contour between the two peak values (i.e., the minimum value of the convex hull area) can be obtained; specifically, the time sequence of each slice image can be used as the horizontal coordinate, and the convex hull area of the bone contour of each slice image can be used as the vertical coordinate to draw a curve, as shown Figure 4 As shown, Figure 4 The middle circle part is the slice image with the smallest area in the middle part of the joint, and the position corresponding to this slice image is taken as the corresponding joint gap position I0;
[0057] S22, screening out the bone regions whose convex hull areas meet the set requirements;
[0058] According to the order of S21, traverse and accumulate the convex hull area corresponding to the first slice image, and calculate the ratio of the accumulated area to the sum of the convex hull areas corresponding to all slice images;
[0059] When the proportion reaches the set value, which is 0.2 in the present invention, the convex hull area corresponding to the traversed slice image is S. The slice image with a convex hull area larger than S among the slice images is the corresponding bone area.
[0060] like Figure 5 As shown, a curve is drawn according to the order of S21, where the vertical axis of the curve is the cumulative area ratio and the horizontal axis is the slice sequence number determined according to the order. The corresponding slice image is Figure 4 The slice images corresponding to the ranges A and B in FIG. 8 , taking the knee joint as an example, these slice images correspond to the femur and tibia regions.
[0061] S23, searching for the seed point set in the skeleton region obtained in S22, thereby obtaining the seed point set corresponding to the skeleton region after excluding other interference points;
[0062] This step can also use the method of S2 to obtain the seed point set corresponding to the bone area after excluding other interference points;
[0063] S24. Determine other bone areas in the joint after removing the bone area obtained in step S23 through physiological positions, such as the positions of the patella and fibula in the knee joint, and then find the corresponding seed point sets on other bone areas in the joint after removing the bone area obtained in step S23 as in step S23.
[0064] S3, based on the multiple seed point sets obtained in S2, using the watershed algorithm to segment the image of the area to be segmented to obtain a segmentation result image;
[0065] A specific example is the knee joint, which contains the femur, patella, tibia, and fibula. In the segmentation result image, each region is represented by a color. By extracting the overlapping parts of each region and the image of the area to be segmented obtained by S3, the bones of each region can be obtained. At the same time, the surface formed by the black lines of each color of each bone region is the segmentation surface Z.
[0066] After obtaining the segmentation result image, it is impossible to match each segmentation area with each bone. Therefore, the specific segmentation surface can be determined by the two bones of the specific joint, and then each segmentation area can be matched with each bone. However, the segmentation surface in the segmentation result image may have interference, especially in the adhesion part of the two bones. Therefore, it is necessary to further screen and optimize it. Figure 6 ,include:
[0067] S31, obtain the joint gap position I0 according to S21;
[0068] S32. Select the segmentation plane Z in the segmentation result image obtained in S2 that is closest to the joint gap position I0 obtained in S21 as the segmentation plane corresponding to the two bones in the joint, such as the segmentation plane of the femur and tibia in the knee joint, and obtain the initial segmentation plane Z1; wherein the distance between each segmentation plane Z and the joint gap position I0 is the average value of the distance between all points in each segmentation plane Z and the joint gap position I0.
[0069] According to the skeleton binary image obtained in S2, it is determined whether each point in the initial segmentation surface Z1 obtained in S61 is a background point; if so, the point is retained; otherwise, the point is eliminated from the point set of the initial segmentation surface Z1, and with the point as the reference, a traversal search is performed between the slice images corresponding to the maximum values of the convex hull areas in the image obtained in S3 in the direction of the head and feet of the human body until the nearest background point is retrieved, and the point is added to the point set of the initial segmentation surface Z1 to correct the initial segmentation surface Z1; if the nearest background point cannot be retrieved, this step is repeated to traverse the next point;
[0070] S33, the traversal is completed, and the final segmentation surface is obtained, and then the corresponding bones in the segmentation result image obtained in S2 can be determined, that is, each segmentation area in the segmentation result image is matched with each bone.
[0071] This invention uses a watershed algorithm to quickly and accurately segment joint bones and intervening cartilage by selecting an appropriate set of seed points. It also provides methods for optimizing and correcting the segmentation plane, ensuring more accurate segmentation of joint images and supporting subsequent joint surgery. Furthermore, the invention fills any voids, ensuring that the segmented image is free of defects.
[0072] The preferred embodiments of the present invention are described in detail above, but the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations (such as quantity, shape, position, etc.) can be made to the technical solution of the present invention, and these equivalent transformations all fall within the scope of protection of the present invention.
Claims
1. Joint image segmentation method based on watershed algorithm, characterized by: include: S1. Obtain an image of the patient's affected area, segment it to obtain an image of the bone area, and binarize it; S2. Performing connected domain extraction on the binarized skeleton region image to obtain an image of the region to be segmented, calculating the geodesic distance between each point in the image of the region to be segmented and its nearest boundary, setting a distance threshold to filter and obtain multiple seed point sets, and selecting seed point sets from the multiple seed point sets that meet set conditions; S3, using the watershed algorithm to segment the image of the area to be segmented based on the seed point set selected in S2, to obtain a segmentation result image; Specifically: S31, calculating the convex hull area of the bone contour in each slice image of the image to be segmented along the head-to-foot direction of the human body, and selecting the slice image corresponding to the minimum value between the two maximum values of the convex hull area as the joint gap position; S32, obtaining a segmentation plane closest to the joint gap position according to the segmentation result image as an initial segmentation plane, and traversing the image of the area to be segmented to determine whether each point in the initial segmentation plane is a background point; If so, keep the point; Otherwise, the point is removed and, with the point as the reference, a traversal search is performed between the slice images corresponding to the maximum values of the two convex hull areas in the image of the area to be segmented in the direction of the head and feet of the human body; if the nearest background point is retrieved, the background point is added to the initial segmentation plane, otherwise the next point in the initial segmentation plane is traversed; S33: After the traversal is completed, a final segmentation surface is obtained, and each bone in the segmentation result image is determined based on the final segmentation surface.
2. The joint image segmentation method according to claim 1, characterized in that In S2, setting a distance threshold to filter and obtain multiple seed point sets of the image of the area to be segmented is specifically: filtering points in the image of the area to be segmented whose geodetic distance is greater than the distance threshold as seed points to obtain multiple seed point sets of the image of the area to be segmented.
3. The joint image segmentation method according to claim 1 or 2, characterized in that: In S2, the step of selecting a seed point set that satisfies a set condition from among the plurality of seed point sets is specifically: S21, calculating the convex hull area of the outer contour of the skeleton in each slice image along the head-to-foot direction of the human body in the image of the area to be segmented; S22 , extracting slice images in which the convex hull area is greater than the area threshold, obtaining the bone regions corresponding to the slice images, and selecting the corresponding seed point sets.
4. The joint image segmentation method according to claim 3, characterized in that: The method for determining the area threshold is: S221, sorting the convex hull areas obtained in S21 from small to large; S222, starting from the convex hull area corresponding to the first slice image according to the sorting, traversing and accumulating, and calculating the ratio of the accumulated area to the sum of the convex hull areas corresponding to all slice images; S223 , obtaining a slice image when the proportion reaches a set value, and the convex hull area corresponding to the slice image is the area threshold.
5. The joint image segmentation method according to claim 3, characterized in that: After the seed point set that meets the set conditions is selected in S22, the following steps are further included: Other bone regions in the joint excluding each bone region obtained in S22 are determined by physiological position, and then corresponding seed point sets on other bone regions are screened and obtained.
6. The joint image segmentation method according to claim 1, characterized in that: In S33, the distance between a certain segmentation plane among the segmentation planes obtained in the segmentation result image and the joint gap position is the average value of the distances between all points in the segmentation plane and the joint gap position.
7. The joint image segmentation method according to claim 1, characterized in that: In S1, the segmentation to obtain the bone region image specifically includes: marking the bone region in the patient's affected area image, and processing the marked image by a graph cut algorithm to obtain the corresponding bone region image.
8. The joint image segmentation method according to claim 1, characterized in that: The method also includes the steps of performing hole filling and morphological opening operations on the binarized skeleton region image.
9. The joint image segmentation method according to claim 1, characterized in that: The connected domain extraction is specifically as follows: After connected domains are extracted from the skeleton region image, connected domains whose areas meet set requirements are retained to obtain the image of the region to be segmented.
Citation Information
Patent Citations
Automatic segmentation method of knee joint cartilage image
CN103440665A
Method and system for abdominal bone segmentation in medical image
CN105701795A