Method of image processing and apparatus therefor

By searching for pixels of skeleton branches along a specific path in image processing and using endpoints and bifurcation points to determine burr branches, the problem of slow processing speed and low accuracy in existing technologies is solved, achieving more efficient burr recognition and removal.

CN117677970BActive Publication Date: 2026-08-04CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
Filing Date
2022-06-30
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing image processing methods fall short in balancing accuracy and speed, especially when identifying and removing burrs in images, where the processing speed is slow and there is a tendency to make accidental or missed deletions.

Method used

By searching for the next pixel along a specific search path based on the current pixel already searched in the skeleton branch of the target image, and determining whether the skeleton branch is a spurious branch based on the number of pixels already searched, the endpoints and bifurcation points are used as anchor points for the search, and a threshold is set to determine whether to stop the search, thereby reducing unnecessary traversal.

Benefits of technology

It improves the speed and accuracy of image processing, saves computing resources, avoids misjudgment and deletion of skeleton branches, and ensures the continuity and accuracy of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117677970B_ABST
    Figure CN117677970B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a kind of image processing method, comprising: according to the searched current pixel point of the skeleton branch of target image, search the next pixel point of skeleton branch;According to the number of searched pixel point of skeleton branch, determine whether the skeleton branch is spur branch.This application technical scheme can take into account processing speed and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and in particular to an image processing method and apparatus. Background Technology

[0002] Previously, most image processing was done manually, which was inefficient, time-consuming, and yielded unsatisfactory results. With technological advancements, more and more fields are beginning to utilize computers for image processing.

[0003] Computer image processing technology is currently immature, making it difficult to balance accuracy and speed. Therefore, how to provide an image processing method and apparatus that balances processing speed and accuracy is a pressing technical problem that needs to be solved. Summary of the Invention

[0004] This application provides an image processing method and apparatus that can balance processing speed and accuracy.

[0005] In a first aspect, an image processing method is provided, comprising: searching for the next pixel of a skeleton branch based on the current pixel of the skeleton branch of the target image that has been searched; and determining whether the skeleton branch is a spur branch based on the number of pixels that have been searched in the skeleton branch.

[0006] This application provides an image processing method, including: searching for the next pixel of a skeleton branch of a target image based on the currently searched pixels of that skeleton branch; and determining whether the skeleton branch is a spurious branch based on the number of pixels searched along that skeleton branch. Searching for the next pixel of the skeleton branch based on the currently searched pixels means that the next pixel of the skeleton branch is related to the currently searched pixels of the skeleton branch; that is, the skeleton branch of the target image is searched along a certain search path. Determining whether the skeleton branch is a spurious branch based on the number of pixels searched means that in some cases, it is not necessary to search all pixels to determine whether the skeleton branch is a spurious branch. Compared to determining a spurious branch by sequentially traversing each pixel, this application can determine a spurious branch based on the number of pixels searched along a specific search path. Therefore, the technical solution of this application can balance processing speed and accuracy.

[0007] In one possible implementation, before searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image, the method further includes: determining endpoints and bifurcation points in the target image, the endpoints and bifurcation points being used to search the skeleton branch. This facilitates subsequent search operations based on the endpoints and bifurcation points in the image.

[0008] In one possible implementation, searching for the next pixel of a skeleton branch based on the currently searched pixel of the skeleton branch of the target image includes: using endpoints in the target image as anchor points, and sequentially searching for the next pixel of the skeleton branch corresponding to each endpoint based on the currently searched pixel of the skeleton branch. In this way, by using endpoints as anchor points and processing the skeleton branches corresponding to each endpoint one by one, the number and category of skeleton branches can be accurately determined, avoiding the misjudgment and deletion of spurious branches caused by grouping different skeleton branches into one, thereby improving the accuracy of identifying spurious branches.

[0009] In one possible implementation, determining whether a skeleton branch is a spurious branch based on the number of pixels searched in the skeleton branch includes: if the number of pixels searched in the skeleton branch reaches a first threshold, determining that the skeleton branch is not a spurious branch. This way, it is not necessary to search all the pixels of the skeleton branch to determine that it is not a spurious branch, which helps improve processing speed and saves computational resources.

[0010] In one possible implementation, determining whether a skeleton branch is a spurious branch based on the number of pixels searched in the skeleton branch includes: determining the skeleton branch as a spurious branch if the number of pixels searched in the skeleton branch does not reach a first threshold and the current searched pixel of the skeleton branch is a branching point. This allows for rapid identification of spurious branches without needing to search all pixels in the target image, thus improving processing speed and saving computational resources.

[0011] In one possible implementation, the method further includes stopping the search when the number of searched pixels in the skeleton branch reaches a first threshold, or when the current searched pixel in the skeleton branch is a branch point. Thus, the number of searched pixels in the skeleton branch reaching the first threshold, or the current searched pixel in the skeleton branch being a branch point, can serve as trigger conditions for stopping the search, thereby facilitating subsequent operations.

[0012] In one possible implementation, the foreground pixels of the target image are set to 1, and the background pixels are set to 0. This ensures that the pixels representing the skeleton branches in the target image are set to 1, facilitating the search for these pixels.

[0013] In one possible implementation, searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image includes: converting the value of the currently searched pixel to 0; and determining the foreground pixel as the next pixel of the skeleton branch if there is only one foreground pixel among the eight neighboring pixels of the currently searched pixel.

[0014] In this implementation, the value of the currently searched pixel is converted to 0. This ensures that when searching for the next pixel based on the currently searched pixel, the previously searched pixel will not be found again, thus guaranteeing that the search is performed along a specific search path, i.e., the skeleton of the skeleton branch. If there is only one foreground pixel among the eight neighboring pixels of the currently searched pixel, that foreground pixel is determined to be the next pixel of the skeleton branch, thus ensuring that the foreground pixel is a pixel on that skeleton branch.

[0015] In one possible implementation, the method further includes: if there is more than one foreground pixel among the eight neighboring pixels of the searched current pixel, determining the searched current pixel as a fork point. This facilitates determining whether a skeleton branch is a burr branch based on whether the current pixel is a fork point.

[0016] In one possible implementation, the method further includes: recording the currently searched pixels, wherein the number of recorded pixels is the number of searched pixels of the skeleton branch. This facilitates determining the length of the skeleton branch based on the number of recorded pixels, and thus determining whether the skeleton branch is a burr branch.

