Image processing method, system, electronic device, robot and storage device
By using methods of arc fitting and straight line fitting to image lines, the problem of insufficient fitting accuracy in existing technologies is solved, achieving accurate recognition of straight lines and curves and improving the accuracy of image processing.
Patent Information
- Application Number
- CN201980011345.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-15
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2039-02-15
AI Technical Summary
Existing technologies using polygon approximation methods in image processing struggle to accurately distinguish and fit straight lines and curves, resulting in insufficient accuracy in the fitting results.
The lines in the image are initially divided using circular arc fitting and circular arc merging methods, followed by straight line fitting and straight line merging. Combined with whole circle fitting judgment, the fitting accuracy is improved.
By performing arc fitting and straight line fitting on the lines in the image, straight lines and curves can be identified more accurately, thus improving the accuracy of the fitting results.
Smart Images

Figure CN111788604B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to an image processing method, an image processing system, an electronic device, a robot and a storage device. Background Art
[0002] In the process of digital image processing, it is usually necessary to identify the lines in the image, that is, to fit the lines in the image in an appropriate way. The polygonal approximation method is often used in the fitting process. According to the polygonal approximation method, the lines in the image (including straight lines and curves) can be fitted using several end-to-end line segments. In the fitting process, the number of line segments is gradually increased until the distance from all feature points on the line to the nearest feature point is less than the required fitting accuracy threshold. Then the broken line formed by these end-to-end connected line segments can be used as the approximation of the line, that is, the fitting curve.
[0003] It can be seen that according to the polygonal approximation method, no matter whether the lines in the image are actually straight lines or curves, they are approximated by line segments during the fitting process. The accuracy of the fitting results finally obtained in this way is also insufficient, and it is impossible to describe the straight lines and curves in the image appropriately. Summary of the invention
[0004] The present application provides an image processing method, an image processing system, an electronic device, a robot and a storage device to improve the accuracy of fitting.
[0005] In order to solve the above technical problems, the present application provides a technical solution for providing an image processing method. The method includes: obtaining multiple feature points of a line in an image; dividing the line into multiple sub-lines; performing arc fitting and arc merging on the multiple sub-lines, and recording the arc fitting results that meet the arc fitting requirements; performing straight line fitting and straight line merging on the sub-lines after the arc fitting and the arc merging, and recording the straight line fitting results that meet the straight line fitting requirements; and outputting the recorded fitting results corresponding to each sub-line.
[0006] In order to solve the above technical problems, another technical solution provided by the present application is to provide an image processing method. The method includes: obtaining multiple feature points of a line in an image; judging whether the line is a closed line, if so, performing whole circle fitting on the line, and judging whether the result of the whole circle fitting meets the whole circle fitting requirements; if the whole circle fitting result meets the whole circle fitting requirements, directly outputting the result of the whole circle fitting; if the whole circle fitting result does not meet the whole circle fitting requirements, executing: dividing the line into multiple sub-lines; performing arc fitting and arc merging on the multiple sub-lines, and recording the arc fitting results that meet the arc fitting requirements; performing straight line fitting and straight line merging on the sub-lines after the arc fitting and the arc merging, and recording the straight line fitting results that meet the straight line fitting requirements; and outputting the fitting results corresponding to each sub-line.
[0007] In order to solve the above technical problems, another technical solution provided by the present application is to provide an image processing system, which includes a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor can load the program instructions and execute the above image recognition method.
[0008] In order to solve the above technical problems, another technical solution provided by the present application is to provide an electronic device, which includes a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor can load the program instructions and execute the above image recognition method.
[0009] In order to solve the above technical problems, another technical solution provided by the present application is to provide a robot, which includes a memory, a processor and an image acquisition device, wherein the image acquisition device is used to acquire images, the memory stores program instructions, and the processor can load the program instructions and execute the above image recognition method.
[0010] In order to solve the above technical problem, another technical solution provided by the present application is to provide a storage device which stores program instructions, and the program instructions can be loaded and execute the above image recognition method.
[0011] By first performing arc fitting and arc merging on multiple sub-lines, the arc fitting results of the multiple sub-lines can be obtained. Some of the sub-lines are actually closer to straight lines. At this time, the results of arc fitting and arc merging are further subjected to straight line fitting and straight line merging, so that these sub-lines can be found and their straight line fitting results can be recorded. For other sub-lines whose arc fitting results meet the arc fitting requirements, their arc fitting results are recorded. Therefore, the present application can fit the lines in the image to be identified using different line types (straight lines or arcs), thereby improving the accuracy of fitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flowchart of an embodiment of the image recognition method of the present application.
[0013] Figure 2 It is a flowchart of another embodiment of the image recognition method of the present application.
[0014] Figure 3 It is shown as an example Figure 2 The specific steps of step S202.
[0015] Figure 4 It is shown as an example Figure 2 The specific steps of step S204.
[0016] Figure 5 It is shown as an example Figure 2 The specific steps of step S205.
[0017] Figure 6 An example of lines in an image to be recognized and feature points thereon is shown.
[0018] Figure 7 It is shown as an example that Figure 6 The process of dividing a line in an image to be recognized into multiple sub-lines is shown.
[0019] Figure 8 and Fig. 9 The example shows Figure 7 The process of arc fitting and arc merging of the sub-lines after division.
[0020] Fig.10 The process of re-fitting the arc sub-lines into straight lines is exemplarily shown.
[0021] Fig.11 Shows the Figures 7 to 10 After processing Figure 6 The fitting curve of the lines in the image to be recognized.
[0022] Fig.12 Several types of situations that can be avoided during the fitting process are shown.
[0023] Fig.13 It is shown as an example Figure 2 The specific steps of step S206.
[0024] Fig.14 It is a flowchart of another embodiment of the image recognition method of the present application.
[0025] Fig.15 It is a structural diagram of an embodiment of the image processing system of the present application.
[0026] Fig.16 It is a structural schematic diagram of an embodiment of the electronic device of the present application.
[0027] Fig.17 It is a schematic diagram of the structure of an embodiment of the robot of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of the image recognition method of the present application. The image recognition method includes steps S101 to S105. The method can be implemented by any electronic device with image acquisition and computing functions, such as a robot with a camera device, or a computer with an external camera device.
[0030] S101: Acquire multiple feature points of lines in an image.
[0031] In step S101, the acquired image is first preprocessed to identify multiple feature points of lines in the image. The method for acquiring feature points of lines in the image can refer to any conventional technology in the art and is not limited here. It should be understood that there may be multiple scattered lines in an image. In this case, feature points of different lines can be acquired respectively, and these feature points can be grouped according to different lines and processed respectively according to subsequent steps.
[0032] S102: Divide the line into a plurality of sub-lines.
[0033] In step S102, the line obtained in the previous step is divided into a plurality of sub-lines, that is, the feature points on the line are divided into sets corresponding to different sub-lines. For example, obvious inflection points / corner points on the line can be identified, and the line is divided into a plurality of sub-lines using these inflection points / corner points as demarcation points. Each sub-line represents the feature points at both ends thereof and the set of feature points between them.
[0034] S103: performing arc fitting and arc merging on the plurality of sub-lines, and recording arc fitting results that meet the arc fitting requirements.
[0035] First, arc fitting is performed on each sub-line, that is, the feature points corresponding to each sub-line are used to try to fit an arc. Then, if a part of the multiple arcs obtained by fitting multiple sub-lines can be merged, this part of the arcs is merged (the sub-lines corresponding to these arcs are merged). It is determined whether these arcs that are fitted individually or merged meet the preset arc fitting requirements, and the results that meet the fitting requirements are recorded. Optionally, the arc fitting requirement can be that the maximum distance from the feature points on the sub-line to the fitted arc is less than the preset accuracy requirement, or the sum of the squares of the distances from each feature point on the sub-line to the fitted arc is less than the preset accuracy requirement, etc.
[0036] S104: performing straight line fitting and straight line merging on the sub-lines after arc fitting and arc merging, and recording the straight line fitting results that meet the straight line fitting requirements.
[0037] It can be understood that when the radius of the arc tends to infinity, the arc itself tends to a straight line segment. In the fitting process of step S103, some sub-lines that are more suitable for fitting with a straight line may be fitted with an arc with a large radius, which affects the accuracy of the fitting result. Therefore, in step S104, firstly, each sub-line that has been fitted with an arc and the sub-line obtained after the arc is merged are fitted with a straight line, that is, the feature points corresponding to each sub-line are used to try to fit a straight line. Then, if part of the multiple straight lines obtained by fitting can be merged, this part of the straight lines is merged (the sub-lines corresponding to these straight lines are merged). It is judged whether these straight lines that are fitted individually or merged meet the preset straight line fitting requirements, and the results that meet the fitting requirements are recorded. Optionally, the straight line fitting requirement can be that the maximum distance from the feature points on the sub-line to the fitted straight line is less than the preset accuracy requirement, or the sum of the squares of the distances from each feature point on the sub-line to the fitted straight line is less than the preset accuracy requirement, etc. It should be understood that the preset accuracy requirements in the straight line fitting requirement and the arc fitting requirement can be the same or different.
[0038] S105: Output the fitting results of the records corresponding to each sub-line.
[0039] In step S105, the fitting results corresponding to the records of each sub-line are output, that is, the straight line fitting results of the sub-lines that meet the straight line fitting requirements obtained in step S104 and the arc fitting results of other sub-lines that meet the arc fitting requirements are output, thereby obtaining the fitting results of the entire line in the image to be identified. It can be understood that the fitting results can be output to any human-computer interaction interface to provide information to the user or operator of the device, and can also be output to the next control / operation link of the device or external device for subsequent control / operation of the device or external device.
[0040] The present application first performs arc fitting and arc merging on multiple sub-lines, and can obtain the arc fitting results of multiple sub-lines. Some of the sub-lines are actually closer to straight lines. At this time, the results of arc fitting and arc merging are further subjected to straight line fitting and straight line merging, and these sub-lines can be found and their straight line fitting results are recorded. For other sub-lines whose arc fitting results meet the arc fitting requirements, their arc fitting results are recorded. Therefore, the present application can fit the lines in the image to be identified using different line types (straight lines or arcs), thereby improving the accuracy of fitting.
[0041] See also Figure 2 , Figure 2 is a flow chart of another embodiment of the image recognition method of the present application. The image recognition method includes steps S201 to S210. Figures 6 to 12 The example given in is used to illustrate.
[0042] S201: Acquire multiple feature points of lines in an image.
[0043] Combination Figure 6 In step S201, it is possible to obtain Figure 6 A plurality of feature points P1 to P22 of lines on the image to be recognized are shown in FIG.
[0044] S202: Divide the line into a plurality of sub-lines.
[0045] In this embodiment, a polygonal approximation method can be used to perform a preliminary fitting on the line, and multiple vertices of the line can be obtained from multiple feature points of the line. These vertices divide the line into multiple sub-lines connected end to end, and each sub-line is marked as a straight sub-line by default, and the preliminary fitting results of each sub-line are recorded. Among them, each sub-line represents the vertices at both ends of it and the collection of other feature points between the vertices. Specifically, Figure 3 As shown, step S202 may include the following sub-steps:
[0046] S2021: Take the starting point and end point of the line as the vertices of the line.
[0047] S2022: Determine line segments between adjacent vertices.
[0048] S2023: Calculate the distances between other feature points of the line and the nearest line segment, and determine the feature point with the farthest distance from the nearest line segment.
[0049] S2024: Determine whether the distance from the feature point to the nearest line segment is greater than a preset threshold. If yes, continue to step S2025, otherwise, end the operation and complete the division of the line.
[0050] S2025: Add the feature point as a vertex of the line, and return to the step of determining the line segments between adjacent vertices in S2022.
[0051] like Figure 7 As shown in (a), the starting point P1 and the end point P22 of the line are first selected as the vertices of the line, and the line segment P1P22 is determined. Then, the feature point P12 that is farthest from the line segment P1P22 is found. The distance between P12 and P1P22 is the farthest and greater than the preset threshold, so P12 is added as the vertex of the line, and the line segments P1P12 and P12P22 between adjacent vertices are re-determined, as shown in FIG. Figure 7 (b) As shown. At this time, the point farthest from the nearest line segment is P7. P7 is closest to line segment P1P12. Assuming that the distance between them is greater than the preset threshold, P7 is added as a vertex of the line, and the line segments P1P7, P7P12 and P12P22 between adjacent vertices are re-determined, as shown in Figure 7 (c) As shown. At this time, the point farthest from the nearest line segment is P9. P9 is closest to line segment P7P12. Assuming that the distance between them is greater than the preset threshold, P9 is added as a vertex of the line, and the line segments P1P7, P7P9, P9P12 and P12P22 between adjacent vertices are re-determined, as shown in Figure 7 (d) As shown in Figure 2, the point farthest from the nearest line segment is P20. P20 is closest to line segment P12P22. Assuming that the distance between them is greater than a preset threshold, P20 is added as a vertex of the line, and the line segments P1P7, P7P12, P12P20 and P2022 between adjacent vertices are re-determined, as shown in Figure 2. Figure 7 (e) As shown. By executing the above steps, multiple vertices of the line can be obtained from the multiple feature points of the line, and these vertices divide the line into multiple sub-lines connected end to end. In the following text, for the convenience of description, P1P7, P7P12, P12P20 and P2022 (i.e., the endpoints at both ends of each sub-line) are still used to represent each sub-line. It should be understood that, unlike the meaning of the line segment in this step, each sub-line represents the vertices at its two ends and the set of other feature points located between the vertices. For example, sub-line P1P7 represents the set of feature points P1~P7, and sub-line P7P12 represents the set of feature points P7~P12.
[0052] It should be understood that as long as the coordinates of any two vertices are known, a straight line can be determined based on their coordinates, thereby calculating the distances from other feature points to the straight line. This is a well-known technique in the art and will not be described in detail here.
[0053] In some embodiments, the preset threshold value may be equal to the accuracy requirement preset by the system. In this way, the preliminary fitting result of the sub-line can meet the accuracy requirement of the system, and if there is no subsequent modification, it can be used as the final fitting result of the sub-line.
[0054] Through the above steps S2021 to S2025, it is possible to divide the lines in the image to be identified into a plurality of sub-lines.
[0055] S203: performing arc fitting and arc merging on the plurality of sub-lines, and recording arc fitting results that meet the arc fitting requirements.
[0056] Specifically, Figure 4 As shown, step S203 may include the following sub-steps:
[0057] S2031: Perform a first arc fitting on the combination of the nth sub-line and the (n+1)th sub-line.
[0058] In step S2031, a first arc fitting is performed on the combination of the nth sub-line and the n+1th sub-line, wherein the n+1th sub-line is adjacent to the nth sub-line, 1≤n≤m-1, n is an integer, and m is the number of the sub-lines, that is, arc fitting is attempted on the combination of each sub-line in the previous step and the next sub-line. Figure 7 Taking (e) as an example, arc fitting is attempted for the combinations of P1P7 and P7P9, P7P9 and P9P12, P9P12 and P12P20, and P12P20 and P20P22, respectively.
[0059] In some embodiments, the starting point of the nth sub-line can be used as the starting point of the arc, and the end point of the n+1th sub-line can be used as the end point of the arc. The other feature points of the nth sub-line and the n+1th sub-line are traversed, and the other feature points are used as the third point to perform arc fitting, and the arc with the best maximum deviation is found as the result of the first arc fitting. The maximum deviation is the maximum distance between the actual line (or actual feature point) to be fitted and the line obtained by fitting. The smaller the maximum deviation, the closer the fitted line is to the actual line, that is, the better the maximum deviation. For example, in the fitting process of the combination of P7P9 and P9P12, P7P9 is the previous sub-line and P9P12 is the next sub-line. Then P7 is used as the starting point of the arc, P12 is used as the end point of the arc, and P8 to P11 are selected as the third point in turn to determine an arc respectively, and the distances of other feature points on the sub-line except the third point from the arc are calculated respectively to find the maximum deviation. The arc with the best maximum deviation among the arcs determined by P8 to P11 as the third points is the result of the first arc fitting.
[0060] S2032: Determine whether the result of the first arc fitting meets the first arc fitting requirement. If yes, proceed to step S2033.
[0061] In some embodiments, the first arc fitting requirement includes: the optimal maximum deviation meets a preset accuracy requirement.
[0062] In some embodiments, the first arc fitting requirement also includes: the length relationship between the current sub-line and the next sub-line is within a preset range. This is to avoid the situation where, in some cases, even if a longer sub-line and a shorter sub-line do not belong to the same arc, the result of the first arc fitting of their combination can meet the accuracy requirement. For example, Fig.12 (a) shows the combination of sub-lines Q1Q2 and Q2Q4. It should be understood that the preset range can be formulated according to specific circumstances, for example, it can be stipulated that the length ratio of the current sub-line to the next sub-line cannot be greater than 3. The length of the sub-line involved in this step can be approximately represented by the length of the straight line segment between the starting point and the end point of the sub-line.
[0063] S2033: Mark the sub-line and the next sub-line as arc sub-lines.
[0064] If the result of the first arc fitting meets the first arc fitting requirement, the sub-line and the next sub-line are marked as arc sub-lines.
[0065] In some embodiments, since in the previous preliminary fitting process, the fitting results of each sub-line obtained using the straight line fitting method have been able to meet the preset accuracy requirements, therefore, in step S2033, only the adjacent sub-lines whose results of the first arc fitting meet the first arc fitting requirements are temporarily marked as arc sub-lines, and there is no need to record the arc fitting results of each sub-line temporarily.
[0066] In other embodiments, if the preset accuracy requirement in the preliminary fitting is different from the final desired accuracy requirement, or if it is desired to compare the straight line fitting results and arc fitting results of each sub-line to find the optimal fitting result when both meet the accuracy requirements, after step S2033, arc fitting can be performed on each sub-line marked as an arc. The arc fitting method is similar to the first arc fitting method and will not be described in detail here. In this way, the arc fitting results of each sub-line marked as an arc can be obtained. Figure 8 As shown, the arc fitting result of the sub-lines P7P9 alone can be the arc segment on the circle C1. The arc fitting result of the sub-line P9P12 alone can be an arc segment on circle C2.
[0067] In some embodiments, the method may further include an operation of determining whether the line is a closed line. For example, the positional relationship between the starting point and the end point of the line (e.g., whether they are close enough) may be determined to determine whether the line is closed or open. If the line is closed, the combination of the first sub-line and the last sub-line in the line may also be subjected to first arc fitting, and if the results of their first arc fitting meet the first arc fitting requirements, the first sub-line and the last sub-line are also marked as arc sub-lines.
[0068] S2034: traverse each sub-line, and when two adjacent sub-lines are marked as arc sub-lines, perform a second arc fitting on their combination.
[0069] Similar to the first arc fitting, in the process of the second arc fitting, the starting point of the current sub-line is used as the starting point of the arc, and the end point of the next sub-line adjacent to the current sub-line is used as the end point of the arc. The other feature points on the current sub-line and the next sub-line are traversed, and the other feature points are used as the third point for arc fitting, and the arc with the maximum deviation and the best value is found as the result of the second arc fitting.
[0070] The distance between the middle feature point of the current sub-line and the end point of the current sub-line is recorded as D1, the distance between the starting point of the next sub-line and the middle feature point of the next sub-line is recorded as D2, and the distance between the middle feature point of the current sub-line and the middle feature point of the next sub-line is recorded as D3. It should be understood that if a sub-line has an odd number of feature points, the middle feature point of the sub-line is the feature point that divides the other feature points into two parts. If a sub-line has an even number of feature points, one of the two feature points in the middle can be selected as the middle feature point of the sub-line. For example, Fig. 9 As shown, the middle point of the current sub-line P7P9 is P8, and the middle feature point of the next sub-line P9P12 can be P10 or P11.
[0071] S2035: Determine whether the result of the second arc fitting meets the second arc fitting requirement. If yes, proceed to step S2036.
[0072] The requirements for the second arc fitting include: the optimal maximum deviation meets the preset accuracy requirements, D3 is greater than D1, and D3 is greater than D2. In other words, in addition to meeting the accuracy requirements, it is also required that the half chord length of the merged arc does not decrease. This is to avoid the following situation: Fig.12 (b) shows the crescent-shaped line. Fig.12In the crescent line shown in (b), the sub-line Q5Q8 and the sub-line Q8Q11 are very close, so the optimal maximum deviation in the result of their second arc fitting may meet the accuracy requirement, but it is inappropriate to merge them in this case. By judging whether the half-chord length of the merged arc is reduced, similar situations can be effectively avoided.
[0073] S2036: Merge the two adjacent sub-lines into one, and record the result of the second arc fitting.
[0074] If the result of the second arc fitting meets the second arc fitting requirement, the two adjacent sub-lines are merged into one, and the result of the second arc fitting is recorded.
[0075] It should be noted that all sub-lines can be traversed multiple times until no second arc fitting result of any adjacent sub-line meets the second arc fitting requirement during the traversal process. Alternatively, after two adjacent sub-lines are merged, the second arc fitting can be continued with the combination of the next sub-line (if it is also marked as an arc sub-line).
[0076] For example, in Fig. 9 In the example shown, the second arc fitting result of the combination of adjacent sub-lines P7P9 and P9P12 meets the second arc fitting requirement. At this time, they are merged into one sub-line P7P12, and their second arc fitting results are In this case, all sub-lines can be traversed again, or the second arc fitting can be continued for the combination of sub-line P7P12 and the next sub-line P12P20 (assuming that the sub-line is marked as an arc), until the next sub-line is not marked as an arc, or the result of the second arc fitting of their combination does not meet the second arc fitting requirements.
[0077] Through the above steps S2031 to S2036, arc fitting and arc merging of multiple sub-lines can be achieved.
[0078] S204: performing straight line fitting and straight line merging on the sub-lines after arc fitting and arc merging, and recording the straight line fitting results that meet the straight line fitting requirements.
[0079] Specifically, Figure 5 As shown, step S204 may include the following sub-steps:
[0080] S2041: Perform first straight line fitting on each sub-line marked as an arc sub-line.
[0081] In some embodiments, a straight line determined by the start point and the end point of each sub-line marked as an arc sub-line is used as the result of the first straight line fitting, and the maximum deviation from other feature points of the sub-line to the straight line is calculated.
[0082] In other embodiments, the least square method may be used to fit the sub-line marked as an arc, the straight line obtained by fitting is used as the result of the first straight line fitting, and the maximum deviation from all feature points of the sub-line to the straight line is calculated.
[0083] S2042: Determine whether the result of the first straight line fitting meets the first straight line fitting requirement. If yes, proceed to step S2043.
[0084] Optionally, the first straight line fitting requirement may include: the maximum deviation obtained in the previous step meets the accuracy requirement.
[0085] S2043: Mark the sub-line as a straight line sub-line, and record the result of the first straight line fitting.
[0086] like Fig.10 As shown, it is assumed that in the previous step, the sub-lines P20P22 are marked as arc sub-lines, and the arc is obtained by arc fitting. In S2041 to S2043, a first straight line fitting is performed on the sub-line P20P22. If the result of the first straight line fitting meets the first straight line fitting requirement, the sub-line P20P22 is re-marked as a straight line sub-line, and the result of the first straight line fitting is recorded, that is, the straight line P20P22 shown as the dotted line in the figure.
[0087] S2044: traverse each sub-line, and when two adjacent sub-lines are marked as straight line sub-lines, perform a second straight line fitting on their combination.
[0088] Specifically, a straight line determined by the starting point of the first sub-line and the end point of the second sub-line of two adjacent sub-lines is used as the result of the second straight line fitting, and the maximum deviation of other feature points of the first sub-line and the second sub-line to the straight line is calculated.
[0089] Among them, the distance between the starting point and the end point of the previous sub-line is recorded as D4, the distance between the missing point and the end point of the next sub-line is recorded as D5, and the distance between the starting point of the previous sub-line and the end point of the next sub-line is recorded as D6.
[0090] S2045: Determine whether the result of the second straight line fitting meets the second straight line fitting requirement. If yes, proceed to step S2046.
[0091] The second straight line fitting requirements include: the maximum deviation meets the preset accuracy requirements, D6 is greater than D4, and D6 is greater than D5. In other words, in addition to meeting the preset accuracy requirements, it is also required that the length of the merged straight line does not decrease. This is to avoid the following situation: Fig.12 (c) shows the U-turn line. Fig.12 In the broken line shown in (c), the sub-line Q11Q14 and the sub-line Q14Q16 are very close, so the maximum deviation obtained in the second straight line fitting results of them may meet the preset accuracy requirements, but it is inappropriate to merge them in this case. By judging whether the length of the merged straight line is reduced, similar situations can be effectively avoided.
[0092] S2046: Merge the two adjacent sub-lines into one, and record the result of the second straight line fitting.
[0093] Through the above steps S2041 to S2046, straight line fitting and straight line merging of multiple sub-lines after arc fitting and arc merging can be achieved.
[0094] Fig.11 Shows Figure 6 The lines shown are fitted curves obtained after the above steps, wherein the sub-lines P1P7, P12P20 and P20P22 retain the results of straight line fitting and / or straight line merging, and the sub-line P7P12 retains the results of arc fitting and / or arc merging.
[0095] S205: Determine whether the length of each sub-line is less than a preset minimum processing length.
[0096] In some embodiments, the result obtained by image recognition may be further provided for subsequent operations (e.g., machining). In this case, it may be further determined whether the length of each sub-line is less than a preset minimum processing length. The preset minimum processing length is the shortest distance that the controllable motion of the processing tool can move in the subsequent processing process.
[0097] It should be understood that in this step, for the sub-line marked as a straight line, its length is the length of the straight line segment between the starting point and the end point of the sub-line; for the sub-line marked as an arc, its length can be the length of the arc obtained by fitting, or it can be approximately expressed by the length of the straight line segment between the starting point and the end point of the sub-line.
[0098] S206: Update the division of sub-lines and re-fit.
[0099] If the length of a sub-line is less than the preset minimum processing length, it means that it is impossible to accurately move on the sub-line in the subsequent processing process, and this sub-line can be called an unqualified sub-line. At this time, the division of the sub-lines can be updated and re-fitted, the purpose is to make the length of each sub-line greater than or equal to the minimum processing length, to ensure the smooth progress of the subsequent processing process.
[0100] Therefore, in step S206, the feature points of the unqualified sub-line whose length is less than the minimum processing length are split into the qualified sub-line adjacent to it, or some or all of the feature points in the qualified sub-line adjacent to the unqualified sub-line are added to the unqualified sub-line. Fig.13 As shown, step S206 may include:
[0101] S2061: Classify each sub-line into a first type of sub-line, a second type of sub-line and / or a third type of sub-line.
[0102] Traverse all unqualified sub-lines whose length is less than the minimum processing length. If the line in the image to be identified is a closed line and the unqualified sub-line is the first sub-line, the sub-line is defined as the first type; if the line in the image to be identified is a closed line and the unqualified sub-line is the last sub-line, the sub-line is defined as the second type; if the line in the image to be identified is not a closed line, or the unqualified sub-line is not the first or last sub-line, the sub-line is defined as the third type.
[0103] S2062: Merge the second type of unqualified sub-line and the previous sub-line adjacent to it (i.e., the end point of the previous sub-line is the starting point of the second type unqualified sub-line), and perform arc fitting or straight line fitting on the merged sub-line according to the mark of the previous sub-line; and merge the third type of unqualified sub-line and the previous sub-line adjacent to it (i.e., the end point of the previous sub-line is the starting point of the third type unqualified sub-line), and perform arc fitting or straight line fitting on the merged sub-line according to the mark of the previous sub-line.
[0104] S2063: Merge the first type of unqualified sub-line and the next sub-line adjacent to it (i.e., the starting point of the next sub-line is the ending point of the first type of unqualified sub-line), and perform arc fitting or straight line fitting on the merged sub-line according to the mark of the next sub-line; and merge the third type of unqualified sub-line and the next sub-line adjacent to it (i.e., the starting point of the next sub-line is the ending point of the third type of unqualified sub-line), and perform arc fitting or straight line fitting on the merged sub-line according to the mark of the next sub-line.
[0105] S2064: Split the third type of unqualified sub-line into two parts, and merge the two split parts with the previous and next sub-lines adjacent to them respectively, and perform arc fitting or straight line fitting on the merged two sub-lines according to the marks of the previous sub-line and the next sub-line respectively.
[0106] S2065: For the second type or third type of unqualified sub-line, determine whether the sum of the length of the unqualified sub-line and the previous sub-line adjacent to it is greater than 2 times the minimum processing length. If so, merge a part of the feature points of the previous sub-line into the feature points of the second type or third type of unqualified sub-line, and perform arc fitting or straight line fitting on the previous sub-line and the merged sub-line, respectively. In this way, the length of the merged sub-line and the shortened length of the previous sub-line can be made greater than the minimum processing length.
[0107] S2066: For the first type or the third type of unqualified sub-line, determine whether the sum of the length of the unqualified sub-line and the next sub-line adjacent to it is greater than 2 times the minimum processing length. If so, merge a part of the feature points of the next sub-line into the feature points of the first type or the third type of unqualified sub-line, and perform arc fitting or straight line fitting on the next sub-line and the merged sub-line, respectively. In this way, the length of the merged sub-line and the shortened length of the next sub-line can be made greater than the minimum processing length.
[0108] Through the above steps S2061 to S2066, the division of the sub-lines can be updated and the updated sub-lines can be refitted. It should be noted that the above steps S2061 to S2066 can be performed in any order, and only a part of them can be performed, as long as all sub-lines with a length less than the minimum processing length can be re-divided.
[0109] S207: Determine whether the re-fitting result meets the fitting requirements. If yes, execute step S208, otherwise execute step S210.
[0110] S208: Record the refitting result.
[0111] S209: Output the fitting results of the records corresponding to each sub-line.
[0112] S210: Generate a notification message to prompt that the accuracy requirement needs to be lowered.
[0113] The fitting requirements may include: the refitting result meets the preset accuracy requirements. If the refitting result meets the fitting requirements, the refitting result may be recorded. At this time, each refitted sub-line can meet the minimum processing length, which can ensure the smooth progress of the subsequent processing process. If the refitting result cannot meet the fitting requirements, a notification message may be generated. The notification message is used to prompt the user or operator that under the current preset accuracy requirements, the system cannot obtain a correct fitting result that can meet the minimum processing length, so the user or operator needs to reduce the preset accuracy according to the actual situation.
[0114] The present application first performs arc fitting and arc merging on multiple sub-lines, and can obtain the arc fitting results of multiple sub-lines. Some of the sub-lines are actually closer to straight lines. At this time, the results of arc fitting and arc merging are further subjected to straight line fitting and straight line merging, and these sub-lines can be found and their straight line fitting results are recorded. For other sub-lines whose arc fitting results meet the arc fitting requirements, their arc fitting results are recorded. Therefore, the present application can fit the lines in the image to be identified using different line types (straight lines or arcs), thereby improving the accuracy of fitting.
[0115] See also Fig.14 , Fig.14 FIG. 2 is a flow chart of another embodiment of the image recognition method of the present application. The image recognition method may include steps S301 to S308.
[0116] S301: Acquire multiple feature points of lines in an image.
[0117] S302: Determine whether the line is a closed line. If yes, proceed to step S303.
[0118] Whether the line is a closed line can be determined by determining the position and distance relationship between the starting point and the end point of the line. For example, if the distance between the starting point and the end point is less than a preset value, the line is determined to be a closed line, otherwise the line is determined to be an open line.
[0119] S303: Perform full circle fitting on the line to determine whether the result of the full circle fitting meets the full circle fitting requirement. If yes, execute step S304, otherwise execute step S305.
[0120] In step S303, the line is fitted with a whole circle using the least square method to obtain a whole circle fitting result of the line, which includes the center of the whole circle, the radius of the whole circle and the maximum fitting deviation. The maximum fitting deviation refers to the maximum distance between the feature point of the line and the whole circle obtained by fitting.
[0121] Based on the center of the whole circle and the image of the image and the X-axis and Y-axis of the image, the fitted whole circle is divided into multiple quadrants, and it is determined whether the line has feature points in multiple quadrants of the fitted whole circle. For example, if the fitted circle has feature points near the angles of 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6 (radians) with the X-axis (or Y-axis), it can be determined that the line has feature points in multiple quadrants of the fitted whole circle. If the line has feature points in multiple quadrants of the whole circle and the maximum fitting deviation meets the accuracy requirements, it can be determined that the whole circle fitting result meets the requirements of the whole circle fitting.
[0122] By judging whether the lines have feature points in multiple quadrants of the fitted full circle, we can avoid the following problems: Fig.12 The crescent-shaped line shown in (b) is misjudged as a full circle, thus improving the accuracy of the fitting.
[0123] S304: directly output the result of the whole circle fitting.
[0124] If it is determined that the result of the whole circle fitting meets the requirements of the whole circle fitting, the result of the whole circle fitting can be directly output as the fitting result of the line on the image to be recognized without executing subsequent steps, thereby improving the efficiency of image recognition.
[0125] S305: Divide the line into a plurality of sub-lines.
[0126] S306: performing arc fitting and arc merging on the multiple sub-lines, and recording arc fitting results that meet the arc fitting requirements.
[0127] S307: performing straight line fitting and straight line merging on the sub-lines after arc fitting and arc merging, and recording the straight line fitting results that meet the straight line fitting requirements.
[0128] S308: Output the fitting results of the records corresponding to each sub-line.
[0129] If the result of the whole circle fitting does not meet the requirements of the whole circle fitting, then steps S305 to S308 may be continued to be performed to fit the line. Steps S305 to S308 refer to the corresponding steps in any of the above embodiments and will not be described in detail here.
[0130] See also Fig.15 , Fig.154 is a schematic diagram of the structure of an embodiment of an image processing system 400 provided by the present invention. The image processing system 400 includes a memory 401 and a processor 402 coupled to each other. The memory 401 stores program data, and the program data can be loaded by the processor 402 to execute the image recognition method in any of the above embodiments. It can be understood that in some other embodiments, the memory 401 may not be set in the same physical device as the processor 402, but the method of any of the above embodiments is executed by combining the image processing system 400 with a network.
[0131] See also Fig.16 , Fig.16 : is a schematic diagram of the structure of an embodiment of an electronic device 500 provided by the present invention. The electronic device 500 includes a memory 501 and a processor 502 coupled to each other. Among them, the memory 501 stores program data, and the program data can be loaded by the processor 502 to execute the image recognition method in any of the above embodiments. It can be understood that in some other embodiments, the memory 501 may not be set in the same physical device as the processor 502, but the method of any of the above embodiments is executed by combining the electronic device 500 with the network. The electronic device 500 can be any device with an image acquisition function, such as a mobile terminal, a camera, a face recognition device, etc.
[0132] See also Fig.17 , Fig.17 600 is a schematic diagram of the structure of an embodiment of the robot 600 provided by the present invention. The robot 600 includes a memory 601, a processor 602 and an image acquisition device 603 that are coupled to each other. Among them, the image acquisition device 603 can be any device that can acquire an image, such as a camera, a lens, and a photosensitive element. The memory 601 stores program data, and the program data can be loaded by the processor 602 to execute the image recognition method in any of the above embodiments. It can be understood that in some other embodiments, the memory 601 may not be set in the same physical device as the processor 602, but the method of any of the above embodiments is executed by combining the robot 600 with the network. The robot 600 can be any robot with image recognition function, such as a machining robot, an assembly robot, etc.
[0133] If the functions described in the above embodiments are implemented in the form of software and sold or used as independent products, they can be stored in a device with a storage function, that is, the present invention also provides a storage device storing a program. The program data in the storage device can be executed to implement the robot motion control method in the above embodiments, and the storage device includes but is not limited to a USB flash drive, an optical disk, a server or a hard disk.
[0134] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image recognition method, characterized in that: include: Get multiple feature points of lines in the image; dividing the line into a plurality of sub-lines; Performing arc fitting and arc merging on the multiple sub-lines, and recording the arc fitting results that meet the arc fitting requirements; Performing straight line fitting and straight line merging on the sub-lines after the arc fitting and the arc merging, and recording the straight line fitting results that meet the straight line fitting requirements; as well as Output the fitting results corresponding to the records of each sub-line; The step of performing arc fitting and arc merging on the plurality of sub-lines and recording the arc fitting results that meet the arc fitting requirements comprises: Performing a first arc fitting on the combination of the nth sub-line and the n+1th sub-line, and if the result of the first arc fitting meets the first arc fitting requirement, marking the nth sub-line and the n+1th sub-line as arc sub-lines, wherein the n+1th sub-line is adjacent to the nth sub-line, 1≤n≤m-1, n is an integer, and m is the number of the sub-lines; Traversing each of the sub-lines, when two adjacent sub-lines are both marked as arc sub-lines, performing a second arc fitting on their combination, and if the result of the second arc fitting meets the second arc fitting requirement, merging the two adjacent sub-lines into one, and recording the result of the second arc fitting; The step of performing a first arc fitting on the combination of the nth sub-line and the n+1th sub-line comprises: Taking the starting point of the nth sub-line as the starting point of the arc, taking the end point of the n+1th sub-line as the end point of the arc, traversing other feature points of the nth sub-line and the n+1th sub-line, and sequentially taking the other feature points as the third point to perform arc fitting, and finding the arc with the maximum deviation and the best value as the result of the first arc fitting; The first arc fitting requirement includes: the optimal maximum deviation meets a preset accuracy requirement.
2. The image recognition method according to claim 1, characterized in that: The step of dividing the line into a plurality of sub-lines comprises: Performing preliminary fitting on the line using a polygonal approximation method, obtaining a plurality of vertices of the line from the plurality of feature points, wherein the plurality of vertices divide the line into a plurality of sub-lines connected end to end, each of the sub-lines representing the vertices at both ends thereof and a set of other feature points located between the vertices at both ends thereof; Each of the sub-lines is marked as a straight sub-line by default, and the result of the preliminary fitting is recorded.
3. The image recognition method according to claim 2, characterized in that: The step of performing preliminary fitting on the line using a polygonal approximation method comprises: Taking the starting point and the end point of the line as the vertices of the line; Determine line segments between adjacent vertices; Calculate the distances between other feature points of the line and the nearest line segment, determine the feature point with the farthest distance from the nearest line segment, and compare the farthest distance with a preset threshold. If the distance exceeds the preset threshold, add the feature point as a vertex of the line; Return to the step of determining line segments between adjacent vertices until the distances between all feature points on the line and the nearest line segment are less than the preset threshold.
4. The image recognition method according to claim 1, wherein: The first arc fitting requirement also includes: the length relationship between the nth sub-line and the (n+1)th sub-line is within a preset range.
5. The image recognition method according to any one of claims 1 to 4, characterized in that: If the line is a closed line, then: After the step of performing the first arc fitting on the combination of the nth sub-line and the n+1th sub-line, the method further includes: The first arc fitting is performed on a combination of a first sub-line and a last sub-line in the line, and if a result of the first arc fitting meets the first arc fitting requirement, the first sub-line and the last sub-line are marked as arc sub-lines.
6. The image recognition method according to claim 5, characterized in that: When two adjacent sub-lines are both marked as arc sub-lines, the step of performing a second arc fitting on their combination comprises: Taking the starting point of the current sub-line as the starting point of the arc, taking the end point of the next sub-line adjacent to the current sub-line as the end point of the arc, traversing other feature points on the current sub-line and the next sub-line, and sequentially taking the other feature points as the third point for arc fitting, finding the arc with the best maximum deviation as the result of the second arc fitting; The distance between the middle feature point of the current sub-line and the end point of the current sub-line is recorded as D1, the distance between the starting point of the next sub-line and the middle feature point of the next sub-line is recorded as D2, and the distance between the middle feature point of the current sub-line and the middle feature point of the next sub-line is recorded as D3; The requirements for the second arc fitting include: the optimal maximum deviation meets the preset accuracy requirement, D3 is greater than D1, and D3 is greater than D2.
7. The image recognition method according to claim 1, characterized in that: The step of performing straight line fitting and straight line merging on the arc fitting and the sub-lines after the arc merging, and recording the straight line fitting result that meets the straight line fitting requirement comprises: Performing first straight line fitting on each of the sub-lines marked as arc sub-lines respectively, if the result of the first straight line fitting meets the first straight line fitting requirement, marking the sub-line as a straight line sub-line, and recording the result of the first straight line fitting; Traversing each of the sub-lines, when two adjacent sub-lines are marked as straight line sub-lines, performing a second straight line fitting on their combination, if the result of the second straight line fitting meets the second straight line fitting requirement, merging the two adjacent sub-lines into one, and recording the result of the second straight line fitting.
8. The image recognition method according to claim 7, wherein: The step of performing first straight line fitting on all sub-lines marked as arc sub-lines comprises: Taking the straight line determined by the starting point and the end point of each sub-line marked as an arc sub-line as the result of the first straight line fitting, and calculating the maximum deviation from the sub-line to the straight line obtained by fitting; The first straight line fitting requirement includes: the maximum deviation meets the accuracy requirement.
9. The image recognition method according to claim 7 or 8, characterized in that: When two adjacent sub-lines are both marked as straight line sub-lines, the step of performing a second straight line fitting on their combination comprises: Taking the straight line determined by the starting point of the first sub-line of the two adjacent sub-lines and the end point of the second sub-line of the two adjacent sub-lines as the result of the second straight line fitting, and calculating the maximum deviation of the first sub-line and the second sub-line to the straight line; The distance between the starting point and the end point of the previous sub-line is recorded as D4, the distance between the starting point and the end point of the next sub-line is recorded as D5, and the distance between the starting point of the previous sub-line and the end point of the next sub-line is recorded as D6; The second straight line fitting requirement includes: the maximum deviation meets the accuracy requirement, D6 is greater than D4, and D6 is greater than D5.
10. The image recognition method according to claim 7, characterized in that: Also includes: Determine whether the length of each sub-line is less than a preset minimum processing length, and if so, update the division of the sub-line and re-fit; if the result of the re-fitting meets the fitting requirement, record the result of the re-fitting, otherwise, generate a notification message, and the notification message is used to prompt that the accuracy requirement needs to be lowered; Wherein, the step of updating the division of the sub-lines comprises: Splitting the feature points of the unqualified sub-lines whose length is less than the minimum processing length into qualified sub-lines adjacent to the unqualified sub-lines; or At least part of the feature points of the qualified sub-line adjacent to the unqualified sub-line are added to the unqualified sub-line.
11. The image recognition method according to claim 10, characterized in that: The step of updating and refitting the division of the sub-lines comprises: Traversing each unqualified sub-line whose length is less than the minimum processing length, wherein if the line is a closed line and the unqualified sub-line is the first sub-line, the unqualified sub-line is determined to be a first type; if the line is a closed line and the unqualified sub-line is the last sub-line, the unqualified sub-line is determined to be a second type; if the line is a non-closed line, or the unqualified sub-line is not the first sub-line or the last sub-line of the line, the unqualified sub-line is determined to be a third type; At least partially merge the first type of unqualified sub-lines and qualified sub-lines adjacent to the first type of unqualified sub-lines, at least partially merge the second type of unqualified sub-lines and qualified sub-lines adjacent to the second type of unqualified sub-lines, at least partially merge the third type of unqualified sub-lines and qualified sub-lines adjacent to the third type of unqualified sub-lines, and re-fit the merged sub-lines.
12. The image recognition method according to claim 11, characterized in that: The step of at least partially merging the unqualified sub-lines of the second type with qualified sub-lines adjacent to the unqualified sub-lines of the second type, and at least partially merging the unqualified sub-lines of the third type with qualified sub-lines adjacent to the unqualified sub-lines of the third type, and refitting the merged sub-lines comprises: Each of the second type and the third type of unqualified sub-lines is merged with a previous sub-line adjacent to the unqualified sub-line, and arc fitting or straight line fitting is performed on the merged sub-lines according to the mark of the previous sub-line.
13. The image recognition method according to claim 11, characterized in that: The step of at least partially merging the unqualified sub-lines of the first type with qualified sub-lines adjacent to the unqualified sub-lines of the first type, and at least partially merging the unqualified sub-lines of the third type with qualified sub-lines adjacent to the unqualified sub-lines of the third type, and refitting the merged sub-lines comprises: The first type and the third type of unqualified sub-lines and a subsequent sub-line adjacent to the unqualified sub-line are merged, and arc fitting or straight line fitting is performed on the merged sub-lines according to the mark of the subsequent sub-line.
14. The image recognition method according to claim 11, characterized in that: The step of at least partially merging the unqualified sub-lines of the third type and the qualified sub-lines adjacent to the unqualified sub-lines of the third type, and refitting the merged sub-lines comprises: The third type of unqualified sub-line is split into two parts, and the two split parts are respectively merged with the previous sub-line and the next sub-line adjacent to the unqualified sub-line, and arc fitting or straight line fitting is performed on the two merged sub-lines according to the marks of the previous sub-line and the next sub-line.
15. The image recognition method according to claim 11, characterized in that: The step of at least partially merging the unqualified sub-lines of the second type with qualified sub-lines adjacent to the unqualified sub-lines of the second type, and at least partially merging the unqualified sub-lines of the third type with qualified sub-lines adjacent to the unqualified sub-lines of the third type, and refitting the merged sub-lines comprises: For the second type and the third type of unqualified sub-lines, determine whether the sum of the lengths of the unqualified sub-line and the previous sub-line adjacent to the unqualified sub-line is greater than twice the minimum processing length. If so, merge a portion of the feature points of the previous sub-line into the feature points of the second type and the third type of unqualified sub-lines, so that the length of the merged sub-line and the length of the shortened previous sub-line are both greater than the minimum processing length, and perform arc fitting or straight line fitting on the updated previous sub-line and the merged sub-line, respectively.
16. The image recognition method according to claim 11, characterized in that: The step of at least partially merging the unqualified sub-lines of the first type with qualified sub-lines adjacent to the unqualified sub-lines of the first type, and at least partially merging the unqualified sub-lines of the third type with qualified sub-lines adjacent to the unqualified sub-lines of the third type, and refitting the merged sub-lines comprises: For the first type and the third type of unqualified sub-lines, determine whether the sum of the length of the unqualified sub-line and the subsequent sub-line adjacent to the unqualified sub-line is greater than twice the minimum processing length. If so, merge a part of the feature points of the subsequent sub-line into the feature points of the second type and the third type of unqualified sub-lines, so that the length of the merged sub-line and the length of the shortened subsequent sub-line are both greater than the minimum processing length, and perform arc fitting or straight line fitting on the updated subsequent sub-line and the merged sub-line, respectively.
17. An image recognition method, characterized in that: include: Get multiple feature points of lines in the image; Determine whether the line is a closed line, and if so, perform whole circle fitting on the line, and determine whether the result of the whole circle fitting meets the whole circle fitting requirements; If the whole circle fitting result meets the whole circle fitting requirement, directly outputting the whole circle fitting result; If the whole circle fitting result does not meet the whole circle fitting requirement, execute: dividing the line into a plurality of sub-lines; Performing arc fitting and arc merging on the multiple sub-lines, and recording the arc fitting results that meet the arc fitting requirements; Performing straight line fitting and straight line merging on the sub-lines after the arc fitting and the arc merging, and recording the straight line fitting results that meet the straight line fitting requirements; as well as Output the fitting results corresponding to the records of each sub-line; The step of performing arc fitting and arc merging on the plurality of sub-lines and recording the arc fitting results that meet the arc fitting requirements comprises: Performing a first arc fitting on the combination of the nth sub-line and the n+1th sub-line, and if the result of the first arc fitting meets the first arc fitting requirement, marking the nth sub-line and the n+1th sub-line as arc sub-lines, wherein the n+1th sub-line is adjacent to the nth sub-line, 1≤n≤m-1, n is an integer, and m is the number of the sub-lines; Traversing each of the sub-lines, when two adjacent sub-lines are both marked as arc sub-lines, performing a second arc fitting on their combination, and if the result of the second arc fitting meets the second arc fitting requirement, merging the two adjacent sub-lines into one, and recording the result of the second arc fitting; The step of performing a first arc fitting on the combination of the nth sub-line and the n+1th sub-line comprises: Taking the starting point of the nth sub-line as the starting point of the arc, taking the end point of the n+1th sub-line as the end point of the arc, traversing other feature points of the nth sub-line and the n+1th sub-line, and sequentially taking the other feature points as the third point to perform arc fitting, and finding the arc with the maximum deviation and the best value as the result of the first arc fitting; The first arc fitting requirement includes: the optimal maximum deviation meets a preset accuracy requirement.
18. The image recognition method according to claim 17, wherein: The step of fitting the line to a whole circle comprises: fitting the line to a whole circle using the least square method to obtain a whole circle fitting result of the line, wherein the whole circle fitting result comprises a whole circle center, a whole circle radius and a maximum fitting deviation, wherein the maximum fitting deviation is a maximum distance between a feature point of the line and the whole circle obtained by fitting; The step of judging whether the result of the whole circle fitting meets the whole circle fitting requirements includes: taking the center of the whole circle and the X-axis and Y-axis of the image domain of the image as references, dividing the whole circle obtained by fitting into multiple quadrants, and judging whether the lines have feature points in the multiple quadrants of the whole circle obtained by fitting; when the lines have feature points in the multiple quadrants of the whole circle and the maximum fitting deviation meets the accuracy requirements, judging that the whole circle fitting result meets the whole circle fitting requirements.
19. An image processing system, comprising a memory and a processor coupled to each other, characterized in that: The memory stores program instructions, and the processor can load the program instructions and execute the image recognition method as described in any one of claims 1-16 or 17-18.
20. An electronic device comprising a memory and a processor coupled to each other, characterized in that: The memory stores program instructions, and the processor can load the program instructions and execute the image recognition method as described in any one of claims 1-16 or 17-18.
21. A robot comprising a processor, a memory and an image acquisition device, characterized in that: The image acquisition device is used to acquire images, the memory stores program instructions, and the processor can load the program instructions and execute the image recognition method as described in any one of claims 1-16 or 17-18.
22. A device with a storage function, characterized in that: Program instructions are stored, and the program instructions can be loaded and executed as described in any one of claims 1-16 or 17-18.
