Abnormal recognition method, related equipment and storage medium

By acquiring and analyzing the boundary information and image attributes of the abnormal area within the detection area, combining the target contour and reference lines, accurately identifying and distinguishing crack defects and interference abnormalities in the imaging hole, the problem of inaccurate identification in the prior art is solved. Improves the accuracy of detection.

CN119228756APending Publication Date: 2024-12-31中科慧远半导体技术(广东)有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411288206.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify or distinguish crack defects in the camera holes from other interference abnormalities, such as surface scratches or dirt, resulting in misidentification or missed identification problems.

Method used

By obtaining the detection area and abnormal area of ​​the detected image, at least two target contours and reference lines are obtained based on the boundary information, the abnormal type of the abnormal area is calculated in combination with the image attributes, and the crack defect and interference abnormality are distinguished by the included angle angle.

Benefits of technology

Accurate identification and distinction of camera hole abnormalities is achieved, the accuracy of detection is improved, misidentified and misidentified, and fine identification support for crack defects and interference abnormalities is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228756A_ABST
    Figure CN119228756A_ABST
Patent Text Reader

Abstract

The invention discloses an exception recognition method, related equipment and a storage medium, and the method comprises the steps: obtaining a detection region of a detection image and an exception region in the detection region, and enabling the detection region to comprise a to-be-recognized object; based on the boundary information of the detection area, obtaining at least two target contours of the detection area; obtaining a first reference line of the abnormal region based on the boundary information of the abnormal region; obtaining a second reference line of the abnormal region based on the first reference line and the at least two target contours; and based on the first reference line and the second reference line, determining the anomaly type of the anomaly region of the to-be-identified object. And crack defect abnormity and interference abnormity can be identified or distinguished.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of abnormality identification technology, and in particular to an abnormality identification method, an abnormality identification device, an electronic device and a storage medium. Background Art

[0002] In the manufacturing process of electronic products (3C products), due to the imperfection of the process, crack defects are easily caused in the camera hole, resulting in product scrapping. In order to avoid this problem, a defect detection method has appeared in the relevant technology. With this defect detection method, whether there is a crack defect in the camera hole can be detected. In the manufacturing process, in addition to crack defects, the camera hole also has interference abnormalities such as surface scratches and dirt. How to identify or distinguish these two types of abnormalities has become a problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides an abnormality identification method, an abnormality identification device, an electronic device and a storage medium to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present application, there is provided an abnormality identification method, comprising:

[0005] Obtaining a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified;

[0006] Based on the boundary information of the detection area, obtaining at least two target contours of the detection area;

[0007] Based on the boundary information of the abnormal area, obtaining a first reference line of the abnormal area;

[0008] Based on the first reference line and the at least two target contours, obtaining a second reference line of the abnormal area;

[0009] Based on the first reference line and the second reference line, an abnormality type of the abnormal area of ​​the object to be identified is determined.

[0010] In one possible implementation manner, obtaining a first reference line of the abnormal area based on the boundary information of the abnormal area includes:

[0011] Based on the boundary information of the abnormal area, obtaining the minimum circumscribed rectangle of the abnormal area;

[0012] Obtain at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detection image;

[0013] Based on at least two target points, a first reference line of the abnormal area is obtained.

[0014] In one embodiment, obtaining a second reference line of the abnormal area based on the first reference line and the at least two target contours includes:

[0015] The at least two target profiles include a first profile and a second profile;

[0016] Obtaining a first intersection point between the first reference line and the first contour;

[0017] Obtain a second intersection point from the first intersection point to the second contour;

[0018] Based on the first intersection point and the second intersection point, a second reference line of the abnormal area is obtained.

[0019] In one possible implementation, determining the abnormality type of the abnormal area of ​​the object to be identified based on the first reference line and the second reference line includes:

[0020] Based on the reference point on the first reference line and the reference point on the second reference line, obtain the angle between the first reference line and the second reference line;

[0021] Based on the angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0022] In one possible implementation, obtaining at least two target contours of the detection area based on the boundary information of the detection area includes:

[0023] The detection area is composed of a plurality of boundary lines;

[0024] From the plurality of boundary lines, determining two or more boundary lines that meet a preset contour condition;

[0025] Two or more boundary lines that meet preset contour conditions are used as at least two target contours, and the at least two target contours are parallel to each other.

[0026] In one possible implementation manner, obtaining at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detected image includes:

[0027] The image attributes include the width and height of the image;

[0028] Based on the abscissa of the center point of the minimum circumscribed rectangle, the sine value of the reference angle, and the image target value, a first abscissa and a second abscissa are obtained;

[0029] Obtaining a first ordinate and a second ordinate based on the ordinate of the center point of the minimum circumscribed rectangle, the cosine value of the reference angle, and the image target value;

[0030] Based on the first horizontal coordinate and the first vertical coordinate, obtain a first target point;

[0031] Based on the second horizontal coordinate and the second vertical coordinate, obtain a second target point;

[0032] The image target value is obtained by performing a square root operation on the sum of the squares of the width value and the height value of the image.

[0033] In one possible implementation, determining the abnormality type of the abnormal area of ​​the object to be identified based on the angle includes:

[0034] In response to the included angle being a non-acute angle, converting the included angle into an acute angle;

[0035] Based on the converted acute angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0036] In one possible implementation, determining the abnormality type of the abnormal area of ​​the object to be identified based on the angle includes:

[0037] In response to the angle being an acute angle and satisfying the first condition, determining that the abnormality type of the abnormal area of ​​the object to be identified is a crack defect type;