[0017] In one possible implementation, recording the searched current pixel includes storing the position information of the searched current pixel in a memory. This facilitates obtaining the skeleton branch diagram based on the position information and also allows for subsequent retrieval from memory when needed.

[0018] In one possible implementation, the method further includes: if the skeleton branch is determined to be a burr branch, converting the value of the currently searched branch point to 1; and / or, if the skeleton branch is determined not to be a burr branch, converting the value of all searched pixels of the skeleton branch to 1.

[0019] In this implementation, if the skeleton branch is determined to be a spur branch, converting the value of the currently searched branch point to 1 ensures the continuity between other skeleton branches connected through that branch point, preventing discontinuous patterns from appearing in the target image. In this implementation, if the skeleton branch is determined not to be a spur branch, converting the values ​​of all searched pixels of the skeleton branch to 1 restores the original shape of the skeleton branch.

[0020] In one possible implementation, determining the endpoints and bifurcation points in the target image includes: determining whether the current pixel in the target image is an endpoint or a bifurcation point based on the values ​​of the eight neighboring pixels of the current pixel. This method is simple and easy to implement, facilitating the identification of endpoints or bifurcation points.

[0021] In one possible implementation, determining the current pixel of the target image as an endpoint includes: determining the current pixel as an endpoint if the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is 1. This facilitates the determination of endpoints in the target image.

[0022] In one possible implementation, determining the current pixel of the target image as the bifurcation point includes: determining the current pixel as the bifurcation point when the sum of the values ​​of the eight neighboring pixels of the current pixel is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are one less than or one greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction. This allows for accurate determination of bifurcation points in the target image, avoiding misidentification of non-bifurcation points as bifurcation points.

[0023] In one possible implementation, the method further includes: when the number of bifurcation points is 0, determining whether the skeleton branch is a burr branch based on the number of foreground pixels of the skeleton branch. This helps to further improve the processing speed of the method and also avoids the situation where burr branches are missed.

[0024] In one possible implementation, determining whether a skeleton branch is a spiky branch based on the number of foreground pixels of the skeleton branch includes: determining the skeleton branch as a spiky branch if the number of foreground pixels of the skeleton branch is less than a first threshold; or determining the skeleton branch as not a spiky branch if the number of foreground pixels of the skeleton branch is not less than the first threshold. Thus, by setting the first threshold, it is convenient to determine whether a skeleton branch is a spiky branch based on the relationship between the number of foreground pixels of the skeleton branch and the first threshold.

[0025] In one possible implementation, the method further includes: acquiring an input image, wherein the foreground pixels of the input image have values ​​of 1 and the background pixels have values ​​of 0; and extracting connected components from the input image to obtain at least one target image, each target image comprising a connected component of the input image. In this way, each target image corresponds to a connected component, and processing each target image individually improves the processing speed of the method.

[0026] In one possible implementation, the width of the skeleton branch is a single pixel. This ensures that when searching for the next pixel of the skeleton branch, there is only one neighboring pixel along the normal direction of the skeleton, guaranteeing the uniqueness of the skeleton path.

[0027] In a second aspect, an image processing apparatus is provided, comprising: a processing module, the processing module being configured to: determine the next pixel of a skeleton branch based on the current pixel of the skeleton branch of a target image that has been searched; and determine whether the skeleton branch is a spur branch based on the number of pixels of the skeleton branch that have been searched.

[0028] Thirdly, an image processing apparatus is provided, comprising: a memory for storing computer-executable instructions; and a processor for accessing the memory and executing the computer-executable instructions to perform operations in the methods of the first aspect and any one of the first aspects.

[0029] Fourthly, a storage medium is provided for storing a computer program that, when executed by a computing device, causes the computing device to perform the method as described in the first aspect and any one of the first aspects.

[0030] This application provides an image processing method, including: searching for the next pixel of a skeleton branch of a target image based on the currently searched pixels of that skeleton branch; and determining whether the skeleton branch is a spurious branch based on the number of pixels searched along that skeleton branch. Searching for the next pixel of the skeleton branch based on the currently searched pixels means that the next pixel of the skeleton branch is related to the currently searched pixels of the skeleton branch; that is, the skeleton branch of the target image is searched along a certain search path. Determining whether the skeleton branch is a spurious branch based on the number of pixels searched means that in some cases, it is not necessary to search all pixels to determine whether the skeleton branch is a spurious branch. Compared to determining a spurious branch by sequentially traversing each pixel, this application can determine a spurious branch based on the number of pixels searched along a specific search path. Therefore, the technical solution of this application can balance processing speed and accuracy. Attached Figure Description

[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the drawings without creative effort.

[0032] Figure 1 This application provides an embodiment of an image processing method.

[0033] Figure 2 This is a schematic diagram of a target image according to an embodiment of this application;

[0034] Figure 3 This is a schematic diagram of neighboring pixels according to an embodiment of this application;

[0035] Figure 4 This is a schematic diagram of neighboring pixels according to an embodiment of this application;

[0036] Figure 5 This is a schematic diagram of neighboring pixels according to an embodiment of this application;

[0037] Figures 6 to 8 This is a schematic diagram of neighboring pixels according to an embodiment of this application;

[0038] Figure 9 This is a flowchart of a method for determining burr branches according to an embodiment of this application;

[0039] Figure 10 This is a schematic diagram of an image processing method according to an embodiment of this application;

[0040] Figure 11 This is a schematic diagram of an input image according to an embodiment of this application;

[0041] Figure 12 and Figure 13 This is a schematic diagram of the input image after connected components have been extracted according to an embodiment of this application;

[0042] Figure 14 This is a schematic diagram of an image processing apparatus according to an embodiment of this application;

[0043] Figure 15 This is a schematic diagram of an image processing apparatus according to an embodiment of this application.

[0044] The accompanying drawings are not drawn to scale. Detailed Implementation

[0045] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of this application by way of example, but should not be used to limit the scope of this application, that is, this application is not limited to the described embodiments.

[0046] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0047] Previously, most image processing was done manually, which was inefficient, time-consuming, and yielded unsatisfactory results. With technological advancements, more and more fields are utilizing computers for image processing. Compared to manual processing, computer-based image processing offers significantly improved accuracy and speed. Therefore, computer-based image processing is increasingly used in areas such as glitch recognition and removal. However, most existing methods for removing glitch from images involve sequentially traversing the pixels in the image to find and identify glitch, which is time-consuming, slow, and prone to accidental deletion.

