Method and device for extracting topological information of main skeleton of image

Through preset skeleton extraction algorithm and directional search technology, the topology information of the main skeleton in the image is extracted, solving the complexity and noise problems of skeleton diagrams in the prior art, and improving the efficiency and accuracy of image processing.

CN119152218AActive Publication Date: 2024-12-17武汉库柏特科技股份有限公司

Patent Information

Application Number
CN202411201939.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-17
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

When processing complex images, the extracted skeleton map contains a large number of branches and noise, resulting in high computational complexity and affecting the accuracy and robustness of subsequent tasks, especially in real-time applications and large-scale image data processing. .

Method used

The initial skeleton diagram is extracted through the preset skeleton extraction algorithm, distinguish skeleton point types, distinguish skeleton branches, delete non-track branches, repeat skeleton extraction and discrimination, until the main skeleton diagram is determined, and a directional search is performed to obtain topological information.

Benefits of technology

Reduces computational complexity, simplifies data, improves image processing speed, enhances the robustness and accuracy of extraction, and is suitable for large image data and real-time applications, and can better cope with data noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152218A_ABST
    Figure CN119152218A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for extracting topological information of a main skeleton of an image. The method comprises the following steps: extracting an initial skeleton graph based on an acquired target image; based on the neighborhood of each skeleton point in the initial skeleton graph, the type of each skeleton point is obtained through discrimination; distinguishing a plurality of skeleton branches according to cross points in the initial skeleton diagram, and determining non-trunk branches in the skeleton branches; deleting non-trunk branches in the initial skeleton diagram to obtain an updated skeleton diagram; performing skeleton extraction on the updated skeleton drawing again, and judging whether cross points exist or not: if yes, determining non-trunk branches again according to the cross points in the new initial skeleton drawing to obtain a new updated skeleton drawing; if not, obtaining a main skeleton drawing; and performing directional search in the main skeleton graph to obtain topological information of the main skeleton graph. According to the method, complex image branches are eliminated, the main topological structure of the image shape is reserved, and data are effectively simplified, so that the complexity of subsequent processing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a device for extracting main skeleton topological information of an image. Background Art

[0002] In the field of image processing and computer vision, the extraction of shape features is a crucial research direction. Shape features can not only help understand the objects in the image, but also provide strong support for subsequent classification, recognition and analysis tasks. Skeletonization technology is one of the key technologies for shape feature extraction and has been widely used in various application scenarios. Specifically, skeletonization technology extracts the central axis of the shape from the binary image. This axis not only represents the main outline of the shape, but also retains the key topological information of the original shape. This makes the skeleton play an important role in image processing tasks, especially in tasks such as shape analysis and feature extraction.

[0003] The core of skeletonization technology is to reduce data redundancy by simplifying the shape information of the image while retaining the topological structure of the shape. This technology can effectively improve the efficiency of image processing, especially in scenarios where a large amount of image data needs to be processed, skeletonizing the image can significantly reduce the computational complexity. In addition, the central axis generated by skeletonization also has good invariance, which can resist the influence of noise and shape deformation to a certain extent, and provide a stable feature basis for subsequent image analysis and recognition. For this reason, skeletonization technology has been widely used and deeply studied in the fields of medical image analysis, object recognition, and robot navigation. Summary of the invention

[0004] In order to better extract the main skeleton of an image, an embodiment of the present invention provides a method and device for extracting topological information of the main skeleton of an image.

[0005] In a first aspect, an embodiment of the present invention provides a method for extracting main skeleton topology information of an image, which may include:

[0006] Based on the acquired target image, a preset skeleton extraction algorithm is used to extract an initial skeleton image;

[0007] Based on the neighborhood of each skeleton point in the initial skeleton graph, the type of each skeleton point is determined; the types of the skeleton points include intersection points, isolated points, endpoints and interior points;

[0008] According to all the intersections in the initial skeleton graph, a plurality of skeleton branches are distinguished;

[0009] Determining non-trunk branches from the plurality of skeleton branches;

[0010] Deleting non-main branches in the initial skeleton graph to obtain an updated skeleton graph;

[0011] Re-extract the skeleton of the updated skeleton image based on the preset skeleton extraction algorithm to obtain a new initial skeleton image, and determine whether there is an intersection in the new initial skeleton image:

[0012] If yes, then according to all the intersections in the new initial skeleton graph, the non-trunk branches are re-determined to obtain a new updated skeleton graph, and the above skeleton extraction and identification steps are performed;

[0013] If not, the new initial skeleton graph is used as the main skeleton graph;

[0014] A directed search is performed in the main skeleton graph to obtain topological information of the main skeleton graph.

[0015] In one or some optional implementations of the embodiment of the present application, the type of each skeleton point is determined based on the neighborhood of each skeleton point in the initial skeleton image, including:

[0016] For each skeleton point in the initial skeleton image, using an 8-neighborhood algorithm to determine the values ​​of 8 neighborhoods of the skeleton point;

[0017] Based on the values ​​of the eight neighborhoods of the skeleton point, subtracting them in a preset order, updating the value of each neighborhood of the skeleton point;