[0038] In response to the angle being an acute angle and satisfying the second condition, it is determined that the abnormality type of the abnormal area of ​​the object to be identified is an interference defect type.

[0039] In one possible implementation manner, obtaining a first reference line of the abnormal area based on the boundary information of the abnormal area includes:

[0040] In response to the presence of two or more abnormal areas satisfying a preset merging condition in the detection area, merging the two or more abnormal areas satisfying the preset merging condition;

[0041] Based on the boundary information of the merged abnormal area, a first reference line of the merged abnormal area is obtained.

[0042] In one possible implementation, the number of the first intersection points is at least two;

[0043] The obtaining a second reference line of the abnormal area based on the first intersection point and the second intersection point comprises:

[0044] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0045] A second reference line of the abnormal area is obtained based on the first intersection point and the second intersection point that meet the first preset condition.

[0046] In one possible implementation, the number of the second intersection points is multiple;

[0047] The obtaining a second reference line of the abnormal area based on the first intersection point and the second intersection point comprises:

[0048] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0049] A second reference line of the abnormal area is obtained based on the first intersection point and a second intersection point that meets a second preset condition.

[0050] In one possible implementation, the number of the first intersection points and the second intersection points are both at least two;

[0051] The obtaining a second reference line of the abnormal area based on the first intersection point and the second intersection point comprises:

[0052] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0053] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0054] Based on the first intersection point satisfying the first preset condition and the second intersection point satisfying the second preset condition, a second reference line of the abnormal area is obtained.

[0055] According to a second aspect of the present application, there is provided an abnormality identification device, comprising:

[0056] A first obtaining unit, used to obtain a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified;

[0057] A second obtaining unit, configured to obtain at least two target contours of the detection area based on the boundary information of the detection area;

[0058] A third obtaining unit, configured to obtain a first reference line of the abnormal area based on the boundary information of the abnormal area;

[0059] a fourth obtaining unit, configured to obtain a second reference line of the abnormal area based on the first reference line and the at least two target contours;

[0060] A determination unit is used to determine an abnormality type of the abnormal area of ​​the object to be identified based on the first reference line and the second reference line.

[0061] In one possible implementation, the third obtaining unit is used to:

[0062] Based on the boundary information of the abnormal area, obtaining the minimum circumscribed rectangle of the abnormal area;

[0063] Obtain at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detection image;

[0064] Based on at least two target points, a first reference line of the abnormal area is obtained.

[0065] In one possible implementation, the fourth obtaining unit is used to:

[0066] The at least two target profiles include a first profile and a second profile;

[0067] Obtaining a first intersection point between the first reference line and the first contour;

[0068] Obtain a second intersection point from the first intersection point to the second contour;

[0069] Based on the first intersection point and the second intersection point, a second reference line of the abnormal area is obtained.

[0070] In one possible implementation manner, the determining unit is configured to:

[0071] Based on the reference point on the first reference line and the reference point on the second reference line, obtain the angle between the first reference line and the second reference line;

[0072] Based on the angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0073] In one possible implementation manner, the second obtaining unit is used to:

[0074] The detection area is composed of a plurality of boundary lines;

[0075] From the plurality of boundary lines, determining two or more boundary lines that meet a preset contour condition;

[0076] Two or more boundary lines that meet preset contour conditions are used as at least two target contours, and the at least two target contours are parallel to each other.

[0077] In one possible implementation, the third obtaining unit is used to:

[0078] The image attributes include the width and height of the image;

[0079] Based on the abscissa of the center point of the minimum circumscribed rectangle, the sine value of the reference angle, and the image target value, a first abscissa and a second abscissa are obtained;

[0080] Obtaining a first ordinate and a second ordinate based on the ordinate of the center point of the minimum circumscribed rectangle, the cosine value of the reference angle, and the image target value;

[0081] Based on the first horizontal coordinate and the first vertical coordinate, obtain a first target point;

[0082] Based on the second horizontal coordinate and the second vertical coordinate, obtain a second target point;

[0083] The image target value is obtained by performing a square root operation on the sum of the squares of the width value and the height value of the image.

[0084] In one possible implementation manner, the determining unit is configured to:

[0085] In response to the included angle being a non-acute angle, converting the included angle into an acute angle;

[0086] Based on the converted acute angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0087] In one possible implementation manner, the determining unit is configured to:

[0088] In response to the angle being an acute angle and satisfying the first condition, determining that the abnormality type of the abnormal area of ​​the object to be identified is a crack defect type;

[0089] In response to the angle being an acute angle and satisfying the second condition, it is determined that the abnormality type of the abnormal area of ​​the object to be identified is an interference defect type.

[0090] In one possible implementation, the third obtaining unit is used to:

[0091] In response to the presence of two or more abnormal areas satisfying a preset merging condition in the detection area, merging the two or more abnormal areas satisfying the preset merging condition;

[0092] Based on the boundary information of the merged abnormal area, a first reference line of the merged abnormal area is obtained.

[0093] In one possible implementation, the fourth obtaining unit is used to:

[0094] The number of the first intersection points is at least two;

[0095] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0096] A second reference line of the abnormal area is obtained based on the first intersection point and the second intersection point that meet the first preset condition.

[0097] In one possible implementation, the fourth obtaining unit is used to:

[0098] The number of the second intersection points is multiple;

[0099] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0100] A second reference line of the abnormal area is obtained based on the first intersection point and a second intersection point that meets a second preset condition.