[0048] In view of this, embodiments of this application provide an image processing method, including: searching for the next pixel of a skeleton branch based on the currently searched pixel of the skeleton branch of the target image; and determining whether the skeleton branch is a spurious branch based on the number of pixels searched in the skeleton branch. Searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image means that the next pixel of the skeleton branch is related to the currently searched pixel of the skeleton branch; that is, the skeleton branch of the target image is searched along a certain search path. Determining whether the skeleton branch is a spurious branch based on the number of pixels searched in the skeleton branch means that in some cases, it is not necessary to search all pixels to determine whether the skeleton branch is a spurious branch. Compared to determining a spurious branch by sequentially traversing each pixel, this application can determine a spurious branch based on the number of pixels searched along a specific search path. Therefore, the technical solution of this application can balance processing speed and accuracy.

[0049] Figure 1 An image processing method according to an embodiment of this application, method 100 specifically includes the following steps 110 and 120.

[0050] Step 110: Based on the current pixel that has been searched in the skeleton branch of the target image, search for the next pixel in the skeleton branch.

[0051] In the field of image processing, images captured by cameras or images that have undergone image compositing and processing generally contain noise. This noise causes protrusions or depressions at the edges of the image, which can cause inconvenience in subsequent image applications. For example, in the industrial field, it can lead to the wrong deletion or omission of some defects.

[0052] The skeleton of a target image can be a graphic composed of foreground pixels in the target image. Skeleton branches can refer to branches of the skeleton that are divided into several branches due to the existence of bifurcation points. For example, a target image may contain a skeleton. When the skeleton does not have bifurcation points, it is a skeleton branch; when the skeleton has bifurcation points, it will be divided into at least three skeleton branches.

[0053] Burr branches are generated due to noise and other reasons. Skeleton branches can include burr branches, and under certain specific conditions, skeleton branches can be identified as burr branches.

[0054] Figure 2 This is a schematic diagram of a target image according to an embodiment of this application. Figure 2 As shown, the target image may include multiple skeleton branches. For example, the target image includes a first skeleton branch W1, a second skeleton branch W2, and a third skeleton branch W3.

[0055] In step 110, for example, for the first skeleton branch W1, point B1 is the currently searched pixel, and the next pixel B2 of the first skeleton branch W1 is searched based on point B1. That is, the next pixel to be searched for in a skeleton branch is related to the currently searched pixel of the skeleton branch; that is, the skeleton branches of the target image are searched according to a certain search path. Compared to traversing each pixel sequentially, this method improves processing speed and also avoids misjudgment of skeleton branches.

[0056] Step 120: Determine whether the skeleton branch is a burr branch based on the number of pixels searched in the skeleton branch.

[0057] For example, if the number of pixels searched in a skeleton branch reaches a preset threshold, the skeleton branch is determined not to be a spur branch. Optionally, in step 120, in some cases, it is not necessary to search all the pixels of a skeleton branch to determine whether the skeleton branch is a spur branch. In this way, compared to searching all the pixels of the target image, this method can reduce the search volume to a certain extent, which is beneficial for saving computational resources.

[0058] This application provides an image processing method, including: searching for the next pixel of a skeleton branch of a target image based on the currently searched pixels of that skeleton branch; and determining whether the skeleton branch is a spurious branch based on the number of pixels searched. Searching for the next pixel of the skeleton branch based on the currently searched pixels means that the next pixel of the skeleton branch is related to the currently searched pixels of the skeleton branch; that is, the skeleton branch of the target image is searched along a certain search path. Determining whether the skeleton branch is a spurious branch based on the number of pixels searched means that in some cases, it is not necessary to search all pixels to determine whether the skeleton branch is a spurious branch. Compared to determining a spurious branch by sequentially traversing each pixel, this application can determine a spurious branch based on the number of pixels searched along a specific search path. Therefore, the technical solution of this application can balance processing speed and accuracy.

[0059] Optionally, in one embodiment of this application, before step 110, method 100 further includes: determining endpoints and bifurcation points in the target image, the endpoints and bifurcation points being used to search for skeleton branches.

[0060] A bifurcation point can be the intersection of multiple skeleton branches in the target image, for example, Figure 2 Point A in the image. The endpoint can be the starting point of a skeleton branch in the target image, for example, Figure 2 Points B, C, and D are given, where point B is the endpoint of the first skeleton branch W1, point C is the endpoint of the first skeleton branch W2, and point D is the endpoint of the first skeleton branch W3.

[0061] Determining endpoints and bifurcation points in a target image may include: determining the number and / or location of endpoints and bifurcation points in the target image.

[0062] Before step 110, the endpoints and bifurcation points in the target image are determined, which facilitates subsequent search operations based on the endpoints and bifurcation points in the image.

[0063] Optionally, in one embodiment of this application, in step 110, the endpoint in the target image is used as the anchor point, and the next pixel of the skeleton branch is searched sequentially according to the current pixel of the skeleton branch corresponding to the endpoint.

[0064] In step 110, if the number of bifurcation points is greater than 0, the endpoints in the target image are used as anchor points, and the next pixel of the skeleton branch is searched sequentially based on the current pixel of the skeleton branch corresponding to the endpoint.

[0065] Optionally, the anchor point is the currently searched pixel. Using an endpoint in the target image as the anchor point means starting the search from the endpoint in the target image.

[0066] Searching for the next pixel of a skeleton branch based on the currently searched pixel of the corresponding endpoint can include specific methods such as the following. For example, see Figure 2 As shown, for the first skeleton branch W1 of the target image, starting from endpoint B (i.e., endpoint B is the current searched pixel of the first skeleton branch W1), the search for the next pixel B1 of the first skeleton branch W1 is performed based on endpoint B. After B1 is found, B1 is taken as the current searched pixel, and the search for the next pixel B2 of the first skeleton branch W1 is performed based on B1, and so on, sequentially performing the search for the next pixel on the first skeleton branch W1. The next pixel can be a neighboring pixel of the current searched pixel; for example, the next pixel can be one of the eight neighboring pixels of the current searched pixel.

[0067] Optionally, the search step size, i.e., the distance between the next pixel and the currently searched pixel, can be set according to actual needs, thereby balancing search speed and search accuracy.

