Image processing method and device and electronic equipment

By classifying the arc contours in the image to be processed in image processing, the problem of disconnection of the target object is solved, and the accuracy of detection is improved.

CN120014227APending Publication Date: 2025-05-16SHENZHEN LINGYUN VISION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411811991.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In a visual detection project, the outline of the target object may be a broken arc outline, resulting in inaccurate detection.

Method used

By identifying the contours in the image to be processed and classifying the index values ​​of each index according to the pair of first arc contours, at least one arc contour contained in each target object is determined.

Benefits of technology

The arc outline of each target object is accurately determined, which improves the accuracy of detecting target objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014227A_ABST
    Figure CN120014227A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device and electronic equipment, and belongs to the technical field of image processing. The method comprises the following steps: identifying a contour in a to-be-processed image; under the condition that at least two to-be-processed first arc contours exist in the to-be-processed image, classifying the at least two first arc contours according to the index values of every two first arc contours in each index to obtain at least one category; each index comprises at least one of a radian difference, a coincidence radian, an included angle difference between an end point connecting line and an end point tangent line, an end point distance, a radius difference and a circle center distance; and outputting at least one first arc contour included in each category as a contour of a target object. At least one arc contour contained in each target object is accurately determined, and the accuracy of target object detection can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular, relates to an image processing method, device and electronic device. Background Art

[0002] In visual inspection projects, it is often necessary to extract the contours of target objects. The contours of some target objects are circular contours or arc contours that are approximately circular. Due to the influence of interference factors such as contrast and transparency, the arc contours extracted by related technologies may be disconnected arc contours. When there are multiple target objects in the image, directly outputting these mixed and disconnected arc contours is very unfavorable for detecting the target objects. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes an image processing method, device and electronic device to accurately determine at least one arc contour contained in each target object, which can effectively improve the accuracy of detecting the target object.

[0004] In a first aspect, the present application provides an image processing method, the method comprising:

[0005] Identify contours in the image to be processed;

[0006] In the case where there are at least two first arc contours to be processed in the image to be processed, the at least two first arc contours are classified according to the index values ​​of each index of the first arc contours, and at least one category is obtained; each index includes at least one of the arc difference, the overlap arc, the angle difference between the end point connection line and the end point tangent line, the end point distance, the radius difference and the center distance; the first arc contour is an unclosed arc contour;

[0007] At least one first arc contour included in each category is output as a contour of a target object.

[0008] According to the image processing method of the present application, when there are at least two first circular arc contours to be processed in the image to be processed, the at least two first circular arc contours are classified according to the index values ​​of each index of each pair of the first circular arc contours to obtain at least one category, and the at least one first circular arc contour contained in each category is output as the contour of a target object, so as to accurately determine the at least one circular arc contour contained in each target object, which can effectively improve the accuracy of detecting the target object.

[0009] According to an embodiment of the present application, at least two first arc contours are classified according to the index values ​​of each index of the pair of first arc contours to obtain at least one category, including:

[0010] Determine the connectability between the two first arc contours according to the index values ​​of each index; the connectability is connectable or not connectable;

[0011] According to the connectability of the two first arc contours, at least two first arc contours are classified to obtain at least one category.

[0012] According to an embodiment of the present application, at least two first arc contours are classified according to the connectability between the two first arc contours to obtain at least one category, including:

[0013] When there is at least one arc contour in the arc contour set of this iteration, a second arc contour of this iteration is selected from the arc contour set of this iteration; the arc contour set of the first iteration is composed of at least two first arc contours contained in the image to be processed;

[0014] In the case that there is at least one candidate arc contour that can be connected to the second arc contour in the arc contour set of this iteration, a target arc contour is determined from the at least one candidate arc contour according to the number of candidate arc contours and / or the connection cost values ​​between the second arc contour and each candidate arc contour respectively; the connection cost value between any two arc contours is determined according to the index values ​​of the two arc contours in each index; the connection cost value of the target arc contour is the smallest;

[0015] Connecting the second arc contour and the corresponding target arc contour to obtain a new arc contour;

[0016] In the arc contour set of this iteration, the second arc contour and the target arc contour are replaced with the new arc contour to obtain the arc contour set of the next iteration;

[0017] When it is determined that there is no candidate arc contour that can be connected to the second arc contour in the arc contour set of this iteration, at least one first arc contour constituting the second arc contour is taken as a category, and the second arc contour is deleted from the arc contour set of this iteration to obtain the arc contour set of the next iteration.

[0018] According to an embodiment of the present application, determining a target arc profile from at least one candidate arc profile according to the number of candidate arc profiles and / or the connection cost value between the second arc profile and each candidate arc profile, includes:

[0019] When the number of candidate circular arc contours is one, the candidate circular arc contour is used as the target circular arc contour of the second circular arc contour;

[0020] When there are multiple candidate contours, normalize the index values ​​of the second arc contour and each candidate arc contour in each index according to the set threshold of each index;

[0021] According to each normalized index value between the second circular arc contour and each candidate circular arc contour, obtaining the connection cost value corresponding to each second circular arc contour and each candidate circular arc contour;

[0022] The candidate arc contour with the smallest connection cost value is used as the target arc contour of the second arc contour.

[0023] According to one embodiment of the present application, selecting the second arc contour of this iteration from the arc contour set includes:

[0024] Use the new arc profile obtained in the previous iteration as the second arc profile of this iteration; or

[0025] Randomly select any arc contour from the arc contour set of this iteration as the second arc contour of this iteration.

[0026] According to an embodiment of the present application, determining the connectability between the two first arc contours according to the index values ​​of the two first arc contours in each index includes:

[0027] When it is determined that the index values ​​of the indicators of the two first arc contours are all less than the corresponding set thresholds, the connectability between the two first arc contours is determined to be connectable;

[0028] When it is determined that the index value of at least one index of the pairwise first arc contours is not less than the corresponding set threshold, the connectability between the pairwise first arc contours is determined to be unconnectable.

[0029] According to an embodiment of the present application, before classifying at least two first circular arc profiles according to the index values ​​of each index of the pairwise first circular arc profiles, the method further includes:

[0030] Performing circle fitting processing on each first circular arc contour to obtain attribute values ​​of each first circular arc contour in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position;

[0031] According to the attribute values ​​of the first circular arc contours in each attribute, the index values ​​of the first circular arc contours in each index are obtained.

[0032] According to an embodiment of the present application, when there are at least two first arc contours to be processed in the image to be processed, before classifying the at least two first arc contours according to the attribute differences between the first arc contours, the method further includes:

[0033] Determine each arc contour from the contours in the image to be processed;

[0034] Closed arc contours are filtered from the arc contours to obtain first arc contours.

[0035] In a second aspect, the present application provides an image processing device, the device comprising:

[0036] A recognition module, used for recognizing contours in the image to be processed;

[0037] A processing module, for classifying the at least two first arc contours to be processed according to the index values ​​of each index of each pair of the first arc contours to obtain at least one category when there are at least two first arc contours to be processed in the image to be processed; each index includes at least one of a radian difference, a coincident radian, an angle between an endpoint connection line and an endpoint tangent line, an endpoint distance, a radius difference, and a center distance; and the first arc contour is an unclosed arc contour;

[0038] The output module is used to output at least one first arc contour included in each category as a contour of a target object.

[0039] According to the image processing device of the present application, when there are at least two first circular arc contours to be processed in the image to be processed, at least two first circular arc contours are classified according to the index values ​​of each index of each pair of the first circular arc contours to obtain at least one category, and at least one first circular arc contour contained in each category is output as the contour of a target object, so as to accurately determine the at least one circular arc contour contained in each target object, which can effectively improve the accuracy of detecting the target object.

[0040] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the image processing method provided in the first aspect is implemented.

[0041] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method provided in the first aspect above.

[0042] In a fifth aspect, the present application provides a chip, the chip comprising a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the image processing method provided in the first aspect.

[0043] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the image processing method provided in the first aspect above.

[0044] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0045] When there are at least two first arc contours to be processed in the image to be processed, at least two first arc contours are classified according to the index values ​​of each index of each pair of the first arc contours to obtain at least one category, and at least one first arc contour contained in each category is output as the contour of a target object, so as to accurately determine the at least one arc contour contained in each target object, thereby effectively improving the accuracy of detecting the target object.

[0046] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0048] Figure 1 This is one of the flowcharts of the image processing method provided in the embodiment of the present application;

[0049] Figure 2 is a schematic diagram of the starting endpoints and the ending endpoints of a plurality of first arc contours provided in an embodiment of the present application;

[0050] Figure 3 is a schematic diagram of the curvature difference between two first arc profiles provided in an embodiment of the present application;

[0051] Figure 4 is a schematic diagram of the overlapping arc between two first arc profiles provided in an embodiment of the present application;

[0052] Figure 5 is a schematic diagram of the angle difference between the endpoint connection line and the endpoint tangent line between two first arc contours provided in an embodiment of the present application;

[0053] Figure 6 is a schematic diagram of the radius difference between two first arc profiles provided in an embodiment of the present application;

[0054] Figure 7 is a schematic diagram of the distance between the centers of two first arc contours provided in an embodiment of the present application;

[0055] Figures 8a-8d It is a schematic diagram of each original first arc contour included in the image to be processed in a specific scene and the first arc contour after being connected, provided by an embodiment of the present application;

[0056] Fig. 9 This is the second flowchart of the image processing method provided in the embodiment of the present application;

[0057] Fig.10 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0058] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0060] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0061] The image processing method, image processing device, electronic device and readable storage medium provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0062] The image processing method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0063] The image processing method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the image processing method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The image processing method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.

[0064] like Figure 1 As shown, the image processing method includes: step 110, step 120 and step 130.

[0065] Step 110: Identify the contours in the image to be processed.

[0066] In the embodiment of the present application, the image to be processed may be an image containing a target object, the outline of the target object may include an arc outline, and the number of target objects may be one or more.

[0067] In different fields, the target object may be different things. For example, in the field of industrial vision, the target object may be an industrial component; in the field of medicine, the target object may be a blood vessel of a human or animal, etc.

[0068] The contours in the image to be processed can be identified by edge detection algorithms, such as the Sobel algorithm, the Canny algorithm, and the Laplacian algorithm.

[0069] Step 120: When there are at least two first arc contours to be processed in the image to be processed, classify the at least two first arc contours according to the index values ​​of each index of each pair of the first arc contours to obtain at least one category; the first arc contour is an unclosed arc contour; each index includes at least one of the arc difference, the overlapping arc, the angle between the endpoint line and the endpoint tangent, the endpoint distance, the radius difference and the center distance.

[0070] The first arc contour to be processed in the embodiment of the present application may be an unclosed arc contour in the image to be processed, and the number of the first arc contour may be one or more.

[0071] After identifying the contour in the image to be processed, the embodiment of the present application needs to determine whether there is a first arc contour in the image to be processed. If so, it is necessary to further determine the number of first arc contours. When there is one first arc contour, the first arc contour is directly taken as a category. When there are at least two first arc contours, the target object to which each first arc contour belongs is determined based on the indicator values ​​of each indicator of each pair of first arc contours.

[0072] Specifically, it is necessary to first perform circle fitting processing on each first arc contour to obtain attribute values ​​of each first arc contour in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position;

