Morphological feature measurement method based on image extraction
By processing RGB images and identifying computer vision systems, extracting and calculating morphological features of local areas, the problem in the prior art that the morphological features of specific areas cannot be directly calculated according to actual needs, and the measurement efficiency is improved.
Patent Information
- Application Number
- CN202411926758.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-08
- 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, the trajectory equation is obtained using a computer vision system, and the morphological characteristics of the local area are extracted according to actual needs.
Accurate extraction of morphological characteristics of specific regions is achieved, the acquisition of useless information is reduced, and the efficiency of morphological characteristics is improved.
Smart Images

Figure CN119785047A_ABST
Abstract
Description
Technical Field
[0001] The 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 features refer to the sum of an object's external shape, internal structure, and related detailed features. The morphological features of human channels include size, shape, and course. Size mainly refers to the overall scale and diameter, shape refers to the geometric appearance, and course refers to the distribution path. Whether these morphological features are normal or not is crucial to human health. At present, the application of morphological features is becoming more and more extensive, especially in the fields of medical image analysis and disease diagnosis, including tumor diagnosis, hypertension, coronary artery disease, etc. Considering that different morphological features have different effects, different morphological features are now quantified separately, including classification dimension, fissure degree, tortuosity, branch point density, centerline length, vascular density, vascular diameter, vascular topology and structure, etc. This proves that the precise quantification of morphological features has a wide range of application value.
[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; in the process of robotic venous blood collection, extracting the venous centerline can improve the positioning accuracy and efficiency of venous blood 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, most of the current morphological feature quantification is aimed at the measurement of the whole image. This measurement method cannot accurately extract the morphological data of the area of interest according to specific needs, and can only provide overall feature information. This deficiency limits the autonomous ability of surgical robots; for example, in surgical planning, it is usually necessary to quickly provide the feature data of specific parts to optimize the surgical path, and the whole image measurement can only find the feature data of the required part after quickly calculating the feature data of each part of the whole image, resulting in the inability of the whole image measurement to meet the needs of rapid measurement during surgery; therefore, there is a problem in the existing technology that it is impossible to directly calculate the morphological features of specific areas according to actual needs. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a morphological feature measurement method based on image extraction, which solves the problem in the prior art that the morphological features of a specific local area 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 tested;
[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 by performing image recognition through 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 specifically includes the following steps:
[0016] The generated grayscale image is smoothed and denoised by 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] The morphological opening operation is used to remove isolated points and connect the disconnected edges;
[0021] Set the threshold L for edge extraction length min ;
[0022] Through connected region analysis, extract the min Edges with length less than the threshold L are removed min The edge of the final edge point set P = {(x i ,y i )|i=1,2,...,N};
[0023] The nearest neighbor sorting algorithm is used to sort the edge point set P, and the sorted point set is optimized to generate an ordered point set;
[0024] The ordered point set is fitted to generate a smooth curve by 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 finally an outer contour line Γ with an actual physical size is obtained;
[0026] The nearest neighbor sorting algorithm is used to sort the edge point set P, and the sorted point set is optimized to generate an ordered point set, which specifically includes the following steps:
[0027] Select any point P in the edge point set P 1 As a starting point;
[0028] The remaining points in the edge point set P are combined with P 1 The distances between them are arranged in order from small to large at the starting point P 1 Afterwards, the edge point set P is sorted;
[0029] The sorted point set is divided into fixed group sizes. In each group, the movement direction of the detection point is determined to determine whether there is a reentry phenomenon. If there is a reentry phenomenon, 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 value θ max , then it is judged that there is a reentry phenomenon;
[0034] Obtaining the center line of the object to be measured according to 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] Detect bifurcation points and endpoints of the skeleton in the skeleton image, and disconnect the skeleton at the bifurcation points and endpoints;
[0037] The discrete point set in each connected area after the skeleton is disconnected is sorted by the nearest neighbor sorting algorithm, and processed by the cubic spline interpolation method to generate a smooth multi-segment center line point set;
[0038] Calculate the distance between each bifurcation point and the starting point and end point 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 centerline 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 a center line C with an 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 according to the outer contour line. By combining image recognition with a computer vision system to obtain trajectory equations of the outer contour line and the center line, the extraction of the outer contour line and the center line can be realized, 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, which 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 It is a flow chart of the morphological feature measurement method based on image extraction of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0047] like Figure 1 As shown, a morphological feature measurement method based on image extraction comprises the following steps:
[0048] Capture and obtain the RGB image of the object to be tested;
[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 by performing image recognition through 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 tested needs to be adjusted so that the image of the object to be tested is clear and complete.
[0056] The grayscale image is preprocessed, which specifically includes the following steps:
[0057] The generated grayscale image is smoothed and denoised by using a Gaussian filter;
[0058] Enhance the contrast of grayscale images through histogram equalization;
[0059] The filters used are:
[0060]
[0061] (x, y) is the coordinate of a pixel in two-dimensional space relative to the center of the filter, and σ is the standard deviation of the Gaussian function.
[0062] Extracting the outer contour line of the object to be measured in 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] The morphological opening operation is used to remove isolated points and connect the disconnected edges;
[0065] The morphological opening operation includes two steps of expansion and corrosion:
[0066]
[0067] Among them, I is a binary image, S is a morphological kernel, ! is an erosion operation, For expansion operation;
[0068] Set the threshold L for edge extraction length min ;
[0069] Through connected region analysis, extract the min Edges with length less than the threshold L are removed min The edge of the final edge point set P = {(x i ,y i )|i=1,2,...,N};
[0070] The edge point set P currently obtained is unordered. In order to obtain an ordered edge point set 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, and the sorted point set is optimized to generate an ordered point set;
[0071] The ordered point set is fitted to generate a smooth curve by 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 (x i ,y i ) according to the image pixel size (W px ,H px ) and actual physical size (W mm ,H mm ) to convert between scaling factors:
[0073]
[0074] x mm,i =x i Scale x ,y mm,i =y i Scale y ,i=1,2,...,N
[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 P, and the sorted point set is optimized to generate an ordered point set, which specifically includes the following steps:
[0077] Select any point P in the edge point set P 1 As a starting point;
[0078] Find the remaining points in the edge point set P that are consistent with the starting point P 1 The point P with the smallest distance k As the next point, point P k Remove from the unsorted point set and add to the sorted point set;
[0079] The remaining points in the edge point set P are combined with P 1 The distances between them are arranged in order from small to large at the starting point P 1 Afterwards, the edge point set P is sorted;
[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 detection point is determined to determine whether there is a reentry phenomenon. If there is a reentry phenomenon, 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 value θ 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] (x i ,y i ) and (x j ,y j ) are the coordinates of two points respectively;
[0091] Obtaining the center line of the object to be measured according to 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] The skeletonization result is a single-pixel line that maintains topological features and can accurately represent the centerline structure of the region. However, if the skeleton is directly sorted, it is difficult to determine the direction or path of the centerline, which can easily lead to a disordered order of points. By splitting the skeleton into multiple simple, non-branched connected line segments, it is easier to sort points and process curves.
[0094] Detect bifurcation points and endpoints of the skeleton in the skeleton image, and disconnect the skeleton at the bifurcation points and endpoints;
[0095] The discrete point set in each connected area after the skeleton is disconnected is sorted by the nearest neighbor sorting algorithm, and processed by the cubic spline interpolation method to generate a smooth multi-segment center line 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 point and end point of the multi-segment centerline point set;
[0098] Selecting two bifurcation points closest to the starting point and the end point of the multi-segment centerline point set respectively, and connecting the two bifurcation points to the starting point and the end point of the multi-segment centerline point set respectively, can 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 center line segment (x start ,y start ) and the end point (x end ,y end ) to the bifurcation point set {(x b ,y b )}:
[0100]
[0101] d start,b is the distance from the starting point to the bifurcation point, d end,b 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 a center line C with an 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 (x s ,y s ), x s ′,y s ′ represents the first-order derivative of the trajectory equation of the point in the x and y directions:
[0105]
[0106] x″ s , y″ s Respectively represent the second-order derivatives of the trajectory equation of the point in the x and y directions:
[0107] x″ s =x s+1 -2x s +x s-1 ,y″ s =y s+1 -2y s +y s-1
[0108] Point (x s ,y s ) s for:
[0109]
[0110] Select the starting and ending points on the curve;
[0111] Get the path from the starting point to the end point as P = {(x 1 ,y 1 ),(x 2 ,y 2 ),...,(x N ,y N )}, the path length is L arc , the straight-line distance from the starting point to the end point is L chord ;
[0112]
[0113] The tortuosity T is:
[0114]
[0115] The distance sequence is calculated as follows: on the extracted path, by setting a fixed interval Δd;
[0116] Generate an equidistant distribution Q = {(x q ,yq )|q=1,2,...,M};
[0117] The interpolation is based on the cumulative arc length S, that is: i=1,2,...,N-1
[0118] Where S i Represents the arc length of the i-th point in the path, based on linear interpolation, to generate the query point s q =q·Δd corresponding coordinates (x q ,y q ).
[0119] For each point (x q ,y q ), calculate its normal direction, and extend it to the left and right sides along the normal direction to the outer contour boundary; the normal direction n q The calculation is based on the tangent vector t q :
[0120]
[0121] where t q =(t q1 ,t q2 ) is the tangent vector, n q is the unit normal vector.
[0122] Search for the boundary outward along the normal direction, and set the maximum extension length to be L max , gradually extended to one side boundary by stepping method, the length L is expressed as:
[0123]
[0124] Where Q q is the current point, Ω represents the area surrounded by the outer contour line, and the total length is the sum of the extension lengths on the left and right sides. q ,y q ) channel diameter D q for:
[0125] D q =L left +L right
[0126] Finally, we get the distance sequence D corresponding to the point set Q one by one. q |q=1,2,...,M}.
[0127] The calculation process of the bending angle is: perform cubic spline interpolation on the path P to generate a smooth path F = {x(t), y(t)}, where t is a parameterized variable, which is specifically expressed as:
[0128] x(t)=S x (t),y(t)=S y (t),t∈[1,N]
[0129] S x (t) and S y (t) are cubic spline interpolation functions, [1, N] represents the index interval of the path points, and F is the high-density point set obtained by interpolation.
[0130] On the fitted path segment, n points are selected near the starting point and the end point, and the tangent direction is calculated by average difference.
[0131] At the starting point of the path segment, select the first n fitting points F i =(x i ,y i )(i=1,2,...,n), calculate the average tangent direction T at the starting point through the difference vectors of adjacent points S :
[0132]
[0133] Similarly, at the end of the path segment, select the last n fitting points F i =(x i ,y i )(i=N-n+1,...,N), calculate the average tangent direction T at the starting point through the difference vectors of adjacent points E for:
[0134]
[0135] Among them, F i =(x i ,y i ) is the coordinate of the i-th fitting point on the path, and N is the total number of points in the fitting path segment.
[0136] In order to ensure the standardization of the tangent direction vector, it is necessary to normalize the vector T = (T x ,T y ) is normalized to obtain the unit tangent vector T norm :
[0137]
[0138] By normalizing, the unit tangent vector T at the starting point and the end point can be obtained respectively. S and T E .
[0139] The angle between the tangent direction and the x-axis is calculated by the inverse tangent function. The bending angle is the angle θ between the starting point and the end point tangents, which is uniformly expressed in the counterclockwise direction:
[0140] θ S = atan2(T Sy ,T Sx ),θ E = atan2(T Ey ,T Ex )
[0141]
[0142] Among them, θ S is the angle between the starting point tangent and the x-axis, θ E is the angle between the end point tangent and the x-axis.
[0143] 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 according to the outer contour line. By combining image recognition with a computer vision system to obtain trajectory equations of the outer contour line and the center line, the extraction of the outer contour line and the center line can be realized, and 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.
[0144] The flow chart of the morphological feature measurement method based on image extraction of the present invention is as follows: Figure 1 shown.
[0145] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0146] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A morphological feature measurement method based on image extraction, characterized in that: The following steps are involved: Capture and obtain the RGB image of the object to be tested; Through grayscale processing, the RGB image is converted into a grayscale image; Preprocess the grayscale image; Extract 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 according to the outer contour line; 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 by performing image recognition through 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.
2. The morphological feature measurement method based on image extraction according to claim 1, characterized in that: The grayscale image is preprocessed, which specifically includes the following steps: The generated grayscale image is smoothed and denoised by using a Gaussian filter; Enhance the contrast of grayscale images through histogram equalization.
3. The morphological feature measurement method based on image extraction according to claim 2, characterized in that: Extracting the outer contour line of the object to be measured in 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; Set the threshold L for edge extraction length min ; Through connected region analysis, extract the min Edges with length less than the threshold L are removed min The edge of the final edge point set P = {(x i ,y i )|i=1,2,...,N}; The nearest neighbor sorting algorithm is used to sort the edge point set P, and the sorted point set is optimized to generate an ordered point set; The ordered point set is fitted to generate a smooth curve by using the cubic spline interpolation method, and the end point of the curve is aligned with the starting point to make the curve closed; 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 an outer contour line Γ with an actual physical size is obtained.
4. The morphological feature measurement method based on image extraction according to claim 3 is characterized in that: The nearest neighbor sorting algorithm is used to sort the edge point set P, and the sorted point set is optimized to generate an ordered point set, which specifically includes the following steps: Select any point P1 in the edge point set P as the starting point; The remaining points in the edge point set P are arranged in order from the smallest to the largest distance from P1 after the starting point P1, and the edge point set P is sorted; The sorted point set is divided into fixed group sizes. In each group, the movement direction of the detection point is determined to determine whether there is a reentry phenomenon. If there is a reentry phenomenon, the points involved in the reentry are removed or corrected to optimize each group. The optimized groups are merged again to generate an ordered point set.
5. The morphological feature measurement method based on image extraction according to claim 4 is characterized in that: The specific method for determining whether there is a reentry phenomenon is as follows: Preset the threshold θmax of the change in the direction angle between two adjacent points; The change in the angular direction of two adjacent points is calculated. If the change in the angular direction of two adjacent points is greater than or equal to the threshold θmax, it is determined that a reentry phenomenon exists.
6. The morphological feature measurement method based on image extraction according to claim 5, characterized in that: Obtaining the center line of the object to be measured according to 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; Detect bifurcation points and endpoints of the skeleton in the skeleton image, and disconnect the skeleton at the bifurcation points and endpoints; The discrete point set in each connected area after the skeleton is disconnected is sorted by the nearest neighbor sorting algorithm, and processed by the cubic spline interpolation method to generate a smooth multi-segment center line point set; Calculate the distance between each bifurcation point and the starting point and end point of the multi-segment centerline point set; 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; 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 center line C with an actual physical size is obtained.
7. The morphological feature measurement method based on image extraction according to claim 6, characterized in that: Morphological features include curvature, tortuosity, distance sequence, and bend angle at selected locations.
Citation Information
Patent Citations
Method for extracting morphologic characteristic of human body bare footprint feature
CN101327126A
Liver subsection method based on CT image and system thereof
CN101425186A
Breast lump image feature extraction method based on edge neighborhood weighing
CN103425986A
Diameter measuring method and device for highly reflective cylinder and use method
CN109945792A
Video monitoring image human shape identification method
CN110287783A
Cited By
Sub-pixel contour extraction method and image processing device
CN120655670A
Sub-pixel profile extraction method and image processing apparatus
CN120655670B