[0068] The search proceeds sequentially from the currently searched pixels of the skeleton branch corresponding to each endpoint to the next pixel of the skeleton branch. This can include specific methods such as the following. For example, see... Figure 2 As shown, the first skeleton branch W1, the second skeleton branch W2, and the third skeleton branch W3 are searched sequentially. That is, the skeleton branch corresponding to each endpoint in the target image must be searched, but the search order of each skeleton branch is not specifically limited.

[0069] In some related technical solutions, the skeleton branches in a target image are classified using the following method. See [link to relevant documentation]. Figure 2As shown, the pixels in the target image are traversed sequentially from left to right and then from top to bottom. That is, starting from the top of the target image, the first row, second row, ..., are traversed sequentially until the last row. In this method, if the current pixel is a foreground point, a label is assigned to a neighboring foreground pixel; if the current pixel is both a foreground point and an endpoint, a new label is assigned to that pixel. Following this method, the first skeleton branch W1 is assigned a label L1, and the second skeleton branch W2 and the third skeleton branch W3 are assigned another label L2, where L1 and L2 are different. In this case, on the one hand, it may lead to errors in the calculation of the number of skeleton branches; on the other hand, it is very likely that the first skeleton branch W1 will be deleted as a spurious branch, while in practical applications, the second skeleton branch W2 is more likely to be a spurious branch. Therefore, the methods in related technologies may cause errors in the counting of skeleton branches, misjudgment and accidental deletion of spurious branches.

[0070] In this embodiment, the endpoints in the target image are used as anchor points. The next pixel of the skeleton branch is searched sequentially based on the current pixel of the skeleton branch corresponding to the endpoint. This can accurately determine the number and type of skeleton branches, avoid misjudging and deleting burr branches caused by classifying different skeleton branches into one skeleton branch, and thus help improve the accuracy of determining burr branches.

[0071] Optionally, in one embodiment of this application, in step 120, if the number of searched pixels of the skeleton branch reaches a first threshold, it is determined that the skeleton branch is not a burr branch.

[0072] Optionally, the first threshold can be set according to the actual situation, such as based on the experience value of a specific application field.

[0073] Optionally, see Figure 2 For the third skeleton branch W3, when the number of searched pixels in the third skeleton branch W3 reaches the first threshold, it is determined that the third skeleton branch W3 is not a spur branch.

[0074] In this embodiment, it is not necessary to search all the pixels of the skeleton branch to determine that the skeleton branch is not a spur branch, which helps to improve processing speed and save computing resources.

[0075] Optionally, in one embodiment of this application, in step 120, if the number of searched pixels of the skeleton branch does not reach a first threshold and the current searched pixel of the skeleton branch is a fork point, the skeleton branch is determined to be a burr branch.

[0076] For example, see Figure 2For the second skeleton branch W2, starting from endpoint C, which is the current searched pixel of the second skeleton branch W2, the search continues until the current searched pixel is the branch point A. At this point, the number of searched pixels for the second skeleton branch W2 has not reached the first threshold. In this case, the second skeleton branch W2 can be determined to be a spur branch.

[0077] In this embodiment, if the number of searched pixels in a skeleton branch has not reached a first threshold, and the currently searched pixel is a fork point, the skeleton branch can be determined to be a spur branch. This allows for rapid identification of spur branches without needing to search all pixels in the target image, thus improving processing speed and saving computational resources.

[0078] Optionally, in one embodiment of this application, the search is stopped when the number of searched pixels in the skeleton branch reaches a first threshold, or when the current searched pixel in the skeleton branch is a branching point.

[0079] Optionally, see Figure 2 For the third skeleton branch W3, the search stops when the number of searched pixels in the third skeleton branch W3 reaches a first threshold. For example, when point D1 is the current searched pixel, the number of searched pixels in the third skeleton branch W3 reaches the first threshold, and the search stops. Therefore, no further search is needed between point D1 and point A on the third skeleton branch W3. In other words, the search for the third skeleton branch W3 ends, allowing the search to proceed to other skeleton branches, such as the first skeleton branch W1 and the second skeleton branch W2, or the search for the entire target image to end.

[0080] Optionally, see Figure 2 For the second skeleton branch W2, the search stops when the current searched pixel is the branch point A. In other words, the search for the second skeleton branch W2 ends at this point, so that other skeleton branches can be searched or the search for the entire target image can be ended.

[0081] Optionally, ending the search of the entire target image includes ending the search of the entire target image when all skeleton branches of the target image have stopped being searched.

[0082] In this embodiment, the number of searched pixels of the skeleton branch reaches a first threshold, or the current searched pixel of the skeleton branch is a branch point, which can be used as a trigger condition to stop the search, thereby facilitating subsequent operations.

[0083] Optionally, in one embodiment of this application, the values ​​of the foreground pixels in the target image are set to 1, and the values ​​of the background pixels are set to 0. This ensures that the values ​​of the pixels representing the skeleton branches in the target image are 1, facilitating the search for these pixels.

[0084] The value of a foreground pixel is 1, meaning it is labeled with a value of 1. The value of a background pixel is 0, meaning it is labeled with a value of 0. For example, if the values ​​of both foreground and background pixels in the target image are any values ​​between 0 and 255, through preset processing, the values ​​of the foreground pixels can be uniformly labeled as 1, and the values ​​of the background pixels can be uniformly labeled as 0.

[0085] Optionally, a value of 1 for a foreground pixel means that the pixel value of the foreground pixel itself is 1. A value of 0 for a background pixel means that the pixel value of the background pixel itself is 0.

[0086] The values ​​of foreground pixels in the target image differ from those of background pixels. The values ​​of foreground pixels can be greater than or less than those of background pixels, depending on the specific situation.

[0087] Optionally, in one embodiment of this application, the value of the searched current pixel is converted to 0; if there is only one foreground pixel among the eight neighboring pixels of the searched current pixel, the foreground pixel is determined to be the next pixel of the skeleton branch.

[0088] The value of the currently searched pixel is converted to 0. For example, for the first skeleton branch W1, pixel B1 is the currently searched pixel with a value of 1. Before searching for the next pixel B2 of the first skeleton branch W1 based on pixel B1, the pixel value of pixel B1 is converted to 0. In this way, when searching for pixel B2 based on pixel B1, the currently searched pixel B1 will not be found again.