[0073] The radius may be the radius of a circular contour obtained after performing circle fitting on the first arc contour.

[0074] The center position of the circle may also be the position of the center of the circular contour obtained after performing circle fitting on the first arc contour.

[0075] The starting endpoint refers to the starting position of the first arc contour in the clockwise direction (of course, it can also refer to the starting position of the first arc contour in the counterclockwise direction); the starting endpoint position refers to the coordinate position of the starting endpoint in the image to be processed.

[0076] The end endpoint refers to the end position of the first arc contour in the clockwise direction (of course, it can also refer to the end position of the first arc contour in the counterclockwise direction); the end endpoint position refers to the coordinate position of the end endpoint in the image to be processed.

[0077] The starting endpoint and the ending endpoint of each first arc contour are determined in the same clockwise direction.

[0078] like Figure 2 As shown, an embodiment of the present application provides a schematic diagram of the starting endpoints and ending endpoints of multiple first arc contours, wherein the multiple first arc contours are arc contour A, arc contour B and arc contour C, respectively. The starting endpoints of the three arc contours all refer to the starting positions of the corresponding arc contours in the clockwise direction, and the ending endpoints all refer to the ending positions of the corresponding arc contours in the clockwise direction.

[0079] The arc length may refer to the length between a starting position and an ending position of the first arc profile, and the arc length of the first arc profile ranges from (0, 2π).

[0080] According to the attribute values ​​of each attribute of the pairwise first arc contours, the index values ​​of each index of the pairwise first arc contours can be obtained, and each index includes at least one of the arc difference, the overlapping arc, the angle between the endpoint connection line and the endpoint tangent, the endpoint distance, the radius difference and the center distance.

[0081] Among them, the radian difference refers to the radian difference between two adjacent endpoints of the two first arc contours to be connected (the starting endpoint of one first arc contour and the ending endpoint of the other first arc contour). There are usually two radian differences between the two first arc contours. The radian difference between the two endpoints to be connected later is involved in the calculation.

[0082] like Figure 3 As shown, the embodiment of the present application provides the curvature difference between two first arc profiles. It can be seen that the arc profile a and the arc profile b are co-centered with the center being O, and the curvature difference between the two includes ɑ and β.

[0083] The overlapping arc refers to the arc corresponding to the overlapping area after the two endpoints (starting endpoints or ending endpoints) of the two arc contours are connected to the center of the circle.

[0084] like Figure 4As shown, the embodiment of the present application provides the overlapping arc between two first arc contours. It can be seen that the center of the arc contour m and the arc contour n is P. After the endpoints of the two arc contours are connected to the center, there is an overlapping area A. The arc θ of the overlapping area here is the overlapping arc between the two.

[0085] The angle difference between the endpoint line and the endpoint tangent line refers to the difference between the angles between the endpoint lines of the two arc contours and the tangent lines at the endpoints. It is used to measure whether the curvature of the arcs at the connection is consistent. The arc contours at both ends usually have two endpoint line angle differences between the endpoint tangent lines. The angle difference between the endpoint line and the endpoint tangent line between the two endpoints to be connected is calculated.

[0086] like Figure 5 As shown, the embodiment of the present application provides the angle difference between the endpoint line and the endpoint tangent of two first arc contours. It can be seen that the center of the arc contour c and the arc contour d is Q, the line connecting the endpoints of the two arc contours are s1 and s2 respectively, the angle between the tangent at the end endpoint of the arc contour c and s1 is Υ1, and the angle between the tangent at the starting endpoint of the arc contour d and s2 is Υ2, then the angle difference between the endpoint line s1 and the endpoint tangent is |Υ2-Υ1|.

[0087] The angle between the tangent at the starting endpoint of the arc profile c and s1 is Υ1', and the angle between the tangent at the ending endpoint of the arc profile d and s2 is Υ2'. Then the angle difference between the endpoint line s1 and the endpoint tangent is |Υ2'-Υ1'|.

[0088] End point distance refers to the length of the line between the starting end point of one arc contour and the ending end point of another arc contour. Figure 5 The length of s1 and s2 is the endpoint distance. When the two endpoints are to be connected later, the endpoint distance between the two endpoints will be calculated.

[0089] The radius difference refers to the difference in the radius length of the circles where the two arc contours are located.

[0090] See also Figure 6 , an embodiment of the present application provides a schematic diagram of the radius difference between two first arc profiles, wherein the radii of the arc profile z1 and the arc profile z2 are r1 and r2 respectively, and the radius difference between the two is r2-r1.

[0091] The center distance refers to the distance between the centers of the fitting circles to which the two first arc contours belong, and the center distance can be determined by the center coordinates of the two centers.

[0092] See also Figure 7The embodiment of the present application provides a schematic diagram of the center distance between two first arc contours. The centers of the arc contour b1 and the arc contour b2 are Q1 and Q2 respectively, and the center distance is the distance between O1 and O2.

[0093] In the embodiment of the present application, at least two first circular arc contours can be classified according to the index values ​​of each index of the pair of first circular arc contours to obtain at least one category, and each category includes at least one circular arc contour.

[0094] It is worth noting that since there are two index values ​​for indicators such as the radian difference between the two first arc contours, the angle difference between the endpoint connection line and the endpoint tangent, and the endpoint distance, in actual use, the index values ​​of indicators such as the radian difference between the two endpoints involved in the connection, the angle difference between the endpoint connection line and the endpoint tangent, and the endpoint distance are used.

[0095] Furthermore, the connectability between the pairwise first arc contours can be determined based on the index values ​​of each index of the pairwise first arc contours; the connectability between the pairwise first arc contours is determined based on the connectability between the starting endpoint of any one of the pairwise first arc contours and the ending endpoint of another first arc contour; the connectability is connectable or not connectable.