[0018] The type of the skeleton point is determined based on the total number of positive values ​​in the values ​​of the eight neighborhoods of the skeleton point.

[0019] In one or some optional implementations of the embodiment of the present application, the values ​​of the eight neighborhoods of the skeleton point are subtracted in a preset order to update the value of each neighborhood of the skeleton point, including:

[0020] Sort the eight neighborhoods of the skeleton point according to the preset rotation direction;

[0021] For each neighborhood of the skeleton point, calculating the difference between the neighborhood and the next neighborhood;

[0022] The value of the neighborhood is updated to the difference between the neighborhood and the next neighborhood.

[0023] In one or some optional implementations of the embodiments of the present application, determining the type of the skeleton point based on the total number of positive values ​​in eight neighborhoods of the skeleton point includes:

[0024] If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 0, the skeleton point is an isolated point;

[0025] If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 1, the skeleton point is an endpoint;

[0026] If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 2, the skeleton point is an inlier;

[0027] If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is greater than or equal to 3, the skeleton point is a crossover point.

[0028] In one or some optional implementations of the embodiment of the present application, after determining the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton image, the method further includes:

[0029] Delete all isolated points in the initial skeleton graph.

[0030] In one or some optional implementations of the embodiment of the present application, the distinguishing multiple skeleton branches according to all the intersections in the initial skeleton graph includes:

[0031] Eliminate all intersections and their neighborhoods in the initial skeleton graph to obtain a segmented skeleton graph;

[0032] A plurality of connected domains in the segmented skeleton graph is detected, and each connected domain is regarded as a skeleton branch.

[0033] In one or some optional implementations of the embodiments of the present application, the determining of the non-trunk branches from the multiple skeleton branches includes:

[0034] Based on the total number of skeleton points of each skeleton branch, a branch skeleton point mean is calculated;

[0035] Determine a trunk threshold based on the branch skeleton point mean;

[0036] The skeleton branches whose total skeleton points are less than the trunk threshold are regarded as non-trunk branches.

[0037] In a second aspect, an embodiment of the present invention provides a device for extracting main skeleton topology information of an image, which may include:

[0038] A first extraction module is used to extract an initial skeleton image based on the acquired target image using a preset skeleton extraction algorithm;

[0039] A first discrimination module is used to discriminate the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton graph; the types of the skeleton points include intersection points, isolated points, endpoints and interior points;

[0040] A second extraction module, used for distinguishing a plurality of skeleton branches according to all the intersections in the initial skeleton graph;

[0041] A third extraction module, used to determine non-trunk branches from the multiple skeleton branches;

[0042] A first deletion module is used to delete non-trunk branches in the initial skeleton graph to obtain an updated skeleton graph;

[0043] A first judgment module is used to re-execute the first extraction module and the first discrimination module based on the updated skeleton graph to obtain the type of each skeleton point in the new initial skeleton graph, and to judge whether there is an intersection in the new initial skeleton graph: if so, based on the new initial skeleton graph, a new updated skeleton graph is re-obtained by the second extraction module, the third extraction module, and the first deletion module, and the first judgment module re-judges; if not, the new initial skeleton graph is used as the main skeleton graph;

[0044] The first search module is used to perform a directional search in the main skeleton graph to obtain topological information of the main skeleton graph.

[0045] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the method for extracting main skeleton topology information of an image as described above.

[0046] In a fourth aspect, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for extracting main skeleton topology information of an image as described above.

[0047] In a fifth aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the processor executes the computer program, the method for extracting main skeleton topological information of an image as described above is implemented.

[0048] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:

[0049] The embodiment of the present invention provides a method for extracting the main skeleton topology information of an image. The method extracts the skeleton of a target image based on a preset skeleton extraction algorithm to obtain an initial skeleton graph, and finds the intersections in the initial skeleton graph based on the neighborhood of each skeleton point in the initial skeleton graph. Based on the intersections, multiple skeleton branches are obtained, and non-main branches in the multiple skeleton branches are further determined. The non-main branches in the initial skeleton graph are deleted to obtain an updated skeleton graph. Next, the updated skeleton graph is re-extracted based on the preset skeleton extraction algorithm to obtain a new initial skeleton graph, and it is determined whether there are still intersections therein: if so, the non-main branches are re-determined to obtain a new updated skeleton graph; if not, the new initial skeleton graph is used as the main skeleton graph, and finally the topology information is determined based on the main skeleton graph. The method has a low computational complexity. Compared with the complete skeleton graph, the extracted main skeleton graph retains the main topological structure of the image shape, effectively simplifies the data, reduces the computational complexity, and thus improves the data processing speed, making it more suitable for large-scale image data and real-time applications. At the same time, the main skeleton graph ignores the tiny branches and noise in the complete skeleton graph and focuses on capturing the global shape information, making the extracted main skeleton graph more robust and able to better cope with data noise. It can show higher accuracy and stability in subsequent classification, recognition and other tasks, and can effectively reduce the complexity of subsequent processing.

[0050] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.

[0051] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0053] Figure 1 A schematic diagram of the steps of a method for extracting main skeleton topology information of an image provided by an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of an example of a target image provided by an embodiment of the present invention;