[0089] If there is only one foreground pixel among the eight neighboring pixels of the current pixel that has been searched, then that foreground pixel is determined to be the next pixel of the skeleton branch. For example, for the first skeleton branch W1, pixel B1 is the currently searched pixel and its pixel value is converted to 0. Among the eight neighboring pixels of B1, there is only one foreground pixel B2. In this case, B2 can be determined as the next pixel of the first skeleton branch W1. If there are two or more foreground pixels among the eight neighboring pixels of B1, then these foreground pixels do not belong to the first skeleton branch W1 and cannot be determined as the next pixel of the first skeleton branch W1.

[0090] In this embodiment, the value of the currently searched pixel is converted to 0. This way, when searching for the next pixel based on the currently searched pixel, the previously searched pixel will not be searched again, thus ensuring that the search is performed along a specific search path, namely the skeleton of the skeleton branch. If there is only one foreground pixel among the eight neighboring pixels of the currently searched pixel, the foreground pixel is determined to be the next pixel of the skeleton branch, thus ensuring that the foreground pixel is a pixel on the skeleton branch.

[0091] Optionally, in one embodiment of this application, if there is more than one foreground pixel among the eight neighboring pixels of the searched current pixel, the searched current pixel is determined to be a fork point.

[0092] For example, for the second skeleton branch W2, when point A is the currently searched pixel of the second skeleton branch W2 and the pixel value of point A is converted to 0, there are two foreground pixels in the 8-neighborhood of point A. In this case, point A can be determined as a branch point.

[0093] In this embodiment, determining the current searched pixel as a branch point can be achieved by searching along a specific search path, thereby determining the current searched pixel as a branch point during the search along that specific search path.

[0094] Optionally, the method for determining the current searched pixel as the branch point is different from the method of determining the branch point by traversing row by row.

[0095] Optionally, in other embodiments, the 8-neighborhood of the searched current pixel may have three, four, or even more pixels. In this case, the searched current pixel can be determined as a branching point.

[0096] In this embodiment, it is convenient to determine whether the skeleton branch is a burr branch based on whether the current pixel is a fork point.

[0097] Optionally, in one embodiment of this application, the currently searched pixels can also be recorded, wherein the number of recorded pixels is the number of searched pixels of the skeleton branch. This facilitates determining the length of the skeleton branch based on the number of recorded pixels, and thus determining whether the skeleton branch is a burr branch.

[0098] Optionally, in one embodiment of this application, the position information of the currently searched pixel can be stored in a memory. This facilitates obtaining the skeleton branch graphic based on the position information and also makes it convenient to retrieve it from the memory when needed.

[0099] Optionally, the memory is a stack container.

[0100] Optionally, in one embodiment of this application, if it is determined that the skeleton branch is a burr branch, the value of the current searched fork point is converted to 1; or, if it is determined that the skeleton branch is not a burr branch, the value of all searched pixels of the skeleton branch is converted to 1.

[0101] In this embodiment, when a skeleton branch is determined to be a burr branch, converting the value of the currently searched bifurcation point to 1 ensures the continuity between other skeleton branches connected through that bifurcation point, preventing discontinuous patterns from appearing in the target image. For example, during the search for the second skeleton branch W2, if point A is determined to be a bifurcation point but its value is not converted to 1, it will cause discontinuity between the first skeleton branch W1 and the third skeleton branch W3, potentially leading to errors in the skeleton branch count.

[0102] In this embodiment, if it is determined that the skeleton branch is not a burr branch, the values ​​of all the searched pixels of the skeleton branch are converted to 1, and the graphic of the skeleton branch can be restored to its original state.

[0103] Optionally, in one embodiment of this application, the current pixel of the target image can be determined as an endpoint or bifurcation point based on the values ​​of the eight neighboring pixels of the current pixel. This method is simple and easy to implement, facilitating the identification of endpoints or bifurcation points.

[0104] In this embodiment, the bifurcation points and endpoints in the target image can be determined by traversing each row and pixel by pixel. For example, the traversal can be performed from top to bottom and from left to right to find or determine the bifurcation points and endpoints. During this traversal process, the endpoints and bifurcation points can be confirmed.

[0105] In this embodiment, determining the endpoints and bifurcation points in the target image may include: determining that there are bifurcation points in the target image if the number of endpoints in the target image is greater than 2; and determining that there are no bifurcation points in the target image if the number of endpoints in the target image is 2.

[0106] Optionally, in one embodiment of this application, the current pixel is determined as an endpoint when the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is 1.

[0107] Figure 3 This is a schematic diagram of neighboring pixels according to an embodiment of this application. Figure 3 As shown, point P1 represents the current pixel, and P2, P3, P4, P5, P6, P7, P8, and P9 represent the pixels in the 8-neighborhood of P1. When the sum of the pixel values ​​of the 8-neighborhood pixels of P1 equals 1, the current pixel P1 can be determined as the endpoint.

[0108] The method in this embodiment facilitates the determination of endpoints in the target image.

[0109] Optionally, in one embodiment of this application, the current pixel is determined to be a bifurcation point if the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction.

[0110] Figure 4 This is a schematic diagram of neighboring pixels according to an embodiment of this application. Figure 4 (a) in the diagram illustrates the values ​​of the 8 neighboring pixels of the current pixel. Figure 4 (b) in the diagram is a schematic representation of the skeleton branch where the current pixel is located. Combined with... Figure 3 and Figure 4 As shown, the pixel values ​​of P3, P5, and P7 are 1, while the pixel values ​​of P1, P2, P4, P6, P8, and P9 are 0. The sum of the values ​​of the eight neighboring pixels of the current pixel P1 is 3. Furthermore, clockwise, the pixel value of P4 is 1 less than the pixel value of P3, the pixel value of P6 is 1 less than the pixel value of P5, and the pixel value of P8 is 1 less than the pixel value of P7. This means that three neighboring pixels have a value 1 less than the value of their previous neighboring pixel in the clockwise direction. Figure 4 As shown, the current pixel P1 can be determined as the bifurcation point.

[0111] Figure 5 This is a schematic diagram of neighboring pixels according to an embodiment of this application. Figure 5 (a) in the diagram illustrates the values ​​of the 8 neighboring pixels of the current pixel. Figure 5 (b) in the diagram is a schematic representation of the skeleton branch where the current pixel is located. Combined with... Figure 3 and Figure 4 As shown, the pixel values ​​of P3, P5, P7, P8, and P9 are 1, while the pixel values ​​of P1, P2, P4, and P6 are 0. The sum of the values ​​of the eight neighboring pixels of the current pixel P1 is 5. Furthermore, clockwise, the pixel value of P4 is 1 less than the pixel value of P3, the pixel value of P6 is 1 less than the pixel value of P5, and the pixel value of P2 is 1 less than the pixel value of P9. This means that three neighboring pixels have a value 1 less than the value of their previous neighboring pixel in the clockwise direction. Figure 5 As shown, the current pixel P1 can be determined as the bifurcation point.