[0096] Assume that the two first arc profiles are arc profile h1 and arc profile h2, and the connectability between the arc profile h1 and the arc profile h2 is not connectable, which means that the starting endpoint of the arc profile h1 and the ending endpoint of the arc profile h2 are not connectable, and the ending endpoint of an arc profile h1 and the starting endpoint of the arc profile h2 are also not connectable.

[0097] Assume that the connectability between the arc profile h1 and the arc profile h2 is connectable, which means that the starting endpoint of the arc profile h1 and the ending endpoint of the arc profile h2 are connectable, and / or the ending endpoint of the arc profile h1 and the starting endpoint of the arc profile h2 are connectable.

[0098] For two connectable first arc contours, even if both end point pairs between the two first arc contours are connectable, only one end point pair will be connected during subsequent connection.

[0099] At least two first circular arc contours may be classified according to the connectability between any two first circular arc contours to obtain at least one category. The detailed process is described in the subsequent content.

[0100] Step 130: Output at least one first arc contour included in each category as a contour of a target object.

[0101] After obtaining at least one category, the embodiment of the present application can output at least one first arc contour contained in each category as the contour of a target object, that is, accurately determine at least one arc contour contained in each target object, which can effectively improve the accuracy of detecting the target object.

[0102] In some embodiments, at least two first arc contours are classified according to the index values ​​of each index of each pair of first arc contours to obtain at least one category, including:

[0103] According to the index values ​​of each index of the two first arc contours, the connectability between the two first arc contours is determined; the connectability is the connectability between the starting end point of one first arc contour and the ending end point of another first arc contour in the two first arc contours; the connectability is connectable or not connectable;

[0104] According to the connectability of the two first arc contours, at least two first arc contours are classified to obtain at least one category.

[0105] When there are multiple first arc contours in the image to be processed, it is necessary to determine the connectivity between the two first arc contours. For example, two arc contours may be far apart or have different degrees of curvature, which means that the two arc contours are not connectable and usually do not belong to the same target object.

[0106] The connectability between the pairwise first arc contours can be determined based on the index values ​​of each index of the pairwise first arc contours. The connectability refers to the connectability between the starting endpoint of one first arc contour and the ending endpoint of another first arc contour in the pairwise first arc contours, that is, the connectability between the starting endpoint of one first arc contour and the ending endpoint of another arc contour.

[0107] The connectability status is connectable or not connectable.

[0108] The embodiment of the present application sets corresponding set thresholds for each indicator, that is, the arc difference, the overlapping arc, the angle difference between the endpoint connection line and the endpoint tangent, the endpoint distance, the radius difference and the center distance all have corresponding set thresholds. It is necessary to compare the indicator values ​​of each indicator of the two first arc contours with the corresponding set thresholds to determine the connectability between the two first arc contours.

[0109] In some embodiments, determining the connectability between the two first arc contours according to the index values ​​of the two first arc contours in each index includes:

[0110] When it is determined that the index values ​​of the indexes of the two first arc contours are all less than the corresponding set thresholds, the connectability between the two first arc contours is determined to be connectable;

[0111] When it is determined that the index value of at least one index of the pairwise first arc contours is not less than the corresponding set threshold, the connectability between the pairwise first arc contours is determined to be unconnectable.

[0112] In practical applications, a comparison order can be set for each indicator, and the indicator value of each indicator is compared with the corresponding set threshold in turn according to the comparison order. The indicator with a smaller calculation amount can be determined first, that is, the comparison order of the indicator with a smaller calculation amount is relatively early, and the comparison order of the indicator with a larger calculation amount is relatively late, thereby reducing the amount of calculation.

[0113] For any two first arc contours, when it is detected that the index value of any index of the two is not less than the corresponding set threshold, it can be determined that the connectability between the two first arc contours is not connectable.

[0114] When it is determined that the index values ​​of the two first arc contours in each index are all smaller than the corresponding set threshold values, it can be determined that the connectability between the two arc contours is connectable.

[0115] It is worth noting that the index involved in the calculation here is the index between the two target endpoints to be connected (the starting endpoint of a first arc contour and the ending endpoint of a first arc contour), and does not involve the index between the other two unconnected endpoints.

[0116] Continuing with the above embodiment, when the starting endpoint of the arc profile h1 and the ending endpoint of the arc profile h2 are connectable, and the ending endpoint of the arc profile h1 and the starting endpoint of the arc profile h2 are connectable, it is subsequently necessary to calculate a first connection cost value between the starting endpoint of the arc profile h1 and the ending endpoint of the arc profile h2, and a second connection cost value between the ending endpoint of the arc profile h1 and the starting endpoint of the arc profile h2, compare the first connection cost value and the second connection cost value, and select the two endpoints with the smallest connection cost value for connection.

[0117] In some embodiments, at least two first arc contours are classified according to the connectability between the two first arc contours to obtain at least one category, including:

[0118] When there is at least one arc contour in the arc contour set of this iteration, a second arc contour of this iteration is selected from the arc contour set of this iteration; the arc contour set of the first iteration is composed of at least two first arc contours contained in the image to be processed;

[0119] In the case that there is at least one candidate arc contour that can be connected to the second arc contour in the arc contour set of this iteration, a target arc contour is determined from the at least one candidate arc contour according to the number of candidate arc contours and / or the connection cost values ​​between the second arc contour and each candidate arc contour respectively; the connection cost value between any two arc contours is determined according to the index values ​​of the two arc contours in each index; the connection cost value of the target arc contour is the smallest;

[0120] Connecting the second arc contour and the corresponding target arc contour to obtain a new arc contour;

