A morphological feature measurement method based on image extraction
Through image processing and computer vision technology, the morphological characteristics of specific areas in the surgical robot's surgical path are extracted, which solves the problem that the morphological characteristics of specific areas cannot be directly calculated in the prior art, and improves the measurement efficiency and accuracy.
Patent Information
- Application Number
- CN202411926758.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The prior art cannot directly calculate specific regional morphological characteristics based on actual needs, which limits the autonomous ability and surgical path optimization of surgical robots.
By taking RGB images, grayscale processing and preprocessing are performed, the outer contour lines and center lines are extracted, and the trajectory equation is identified in combination with the computer vision system. Canny edge detection and morphological opening operations are used to eliminate isolated points and break edges, set thresholds to extract effective edges, and use nearest neighbor sorting and cubic spline interpolation to generate smooth curves to obtain the outer contour and center lines with actual physical dimensions.
It realizes accurate extraction of morphological characteristics of a specific region according to actual needs, reduces useless information, and improves the efficiency and accuracy of morphological characteristics measurement.
Smart Images

Figure CN119785047B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a morphological feature measurement method based on image extraction. Background Art
[0002] Morphological characteristics refer to the sum of an object's external shape, internal structure, and related detailed features. Morphological characteristics of human passageways include size, shape, and course. Size primarily refers to overall scale and diameter, shape refers to geometric appearance, and course refers to distribution path. The normality of these morphological characteristics is crucial to human health. Morphological characteristics are increasingly being used, particularly in fields such as medical imaging analysis and disease diagnosis, including tumor diagnosis, hypertension, and coronary artery disease. Considering the varying roles of different morphological characteristics, quantification is now being performed on various morphological features, including classification dimension, fissure degree, tortuosity, branch point density, centerline length, vessel density, vessel diameter, and vascular topology and structure. This demonstrates the broad application value of accurate quantification of morphological characteristics.
[0003] As an innovative tool that combines high-precision control with minimally invasive surgical techniques, the application of surgical robots is also inseparable from the quantification of morphological features. During surgery, the complex and changeable vascular morphology limits the development and application of surgical robots. For example, the unclear vascular morphology will bring challenges to interventional path planning. When reconstructing the shape of the blood vessel, the curvature of the blood vessel will affect the reconstruction accuracy; during the process of robotic venous blood collection, extracting the venous centerline can improve the positioning accuracy and efficiency of venous vessel detection and increase the success rate of blood collection. This proves that accurate quantitative morphological features play a key role in robot-assisted surgery.
[0004] However, current morphological feature quantification methods mostly focus on full-image measurements. This measurement method cannot accurately extract morphological data of regions of interest based on specific needs, and can only provide overall feature information. This deficiency limits the autonomous capabilities of surgical robots. For example, during surgical planning, it is often necessary to quickly provide feature data of specific parts to optimize the surgical path. However, full-image measurement can only quickly calculate the feature data of all parts of the full image before finding the feature data of the required parts, resulting in full-image measurement being unable to meet the needs of rapid measurement during surgery. Therefore, the existing technology has the problem of being unable to directly calculate the morphological features of specific regions according to actual needs. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a morphological feature measurement method based on image extraction, which solves the problem in the existing technology that the morphological features of specific local areas cannot be directly calculated according to actual needs.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A morphological feature measurement method based on image extraction comprises the following steps:
[0008] Capture and obtain the RGB image of the object to be measured;
[0009] Through grayscale processing, the RGB image is converted into a grayscale image;
[0010] Preprocess the grayscale image;
[0011] Extract the outer contour line of the object to be measured in the preprocessed grayscale image;
[0012] Obtain the center line of the object to be measured according to the outer contour line;
[0013] The extracted outer contour line and center line are redrawn on the RGB image, and the trajectory equations of the outer contour line and center line are obtained through image recognition by a computer vision system;
[0014] Select any position to be measured on the outer contour or center line, calculate the value of the morphological feature of the selected position and save it;
[0015] The grayscale image is preprocessed, which includes the following steps:
[0016] The generated grayscale image is smoothed and denoised using a Gaussian filter;
[0017] Enhance the contrast of grayscale images through histogram equalization;
[0018] Extracting the outer contour line of the object to be measured in the preprocessed grayscale image specifically includes the following steps:
[0019] The Canny edge detection algorithm is used to extract valid edges from the preprocessed grayscale image;
[0020] Use morphological opening operation to remove isolated points and connect disconnected edges;
[0021] Set the threshold for edge extraction length L min ;
[0022] Through connected component analysis, extract the length greater than or equal to the threshold L min Edges with length less than the threshold are removed L min The edge of the final point set is obtained ;
[0023] The nearest neighbor sorting algorithm is used to sort the edge point set PSort and optimize the sorted point set to generate an ordered point set;
[0024] The ordered point set is fitted to generate a smooth curve using the cubic spline interpolation method, and the end point of the curve is aligned with the starting point to make the curve closed;
[0025] The curve is converted according to the scaling factor between the pixel size of the RGB image and the actual size of the object to be measured, and the outer contour line with the actual physical size is finally obtained. ;
[0026] The nearest neighbor sorting algorithm is used to sort the edge point set P Sorting is performed, and the sorted point set is optimized to generate an ordered point set, which specifically includes the following steps:
[0027] Select edge point set P Any point P 1 As a starting point;
[0028] The edge point set P The remaining points in P 1 The distances between them are arranged in order from small to large at the starting point P 1 Afterwards, edge point set P sorting;
[0029] The sorted point set is divided into fixed group sizes. In each group, the movement direction of the points is detected to determine whether there is a reentry phenomenon. If a reentry phenomenon exists, the points involved in the reentry are removed or corrected to optimize each group.
[0030] The optimized groups are merged again to generate an ordered point set.
[0031] The specific method for determining whether there is a reentry phenomenon is as follows:
[0032] Preset the threshold θ of the change in the direction angle between two adjacent points max ;
[0033] Calculate the change in the angular direction of two adjacent points. If the change in the angular direction of two adjacent points is greater than or equal to the threshold θ max , then it is judged that there is a reentry phenomenon;
[0034] Obtaining the center line of the object to be measured based on the outer contour line specifically includes the following steps:
[0035] The binary image generated by the closed outer contour mask is input into the computer vision system, and the region is skeletonized and extracted through morphological operations to generate a skeleton image with a single pixel width;
[0036] Detecting bifurcation points and endpoints of the skeleton in the skeleton image, and breaking the skeleton at the bifurcation points and endpoints;
[0037] The discrete point sets in each connected area after the skeleton is disconnected are sorted using the nearest neighbor sorting algorithm and processed using the cubic spline interpolation method to generate a smooth multi-segment centerline point set.
[0038] Calculate the distance between each bifurcation point and the starting and ending points of the multi-segment centerline point set;
[0039] Select two bifurcation points closest to the starting point and the end point of the multi-segment centerline point set respectively, and connect the two bifurcation points to the starting point and the end point of the multi-segment centerline point set respectively to generate the center line of the object in the skeleton image;
[0040] The curve is converted according to the scaling factor between the pixel size of the RGB image and the actual size of the object to be measured, and finally the center line C with the actual physical size is obtained.
[0041] Morphological features include curvature, tortuosity, distance sequence, and bend angle at selected locations.
[0042] Beneficial effects of the present invention:
[0043] The present invention can capture and obtain an RGB image of an object to be measured, convert the RGB image into a grayscale image, and after preprocessing the grayscale image, extract the outer contour line of the object to be measured in the preprocessed grayscale image, and obtain the center line of the object to be measured based on the outer contour line. By combining image recognition with a computer vision system to obtain the trajectory equations of the outer contour line and the center line, the outer contour line and the center line can be extracted, and then the feature information of any local area of the outer contour line and the center line can be separately extracted according to actual needs. This solves the problem in the prior art that the morphological features of a specific local area cannot be directly calculated according to actual needs, reduces the acquisition of useless information, and improves the efficiency of morphological feature measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 This is a flow chart of the morphological feature measurement method based on image extraction of the present invention. DETAILED DESCRIPTION
[0046] 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 any creative efforts shall fall within the scope of protection of the present invention.
[0047] like Figure 1 As shown, a morphological feature measurement method based on image extraction includes the following steps:
[0048] Capture and obtain the RGB image of the object to be measured;
[0049] Through grayscale processing, the RGB image is converted into a grayscale image;
[0050] Preprocess the grayscale image;
[0051] Extract the outer contour line of the object to be measured in the preprocessed grayscale image;
[0052] Obtain the center line of the object to be measured according to the outer contour line;
[0053] The extracted outer contour line and center line are redrawn on the RGB image, and the trajectory equations of the outer contour line and center line are obtained through image recognition by a computer vision system;
[0054] Select any position to be measured on the outer contour or center line, calculate the value of the morphological feature of the selected position and save it.
[0055] Before shooting, the relative position of the camera and the object to be measured needs to be adjusted so that the image of the object to be measured is clear and complete.
[0056] The grayscale image is preprocessed, which includes the following steps:
[0057] The generated grayscale image is smoothed and denoised using a Gaussian filter;
[0058] Enhance the contrast of grayscale images through histogram equalization;
[0059] The filters used are:
[0060]
[0061] is the coordinate of a pixel point in two-dimensional space relative to the filter center, is the standard deviation of the Gaussian function.
[0062] Extracting the outer contour of the object to be measured from the preprocessed grayscale image specifically includes the following steps:
[0063] The Canny edge detection algorithm is used to extract valid edges from the preprocessed grayscale image;
[0064] Use morphological opening operation to remove isolated points and connect disconnected edges;
[0065] The morphological opening operation includes two steps: expansion and erosion:
[0066]
[0067] in, is a binary image, is the morphological nucleus, For corrosion operations, For expansion operation;
[0068] Set the threshold for edge extraction length L min ;
[0069] Through connected component analysis, extract the length greater than or equal to the threshold L min Edges with length less than the threshold are removed L min The edge of the final point set is obtained ;
[0070] The currently obtained edge point set In order to obtain an ordered set of edge points and ensure that the connection order of the points conforms to the geometric structure of the curve, the nearest neighbor sorting algorithm is used to sort the edge point set. P Sort and optimize the sorted point set to generate an ordered point set;
[0071] The ordered point set is fitted to generate a smooth curve using the cubic spline interpolation method, and the end point of the curve is aligned with the starting point to make the curve closed;
[0072] In order to obtain the size of the curve, the pixel coordinates of the curve need to be According to the image pixel size and actual physical size Convert between scaling factors:
[0073]
[0074]
[0075] Finally, the outer contour line with the actual object size is obtained .
[0076] The nearest neighbor sorting algorithm is used to sort the edge point set PSorting is performed, and the sorted point set is optimized to generate an ordered point set, which specifically includes the following steps:
[0077] Select edge point set P Any point P 1 As a starting point;
[0078] Find the edge point set P The remaining points and the starting point P 1 The point with the smallest distance As the next point, point Remove from the unsorted point set and add to the sorted point set;
[0079] The edge point set P The remaining points in P 1 The distances between them are arranged in order from small to large at the starting point P 1 Afterwards, edge point set P sorting;
[0080]
[0081] The distance between two points is calculated as follows:
[0082]
[0083] The sorted point set is divided into fixed group sizes. In each group, the movement direction of the points is detected to determine whether there is a reentry phenomenon. If a reentry phenomenon exists, the points involved in the reentry are removed or corrected to optimize each group.
[0084] The optimized groups are merged again to generate an ordered point set.
[0085] The specific method for determining whether there is a reentry phenomenon is as follows:
[0086] Preset the threshold θ of the change in the direction angle between two adjacent points max ;
[0087] Calculate the change in the angular direction of two adjacent points. If the change in the angular direction of two adjacent points is greater than or equal to the threshold θ max , then it is judged that there is a reentry phenomenon;
[0088] The direction angle is the angle between the line connecting two points and the x-axis. The direction angle calculation formula is:
[0089]
[0090] (xi, yi) and (xj, yj) are the coordinates of two points respectively;
[0091] Obtaining the center line of the object to be measured based on the outer contour line specifically includes the following steps:
[0092] The binary image generated by the closed outer contour mask is input into the computer vision system, and the region is skeletonized and extracted through morphological operations to generate a skeleton image with a single pixel width;
[0093] Skeletonization results in single-pixel lines that retain topological features and accurately represent the centerline structure of the region. However, directly sorting the skeleton makes it difficult to determine the direction or path of the centerline, which can easily lead to point order confusion. By splitting the skeleton into multiple simple, connected line segments without bifurcations, point sorting and curve processing are much easier.
[0094] Detecting bifurcation points and endpoints of the skeleton in the skeleton image, and breaking the skeleton at the bifurcation points and endpoints;
[0095] The discrete point sets in each connected area after the skeleton is disconnected are sorted using the nearest neighbor sorting algorithm and processed using the cubic spline interpolation method to generate a smooth multi-segment centerline point set.
[0096] The point set sorting method in this step is the same as the edge point set sorting and optimization steps;
[0097] Calculate the distance between each bifurcation point and the starting and ending points of the multi-segment centerline point set;
[0098] Select the two bifurcation points closest to the starting point and the end point of the multi-segment centerline point set respectively, and connect the two bifurcation points to the starting point and the end point of the multi-segment centerline point set respectively, so as to ensure the topological coherence of the centerline segment and generate the centerline of the object in the skeleton image;
[0099] Calculate the starting point of the centerline segment and end point To the bifurcation point set The distance to each bifurcation point in :
[0100]
[0101] is the distance from the starting point to the bifurcation point, is the distance from the end point to the bifurcation point.
[0102] The curve is converted according to the scaling factor between the pixel size of the RGB image and the actual size of the object to be measured, and finally the center line C with the actual physical size is obtained.
[0103] Morphological features include curvature, tortuosity, distance sequence, and bend angle at selected locations;
[0104] The curvature calculation process is: select the point to be measured , , Represents the trajectory equation of the point here , First derivative of direction:
[0105]
[0106] , Represents the trajectory equation of the point here , Second derivative of direction:
[0107]
[0108] point The curvature at for:
[0109]
[0110] Select the starting and ending points on the curve;
[0111] Get the path from the start point to the end point as , the path length is , the straight-line distance from the starting point to the end point is ;
[0112]
[0113] Tortuosity for:
[0114]
[0115] The calculation process of the distance sequence is as follows: on the extracted path, by setting a fixed interval ;
[0116] Generate an equidistant distribution ;
[0117] Interpolation based on cumulative arc length ,Right now:
[0118]
[0119] in Indicates the path The arc length of the point, based on linear interpolation, generates query points Corresponding coordinates .
[0120] For each point on the path , calculate its normal direction, and extend it to the left and right sides along the normal direction to the outer contour boundary; normal direction The calculation is based on the tangent vector :
[0121]
[0122] in is the tangent vector, is the unit normal vector.
[0123] Search for the boundary outward along the normal direction and set the maximum extension length to , gradually extended to one side boundary by step method, length Expressed as:
[0124]
[0125] in is the current point, Indicates the area enclosed by the outer contour line. The total length is the sum of the lengths of the left and right sides. Channel diameter at for:
[0126]
[0127] Finally, we get the sum point set One-to-one distance sequence .
[0128] The calculation process of the bending angle is: Perform cubic spline interpolation to generate a smooth path ,in is a parameterized variable, specifically expressed as:
[0129]
[0130] and are cubic spline interpolation functions, Indicates the index interval of the path points, To obtain a high-density point set through interpolation.
[0131] On the fitted path segment, select points and calculate the tangent direction by averaging the differences.
[0132] At the start of the path segment, select the front Fitting points , calculate the average tangent direction at the starting point through the difference vector of adjacent points :
[0133]
[0134] Similarly, at the end of the path segment, select the last Fitting points , calculate the average tangent direction at the starting point through the difference vector of adjacent points for:
[0135]
[0136] in, It is the first The coordinates of the fitting points, is the total number of points in the fitted path segment.
[0137] In order to ensure the standardization of the tangent direction vector, it is necessary to normalize the vector Normalize and get the unit tangent vector :
[0138]
[0139] By normalizing, the unit tangent vectors at the starting point and the end point can be obtained respectively. and .
[0140] Tangent direction and The angle between the axes is calculated using the inverse tangent function, and the bending angle is the angle between the starting and ending tangents. Unified as counterclockwise direction:
[0141]
[0142]
[0143] in, The starting point tangent The angle of the axis, The end point tangent The angle between the axes.
[0144] The present invention can capture and obtain an RGB image of an object to be measured, convert the RGB image into a grayscale image, and after preprocessing the grayscale image, extract the outer contour line of the object to be measured in the preprocessed grayscale image, and obtain the center line of the object to be measured based on the outer contour line. By combining image recognition with a computer vision system to obtain the trajectory equations of the outer contour line and the center line, the outer contour line and the center line can be extracted. Then, according to actual needs, feature information of any local area of the outer contour line and the center line can be separately extracted, thereby reducing the acquisition of useless information and improving efficiency.
[0145] The flow chart of the morphological feature measurement method based on image extraction of the present invention is as follows: Figure 1 shown.
[0146] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0147] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A morphological feature measurement method based on image extraction, characterized in that: The following steps are involved: Capturing and acquiring an RGB image of the object to be measured; converting the RGB image into a grayscale image through grayscale processing; preprocessing the grayscale image; extracting the outer contour line of the object to be measured in the preprocessed grayscale image; Obtain the center line of the object to be measured based on the outer contour line; redraw the extracted outer contour line and center line on the RGB image, and obtain the trajectory equations of the outer contour line and center line through image recognition by a computer vision system; select any position to be measured on the outer contour or center line, calculate the value of the morphological feature of the selected position and save it; Extracting the outer contour of the object to be measured from the preprocessed grayscale image specifically includes the following steps: The Canny edge detection algorithm is used to extract valid edges from the preprocessed grayscale image; the morphological opening operation is used to remove isolated points and connect the disconnected edges; the threshold of the edge extraction length is set L min ; Through connected region analysis, extract the length greater than or equal to the threshold L min Edges with length less than the threshold are removed L min The edge of the final point set is obtained ; Use the nearest neighbor sorting algorithm to sort the edge point set P The points are sorted and optimized to generate an ordered set of points. A smooth curve is generated by fitting the ordered set of points using the cubic spline interpolation method, and the end point of the curve is aligned with the starting point to close the curve. The curve is converted according to the scaling factor between the pixel size of the RGB image and the actual size of the object to be measured, and an outer contour line with the actual physical size is finally obtained. ; Obtaining the center line of the object to be measured based on the outer contour line specifically includes the following steps: The binary image generated by the closed outer contour mask is input into the computer vision system, and the region is skeletonized and extracted through morphological operations to generate a skeleton image with a single pixel width; the bifurcation points and endpoints of the skeleton in the skeleton image are detected, and the skeleton is disconnected at the bifurcation points and endpoints; The discrete point sets within each connected region after skeleton disconnection are sorted using the nearest neighbor sorting algorithm and processed through the cubic spline interpolation method to generate a smooth multi-segment centerline point set. The distances between each bifurcation point and the starting and ending points of the multi-segment centerline point set are calculated. The two bifurcation points closest to the starting and ending points of the multi-segment centerline point set are respectively selected and connected to the starting and ending points of the multi-segment centerline point set to generate the centerline of the object in the skeleton image. The curve is converted according to the scaling factor between the pixel size of the RGB image and the actual size of the object to be measured, and finally a centerline C with actual physical size is obtained.
2. The morphological feature measurement method based on image extraction according to claim 1, characterized in that: The grayscale image is preprocessed, specifically including the following steps: smoothing and denoising the generated grayscale image through a Gaussian filter; and enhancing the contrast of the grayscale image through histogram equalization.
3. The morphological feature measurement method based on image extraction according to claim 2, characterized in that: The nearest neighbor sorting algorithm is used to sort the edge point set P Sorting and optimizing the sorted point set to generate an ordered point set, specifically including the following steps: Selecting the edge point set P Any point P 1 As the starting point; the edge point set P The remaining points in P 1 The distances between them are arranged in order from small to large at the starting point P 1 Afterwards, edge point set P The sorting method is to divide the sorted point set into fixed group sizes, and determine whether there is a reentry phenomenon in each group by detecting the movement direction of the points. If there is a reentry phenomenon, the points involved in the reentry are removed or corrected, and each group is optimized; the optimized groups are re-merged to generate an ordered point set.
4. The morphological feature measurement method based on image extraction according to claim 3, characterized in that: The specific method for determining whether there is a reentry phenomenon is as follows: pre-set the threshold θmax of the change in the direction angle of two adjacent points; calculate the change in the direction angle of two adjacent points, and if the change value of the direction angle of two adjacent points is greater than or equal to the threshold θmax, it is determined that a reentry phenomenon exists.
5. The morphological feature measurement method based on image extraction according to claim 4, characterized in that: Morphological features include curvature, tortuosity, distance sequence, and bend angle at selected locations.
Citation Information
Patent Citations
Liver subsection method based on CT image and system thereof
CN101425186A
Diameter measuring method and device for highly reflective cylinder and use method
CN109945792A
Video monitoring image human shape identification method
CN110287783A