[0112] It should be noted that if the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is greater than or equal to 3, the current pixel can be identified as a branching point if the values ​​of at least three neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise direction, or if the values ​​of at least three neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the counterclockwise direction.

[0113] Figures 6 to 8 This is a schematic diagram of neighboring pixels according to an embodiment of this application. Figures 6 to 8 (a) in the diagram is a schematic diagram of the values ​​of the 8 neighboring pixels of the current pixel. The sum of the values ​​of the 8 neighboring pixels of the current pixel P1 is 3. Figures 6 to 8 (b) in the diagram is a schematic diagram of the skeleton branch where the current pixel is located, such as... Figures 6 to 8 As shown in (b), the current pixel P1 cannot be determined as a branch point because the values ​​of at least three of the eight neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction.

[0114] In this embodiment, the current pixel is determined to be a branching point if the sum of the values ​​of its eight neighboring pixels is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are one less than or one greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction. This allows for accurate identification of branching points in the target image, avoiding misidentification of non-branching points as branching points.

[0115] Optionally, in one embodiment of this application, when the number of bifurcation points is 0, the skeleton branch is determined to be a burr branch based on the number of foreground pixels of the skeleton branch.

[0116] In this embodiment, when the number of bifurcation points is 0, determining whether a skeleton branch is a spur branch based on the number of foreground pixels of the skeleton branch avoids directly identifying skeleton branches without bifurcation points as non-spur branches, thus preventing the omission of spur branches. Furthermore, when the number of bifurcation points is 0, directly determining the number of foreground pixels of the skeleton branch is sufficient to confirm whether it is a spur branch, which helps improve the processing speed of the method.

[0117] Optionally, in one embodiment of this application, when the number of bifurcation points is 0, the skeleton branch is determined to be a burr branch if the number of foreground pixels of the skeleton branch is less than a first threshold; or, the skeleton branch is determined not to be a burr branch if the number of foreground pixels of the skeleton branch is not less than the first threshold. Thus, by setting the first threshold, it is convenient to determine whether a skeleton branch is a burr branch based on the relationship between the number of foreground pixels of the skeleton branch and the first threshold.

[0118] Figure 9 This is a flowchart illustrating a method for determining burr branches according to an embodiment of this application. Figure 9 As shown, method 900 includes the following steps.

[0119] Step 910: Obtain the target image.

[0120] Optionally, the target image is the processed version of the original image. The target image is a binarized image, meaning that the pixels of the skeleton branches in the target image, i.e., the foreground pixels, have a pixel value of 1; while the pixel values ​​of other pixels, i.e., the background pixels, have a pixel value of 0.

[0121] Step 920: Determine the bifurcation points and endpoints in the target image.

[0122] Specifically, the method for determining bifurcation points and endpoints in a target image can refer to [the relevant documentation / method / etc.]. Figures 3 to 8 The relevant details will not be elaborated upon here.

[0123] Step 930: Determine if the number of bifurcation points in the target image is greater than 0. If the number of bifurcation points is not greater than 0, proceed to step 940. If the number of bifurcation points in the target image is greater than 0, proceed to step 950.

[0124] Step 940: Count the number of foreground pixels in the target image.

[0125] Step 950: Based on the currently searched pixel of the skeleton branch of the target image, search for the next pixel of the skeleton branch.

[0126] Step 960: Determine whether the number of searched pixels has reached the first threshold or whether the current pixel is a branch point. If the number of searched pixels has reached the first threshold or the current pixel is a branch point, proceed to step 970. If the number of searched pixels has not reached the first threshold and the current pixel is not a branch point, return to step 950.

[0127] Step 970: Stop the search.

[0128] Optionally, stopping the search can be done by stopping the search for the next pixel on that skeleton branch.

[0129] Optionally, if all skeleton branches of the target image satisfy the condition of step 960, stopping the search can be done by stopping the search for the next pixel of all skeleton branches of the target image.

[0130] Optionally, in one embodiment of this application, method 100 further includes: acquiring an input image, wherein the values ​​of foreground pixels in the input image are 1 and the values ​​of background pixels are 0; extracting connected components of the input image to obtain at least one target image, wherein each target image includes a connected component of the input image.

[0131] Figure 10 This is a schematic diagram of an image processing method according to an embodiment of this application. Figure 10 As shown, the method includes the following steps.

[0132] Step 1010: Obtain the input image.

[0133] The input image can be the binarized version of the original image, with the foreground pixels having a value of 1 and the background pixels having a value of 0.

[0134] Step 1020: Extract the connected components of the input image.

[0135] A connected component, also known as a connected region, generally refers to an image region consisting of foreground pixels with the same pixel value and adjacent positions.

[0136] Optionally, step 1020 is performed before step 910.

[0137] Figure 11 This is a schematic diagram of an input image according to an embodiment of this application. Figure 12 and Figure 13 This is a schematic diagram showing the input image after connected components have been extracted according to an embodiment of this application. For example... Figure 11 As shown, the input image includes two connected components. After connected component extraction, the following can be obtained: Figure 12 and Figure 13 The image shown can be represented in which each connected component corresponds to a target image. Connected component extraction can employ methods such as the Two-Pass algorithm and seed filling algorithms; this embodiment does not impose specific limitations on these methods.

[0138] In this embodiment, each target image corresponds to a connected component, and each target image is processed separately, which helps to improve the processing speed of the method.

[0139] Optionally, in one embodiment of this application, the width of the skeleton branch is a single pixel. This ensures that when searching for the next pixel of the skeleton branch, there is only one neighboring pixel along the normal direction of the skeleton, thus guaranteeing the uniqueness of the skeleton path.

[0140] The above text combined Figures 1 to 13The method embodiments of this application have been described in detail. The embodiments of the image processing apparatus of this application will be described in detail below. It should be understood that the method embodiments and the apparatus embodiments correspond to each other, and similar descriptions can be made with reference to the method embodiments.