[0121] In the arc contour set of this iteration, the second arc contour and the target arc contour are replaced with the new arc contour to obtain the arc contour set of the next iteration;

[0122] When it is determined that there is no candidate arc contour that can be connected to the second arc contour in the arc contour set of this iteration, at least one first arc contour constituting the second arc contour is taken as a category, and the second arc contour is deleted from the arc contour set of this iteration to obtain the arc contour set of the next iteration.

[0123] The embodiment of the present application classifies each first arc contour during the iteration process. During this iteration, the arc contour set of this iteration needs to be obtained. When there is at least one arc contour in the arc contour set of this iteration, it can be determined that the iterative classification has not ended.

[0124] When there is no arc contour in the arc contour set of this iteration, it can be determined that the iterative classification is finished.

[0125] In the embodiment of the present application, when it is determined that there is at least one arc contour in the arc contour set of this iteration, the second arc contour of this iteration is selected from the arc contour set of this iteration. The arc contour set of the first iteration is composed of at least two first arc contours contained in the image to be processed, and the second arc contour of the first iteration can be any first arc contour randomly selected from the arc contour set.

[0126] After determining the second arc contour of this iteration, the embodiment of the present application needs to determine whether there is at least one candidate arc contour in the arc contour set of this iteration that can be connected to the second arc contour. When it is determined that there is at least one candidate arc contour in the arc contour set of this iteration that can be connected to the second arc contour, it is necessary to select a target arc contour from the at least one candidate arc contour. Here, the candidate arc contour includes connectable arc contours corresponding to the starting endpoint and the ending endpoint of the second arc contour, respectively.

[0127] Specifically, when there is only one candidate circular arc contour, the one candidate circular arc contour may be directly used as the target circular arc contour.

[0128] When there are multiple candidate contours, a target arc contour may be determined from at least one candidate arc contour according to the connection cost values ​​between the second arc contour and each candidate arc contour.

[0129] Specifically, assuming that the second arc contour has two candidate arc contours, assuming that the cost value between the starting endpoint of the second arc contour S1 and the ending endpoint of the candidate arc contour E1 is C1, and the cost value between the ending endpoint of the second arc contour S1 and the starting endpoint of the candidate arc contour E2 is C2, then the candidate arc contour corresponding to the smaller value of C1 and C2 can be used as the target arc contour.

[0130] The connection cost is determined based on the index values ​​of each index between the two arc contours. The detailed process is shown in the subsequent section.

[0131] Furthermore, the second arc contour and the target arc contour can be connected to obtain a new arc contour. Specifically, assuming that the starting endpoint of the second arc contour is connected to the ending endpoint of the target arc contour, the starting endpoint of the new arc contour is the starting endpoint of the original target arc contour, and the ending endpoint of the new arc contour is the ending endpoint of the original second arc contour. The arc contour of this letter is not a closed arc contour, but still has endpoints and is still an unclosed arc contour.

[0132] It is worth noting that since the new arc contour is formed by connecting multiple arc contours, the new arc contour may have two centers and two radii. When calculating the connectability and connection cost between the new arc contour and other arc contours, it is necessary to determine that the endpoints of the new arc contour were originally the endpoints of the original first arc contour. The connectability and connection cost of the endpoints of the original first arc contour and the endpoints of other arc contours can be used as the connectability and connection cost of the endpoints of the new arc contour and other arc contours.

[0133] After obtaining the new arc contour, the second arc contour and the target arc contour may be replaced by the new arc contour in the arc contour set of this iteration to obtain the arc contour set of the next iteration, thereby performing the next iteration.

[0134] In addition, when it is determined that there is no candidate arc contour that can be connected to the second arc contour in the arc contour set of this iteration, at least one first arc contour that constitutes the second arc contour can be taken as a category, and the category may not include the connection between the first arc contours. In addition, the second arc contour can be deleted from the arc contour set of this iteration, thereby obtaining the arc contour set of the next iteration.

[0135] If there is no arc contour in the arc contour set of the next iteration, the entire iterative classification process is completed.

[0136] like Figures 8a-8d As shown, the embodiment of the present application provides a schematic diagram of each original first arc contour contained in the image to be processed in a specific scene and the first arc contour after being connected,

[0137] Figure 8a The image to be processed on the left side includes three first arc contours. These three first arc contours have the same center and the same radius. After being connected, we get Figure 8a The effect of the image on the right shows that there are two connections between the three first arc contours.

[0138] Figure 8b The image to be processed on the left includes two first arc contours. These two first arc contours are not co-centered and have different radii. Since the connection cost of the starting endpoint of the shorter arc contour and the ending endpoint of the longer arc contour is less than the connection cost of the ending endpoint of the shorter arc contour and the starting endpoint of the longer arc contour, the starting endpoint of the shorter arc contour and the ending endpoint of the longer arc contour are connected to obtain Figure 8b The effect on the right.

[0139] Figure 8c The image to be processed on the left includes two first arc contours. The two first arc contours are co-centered and have different radii. Since the end endpoint of the shorter arc contour and the start endpoint of the longer arc contour are connectable, while the start endpoint of the shorter arc contour and the end endpoint of the longer arc contour are not connectable, the end endpoint of the shorter arc contour and the start endpoint of the longer arc contour are connected to obtain Figure 8c The effect on the right.

[0140] Figure 8d The image to be processed on the left includes 14 first arc contours. The 7 first arc contours on the upper left are co-centered and have the same radius; the 3 first arc contours on the upper right are co-centered and have the same radius; the 2 first arc contours on the lower left are co-centered and have the same radius; the 2 first arc contours on the upper right are co-centered and have the same radius. After connecting, we get Figure 8dThe effect of the image on the right shows that there are 6 connections between the 7 first arc contours in the upper left; there are 2 connections between the 3 first arc contours in the upper right; there is 1 connection between the 2 first arc contours in the lower left; and there is 1 connection between the 2 first arc contours in the upper right.