[0101] In one possible implementation, the fourth obtaining unit is used to:

[0102] The number of the first intersection points and the second intersection points is at least two;

[0103] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0104] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0105] Based on the first intersection point satisfying the first preset condition and the second intersection point satisfying the second preset condition, a second reference line of the abnormal area is obtained.

[0106] According to a third aspect of the present application, an electronic device is provided, including:

[0107] at least one processor; and

[0108] a memory communicatively connected to the at least one processor; wherein,

[0109] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present application.

[0110] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the present application.

[0111] According to a fifth aspect of the present application, a computer program product is provided, comprising a computer program or instructions, which implement the method described in the present application when executed by a processor.

[0112] The technical solution of the present application can identify or distinguish whether the abnormality in the abnormal area is a crack defect abnormality or an interference abnormality such as a scar or dirt based on two reference lines (a first reference line and a second reference line) in the abnormal area within the detection area.

[0113] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0114] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:

[0115] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0116] Figure 1 The following is a schematic diagram showing the implementation process of the abnormality identification method in the embodiment of the present application. Figure 1 ;

[0117] Figure 2 A schematic diagram of detecting an image in an embodiment of the present application is shown;

[0118] Figure 3 A schematic diagram of the detection area and boundary line in an embodiment of the present application is shown;

[0119] Figure 4 A schematic diagram of an abnormal area in an embodiment of the present application is shown;

[0120] Figure 5 The following is a schematic diagram showing the implementation process of the abnormality identification method in the embodiment of the present application. Figure 2 ;

[0121] Figure 6 A schematic diagram of the direction straight line of the abnormal area in the embodiment of the present application is shown;

[0122] Figure 7 The following is a schematic diagram showing the implementation process of the abnormality identification method in the embodiment of the present application. Figure 3 ;

[0123] Figure 8 A schematic diagram of a normal line of an abnormal area in an embodiment of the present application is shown;

[0124] Fig. 9 A schematic diagram of the structure of an abnormality identification device in an embodiment of the present application is shown;

[0125] Fig.10 A schematic diagram of the structure of an electronic device in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0126] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 those skilled in the art without creative work are within the scope of protection of the present application.

[0127] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0128] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0129] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0130] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0131] It should be understood that in the various embodiments of the present application, the size of the serial number of each implementation process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0132] The technical solution of the present application can identify or differentiate whether the abnormality in the abnormal area is a crack defect abnormality or an interference abnormality such as a scar or dirt based on two reference lines (the first reference line and the second reference line) in the abnormal area within the detection area. The technical solution of the present application can ensure the accuracy of abnormality identification or differentiation, and provide a technical support for the identification of camera hole crack defect abnormalities and interference abnormalities.

[0133] Figure 1 The following is a schematic diagram showing the implementation process of the abnormality identification method in the embodiment of the present application. Figure 1 .like Figure 1 As shown, the method includes:

[0134] S101: Obtain a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified.

[0135] In this step, the object to be identified may be an object on which cracks, scratches, dirt, etc. may occur, such as a camera hole, a display screen, etc. The detection image may include an image of the complete object to be identified, or an image including a portion of the object to be identified. The detection area may be an area in the detection image that is prone to cracks, scratches, and dirt.

[0136] In this application, unless there are special circumstances, the object to be identified is taken as a camera hole as an example. Figure 2 The image shown is a detection image including a portion of the camera hole. In some embodiments, an image including a complete camera hole can be collected and used as a detection image. The image including the complete camera hole can also be segmented to obtain two or more sub-images. Each sub-image includes a portion of the camera hole and can be used as a detection image. The sub-images including a portion of the camera hole can be spliced ​​into an image including a complete camera hole.

[0137] Usually, the detection area is an area of ​​a certain size, and abnormal phenomena such as cracks, scratches, dirt, etc. can occur anywhere in the area. Figure 3 In the figure, the area framed by the black line can be used as the detection area of ​​the detection image.

[0138] The abnormal area in this application refers to the area in the detection area that is prone to abnormalities such as cracks, scratches, dirt, etc. The number of abnormal areas in the detection area may be one, or two or more, such as Figure 4 Abnormal area 1, abnormal area 2 and abnormal area 3 in the detection area. The shape of the abnormal area in the present application can be an irregular shape or a regular shape, and no specific limitation is made. The size of the abnormal area in the present application is not specifically limited, and most of the area of ​​the abnormal area is within the detection area.

[0139] In the technical solution of the present application, the subsequent S102 to S105 solutions can be executed for each abnormal area, so as to realize the recognition or distinction of whether the abnormality of each abnormal area is a crack defect abnormality or an interference abnormality. Differentiating the abnormalities of each abnormal area is a fine-grained abnormality recognition, which can effectively avoid misidentification or missed recognition.

[0140] During implementation, the detection area of ​​the detection image can be input into a trained AI (artificial intelligence) model, so that the confidence of each sub-area in the detection area can be judged through the AI ​​model, so as to realize the recognition of abnormalities such as cracks, scratches, dirt, etc. in the detection area. It can be understood that the abnormality in the detection area identified by the AI ​​model may be an abnormality such as a crack defect, or it may be an interference abnormality such as scratches, dirt, etc. Utilizing the technical solution of the present application, it is possible to recognize or distinguish whether the abnormality in the abnormal area is a crack defect abnormality or an interference abnormality, thereby realizing accurate detection of camera abnormalities. Identifying whether the abnormality is an interference abnormality or a crack defect abnormality also provides a technical support for the fine detection of camera hole abnormalities.