[0055] Figure 3 A second schematic diagram of an example of a target image provided by an embodiment of the present invention;

[0056] Figure 4 A schematic diagram of an example of an initial skeleton diagram provided by an embodiment of the present invention;

[0057] Figure 5 A second schematic diagram of an example of an initial skeleton diagram provided by an embodiment of the present invention;

[0058] Figure 6 A schematic diagram of an example of a skeletonized effect diagram provided by an embodiment of the present invention;

[0059] Figure 7 A second schematic diagram of an example of a skeletonized effect diagram provided by an embodiment of the present invention;

[0060] Figure 8 A schematic diagram of eight neighborhood points of a skeleton point provided in an embodiment of the present invention;

[0061] Fig. 9 A schematic diagram of an example of the types of skeleton points provided in an embodiment of the present invention;

[0062] Fig.10 A schematic diagram of one of the details of the types of skeleton points provided in an embodiment of the present invention;

[0063] Fig.11 A second schematic diagram of an example of the types of skeleton points provided in an embodiment of the present invention;

[0064] Fig.12 A second schematic diagram of the details of the types of skeleton points provided in the embodiment of the present invention;

[0065] Fig.13 A schematic diagram of an example of a segmented skeleton graph provided by an embodiment of the present invention;

[0066] Fig.14 A second schematic diagram of an example of a segmented skeleton diagram provided by an embodiment of the present invention;

[0067] Fig.15 A schematic diagram of an example of a skeleton branch provided in an embodiment of the present invention;

[0068] Fig.16 A second schematic diagram of an example of a skeleton branch provided in an embodiment of the present invention;

[0069] Fig.17 A schematic diagram of an example of updating a skeleton graph provided by an embodiment of the present invention;

[0070] Fig.18 A second schematic diagram of an example of updating a skeleton diagram provided by an embodiment of the present invention;

[0071] Fig.19 A schematic diagram of an example of pixel deviation provided by an embodiment of the present invention;

[0072] Fig. 20 A schematic diagram of one of the details of an example of pixel deviation provided in an embodiment of the present invention;

[0073] Fig.21 A second schematic diagram of an example of pixel deviation provided by an embodiment of the present invention;

[0074] Fig. 22 A second schematic diagram of the details of an example of pixel deviation provided in an embodiment of the present invention;

[0075] Fig.23 A schematic diagram of an example of a main skeleton diagram provided by an embodiment of the present invention;

[0076] Fig.24 A second schematic diagram of an example of a main skeleton diagram provided by an embodiment of the present invention;

[0077] Fig.25 A schematic diagram of a neighborhood search path provided by an embodiment of the present invention;

[0078] Fig.26 A schematic diagram of an abnormal search situation provided by an embodiment of the present invention;

[0079] Fig. 27 A second schematic diagram of an abnormal search situation provided by an embodiment of the present invention;

[0080] Fig.28 An example schematic diagram of a directed diffusion search provided by an embodiment of the present invention;

[0081] Fig.29 A schematic diagram of the structure of an apparatus for extracting main skeleton topological information of an image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0083] The inventors found that in the prior art, the target image often has a complex structure. The existing skeletonization technology will extract all the skeletons in the target image, and the resulting skeleton graph will contain complex branches. Although the skeleton graph can fully present the shape of the image, it will also be accompanied by a large number of processing strategies and complex discrimination logic, which will seriously increase the amount of data and the computational burden, which is particularly evident in application fields that require real-time processing. At the same time, the skeleton graph is prone to noise and redundant information, which will cause model confusion in subsequent classification, recognition and other tasks, reduce its generalization ability, and reduce the accuracy and robustness of subsequent tasks.

[0084] Based on this, the inventors have made the present invention after further research and development, providing a method and device for extracting the main skeleton topological information of an image.

[0085] Embodiment 1

[0086] In the first embodiment of the present invention, a method for extracting the main skeleton topology information of an image is provided. Figure 1 As shown, the method may include the following steps S101-S109:

[0087] S101: extracting an initial skeleton image based on the acquired target image using a preset skeleton extraction algorithm.

[0088] S102: Based on the neighborhood of each skeleton point in the initial skeleton graph, the type of each skeleton point is determined. The types of skeleton points include intersection points, isolated points, endpoints, and interior points.

[0089] S103: Distinguish a plurality of skeleton branches according to all intersections in the initial skeleton graph.

[0090] S104: Determine a non-main branch from the multiple skeleton branches.

[0091] S105: Delete the non-main branches in the initial skeleton graph to obtain an updated skeleton graph.

[0092] S106: re-execute the above steps S101-S102 based on the updated skeleton graph to obtain a new initial skeleton graph, and determine whether there is an intersection in the new initial skeleton graph: if so, execute step S107; if not, execute step S108;

[0093] S107: re-execute the above steps S103-S106 according to the new initial skeleton image.

[0094] S108: Using the new initial skeleton graph as the main skeleton graph.

[0095] S109: Perform a directional search in the main skeleton graph to obtain topological information of the main skeleton graph.