[0141] In some embodiments, selecting the second arc contour of this iteration from the arc contour set includes:

[0142] Use the new arc profile obtained in the previous iteration as the second arc profile of this iteration; or

[0143] Randomly select any arc contour from the arc contour set of this iteration as the second arc contour of this iteration.

[0144] When selecting the second arc contour of this iteration from the arc contour set, the embodiment of the present application can use the new arc contour obtained in the previous iteration as the second arc contour of this iteration, thereby continuously calculating the target arc contour to be connected to the new arc contour until there is no target arc contour position that can be connected.

[0145] Of course, any arc contour may be directly randomly selected from the arc contour set of this iteration as the second arc contour of this iteration, and there is no restriction on this.

[0146] In some embodiments, according to the number of candidate arc contours and / or the connection cost value between the second arc contour and each candidate arc contour, determining the target arc contour from at least one candidate arc contour comprises:

[0147] When the number of candidate circular arc contours is one, the candidate circular arc contour is used as the target circular arc contour;

[0148] When there are multiple candidate contours, normalize the index values ​​of the second arc contour and each candidate arc contour in each index according to the set threshold of each index;

[0149] According to each normalized index value between the second circular arc contour and each candidate circular arc contour, obtaining the connection cost value corresponding to each second circular arc contour and each candidate circular arc contour;

[0150] The candidate arc contour with the smallest connection cost value is taken as the target arc contour.

[0151] The above-mentioned embodiment has explained that, when there are multiple candidate arc contours, the connection cost value between the second arc contour and each candidate arc contour is required to determine the target arc contour from at least one candidate arc contour.

[0152] Specifically, the index values ​​of the second arc contour and each candidate arc contour in each index can be normalized according to the set threshold of each index. For example, for any index, the ratio of the index value of the index and the corresponding set threshold can be used as the normalized index value.

[0153] It is worth noting that the indices involved in the calculation here are the indices between the two target endpoints to be connected (the starting endpoint of a first arc contour and the ending endpoint of a first arc contour), and do not involve the indices between the other two unconnected endpoints. For example, the two arc contours are m1 and m2, and the starting endpoint and ending endpoint of m1 are S1 and E1 respectively; the starting endpoint and ending endpoint of m2 are S2 and E2 respectively. Assuming that S1 and E2 are the two endpoints to be connected, at least one of the radian difference between S1 and E2, the angle difference between the endpoint connection line and the endpoint tangent, and the endpoint distance will be used. The angle difference between the endpoint connection line and the endpoint tangent, and the endpoint distance between S2 and E1 will not be involved in the calculation of the connection cost value.

[0154] After the normalized index is obtained, the normalized index values ​​may be accumulated to obtain a connection cost value between the second circular arc contour and the candidate circular arc contour.

[0155] After obtaining the connection cost values ​​respectively corresponding to the second arc contour and each candidate arc contour, the candidate arc contour with the smallest connection cost value may be used as the target arc contour.

[0156] In some embodiments, before classifying at least two first circular arc contours according to the index values ​​of each index of the pairwise first circular arc contours, the method further comprises:

[0157] Performing circle fitting processing on each first circular arc contour to obtain attribute values ​​of each first circular arc contour in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position;

[0158] According to the attribute values ​​of the first circular arc contours in each attribute, the index values ​​of the first circular arc contours in each index are obtained.

[0159] This has been explained in the above-mentioned embodiment and will not be described again here.

[0160] In some embodiments, when there are at least two first arc contours to be processed in the image to be processed, before classifying the at least two first arc contours according to the attribute differences between the first arc contours, the method further includes:

[0161] Determine each arc contour from the contours in the image to be processed;

[0162] Closed arc contours are filtered from the arc contours to obtain first arc contours.

[0163] After identifying the contour in the image to be processed, since the closed arc contour belongs to a complete arc contour, the closed arc contour can be directly output as the contour of the target object.

[0164] The unclosed arc contour is obtained by filtering the closed arc contours from the arc contours. The unclosed arc contour is the first arc contour to be processed.

[0165] like Fig. 9 As shown, the present application embodiment provides a second flow chart of an image processing method, comprising the following steps:

[0166] Step 901, identifying the contour in the image to be processed; executing step 902;

[0167] Step 902, filtering closed arc contours from the arc contours to obtain each unclosed arc contour; the unclosed arc contour is the first arc contour to be processed; executing step 903;

[0168] Step 903, performing circle fitting processing on each first arc contour to obtain attribute values ​​of each first arc contour in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position; executing step 904;

[0169] Step 904, obtaining the index value of each index of each first arc contour according to the attribute value of each attribute of each first arc contour; executing step 905;

[0170] Step 905, determining the connectability between the two first arc contours according to the index values ​​of each index of the two first arc contours; the connectability is connectable or not connectable; and executing step 906;

[0171] Step 906, determining whether there is at least one arc contour in the arc contour set of this iteration; if yes, executing step 907; if no, ending;

[0172] Step 907, selecting the second arc contour of this iteration from the arc contour set of this iteration; the arc contour set of the first iteration is composed of at least two first arc contours included in the image to be processed;

[0173] Step 908, determining whether the arc contour set of this iteration contains at least one candidate arc contour that can be connected to the second arc contour; if so, executing step 909; if not, executing step 912;

[0174] Step 909, determining a target arc profile from at least one candidate arc profile according to the number of candidate arc profiles and / or the connection cost values ​​between the second arc profile and each candidate arc profile; executing step 910;