[0141] S102: Based on the boundary information of the detection area, obtain at least two target contours of the detection area.

[0142] In this application, the detection area can be a closed area or a non-closed area. Taking the closed area as an example, the detection area can be composed of multiple boundary lines. Multiple boundary lines are connected end to end in a certain order to form the boundary of the closed area. Figure 3 The boundary lines 1, 2, 3 and 4 in the detection area are connected end to end in sequence to form a detection area. From the multiple boundary lines constituting the detection area, two or more boundary lines that meet the preset contour conditions are determined. The two or more boundary lines that meet the preset contour conditions are used as at least two target contours, wherein at least two target contours are parallel to each other.

[0143] The two boundary lines that meet the preset contour condition may be the two longest boundary lines among the multiple boundary lines. Figure 3 Among the boundary lines 1 to 4 shown, boundary line 1 and boundary line 3 are the same or close in length, boundary line 2 and boundary line 4 are the same or close in length, and the two boundary lines with the longest length are boundary line 2 and boundary line 4. Boundary line 2 and boundary line 4 can be used as the target contours of the detection area. Considering that the object to be identified in this application is a camera hole as an example, the hole itself has a certain thickness, the position of the camera hole lens boundary line 4 can be the outside of the hole, and the position of boundary line 2 can be the inside of the hole, so boundary line 4 and boundary line 2 are parallel to each other. Naturally, in the detection area of ​​the detection image, the two target contours are parallel to each other.

[0144] In this application, the boundary of the detection area and the target contour are described as lines from a simplified perspective. It can be understood that in practical applications, because the object to be identified itself has thickness, the boundary of the detection area and the target contour of the detection area presented in the image can be a line with a certain width. If the width of the line is larger, the boundary of the detection area and the target contour of the detection area are areas of a certain size, rather than lines.

[0145] S103: Based on the boundary information of the abnormal area, obtain a first reference line of the abnormal area.

[0146] In the present application, there are two reference lines for the abnormal area: a first reference line and a second reference line. Because the abnormal area is an area within the detection area, the area has a certain direction within the detection area, and the direction can be represented by two reference lines to a certain extent. If the first reference line is a directional straight line representing the abnormal area, the second reference line can be represented as a directional normal line of the abnormal area. If the first reference line is represented as a directional normal line of the abnormal area, the second reference line can be represented as a directional straight line of the abnormal area.

[0147] Unless otherwise specified, the first reference line in this application is represented as the directional straight line of the abnormal area, and the second reference line is represented as the directional normal line of the abnormal area. The first reference line and the second reference line can be straight lines or line segments, preferably straight lines. During implementation, the shape and size of the abnormal area can be easily known based on the boundary information of the abnormal area. The central axis is made for the area with the shape and size, and the central axis or a part of the line segment on the central axis can be used as the first reference line of the abnormal area.

[0148] S104: Obtain a second reference line of the abnormal area based on the first reference line and at least two target contours.

[0149] If the target contour is a line or approximates a line, the scheme of this step can be: based on the first reference line and two or more contour lines, the second reference line is obtained or calculated. The scheme for obtaining the second reference line is more practical and easy to implement in engineering. Among them, the two contour lines constrain the detection range of the anomaly, and the first reference line gives the direction of the anomaly area. Combining the detection range and direction, the acquisition of the second reference line can ensure the accuracy of calculation or acquisition of the second reference line (direction normal) of the anomaly area. It provides a guarantee for accurately distinguishing the two types of anomalies: interference anomalies and crack defect anomalies.

[0150] S105: Determine the abnormality type of the abnormal area of ​​the object to be identified based on the first reference line and the second reference line.

[0151] In this application, there are two main types of abnormalities, one is a crack defect abnormality, and the other is an interference abnormality such as dirt, scratches, etc. Based on the two reference lines of the abnormal area, the type of abnormality appearing in the abnormal area can be distinguished or identified. Furthermore, in this step, the angle between the first reference line and the second reference line can be obtained based on the reference point on the first reference line and the reference point on the second reference line. Based on the angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0152] S101~S105, based on the boundary information of the detection area, at least two target contours of the detection area are obtained, based on the boundary information of the abnormal area in the detection area, a first reference line of the abnormal area is obtained, based on the first reference line and at least two target contours, a second reference line of the abnormal area is obtained, based on the two reference lines of the abnormal area (the first reference line and the second reference line), it is possible to identify or distinguish whether the abnormality in the abnormal area is a crack defect abnormality, or an interference abnormality such as a scar or dirt, which can ensure the accuracy of abnormality identification or differentiation, and provide a technical support for the identification of crack defect abnormalities and interference abnormalities in camera holes.

[0153] In some embodiments, the above-mentioned solution of obtaining the first reference line of the abnormal area based on the boundary information of the abnormal area can be achieved by Figure 5 The solution shown is to achieve:

[0154] S501: Based on the boundary information of the abnormal area, a minimum circumscribed rectangle of the abnormal area is obtained.

[0155] The abnormal area can be a closed area or a non-closed area. Taking the abnormal area as a closed area as an example, a polygon fitting is performed on the abnormal area according to the boundary of the abnormal area. According to each side of the polygon, the minimum rectangle parallel to each side is obtained to obtain multiple minimum rectangles. From the multiple minimum rectangles, the rectangle with the smallest area is obtained. The rectangle with the smallest area is the minimum circumscribed rectangle of the abnormal area.