[0141] Figure 14 This is a schematic diagram of an image processing apparatus according to an embodiment of this application. Figure 14 As shown, the image processing apparatus 200 includes a processing module 201. The processing module 201 is used to: determine the next pixel of the skeleton branch based on the current pixel that has been searched in the skeleton branch of the target image; and determine whether the skeleton branch is a spur branch based on the number of pixels that have been searched in the skeleton branch.

[0142] Optionally, in one embodiment of this application, the processing module 201 is configured to: determine endpoints and bifurcation points in the target image before searching for the next pixel of the skeleton branch based on the current pixel of the skeleton branch that has been searched, the endpoints and bifurcation points being used to search for the skeleton branch.

[0143] Optionally, in one embodiment of this application, the processing module 201 is used to: take the endpoint in the target image as the anchor point, and sequentially search for the next pixel of the skeleton branch according to the currently searched pixel of the skeleton branch corresponding to the endpoint.

[0144] Optionally, in one embodiment of this application, the processing module 201 is configured to: determine that the skeleton branch is not a burr branch when the number of searched pixels of the skeleton branch reaches a first threshold.

[0145] Optionally, in one embodiment of this application, the processing module 201 is used to: determine that the skeleton branch is a burr branch when the number of searched pixels of the skeleton branch does not reach a first threshold and the current searched pixel of the skeleton branch is a fork point.

[0146] Optionally, in one embodiment of this application, the processing module 201 is configured to: stop searching when the number of searched pixels in the skeleton branch reaches a first threshold, or when the current searched pixel in the skeleton branch is a branching point.

[0147] Optionally, in one embodiment of this application, the processing module 201 is used to: convert the value of the searched current pixel to 0; and if there is only one foreground pixel among the eight neighboring pixels of the searched current pixel, determine that foreground pixel as the next pixel of the skeleton branch.

[0148] Optionally, in one embodiment of this application, the processing module 201 is used to: determine the searched current pixel as a fork point when there is more than one foreground pixel among the eight neighboring pixels of the searched current pixel.

[0149] Optionally, in one embodiment of this application, the processing module 201 is used to: record the current pixels that have been searched, wherein the number of pixels that have been recorded is the number of pixels that have been searched in the skeleton branch.

[0150] Optionally, in one embodiment of this application, the processing module 201 is used to: store the position information of the searched current pixel in a memory.

[0151] Optionally, in one embodiment of this application, the processing module 201 is configured to: convert the value of the current searched branch point to 1 if it is determined that the skeleton branch is a burr branch; or, convert the value of all searched pixels of the skeleton branch to 1 if it is determined that the skeleton branch is not a burr branch.

[0152] Optionally, in one embodiment of this application, the processing module 201 is used to: determine whether the current pixel of the target image is an endpoint or a bifurcation point based on the values ​​of the eight neighboring pixels of the current pixel of the target image.

[0153] Optionally, in one embodiment of this application, the processing module 201 is used to: determine the current pixel as an endpoint when the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is 1.

[0154] Optionally, in one embodiment of this application, the processing module 201 is used to: determine the current pixel as a bifurcation point when the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction.

[0155] Optionally, in one embodiment of this application, the processing module 201 is used to: determine whether the skeleton branch is a burr branch based on the number of foreground pixels of the skeleton branch when the number of bifurcation points is 0.

[0156] Optionally, in one embodiment of this application, the processing module 201 is configured to: determine that the skeleton branch is a burr branch when the number of foreground pixels of the skeleton branch is less than a first threshold; or, determine that the skeleton branch is not a burr branch when the number of foreground pixels of the skeleton branch is not less than the first threshold.

[0157] Optionally, in one embodiment of this application, the processing module 201 is configured to: acquire an input image, wherein the values ​​of the foreground pixels of the input image are 1 and the values ​​of the background pixels are 0; extract the connected components of the input image to obtain at least one target image, wherein each target image includes a connected component of the input image.

[0158] Figure 15 This is a schematic diagram of an image processing apparatus according to an embodiment of this application. Figure 15 As shown, this application embodiment provides an image processing apparatus 210, including a memory 211 and a processor 212. The memory 211 is used to store computer-executable instructions; the processor 212 is used to access the memory and execute the computer-executable instructions to perform the operations in the image processing method of any of the foregoing embodiments.

[0159] The processor 212 in this application embodiment can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods and steps disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0160] The memory 211 in this embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0161] This application provides a storage medium for storing a computer program, which, when executed by a computing device, causes the computing device to implement the method described in any of the foregoing embodiments.

[0162] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. An image processing method, characterized in that, include: Based on the currently searched pixel of the skeleton branch of the target image, search for the next pixel of the skeleton branch; Determining whether a skeleton branch is a glitch branch based on the number of pixels searched in the skeleton branch includes: If the number of searched pixels in the skeleton branch reaches a first threshold, the skeleton branch is determined not to be a burr branch.

2. The method according to claim 1, characterized in that, Before searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image, the method further includes: The endpoints and bifurcation points in the target image are determined, and the endpoints and bifurcation points are used to search for the skeleton branches.

3. The method according to claim 2, characterized in that, The step of searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image includes: Using the endpoints in the target image as anchor points, the next pixel of the skeleton branch is searched sequentially based on the currently searched pixel of the skeleton branch corresponding to the endpoint.

4. The method according to any one of claims 1 to 3, characterized in that, The step of determining whether a skeleton branch is a spurious branch based on the number of pixels searched in the skeleton branch includes: If the number of searched pixels in the skeleton branch does not reach the first threshold and the current searched pixel in the skeleton branch is a fork point, the skeleton branch is determined to be a burr branch.

5. The method according to claim 4, characterized in that, The method further includes: The search stops when the number of searched pixels in the skeleton branch reaches a first threshold, or when the current searched pixel in the skeleton branch is a branch point.

6. The method according to claim 1, characterized in that, The value of the foreground pixel in the target image is 1, and the value of the background pixel is 0.

7. The method according to claim 6, characterized in that, The step of searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image includes: Convert the value of the currently searched pixel to 0; If there is only one foreground pixel among the eight neighboring pixels of the current pixel that has been searched, then the foreground pixel is determined to be the next pixel of the skeleton branch.

8. The method according to claim 7, characterized in that, The method further includes: If there is more than one foreground pixel among the eight neighboring pixels of the currently searched pixel, the currently searched pixel is determined to be a fork point.

9. The method according to claim 8, characterized in that, The method further includes: Record the currently searched pixels, wherein the number of recorded pixels is the number of searched pixels in the skeleton branch.