[0096] The embodiment of the present invention provides a method for extracting the main skeleton topology information of an image. The method extracts the skeleton of a target image based on a preset skeleton extraction algorithm to obtain an initial skeleton graph, and finds the intersections in the initial skeleton graph based on the neighborhood of each skeleton point in the initial skeleton graph. Based on the intersections, multiple skeleton branches are obtained, and non-main branches in the multiple skeleton branches are further determined. The non-main branches in the initial skeleton graph are deleted to obtain an updated skeleton graph. Next, the updated skeleton graph is re-extracted based on the preset skeleton extraction algorithm to obtain a new initial skeleton graph, and it is determined whether there are still intersections therein: if so, the non-main branches are re-determined to obtain a new updated skeleton graph; if not, the new initial skeleton graph is used as the main skeleton graph, and finally the topology information is determined based on the main skeleton graph. The method has a low computational complexity. Compared with the complete skeleton graph, the extracted main skeleton graph retains the main topological structure of the image shape, effectively simplifies the data, reduces the computational complexity, and thus improves the data processing speed, making it more suitable for large-scale image data and real-time applications. At the same time, the main skeleton graph ignores the tiny branches and noise in the complete skeleton graph and focuses on capturing the global shape information, making the extracted main skeleton graph more robust and able to better cope with data noise. It can show higher accuracy and stability in subsequent classification, recognition and other tasks, and can effectively reduce the complexity of subsequent processing.

[0097] In the above step S101, a preset skeleton extraction algorithm is used to skeletonize the acquired target image to obtain an initial skeleton image.

[0098] Those skilled in the art may select an existing algorithm as the preset skeleton extraction algorithm according to specific circumstances, such as the Zhang-Suen algorithm, the Hilditch algorithm, etc., which may not be specifically limited in the embodiments of the present application.

[0099] In a specific embodiment, the Zhang-Suen algorithm is used as the preset skeleton extraction algorithm to illustrate the skeletonization operation of step S101. Figure 2 , Figure 3 As shown in Figure 2, both target images are processed binary images. Figure 2 The initial skeleton image obtained by skeletonizing the target image shown in Figure 4 As shown in the figure, the extracted initial skeleton image is also a binary image, and the white pixels are the skeleton points. Figure 3 The initial skeleton image corresponding to the target image shown is as follows Figure 5 Furthermore, in order to more intuitively demonstrate the effect of skeletonization, all the skeleton points in the initial skeleton image are superimposed on the original target image. Figure 2 The skeletonization effect diagram corresponding to the target image shown is as follows Figure 6 As shown, the blue points are all the skeleton points extracted. Similarly, Figure 3 The skeletonization effect diagram corresponding to the target image shown is as follows Figure 7 As shown in Figure 2, it can be seen that the initial skeleton graph effectively retains the core structure of the geometric shape of the target image, simplifies and abstracts the shape of the target image, and provides a basis for the subsequent main skeleton extraction.

[0100] In the above step S102, based on the neighborhood of each skeleton point in the initial skeleton image, the type of each skeleton point is determined, which specifically includes the following steps S1021-S1023:

[0101] S1021: For each skeleton point in the initial skeleton image, an 8-neighborhood algorithm is used to determine the values ​​of the 8 neighborhoods of the skeleton point.

[0102] Specifically, for each skeleton point in the initial skeleton image, the values ​​of the eight neighborhoods of the skeleton point are obtained. i,j The 8 neighborhoods of Figure 8 As shown, the middle P i,j is a skeleton point, i and j represent the coordinates of the skeleton point in the initial skeleton graph, and the eight neighborhoods of the skeleton point are P i-1,j-1 , P i-1,j , P i-1,j+1 , P i,j-1 , P i,j+1 , P i+1,j-1 , P i+1,j and P i+1,j+1 .

[0103] S1022: Subtract the values ​​of the eight neighborhoods of the skeleton point in a preset order to update the value of each neighborhood of the skeleton point. Specifically, the following steps S10221-S10223 are included:

[0104] S10221: Sort the eight neighborhoods of the skeleton point according to a preset rotation direction.

[0105] Specifically, starting from any neighborhood, the eight neighborhoods of the skeleton point are sorted according to a preset rotation direction, wherein the preset rotation direction may be clockwise or counterclockwise.

[0106] In a specific embodiment, Figure 8 The skeleton point P shown i,j As an example, from the upper left corner of the neighborhood P i-1,j-1 First, sort the eight neighbors of the skeleton point clockwise, and the order of the eight neighbors after sorting is P i-1,j-1 , P i-1,j , P i-1,j+1 , P i,j+1 , P i+1,j+1 , P i+1,j , P i+1,j-1 , Pi,j-1 .

[0107] S10222: For each neighborhood of the skeleton point, calculate the difference between the neighborhood and the next neighborhood.

[0108] S10223: Update the value of the neighborhood to the difference between the neighborhood and the next neighborhood.

[0109] In a specific embodiment, the expression for updating the skeleton points in step S1022 is as follows:

[0110] P' i-1,j-1 =P i-1,j -P i-1,j-1 Formula 1

[0111] P' i-1,j =P i-1,j+1 -P i-1,j Formula 2 ...