[0156] If it will be Figure 4 The lower left corner of the detection image shown is used as the origin of the XOY coordinate system, the right side of the image is the positive direction of the x-axis, and the top of the image is the positive direction of the y-axis to establish the XOY coordinate system. The minimum bounding rectangle of the abnormal area has a center point and a reference angle in the XOY coordinate system. Among them, the horizontal coordinate of the center point of the minimum bounding rectangle is the average value of the maximum horizontal coordinate and the minimum horizontal coordinate on the minimum bounding rectangle. The vertical coordinate of the center point of the minimum bounding rectangle is the average value of the maximum vertical coordinate and the minimum vertical coordinate on the minimum bounding rectangle. A straight line is fitted through the midpoints of the two short sides of the minimum bounding rectangle. The angle between the straight line and the x-axis of the coordinate system is the reference angle of the minimum bounding rectangle.

[0157] S502: Obtain at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detection image.

[0158] In this step, the image attributes include the width value and the height value of the image. Each of the at least two target points has a horizontal and vertical coordinates in the XOY coordinate system. Taking the acquisition of two target points as an example, the horizontal coordinate of the first target point is the first horizontal coordinate, and the vertical coordinate is the first vertical coordinate. The horizontal coordinate of the second target point is the second horizontal coordinate, and the vertical coordinate is the second vertical coordinate. That is, based on the first horizontal coordinate and the first vertical coordinate, the first target point is obtained. Based on the second horizontal coordinate and the second vertical coordinate, the second target point is obtained. In the present application, the horizontal and vertical coordinates of the first target point and the second target point can be obtained in the following manner: based on the horizontal coordinate of the center point of the minimum circumscribed rectangle, the sine value of the reference angle, and the image target value, the first horizontal coordinate and the second horizontal coordinate are obtained. Based on the vertical coordinate of the center point of the minimum circumscribed rectangle, the cosine value of the reference angle, and the image target value, the first vertical coordinate and the second vertical coordinate are obtained.

[0159]

[0160] Among them, start_row and start_col are the horizontal and vertical coordinates of the first target point. end_row and end_col are the horizontal and vertical coordinates of the second target point. flaw_center_row and flow_center_col are the horizontal and vertical coordinates of the minimum circumscribed rectangle. phi is the reference angle. Width and Height are the width and height values ​​of the image.

[0161] From formulas (1) to (4), it can be seen that the coordinates of the target point are related to the width and height of the detected image, rather than preset or fixed values. The coordinates of the target point are calculated according to the actual width and height of the image, which is compatible with images of different sizes. For images of different sizes, the target points suitable for images of different sizes can be calculated according to formulas (1) to (4), thereby obtaining the first reference line suitable for the images. The method is highly practical and conducive to promotion.

[0162] S503: Obtain a first reference line of the abnormal area based on at least two target points.

[0163] In this step, a line segment formed by two or more target points, or a straight line obtained by extending a line segment formed by two or more target points, is used as a direction line of the abnormal area, that is, as a first reference line of the abnormal area. Figure 6 The straight line L1 shown is the direction straight line of the abnormal area. P1 is the center point of the minimum circumscribed rectangle.

[0164] S501 to S503 can be considered as a calculation scheme for the direction line of the abnormal area using the minimum circumscribed rectangle of the abnormal area. Usually, the coverage area of ​​the minimum circumscribed rectangle is larger than the coverage area of ​​the abnormal area, and small anomalies close to the abnormal area can be covered. In this way, the minimum circumscribed rectangle is used instead of the abnormal area to prevent the problem of incomplete anomaly acquisition due to the abnormalities in the abnormal area being too discrete or the small anomalies close to the abnormal area being forgotten. It is also convenient to obtain key information of the anomalies in the anomaly, such as the center point and reference angle of the abnormal area. In this way, a guarantee is provided for the smooth and accurate distinction or identification of the two types of anomalies.

[0165] In the technical solution of the present application, the technical solution of obtaining the second reference line of the abnormal area based on the first reference line and at least two target contours can be achieved by Figure 7 The solution shown in the figure can be used to achieve this. Figure 7 As shown, the method includes:

[0166] S701: Obtain a first intersection point between a first reference line and a first contour, wherein the at least two target contours include the first contour and the second contour.

[0167] In this step, taking the target contour including two contours as an example, the intersection point between the first reference line and the first contour is obtained, and such an intersection point is recorded as the first intersection point.

[0168] S702: Obtain a second intersection point from the first intersection point to the second contour;

[0169] In this step, the intersection point between the first intersection point and the second contour is obtained and recorded as the second intersection point.

[0170] S703: Based on the first intersection point and the second intersection point, obtain a second reference line of the abnormal area.

[0171] In this step, the straight line passing through the first intersection point and the second intersection point is used as the direction normal line of the abnormal area, that is, as the second reference line of the abnormal area.

[0172] In S701 to S703, the second reference line is obtained based on two intersection points (the first intersection point and the second intersection point). It is easy to implement in engineering and has strong scalability. Among them, the first intersection point is the intersection point of the first reference line and the first contour, and the second intersection point is the intersection point of the first intersection point to the second contour. Based on the contour line and the first reference line, the second reference line is obtained, which can ensure the calculation or acquisition accuracy of the second reference line.

[0173] In practical applications, the first contour can be approximately regarded as a line, or as an area of ​​a certain size. Thus, the number of intersections between the first reference line and the first contour can be one, or at least two.