10. The method according to claim 9, characterized in that, The recording of the currently searched pixel points includes: The position information of the current searched pixel is stored in the memory.

11. The method according to any one of claims 7 to 10, characterized in that, The method further includes: If the skeleton branch is determined to be a burr branch, the value of the currently searched fork point is converted to 1; or, If it is determined that the skeleton branch is not a burr branch, the values ​​of all searched pixels of the skeleton branch are converted to 1.

12. The method according to claim 2, characterized in that, Determining the endpoints and bifurcation points in the target image includes: Based on the values ​​of the eight neighboring pixels of the current pixel in the target image, the current pixel in the target image is determined to be an endpoint or a branching point.

13. The method according to claim 12, characterized in that, Determining the current pixel of the target image as the endpoint includes: If the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is 1, the current pixel is determined to be an endpoint.

14. The method according to claim 12, characterized in that, Determining the current pixel of the target image as the bifurcation point includes: If the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction, the current pixel is determined to be a branching point.

15. The method according to claim 2, characterized in that, The method further includes: When the number of bifurcation points is 0, the skeleton branch is determined to be a burr branch based on the number of foreground pixels of the skeleton branch.

16. The method according to claim 15, characterized in that, The step of determining whether a skeleton branch is a spiky branch based on the number of foreground pixels of the skeleton branch includes: If the number of foreground pixels in the skeleton branch is less than a first threshold, the skeleton branch is determined to be a burr branch; or, If the number of foreground pixels of the skeleton branch is not less than a first threshold, the skeleton branch is determined not to be a burr branch.

17. The method according to claim 1, characterized in that, The method further includes: Obtain an input image, wherein the value of the foreground pixel in the input image is 1 and the value of the background pixel is 0; The connected components of the input image are extracted to obtain at least one target image, and each target image includes a connected component of the input image.

18. The method according to claim 1, characterized in that, The width of the skeleton branch is a single pixel.

19. An image processing apparatus, characterized in that, include: The processing module is used for: Based on the currently searched pixel of the skeleton branch of the target image, determine the next pixel of the skeleton branch; Determining whether a skeleton branch is a burr branch based on the number of searched pixels of the skeleton branch includes: if the number of searched pixels of the skeleton branch reaches a first threshold, determining that the skeleton branch is not a burr branch.

20. The apparatus according to claim 19, characterized in that, The processing module is used for: Before searching for the next pixel of the skeleton branch based on the currently searched pixel of the skeleton branch of the target image, endpoints and bifurcation points in the target image are determined, and the endpoints and bifurcation points are used to search the skeleton branch.

21. The apparatus according to claim 20, characterized in that, The processing module is used for: Using the endpoints in the target image as anchor points, the next pixel of the skeleton branch is searched sequentially based on the currently searched pixel of the skeleton branch corresponding to the endpoint.

22. The apparatus according to any one of claims 19 to 21, characterized in that, The processing module is used for: If the number of searched pixels in the skeleton branch does not reach the first threshold and the current searched pixel in the skeleton branch is a fork point, the skeleton branch is determined to be a burr branch.

23. The apparatus according to claim 22, characterized in that, The processing module is used for: The search stops when the number of searched pixels in the skeleton branch reaches a first threshold, or when the current searched pixel in the skeleton branch is a branch point.

24. The apparatus according to claim 19, characterized in that, The value of the foreground pixel in the target image is 1, and the value of the background pixel is 0.

25. The apparatus according to claim 24, characterized in that, The processing module is used for: Convert the value of the currently searched pixel to 0; If there is only one foreground pixel among the eight neighboring pixels of the current pixel that has been searched, then the foreground pixel is determined to be the next pixel of the skeleton branch.

26. The apparatus according to claim 25, characterized in that, The processing module is used for: If there is more than one foreground pixel among the eight neighboring pixels of the currently searched pixel, the currently searched pixel is determined to be a fork point.

27. The apparatus according to claim 25, characterized in that, The processing module is used for: Record the currently searched pixels, wherein the number of recorded pixels is the number of searched pixels in the skeleton branch.

28. The apparatus according to claim 27, characterized in that, The processing module is used for: The position information of the current searched pixel is stored in the memory.

29. The apparatus according to any one of claims 25 to 28, characterized in that, The processing module is used for: If the skeleton branch is determined to be a burr branch, the value of the currently searched fork point is converted to 1; or, If it is determined that the skeleton branch is not a burr branch, the values ​​of all searched pixels of the skeleton branch are converted to 1.

30. The apparatus according to claim 20, characterized in that, The processing module is used for: Based on the values ​​of the eight neighboring pixels of the current pixel in the target image, the current pixel in the target image is determined to be an endpoint or a branching point.

31. The apparatus according to claim 30, characterized in that, The processing module is used for: If the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is 1, the current pixel is determined to be an endpoint.

32. The apparatus according to claim 30, characterized in that, The processing module is used for: If the sum of the values ​​of the eight neighboring pixels of the current pixel in the target image is greater than or equal to 3, and the values ​​of at least three of the eight neighboring pixels are 1 less or 1 greater than the value of the previous neighboring pixel in the clockwise or counterclockwise direction, the current pixel is determined to be a branching point.

33. The apparatus according to claim 20, characterized in that, The processing module is used for: When the number of bifurcation points is 0, the skeleton branch is determined to be a burr branch based on the number of foreground pixels of the skeleton branch.

34. The apparatus according to claim 33, characterized in that, The processing module is used for: If the number of foreground pixels in the skeleton branch is less than a first threshold, the skeleton branch is determined to be a burr branch; or, If the number of foreground pixels of the skeleton branch is not less than a first threshold, the skeleton branch is determined not to be a burr branch.

35. The apparatus according to claim 19, characterized in that, The processing module is used for: Obtain an input image, wherein the value of the foreground pixel in the input image is 1 and the value of the background pixel is 0; The connected components of the input image are extracted to obtain at least one target image, and each target image includes a connected component of the input image.

36. The apparatus according to claim 20, characterized in that, The width of the skeleton branch is a single pixel.

37. An image processing apparatus, characterized in that, include: Memory is used to store executable instructions for a computer; A processor for accessing the memory and executing the computer-executable instructions to perform the operations in the method according to any one of claims 1 to 18.

38. A storage medium, characterized in that, Used to store a computer program that, when executed by a computing device, causes the computing device to implement the method as described in any one of claims 1 to 18.