[0113] P' i+1,j-1 =P i,j-1 -P i+1,j-1 Formula 3

[0114] P' i,j-1 =P i-1,j-1 -P i,j-1 Formula 4

[0115] In the formula, P′ i-1,j-1 , P′ i-1,j , P′ i+1,j-1 , P′ i,j-1 represents the updated neighborhood.

[0116] S1023: Determine the type of the skeleton point based on the total number of positive values ​​in the values ​​of the eight neighborhoods of the skeleton point.

[0117] Specifically, the types of skeleton points can be divided into isolated points, endpoints, internal points and intersection points. An isolated point represents a single skeleton point that is not connected to any other skeleton point and is an isolated point in the initial skeleton graph. An endpoint represents a skeleton point that is connected to only one skeleton point and is a branch of a skeleton branch. An internal point represents a skeleton point that is connected to two skeleton points. An intersection point represents a skeleton point that is connected to three or more skeleton points and is a point where multiple skeleton branches intersect.

[0118] The values ​​of the eight neighborhoods of the skeleton point updated in step S1022 can represent the connection between the skeleton point and other skeleton points. Therefore, the type of the skeleton point can be determined according to the total number of positive values ​​in the values ​​of the eight neighborhoods of the skeleton point. Specifically, the type of the skeleton point is determined according to the following method:

[0119] If the total number of positive values ​​in the values ​​of the 8 neighborhoods of a skeleton point is 0, the skeleton point is an isolated point. If the total number of positive values ​​in the values ​​of the 8 neighborhoods of a skeleton point is 1, the skeleton point is an endpoint. If the total number of positive values ​​in the values ​​of the 8 neighborhoods of a skeleton point is 2, the skeleton point is an inlier. If the total number of positive values ​​in the values ​​of the 8 neighborhoods of a skeleton point is greater than or equal to 3, the skeleton point is a crossover point.

[0120] In a specific embodiment, based on Figure 2 After the target image shown in the figure is processed by the above steps S101-S102, the type of each skeleton point is determined, and the type of each skeleton point is marked with different colors in the target image. Fig. 9 As shown in the figure, the red boxes mark the endpoints and intersections, and the details are shown in Fig.10 As shown in the figure, the red points represent endpoints, the blue points represent intersection points, and the green points represent interior points. Figure 3 The target image shown in the figure has the corresponding schematic diagram with the types of skeleton points marked as follows Fig.11 As shown, the details are as follows Fig.12 shown.

[0121] In the embodiment of the present application, since the purpose of the present application is to extract the main skeleton of the target image, and the isolated points usually do not contribute to the extraction of the main skeleton, the isolated points in the initial skeleton image need to be deleted after step S102.

[0122] In the embodiment of the present application, the type of each skeleton point is determined by step S102, which can effectively identify the intersection points in the initial skeleton image, clarify the connection relationship between different parts of the initial skeleton image, and help to distinguish different branches of the skeleton in the subsequent process. At the same time, the isolated points in the initial skeleton image are deleted, the redundant information in the initial skeleton image is simplified, and the amount of subsequent data processing is reduced.

[0123] In the above step S103, multiple skeleton branches are divided from the initial skeleton image according to all the intersections in the initial skeleton image, which specifically includes the following steps S1031-S1032:

[0124] S1031: Eliminate all intersection points and their neighborhoods in the initial skeleton graph to obtain a segmented skeleton graph.

[0125] Specifically, based on the initial skeleton graph, all the intersections and the 8-neighborhood of each intersection are deleted, that is, the value of the pixel is set to 0 (black). At this time, the skeleton in the initial skeleton graph is no longer completely connected, but is divided into multiple skeleton branches.

[0126] In a specific embodiment, based on Figure 4 The initial skeleton diagram shown in the figure, the obtained segmented skeleton diagram is as follows Fig.13 As shown, similarly, based on Figure 5 The initial skeleton diagram shown in the figure, the obtained segmented skeleton diagram is as follows Fig.14 As shown in the figure, it can be seen that the pixels in the area where the intersection was originally are all converted to black, and the entire skeleton is no longer connected.

[0127] S1032: Detect multiple connected domains in the segmented skeleton graph, and regard each connected domain as a skeleton branch.

[0128] Specifically, after the processing of step S1031, a segmented skeleton graph containing multiple skeleton branches is obtained, but at this time the skeleton points of each skeleton branch are discrete, which is not convenient for subsequent unified processing of each skeleton branch. Therefore, it is also necessary to detect the connected domain in the segmented skeleton graph, obtain all independent skeleton branch connected domains in the segmented skeleton graph, and obtain multiple skeleton branches {B1, B2...B n}.

[0129] Those skilled in the art can implement the detection of connected domains based on the detailed description of the prior art, such as using the findContours function in the open source image processing library OpenCV, which may not be specifically limited in the embodiments of the present application.

[0130] In a specific embodiment, based on Fig.13 The segmented skeleton diagram shown in Figure 2 shows the three skeleton branches obtained. Fig.15 As shown, similarly, based on Fig.14 The segmented skeleton diagram shown in Figure 2 shows the three skeleton branches obtained. Fig.16 As shown, the figure shows three skeleton branches in the original target image with different colors.