[0174] If the number of the first intersection points is two or more, then the scheme for obtaining the second reference line of the abnormal area based on the first intersection points and the second intersection points may be: obtaining the first intersection point satisfying the first preset condition from at least two first intersection points; obtaining the second reference line of the abnormal area based on the first intersection point and the second intersection point satisfying the first preset condition. Among them, the point satisfying the first preset condition may be the point with the shortest distance from the center point of the minimum circumscribed rectangle of the abnormal area among the two or more first intersection points. The straight line passing through the point satisfying the first preset condition and the second intersection point is used as the second reference line.

[0175] If the number of the second intersection points is two or more, then the scheme for obtaining the second reference line of the abnormal area based on the first intersection point and the second intersection point may be: obtaining the second intersection point satisfying the second preset condition from the two or more second intersection points; obtaining the second reference line of the abnormal area based on the first intersection point and the second intersection point satisfying the second preset condition. Among them, the point satisfying the second preset condition may be the point with the shortest distance to the first intersection point among the two or more second intersection points. The straight line passing through the first intersection point and the second intersection point satisfying the second preset condition is used as the second reference line.

[0176] If the number of the first intersection points and the second intersection points is at least two, then based on the first intersection points and the second intersection points, the scheme for obtaining the second reference line of the abnormal area may be: obtaining the first intersection points satisfying the first preset condition from at least two first intersection points; obtaining the second intersection points satisfying the second preset condition from at least two second intersection points; obtaining the second reference line of the abnormal area based on the first intersection points satisfying the first preset condition and the second intersection points satisfying the second preset condition. The first preset condition and the second preset condition refer to the above description. The straight line passing through the first intersection points satisfying the first preset condition and the second intersection points satisfying the second preset condition is used as the second reference line.

[0177] The following is an exemplary description of the schemes S701 to S703.

[0178] Taking the first contour and the second contour as approximations of boundary line 4 and boundary line 2 as an example, the intersection of direction line L1 and boundary line 4 is obtained. If there are two or more intersections between direction line L1 and boundary line 4, the distance between the center point P1 of the minimum circumscribed rectangle and each of these intersections is calculated. The intersection with the shortest distance to the center point P1 of the minimum circumscribed rectangle is taken as a valid intersection that meets the first preset condition. Figure 8 The intersection point P2 shown in FIG. Calculate the distances from P2 to all points on boundary line 2. From these distances, select the shortest distance. The point on boundary line 2 that is the shortest distance from P2 is taken as a valid intersection point that meets the second preset condition, such as Figure 8The intersection point P3 is shown. According to the effective intersection points P2 and P3, a straight line is fitted to obtain the directional normal L2 of the abnormal area. It can be understood that boundary line 2 and boundary line 4 are a set of parallel lines, and P2 and P3 are points on the parallel lines. It is known that the line extending from the minimum distance from one point of a parallel line to another parallel line is perpendicular to the parallel lines. Therefore, the straight line L2 fitted by the two points P2 and P3 on the parallel lines can be regarded as a line perpendicular to boundary line 2 and boundary line 4, so L2 can be regarded as the directional normal of the abnormal area.

[0179] In the present application, the coordinates of P1, P2 and P3 in the XOY coordinate system are easy to obtain, and P1 is on L1, P2 is on L1 and L2, and P3 is on L2. Using the coordinates of the points on L1 and the points on L2, it is easy to obtain the angle between L1 and L2 in the XOY coordinate system.

[0180] The angle between L1 and L2 may be an acute angle or an obtuse angle. If it is an obtuse angle, the above-mentioned scheme for determining the abnormal type of the abnormal area of ​​the object to be identified based on the included angle may be: in response to the included angle being a non-acute angle, converting the included angle into an acute angle; and determining the abnormal type of the abnormal area of ​​the object to be identified based on the converted acute angle.

[0181] In the present application, in response to the angle being an acute angle and satisfying the first condition, that is, the angle being an acute angle, the angle value is zero or close to zero (the difference between the angle and 0 degrees is less than or equal to the first threshold value such as 3 degrees, 4 degrees), the abnormal type of the abnormal area of ​​the object to be identified is determined to be a crack defect type. In response to the angle being an acute angle and satisfying the second condition, that is, the angle being an acute angle, the angle value is 90 degrees or close to 90 degrees (the difference between 90 degrees and the angle is less than or equal to the second threshold value such as 2 degrees, 3 degrees), the abnormal type of the abnormal area of ​​the object to be identified is determined to be an interference defect type.

[0182] The main consideration is that for the camera hole, the crack defect is usually perpendicular or nearly perpendicular to the target contour, while the interference anomalies such as scratches, dirt, background, etc. are usually parallel to or non-perpendicular to the target contour, and the angle formed with the target contour is large. In the technical solution of this application, the angle between L1 and L2 is judged to distinguish whether the abnormality in the abnormal area is a crack defect abnormality or an interference abnormality. It provides a technical support for the identification of crack defect abnormalities and interference abnormalities in camera holes.

[0183] In practical applications, the number of abnormal areas appearing in the detection area may be one. The above scheme can be executed for each abnormal area, so as to realize the type of abnormality appearing in each abnormal area, such as crack defect abnormality or interference abnormality such as dirt and scratches. The number of abnormal areas appearing in the detection area may be two or more. For abnormal areas with a larger area, the above scheme can be adopted to realize the identification of the type of abnormality appearing in the abnormal area. For two or more abnormal areas with a small area and a close distance, such abnormal areas are likely to be different areas affected by the same abnormality. In this way, in order to achieve high efficiency of abnormal identification, such abnormal areas can be merged. Specifically, in response to the presence of two or more abnormal areas that meet the preset merging conditions in the detection area, the two or more abnormal areas that meet the preset merging conditions are merged; based on the boundary information of the merged abnormal area, a first reference line of the merged abnormal area is obtained. Based on the first reference line and at least two target contours, a second reference line of the merged abnormal area is obtained. Based on the first reference line and the second reference line, the abnormal type of the abnormal area of ​​the object to be identified is determined. Among them, the preset merging conditions are met for two or more abnormal areas with a small area and a close distance. In implementation, the merged abnormal area can be treated as a regular abnormal area, using the following method: Figure 1 The technical solution shown realizes the identification of the types of anomalies occurring in the merged anomaly area.