[0175] The connection cost between any two arc contours is determined based on the index values ​​of the two arc contours in each index; the connection cost of the target arc contour is the smallest;

[0176] Step 910, connecting the second arc contour and the target arc contour to obtain a new arc contour; executing step 911;

[0177] Step 911, replacing the second arc contour and the target arc contour with the new arc contour in the arc contour set of this iteration to obtain the arc contour set of the next iteration; executing step 906;

[0178] Step 912, taking at least one first arc contour constituting the second arc contour as a category; executing steps 913 and 914;

[0179] Step 913, delete the second arc contour in the arc contour set of this iteration, obtain the arc contour set of the next iteration, and execute step 906;

[0180] Step 914, outputting at least one first arc contour included in the category as a contour of a target object; end.

[0181] The detailed implementation process of the above steps 901 to 914 is shown in the above embodiments and will not be described again here.

[0182] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, an image processing device executing the image processing method is taken as an example to illustrate the image processing device provided in the embodiment of the present application.

[0183] The embodiment of the present application also provides an image processing device.

[0184] like Fig.10 As shown, the image processing device includes: a recognition module 1010 , a processing module 1020 and an output module 1030 .

[0185] A recognition module 1010 is used to recognize contours in the image to be processed;

[0186] The processing module 1020 is used for classifying the at least two first arc contours to be processed according to the index values ​​of each index of the first arc contours to obtain at least one category when there are at least two first arc contours to be processed in the image to be processed; each index includes at least one of the following: arc difference, overlap arc, angle between the endpoint connection line and the endpoint tangent line, endpoint distance, radius difference and center distance;

[0187] The output module 1030 is used to output at least one first arc contour included in each category as a contour of a target object.

[0188] According to the image processing device provided by the embodiment of the present application, when there are at least two first arc contours to be processed in the image to be processed, the at least two first arc contours are classified according to the index values ​​of each index of each pair of the first arc contours to obtain at least one category, and the at least one first arc contour contained in each category is output as the contour of a target object, so as to accurately determine the at least one arc contour contained in each target object, thereby effectively improving the accuracy of detecting the target object.

[0189] In some embodiments, the processing module 1020 includes:

[0190] The first processing submodule is used to determine the connectability between the two first arc contours according to the index values ​​of each index of the two first arc contours; the connectability is connectable or not connectable;

[0191] The second processing submodule is used to classify at least two first circular arc contours according to the connectability between any two first circular arc contours to obtain at least one category.

[0192] In some embodiments, the second processing submodule includes:

[0193] A first processing unit is configured to select a second arc contour of this iteration from the arc contour set of this iteration when there is at least one arc contour in the arc contour set of this iteration; the arc contour set of the first iteration is composed of at least two first arc contours included in the image to be processed;

[0194] The second processing unit is used to determine a target arc profile from at least one candidate arc profile according to the number of candidate arc profiles and / or the connection cost values ​​between the second arc profile and each candidate arc profile, when there is at least one candidate arc profile that can be connected to the second arc profile in the arc profile set of this iteration; the connection cost value between any two arc profiles is determined according to the index values ​​of the two arc profiles in each index; the connection cost value of the target arc profile is the smallest; and the first arc profile is an unclosed arc profile;

[0195] A third processing unit is used to connect the second arc contour and the corresponding target arc contour to obtain a new arc contour;

[0196] A fourth processing unit, configured to replace the second arc contour and the target arc contour with the new arc contour in the arc contour set of this iteration, so as to obtain the arc contour set of the next iteration;

[0197] The fifth processing unit is used to, when it is determined that there is no candidate arc contour to which the second arc contour can be connected in the arc contour set of this iteration, classify at least one first arc contour constituting the second arc contour as a category, and delete the second arc contour from the arc contour set of this iteration to obtain the arc contour set of the next iteration.

[0198] In some embodiments, the second processing unit is specifically configured to:

[0199] When the number of candidate circular arc contours is one, the candidate circular arc contour is used as the target circular arc contour of the second circular arc contour;

[0200] When there are multiple candidate contours, normalize the index values ​​of the second arc contour and each candidate arc contour in each index according to the set threshold of each index;

[0201] According to each normalized index value between the second circular arc contour and each candidate circular arc contour, obtaining the connection cost value corresponding to each second circular arc contour and each candidate circular arc contour;

[0202] The candidate arc contour with the smallest connection cost value is used as the target arc contour of the second arc contour.

[0203] In some embodiments, the first processing unit is configured to:

[0204] Use the new arc profile obtained in the previous iteration as the second arc profile of this iteration; or

[0205] Randomly select any arc contour from the arc contour set of this iteration as the second arc contour of this iteration.

[0206] In some embodiments, the first processing submodule is specifically configured to:

[0207] When it is determined that the index values ​​of the indicators of the two first arc contours are all less than the corresponding set thresholds, the connectability between the two first arc contours is determined to be connectable;

[0208] When it is determined that the index value of at least one index of the pairwise first arc contours is not less than the corresponding set threshold, the connectability between the pairwise first arc contours is determined to be unconnectable.

[0209] In some embodiments, the image processing apparatus further includes:

[0210] An acquisition module, used for performing circle fitting processing on each first arc contour to obtain attribute values ​​of each first arc contour in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position;

[0211] According to the attribute values ​​of the first circular arc contours in each attribute, the index values ​​of the first circular arc contours in each index are obtained.

[0212] In some embodiments, the image processing apparatus further includes:

[0213] Filter modules for:

[0214] Determine each arc contour from the contours in the image to be processed;

[0215] Closed arc contours are filtered out from the arc contours to obtain various unclosed arc contours; the unclosed arc contour is the first arc contour to be processed.