[0131] In the embodiment of the present application, step S103 distinguishes multiple skeleton branches from the initial skeleton image, clarifies the hierarchical relationship of the skeleton structure in the initial skeleton image, and lays a foundation for the subsequent identification of non-trunk branches.

[0132] In the above step S104, non-main branches are determined from multiple skeleton branches, which specifically includes the following steps S1041-S1043:

[0133] S1041: Based on the total number of skeleton points of each skeleton branch, calculate the branch skeleton point mean.

[0134] Specifically, the total number of skeleton points of each skeleton branch may be used to calculate the branch skeleton point mean using the following formula 5:

[0135]

[0136] In the formula, S avg is the mean of the branch skeleton points, n is the total number of skeleton branches, For skeleton branch Bi The total number of skeleton points, B i represents the i-th skeleton branch.

[0137] S1042: Determine a trunk threshold based on the branch skeleton point mean.

[0138] Specifically, the trunk threshold value may be obtained by multiplying the preset trunk multiple value by the mean value of the branch skeleton points. For example, if the preset trunk multiple is 0.6, the calculation formula of the trunk threshold value is as shown in the following formula 6:

[0139] S th =0.6*S avg Formula 6

[0140] In the formula, S th is the trunk threshold, S avg is the mean of branch skeleton points, and 0.6 is the preset trunk multiple.

[0141] S1043: The skeleton branches whose total number of skeleton points is less than the trunk threshold are regarded as non-trunk branches.

[0142] Specifically, skeleton branches whose total number of skeleton points is less than a trunk threshold may be selected from all skeleton branches, and these skeleton branches are determined as non-trunk branches.

[0143] In the above step S105, the non-main branches in the initial skeleton graph are deleted to obtain an updated skeleton graph.

[0144] Specifically, based on the non-main branches determined in step S104, the non-main branches in the initial skeleton image are deleted, that is, the values ​​of all pixels of the non-main branches are set to 0 to obtain an updated skeleton image.

[0145] Please note that the initial skeleton graph here is obtained through step S101, and the processing of the above step S103 is only for determining the skeleton branches, and the initial skeleton graph is not processed.

[0146] In a specific embodiment, based on Figure 4 The initial skeleton diagram shown in the figure, the updated skeleton diagram obtained after deleting non-main branches is as follows Fig.17 As shown, similarly, based on Figure 5 The initial skeleton graph shown in Figure 1 is the updated skeleton graph obtained as Fig.18 shown.

[0147] In an embodiment of the present application, after completing step S105 and obtaining an updated skeleton map, the inventors found that, since when executing step S103 to determine the skeleton branches, in order to prevent incomplete segmentation, the present method eliminates the intersection and the 8 neighborhoods of the intersection. Therefore, the obtained updated skeleton map will have pixel deviations at the original intersections, and only executing one round of steps S101-S105 cannot guarantee that all non-main branches are successfully deleted. Therefore, the updated skeleton map needs to be further processed to ensure that there is no pixel deviation and all non-main branches are successfully deleted.

[0148] In order to help those skilled in the art understand what pixel deviation is, the following is an example of updating the skeleton graph provided in the embodiment of the present application to illustrate pixel deviation. Fig.17 The updated skeleton diagram shown shows an example of pixel deviation. Fig.19 As shown, the red box is the location of the original intersection, and the details in the red box are as follows Fig. 20 As shown in the figure, it can be seen that there are extra pixels on the right side of the original intersection, that is, there is a pixel deviation. Fig.18 The updated skeleton diagram shown shows an example of pixel deviation. Fig.21 As shown, the red box is the location of the original intersection, and the details in the red box are as follows Fig. 22 As shown, it can be seen that there are redundant pixels below the original intersection, that is, there is a pixel deviation.

[0149] In the above step S106, the above steps S101-S102 are re-executed based on the updated skeleton graph to obtain a new initial skeleton graph, and it is determined whether there is an intersection in the new initial skeleton graph: if so, step S107 is executed; if not, step S108 is executed.

[0150] Specifically, step S101 may be re-executed based on the updated skeleton graph, the preset skeleton extraction algorithm in step S101 will remove the pixel deviation in the updated skeleton graph, extract a new initial skeleton graph, and then, based on the new initial skeleton graph, step S102 is executed to identify the type of each skeleton point and determine whether there is an intersection therein: if so, execute step S107; if not, execute step S108.

[0151] In the above step S107, the above steps S103-S106 are re-executed according to the new initial skeleton graph.

[0152] Specifically, at this time, there are still intersections in the new initial skeleton graph, which means that there are still non-main branches that have not been deleted, so steps S103-S106 are re-executed based on the new initial skeleton graph to delete the newly found non-main branches.

[0153] In the above step S108, the new initial skeleton graph is used as the main skeleton graph.

[0154] Specifically, at this time, there is no intersection in the new initial skeleton graph, which means there is only one skeleton branch. Then the skeleton branch is the main skeleton, and the new initial skeleton graph is the main skeleton graph.