[0184] In layman's terms, the technical solution of the present application obtains a parallel target contour by detecting the boundary information of the area. The target contour provides a basic guarantee for obtaining or calculating the direction straight line and the direction normal of the abnormal area. The problem of incomplete coverage of the abnormal area can be avoided by using the minimum circumscribed rectangle of the abnormal area to replace the abnormal area existing in the detection area. The direction straight line of the abnormal area is obtained by using the center point and reference angle of the minimum circumscribed rectangle. The direction normal of the abnormal area is obtained by the effective intersection of the direction straight line and a contour in the target contour, and the distance relationship between the effective intersection and another contour in the target contour.

[0185] Among them, in the scheme for obtaining the direction line, the influence of the width and height values ​​of the detection image on the two target points on the direction line is taken into account. Therefore, the width and height values ​​are taken into account in the formula for calculating the coordinates of the target points. In this way, it can be compatible with defects and images of different sizes, increasing the versatility of the scheme.

[0186] Normally, the normal line will change with the shape of the contour. In this application, the direction normal line of the abnormal area is obtained through the distance relationship between the effective intersection point of the direction straight line and one contour in the target contour and another contour in the target contour, which can reduce the influence of the contour shape on the normal line calculation. This normal line calculation scheme of the present application is applicable to contours with linear shapes and also to contours with nonlinear shapes. It has a wide range of uses, making the abnormal type differentiation scheme of the present application more universal.

[0187] The technical solution of the present application can realize the identification of abnormal crack defects and interference anomalies in camera holes, and provides a technical support for the accurate identification of abnormalities in camera holes.

[0188] The present application provides an abnormality identification device, such as Fig. 9 As shown, the device includes:

[0189] A first obtaining unit 901 is used to obtain a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified;

[0190] A second obtaining unit 902 is used to obtain at least two target contours in the detection area based on the boundary information of the detection area;

[0191] A third obtaining unit 903 is used to obtain a first reference line of the abnormal area based on the boundary information of the abnormal area;

[0192] A fourth obtaining unit 904 is configured to obtain a second reference line of the abnormal area based on the first reference line and the at least two target contours;

[0193] The determination unit 905 is configured to determine an abnormality type of the abnormal area of ​​the object to be identified based on the first reference line and the second reference line.

[0194] In this application, the third obtaining unit 903 is used to:

[0195] Based on the boundary information of the abnormal area, obtaining the minimum circumscribed rectangle of the abnormal area;

[0196] Obtain at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detection image;

[0197] Based on at least two target points, a first reference line of the abnormal area is obtained.

[0198] In this application, the fourth obtaining unit 904 is used to:

[0199] The at least two target profiles include a first profile and a second profile;

[0200] Obtaining a first intersection point between the first reference line and the first contour;

[0201] Obtain a second intersection point from the first intersection point to the second contour;

[0202] Based on the first intersection point and the second intersection point, a second reference line of the abnormal area is obtained.

[0203] In this application, the determining unit 905 is used to:

[0204] Based on the reference point on the first reference line and the reference point on the second reference line, obtain the angle between the first reference line and the second reference line;

[0205] Based on the angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0206] In this application, the second obtaining unit 902 is used to:

[0207] The detection area is composed of a plurality of boundary lines;

[0208] From the plurality of boundary lines, determining two or more boundary lines that meet a preset contour condition;

[0209] Two or more boundary lines that meet preset contour conditions are used as at least two target contours, and the at least two target contours are parallel to each other.

[0210] In this application, the third obtaining unit 903 is used to:

[0211] The image attributes include the width and height of the image;

[0212] Based on the abscissa of the center point of the minimum circumscribed rectangle, the sine value of the reference angle, and the image target value, a first abscissa and a second abscissa are obtained;

[0213] Obtaining a first ordinate and a second ordinate based on the ordinate of the center point of the minimum circumscribed rectangle, the cosine value of the reference angle, and the image target value;

[0214] Based on the first horizontal coordinate and the first vertical coordinate, obtain a first target point;

[0215] Based on the second horizontal coordinate and the second vertical coordinate, obtain a second target point;

[0216] The image target value is obtained by performing a square root operation on the sum of the squares of the width value and the height value of the image.

[0217] In this application, the determining unit 905 is used to:

[0218] In response to the included angle being a non-acute angle, converting the included angle into an acute angle;

[0219] Based on the converted acute angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

[0220] In this application, the determining unit 905 is used to:

[0221] In response to the angle being an acute angle and satisfying the first condition, determining that the abnormality type of the abnormal area of ​​the object to be identified is a crack defect type;

[0222] In response to the angle being an acute angle and satisfying the second condition, it is determined that the abnormality type of the abnormal area of ​​the object to be identified is an interference defect type.

[0223] In this application, the third obtaining unit 903 is used to:

[0224] In response to the presence of two or more abnormal areas satisfying a preset merging condition in the detection area, merging the two or more abnormal areas satisfying the preset merging condition;