[0216] The image processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0217] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0218] The image processing device provided in the embodiment of the present application can achieve Figures 1 to 9 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0219] In some embodiments, Fig.11 As shown, an embodiment of the present application also provides an electronic device 1100, including a processor 1101, a memory 1102, and a computer program stored in the memory 1102 and executable on the processor 1101. When the program is executed by the processor 1101, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0220] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0221] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned image processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0222] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0223] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned image processing method when executed by a processor.

[0224] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0225] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0226] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0227] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0228] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0229] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0230] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0231] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. An image processing method, characterized in that: include: Identify contours in the image to be processed; In the case where there are at least two first arc contours to be processed in the image to be processed, the at least two first arc contours are classified according to the index values ​​of each index of the first arc contours to obtain at least one category; each index includes at least one of the following: arc difference, overlap arc, angle difference between the endpoint connection line and the endpoint tangent line, endpoint distance, radius difference and center distance; the first arc contour is an unclosed arc contour; At least one first arc contour included in each category is output as a contour of a target object.

2. The image processing method according to claim 1, characterized in that: The at least two first circular arc contours are classified according to the index values ​​of each index of each pair of first circular arc contours to obtain at least one category, including: Determine the connectability between the two first arc contours according to the index values ​​of each index; the connectability is connectable or not connectable; According to the connectability between the two first circular arc contours, the at least two first circular arc contours are classified to obtain at least one category.

3. The image processing method according to claim 2, characterized in that: The at least two first circular arc contours are classified according to the connectability between the two first circular arc contours to obtain at least one category, including: When there is at least one arc contour in the arc contour set of this iteration, selecting the second arc contour of this iteration from the arc contour set of this iteration; the arc contour set of the first iteration is composed of at least two first arc contours contained in the image to be processed; In the case that there is at least one candidate circular arc contour that can be connected to the second circular arc contour in the circular arc contour set of this iteration, a target circular arc contour is determined from the at least one candidate circular arc contour according to the number of the candidate circular arc contours and / or the connection cost value between the second circular arc contour and each candidate circular arc contour; the connection cost value between any two circular arc contours is determined according to the index value of each index of the two circular arc contours; the connection cost value of the target circular arc contour is the smallest; Connecting the second circular arc profile and the corresponding target circular arc profile to obtain a new circular arc profile; In the circular arc contour set of the current iteration, the second circular arc contour and the target circular arc contour are replaced with the new circular arc contour to obtain the circular arc contour set of the next iteration; When it is determined that there is no candidate arc contour connectable to the second arc contour in the arc contour set of this iteration, at least one first arc contour constituting the second arc contour is taken as a category, and the second arc contour is deleted from the arc contour set of this iteration to obtain the arc contour set of the next iteration.

4. The image processing method according to claim 3, characterized in that: Determining a target circular arc profile from the at least one candidate circular arc profile according to the number of the candidate circular arc profiles and / or the connection cost value between the second circular arc profile and each candidate circular arc profile, comprises: When the number of the candidate circular arc contours is one, taking the one candidate circular arc contour as the target circular arc contour of the second circular arc contour; In the case where there are multiple candidate contours, normalizing the index values ​​of the second arc contour and each candidate arc contour in each index according to the set threshold of each index; According to each normalized index value between the second circular arc contour and each candidate circular arc contour, obtaining the connection cost values ​​respectively corresponding to the second circular arc contour and each candidate circular arc contour; The candidate arc contour with the smallest connection cost value is used as the target arc contour of the second arc contour.

5. The image processing method according to claim 3, characterized in that: The step of selecting the second arc contour of this iteration from the arc contour set includes: Using the new arc profile obtained in the previous iteration as the second arc profile of the current iteration; or Randomly select any arc contour from the arc contour set of the current iteration as the second arc contour of the current iteration.

6. The image processing method according to claim 2, characterized in that: The step of determining the connectability between the two first arc contours according to the index values ​​of the two first arc contours in each index includes: When it is determined that the index values ​​of the indexes of the two first circular arc contours are all less than the corresponding set thresholds, determining that the two first circular arc contours are connectable; When it is determined that the index value of at least one index of the pairwise first arc contours is not less than a corresponding set threshold, the connectability between the pairwise first arc contours is determined to be unconnectable.

7. The image processing method according to claim 1, characterized in that: Before classifying the at least two first circular arc contours according to the index values ​​of each index of the pairwise first circular arc contours, the method further includes: Performing circle fitting processing on each of the first circular arc contours to obtain attribute values ​​of each of the first circular arc contours in each attribute; the attribute includes at least one of radius, arc length, circle center position, start endpoint position, and end endpoint position; According to the attribute values ​​of the first circular arc contours in each attribute, the index values ​​of the first circular arc contours in each index are obtained.

8. The image processing method according to any one of claims 1 to 7, characterized in that: In the case where there are at least two first arc contours to be processed in the image to be processed, before classifying the at least two first arc contours according to the attribute differences between the first arc contours, the method further includes: Determine each arc contour from the contours in the image to be processed; Closed arc contours are filtered from the arc contours to obtain first arc contours.

9. An image processing device, characterized in that: include: A recognition module, used for recognizing contours in the image to be processed; A processing module, for classifying the at least two first arc contours to be processed according to the index values ​​of each index of the first arc contours in pairs to obtain at least one category when there are at least two first arc contours to be processed in the image to be processed; each of the indexes includes at least one of a radian difference, a coincident radian, an angle between an endpoint connection line and an endpoint tangent line, an endpoint distance, a radius difference, and a center distance; and the first arc contour is an unclosed arc contour; The output module is used to output at least one first arc contour included in each category as a contour of a target object.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the image processing method according to any one of claims 1 to 8 is implemented.