[0155] In a specific embodiment, based on Figure 2 The target image shown in Figure 2 shows the main skeleton diagram. Fig.23 As shown, similarly, based on Figure 3 The target image shown in Figure 2 is the main skeleton image obtained. Fig.24 As shown, at this time, the pixel deviation is successfully eliminated in the main skeleton image, and there is only one skeleton branch.

[0156] In the above step S109, a directional search is performed in the main skeleton graph to obtain the topological information of the main skeleton graph.

[0157] In the embodiment of the present application, after obtaining the main skeleton image, when further analyzing the graphic morphology of the target image, it is necessary to establish a topological relationship of the endpoint-interior point-endpoint of the skeleton points to determine the topological information.

[0158] Specifically, one endpoint of the main skeleton graph can be selected as the starting seed point, as follows Fig.25 The neighborhood search path shown is used to search to find the next skeleton point, and the next skeleton point found is used as a new seed point, and the pixel value corresponding to the previous seed point is set to 0, and the search is continued until the next skeleton point is not found.

[0159] However, the inventors have found that in the process of searching based on the neighborhood search path, the newly found seed point may not be able to find the subsequent seed point in the correct direction due to the order of setting the search path. Fig.26 and Fig. 27 The abnormal search situation shown in the figure, the box represents the skeleton point, the red one is the starting endpoint, the green one is the seed point found in the search order, the blue one is the disconnection point caused by the search failure, and the white one is the skeleton point that has not been found. The numbers in the red and green boxes are the order in which the seed points are searched. Fig.26 For example, it can be seen that when the green box with the number 1 is used as the seed point, due to the order of the search path, the green box with the number 2 is used as the next seed point. Further, when the green box with the number 2 is used as the seed point, the green box with the number 3 is used as the next seed point. However, at this time, there are no unsearched skeleton points in the neighborhood of the green box with the number 3, resulting in search abnormalities.

[0160] In the embodiment of the present application, a new search method is introduced to solve the problem of search anomalies, so as to implement directional expansion search to avoid search anomalies, which specifically includes:

[0161] Record the last seed point P during the search process n-1 With the current seed point P n The neighborhood position relationship of the current seed point P n When performing neighborhood search, remove the previous seed point P n-1 Neighborhood, search for the previous seed point P n-1 Point to the current seed point P n and diffusion direction, as in the previous seed point P n-1 Located in the neighborhood i, then for the current seed point P n , we need to calculate the current seed point P n The skeleton points in the directional neighborhood {(i+7)mod(8), (i+6)mod(8), (i)mod(8), (i+1)mod(8), (i+2)mod(8)} are searched to find the next seed point. Fig.28 As shown, the current seed point P n Located at the previous seed point P n-1 The neighborhood of 4 bits, then when the current seed point searches for the next seed point, it only needs to search the current seed point P n The directional neighborhood of {2, 3, 4, 5, 6} skeleton points. Where (i) mod (8) means modulo 8 based on i.

[0162] If the current seed point P n If the unsearched skeleton point cannot be found in the directional neighborhood of , the seed point is reset to the previous seed point and the search continues until all points are found, and the connectivity matrix, i.e., the topological information, is obtained.

[0163] Embodiment 2

[0164] Based on the same inventive concept, the embodiment of the present invention also provides a device for extracting the main skeleton topological information of an image, referring to Fig.29 As shown, the device comprises:

[0165] The first extraction module 101 is used to extract an initial skeleton image based on the acquired target image using a preset skeleton extraction algorithm;

[0166] A first discrimination module 102 is used to discriminate the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton graph; the type of the skeleton point includes a cross point;

[0167] A second extraction module 103, used to distinguish a plurality of skeleton branches according to all the intersections in the initial skeleton graph;

[0168] A third extraction module 104, configured to determine non-main branches from the plurality of skeleton branches;

[0169] A first deleting module 105 is used to delete non-trunk branches in the initial skeleton graph to obtain an updated skeleton graph;

[0170] The first judgment module 106 is used to re-execute the first extraction module and the first discrimination module based on the updated skeleton graph to obtain the type of each skeleton point in the new initial skeleton graph, and to judge whether there is an intersection in the new initial skeleton graph: if so, based on the new initial skeleton graph, a new updated skeleton graph is re-obtained by the second extraction module, the third extraction module, and the first deletion module, and the first judgment module re-judges; if not, the new initial skeleton graph is used as the main skeleton graph;

[0171] The first search module 107 is used to perform a directional search in the main skeleton graph to obtain topological information of the main skeleton graph.

[0172] Embodiment 3

[0173] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the method for extracting main skeleton topology information of an image as described in the above-mentioned embodiment 1 is implemented.

[0174] Embodiment 4

[0175] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for extracting main skeleton topology information of an image as described in the above-mentioned embodiment 1.

[0176] Embodiment 5

[0177] Based on the same inventive concept, an embodiment of the present invention also provides a computer device, including a memory, a processor and a computer program stored in the memory. When the processor executes the computer program, it implements the method for extracting the main skeleton topology information of the image as described in the above embodiment 1.