[0225] Based on the boundary information of the merged abnormal area, a first reference line of the merged abnormal area is obtained.

[0226] In this application, the fourth obtaining unit 904 is used to:

[0227] The number of the first intersection points is at least two;

[0228] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0229] A second reference line of the abnormal area is obtained based on the first intersection point and the second intersection point that meet the first preset condition.

[0230] In this application, the fourth obtaining unit 904 is used to:

[0231] The number of the second intersection points is multiple;

[0232] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0233] A second reference line of the abnormal area is obtained based on the first intersection point and a second intersection point that meets a second preset condition.

[0234] In this application, the fourth obtaining unit 904 is used to:

[0235] The number of the first intersection points and the second intersection points is at least two;

[0236] Obtaining a first intersection point satisfying a first preset condition from at least two first intersection points;

[0237] Obtaining a second intersection point satisfying a second preset condition from the at least two second intersection points;

[0238] Based on the first intersection point satisfying the first preset condition and the second intersection point satisfying the second preset condition, a second reference line of the abnormal area is obtained.

[0239] It should be noted that the abnormality identification device of the embodiment of the present application solves the problem in a similar principle to the aforementioned abnormality identification method. Therefore, the implementation process and implementation principle of the abnormality identification device can refer to the description of the implementation process and implementation principle of the aforementioned method, and the repeated parts will not be repeated.

[0240] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0241] The electronic device includes at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the abnormality identification method described in the present application. The computer instructions are used to enable the computer to perform the abnormality identification method described in the present application.

[0242] The present application also provides a computer program product, including a computer program / instruction, which implements the abnormality identification method of the present application when executed by a processor.

[0243] Fig.10 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0244] like Fig.10 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0245] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0246] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as an abnormal identification method. For example, in some embodiments, the abnormal identification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or a communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the abnormal identification method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the abnormal identification method in any other appropriate manner (e.g., by means of firmware).

[0247] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0248] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0249] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0250] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0251] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0252] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0253] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for identifying anomalies, characterized in that: include: Obtaining a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified; Based on the boundary information of the detection area, obtaining at least two target contours of the detection area; Based on the boundary information of the abnormal area, obtaining a first reference line of the abnormal area; Based on the first reference line and the at least two target contours, obtaining a second reference line of the abnormal area; Based on the first reference line and the second reference line, an abnormality type of the abnormal area of ​​the object to be identified is determined.

2. The method according to claim 1, characterized in that The obtaining, based on the boundary information of the abnormal area, a first reference line of the abnormal area comprises: Based on the boundary information of the abnormal area, obtaining the minimum circumscribed rectangle of the abnormal area; Obtain at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detection image; Based on at least two target points, a first reference line of the abnormal area is obtained.

3. The method according to claim 1, characterized in that: The obtaining, based on the first reference line and the at least two target contours, a second reference line of the abnormal area comprises: The at least two target profiles include a first profile and a second profile; Obtaining a first intersection point between the first reference line and the first contour; Obtain a second intersection point from the first intersection point to the second contour; Based on the first intersection point and the second intersection point, a second reference line of the abnormal area is obtained.

4. The method according to any one of claims 1 to 3, characterized in that: The determining, based on the first reference line and the second reference line, the abnormality type of the abnormal area of ​​the object to be identified includes: Based on the reference point on the first reference line and the reference point on the second reference line, obtain the angle between the first reference line and the second reference line; Based on the angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

5. The method according to claim 1, characterized in that The obtaining at least two target contours of the detection area based on the boundary information of the detection area includes: The detection area is composed of a plurality of boundary lines; From the plurality of boundary lines, determining two or more boundary lines that meet a preset contour condition; Two or more boundary lines that meet preset contour conditions are used as at least two target contours, and the at least two target contours are parallel to each other.

6. The method according to claim 2, characterized in that The obtaining of at least two target points based on the center point of the minimum circumscribed rectangle, the reference angle, and the image attributes of the detected image includes: The image attributes include the width and height of the image; Based on the abscissa of the center point of the minimum circumscribed rectangle, the sine value of the reference angle, and the image target value, a first abscissa and a second abscissa are obtained; Obtaining a first ordinate and a second ordinate based on the ordinate of the center point of the minimum circumscribed rectangle, the cosine value of the reference angle, and the image target value; Based on the first horizontal coordinate and the first vertical coordinate, obtain a first target point; Based on the second horizontal coordinate and the second vertical coordinate, obtain a second target point; The image target value is obtained by performing a square root operation on the sum of the squares of the width value and the height value of the image.

7. The method according to claim 4, characterized in that The determining, based on the angle, the abnormal type of the abnormal area of ​​the object to be identified, comprises: In response to the included angle being a non-acute angle, converting the included angle into an acute angle; Based on the converted acute angle, the abnormality type of the abnormal area of ​​the object to be identified is determined.

8. An abnormality identification device, characterized in that: include: A first obtaining unit, used to obtain a detection area of ​​a detection image and an abnormal area within the detection area, wherein the detection area includes an object to be identified; A second obtaining unit, configured to obtain at least two target contours of the detection area based on the boundary information of the detection area; A third obtaining unit, configured to obtain a first reference line of the abnormal area based on the boundary information of the abnormal area; a fourth obtaining unit, configured to obtain a second reference line of the abnormal area based on the first reference line and the at least two target contours; A determination unit is used to determine an abnormality type of the abnormal area of ​​the object to be identified based on the first reference line and the second reference line.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-7.