[0178] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0179] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0180] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0182] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for extracting main skeleton topological information of an image, characterized in that: include: Based on the acquired target image, a preset skeleton extraction algorithm is used to extract an initial skeleton image; Based on the neighborhood of each skeleton point in the initial skeleton graph, the type of each skeleton point is determined; the types of the skeleton points include intersection points, isolated points, endpoints and interior points; According to all the intersections in the initial skeleton graph, a plurality of skeleton branches are distinguished; Determining non-trunk branches from the plurality of skeleton branches; Deleting non-main branches in the initial skeleton graph to obtain an updated skeleton graph; Re-extract the skeleton of the updated skeleton image based on the preset skeleton extraction algorithm to obtain a new initial skeleton image, and determine whether there is an intersection in the new initial skeleton image: If yes, then according to all the intersections in the new initial skeleton graph, the non-trunk branches are re-determined to obtain a new updated skeleton graph, and the above skeleton extraction and identification steps are performed; If not, the new initial skeleton graph is used as the main skeleton graph; A directed search is performed in the main skeleton graph to obtain topological information of the main skeleton graph.

2. The method according to claim 1, characterized in that The determining the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton image comprises: For each skeleton point in the initial skeleton image, using an 8-neighborhood algorithm to determine the values ​​of 8 neighborhoods of the skeleton point; Based on the values ​​of the eight neighborhoods of the skeleton point, subtracting them in a preset order, updating the value of each neighborhood of the skeleton point; The type of the skeleton point is determined based on the total number of positive values ​​in the values ​​of the eight neighborhoods of the skeleton point.

3. The method according to claim 2, characterized in that The subtracting the values ​​of the eight neighborhoods of the skeleton point in a preset order to update the value of each neighborhood of the skeleton point includes: Sort the eight neighborhoods of the skeleton point according to the preset rotation direction; For each neighborhood of the skeleton point, calculating the difference between the neighborhood and the next neighborhood; The value of the neighborhood is updated to the difference between the neighborhood and the next neighborhood.

4. The method according to claim 2, characterized in that: The determining the type of the skeleton point based on the total number of positive values ​​in eight neighborhoods of the skeleton point comprises: If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 0, the skeleton point is an isolated point; If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 1, the skeleton point is an endpoint; If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is 2, the skeleton point is an inlier; If the total number of positive values ​​in the values ​​of the 8 neighborhoods of the skeleton point is greater than or equal to 3, the skeleton point is a crossover point.

5. The method according to claim 4, characterized in that After determining the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton image, the method further includes: Delete all isolated points in the initial skeleton graph.

6. The method according to claim 1, characterized in that The distinguishing a plurality of skeleton branches according to all the intersections in the initial skeleton graph comprises: Eliminate all intersections and their neighborhoods in the initial skeleton graph to obtain a segmented skeleton graph; A plurality of connected domains in the segmented skeleton graph is detected, and each connected domain is regarded as a skeleton branch.

7. The method according to claim 1, characterized in that The step of determining a non-main branch from the plurality of skeleton branches comprises: Based on the total number of skeleton points of each skeleton branch, a branch skeleton point mean is calculated; Determine a trunk threshold based on the branch skeleton point mean; The skeleton branches whose total skeleton points are less than the trunk threshold are regarded as non-trunk branches.

8. A device for extracting main skeleton topological information of an image, characterized in that: include: A first extraction module is used to extract an initial skeleton image based on the acquired target image using a preset skeleton extraction algorithm; A first discrimination module is used to discriminate the type of each skeleton point based on the neighborhood of each skeleton point in the initial skeleton graph; the types of the skeleton points include intersection points, isolated points, endpoints and interior points; A second extraction module, used for distinguishing a plurality of skeleton branches according to all the intersections in the initial skeleton graph; A third extraction module, used to determine non-trunk branches from the multiple skeleton branches; A first deletion module is used to delete non-trunk branches in the initial skeleton graph to obtain an updated skeleton graph; A first judgment module is used to re-execute the first extraction module and the first discrimination module based on the updated skeleton graph to obtain the type of each skeleton point in the new initial skeleton graph, and to judge whether there is an intersection in the new initial skeleton graph: if so, based on the new initial skeleton graph, a new updated skeleton graph is re-obtained by the second extraction module, the third extraction module, and the first deletion module, and the first judgment module re-judges; if not, the new initial skeleton graph is used as the main skeleton graph; The first search module is used to perform a directional search in the main skeleton graph to obtain topological information of the main skeleton graph.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the method for extracting main skeleton topology information of an image as described in any one of claims 1 to 7 is implemented.

10. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method for extracting main skeleton topology information of an image as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Image detection method for middle axis and length of leaf of long-petiole axisymmetric plant

    CN103632148A

  • River network topology information extraction method and system

    CN110688961A

  • Binarized image anti-noise skeleton extraction method and system

    CN114494704A

  • System and method for extracting a region of interest from volume data

    US20190139223A1

  • Process and device for sequential image transformation

    US4809348A

Cited By

  • Eye fundus blood vessel image continuous completion method and device, electronic equipment and storage medium

    CN120125693A

  • Ultrasonic image processing method and device, storage medium and equipment

    CN121504842A