Burr detection method, device and storage medium

By using a combination of a monocular camera and a low-angle light source above a metal workpiece, along with a segmentation model and physical space coordinates, an automated assessment of burr height and grade is achieved, solving the problems of high inspection costs and demanding installation requirements in existing technologies.

CN116735605BActive Publication Date: 2026-03-20CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, burr detection at the drilled holes of metal workpieces is costly and requires sophisticated equipment installation, making it impossible to effectively assess the height and severity of burrs.

Method used

A monocular camera positioned above the metal workpiece and a low-angle light source are used to capture images of the perforated parts. Burrs are detected using a trained segmentation model, burr height values ​​are extracted, and the burr level is evaluated by combining the physical space coordinate relationship.

Benefits of technology

This technology enables automated assessment of the height and severity of burrs while reducing testing costs and equipment installation requirements, thus avoiding the impact of burrs on equipment performance and lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116735605B_ABST
    Figure CN116735605B_ABST
Patent Text Reader

Abstract

The application provides a burr detection method and device and a storage medium, and relates to the field of detection. The method avoids using a high-precision sensor and an optical microscope with high cost and high installation precision by adopting a camera and a low-angle light source arranged above a metal workpiece to shoot a punching position of the metal workpiece, obtain a punching image, and detect whether a burr exists according to the shot punching image. When it is detected that the burr exists, a burr height value is extracted according to edge information of the burr, and the burr height value is corresponded with a grade, so that automatic detection of the burr of the metal workpiece is realized. The enterprise can evaluate the severity and grade of the burr according to the height of the burr while reducing the detection cost and installation requirement of the detection device, and the influence of the metal burr on the use performance and service life of equipment is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of detection, in particular to a burr detection method, device and storage medium. BACKGROUND

[0002] In the field of mechanical processing technology, it is necessary to punch holes in the middle of metal workpieces. However, due to reasons such as tool edge aging or cutting force, burrs often occur at the edges of metal holes. If these burrs are not treated, they will affect the assembly, use performance and service life of the parts, so after the metal workpiece is processed, strict punch quality detection and burr removal operations are required.

[0003] In the prior art, the detection method for the punch hole of a metal workpiece includes manually inspecting the quality of the metal punch hole, or using an expensive 3D high-precision sensor to detect the height information of the metal surface to determine whether there is a burr anomaly. Some manufacturers use a 2D image vision method to detect defects in the punch hole. However, these methods can only determine whether there is a burr defect, and do not consider the height of the burr. Due to cost constraints, the installation requirements of the camera cannot be strictly standardized, so the severity and grade of the burr cannot be evaluated according to the height of the burr.

[0004] The prior art still has deficiencies in terms of high detection cost and high installation requirements of the detection device, which makes it impossible to evaluate the severity and grade of the burr according to the height of the burr. SUMMARY

[0005] The present application provides a burr detection method, device and storage medium to solve the problem that the detection cost is high and the installation requirements of the detection device are high, which makes it impossible to evaluate the severity and grade of the burr according to the height of the burr.

[0006] In a first aspect, the present application provides a burr detection method, comprising:

[0007] Obtaining a shooting image of a workpiece shot by a camera, and obtaining a target rectangular region according to the shooting image, wherein the camera is vertically placed above the workpiece, a low-angle light source is further arranged above the workpiece, the light source is used to irradiate the punch hole edge of the workpiece, and the target rectangular region includes a punch hole image;

[0008] Obtaining a segmentation region according to the target rectangular region, and obtaining the number of pixels of the segmentation region, wherein the segmentation region is a highlight and irregular connected region in the target rectangular region;

[0009] If the number of pixels is greater than a first threshold, a set of edge points in the segmentation region is extracted, and an edge straight line equation in the segmentation region is obtained according to the set of edge points; a burr height line segment is obtained according to the edge straight line equation and an upper edge point in the segmentation region;

[0010] A physical space coordinate relationship between the camera and the workpiece punching surface is established through a calibration plate, a burr actual height is obtained according to the burr height line segment and the physical space coordinate relationship, and if the burr actual height is greater than a second threshold, it is determined that the grade of the current burr is unqualified, otherwise, it is qualified.

[0011] In a possible design, the segmentation region is obtained according to the target rectangular region, including: selecting a highlighted and irregular connected region in the target rectangular region through a segmentation network, and taking the selected connected region as the segmentation region, wherein the area of the connected region is in a proportional relationship with the height of the burr.

[0012] In a possible design, the set of edge points in the segmentation region is extracted, including: establishing an image coordinate relationship in the segmentation region, and extracting a coordinate set of points on an edge contour in the segmentation region, and traversing the coordinate set of points on the edge contour in turn from bottom to top, from top to bottom, from left to right and from right to left to obtain a lower edge point set, an upper edge point set, a left edge point set and a right edge point set, and obtaining the set of edge points according to the lower edge point set, the upper edge point set, the left edge point set and the right edge point set.

[0013] In a possible design, the set of edge points is obtained according to the lower edge point set, the upper edge point set, the left edge point set and the right edge point set, including:

[0014] A first intersection of the lower edge point set and the left edge point set is obtained, if the number of edge points in the first intersection is greater than or equal to a third threshold, the first intersection is taken as a new lower edge point set, otherwise, the first intersection is taken as a new left edge point set;

[0015] A second intersection of the upper edge point set and the left edge point set is obtained, if the number of edge points in the second intersection is greater than or equal to the third threshold, the second intersection is taken as a new upper edge point set, otherwise, the second intersection is taken as a new left edge point set;

[0016] A third intersection of the upper edge point set and the right edge point set is obtained, if the number of edge points in the third intersection is greater than or equal to the third threshold, the third intersection is taken as a new upper edge point set, otherwise, the third intersection is taken as a new right edge point set;

[0017] acquiring a fourth intersection of the lower edge point set and the right edge point set, if a number of edge points in the fourth intersection is greater than or equal to a third threshold value, taking the fourth intersection as a new lower edge point set, otherwise taking the fourth intersection as a new right edge point set;

[0018] acquiring the edge point set according to the new edge point set and the unchanged edge point set.

[0019] In a possible design, the acquiring the edge straight line equation in the segmentation region according to the edge point set comprises:

[0020] acquiring a lower edge straight line equation according to the lower edge point set in the edge point set, so that a distance between a straight line indicated by the lower edge straight line equation and a plurality of lower edge points in the lower edge point set is minimum;

[0021] acquiring a left edge straight line equation according to the left edge point set in the edge point set, so that a distance between a straight line indicated by the left edge straight line equation and a plurality of left edge points in the left edge point set is minimum;

[0022] acquiring a right edge straight line equation according to the right edge point set in the edge point set, so that a distance between a straight line indicated by the right edge straight line equation and a plurality of right edge points in the right edge point set is minimum.

[0023] In a possible design, before the acquiring the burr height line segment according to the edge straight line equation and the upper edge point in the segmentation region, the method further comprises: confirming whether the straight line indicated by the lower edge straight line equation passes through an optical center, wherein the optical center is a point on an optical axis of the camera;

[0024] if the straight line indicated by the lower edge straight line equation passes through the optical center, sending prompt information to the user end to remind the user to adjust the position of the workpiece;

[0025] if the straight line indicated by the lower edge straight line equation does not pass through the optical center, determining to perform the step of acquiring the burr height line segment according to the edge straight line equation and the upper edge point in the segmentation region.

[0026] In a possible design, the acquiring the burr height line segment according to the edge straight line equation and the upper edge point in the segmentation region comprises: translating the straight line indicated by the lower edge straight line equation in the edge straight line equation upward to acquire a translated straight line, so that a target upper edge point in the edge point set passes through the translated straight line, wherein the target upper edge point has a shortest distance to the straight line indicated by the lower edge straight line equation; acquiring a corresponding translated straight line equation according to the translated straight line; and acquiring the burr height line segment according to the translated straight line equation, the edge straight line equation and the upper edge point.

[0027] In a possible design, the obtaining of the burr height line segment according to the translation straight line equation, the edge straight line equation, and the upper edge point includes the following steps.

[0028] Obtaining a vertex formed by intersection between a straight line indicated by the translation straight line equation and each straight line indicated by the edge straight line equation, where the vertex includes a first intersection point, a second intersection point, a third intersection point, and a fourth intersection point.

[0029] Obtaining a first line segment composed of the first intersection point and the second intersection point, and a second line segment composed of the third intersection point and the fourth intersection point, where the first line segment and the second line segment are parallel to the straight line indicated by the translation straight line equation, and the second line segment is a line segment away from the upper edge point.

[0030] Equally dividing the first line segment and the second line segment respectively, and obtaining a plurality of equally divided points on the respective line segments, where the number of equally divided points of the first line segment is the same as the number of equally divided points of the second line segment, and the plurality of equally divided points of the first line segment are selected as a first equally divided point set, and the plurality of equally divided points of the second line segment are selected as a second equally divided point set.

[0031] Obtaining a burr height line segment according to the first equally divided point set, the second equally divided point set, and the upper edge point.

[0032] In a possible design, the obtaining of the burr height line segment according to the first equally divided point set, the second equally divided point set, and the upper edge point includes the following steps.

[0033] Obtaining a plurality of intersection points of a plurality of straight lines indicated by the intersection straight line equations and the upper edge point set in the segmentation region, and selecting the plurality of intersection points as a third equally divided point set, where the intersection points are upper edge points in the upper edge point set that are closest to the straight lines indicated by the intersection straight line equations, and the number of the plurality of intersection points is the same as the number of the intersection straight line equations.

[0034] Obtaining a plurality of line segments composed of equally divided points in the second equally divided point set and corresponding intersection points in the third equally divided point set, and taking the line segments as the burr height line segments, obtaining a plurality of the burr height line segments, and recording coordinates of the equally divided points in the second equally divided point set and the corresponding intersection points in the third equally divided point set that constitute the burr height line segments.

[0035] In a possible design, the obtaining of the burr actual height according to the burr height line segment and the physical space coordinate relationship includes the following steps.

[0036] obtaining a burr lower edge space coordinate through a correspondence between the physical space coordinate and the image coordinate of the burr height line segment, the burr lower edge space coordinate comprising a burr lower edge space horizontal coordinate and a burr lower edge space vertical coordinate, the correspondence being realized through the following formula:

[0037] λ[Mi1.x, Mi1.y, 1] T = Q[Xi, Yi, 0, 1];

[0038] wherein λ is a preset constant, Q is a constant matrix, Mi1.x is a horizontal coordinate of a bisecting point in a second set of bisecting points constituting the burr height line segment, Mi1.y is a vertical coordinate of the bisecting point in the second set of bisecting points, Xi is the burr lower edge space horizontal coordinate, and Yi is the burr lower edge space vertical coordinate;

[0039] after obtaining the burr lower edge space coordinate, and according to the burr lower edge space coordinate, obtaining a burr actual height through the following formula:

[0040] λ[Mi2.x, Mi2.y, 1] T = Q[Xi, Yi, Zi, 1] T ;

[0041] wherein λ is a preset constant, Q is a constant matrix, Mi2.x is a horizontal coordinate of a bisecting point in a third set of bisecting points constituting the burr height line segment, Mi2.y is a vertical coordinate of the bisecting point in the third set of bisecting points, Xi is the burr lower edge space horizontal coordinate, Yi is the burr lower edge space vertical coordinate, and Zi is the burr actual height.

[0042] In a second aspect, the present application provides a burr detection processing device, comprising:

[0043] an obtaining module, configured to obtain a shooting image of a workpiece shot by a camera, and obtain a target rectangular region according to the shooting image, wherein the camera is vertically placed above the workpiece, a low-angle light source is further arranged above the workpiece, the light source is used for irradiating a punching edge of the workpiece, and the target rectangular region comprises a punching image;

[0044] a first processing module, configured to obtain a segmentation region according to the target rectangular region, and obtain a pixel number of the segmentation region, the segmentation region being a highlight and irregular connected region in the target rectangular region;

[0045] The second processing module is configured to, if the number of pixels is greater than a first threshold, extract a set of edge points in the segmentation region, obtain an edge straight line equation in the segmentation region according to the set of edge points, and obtain a burr height line segment according to the edge straight line equation and an upper edge point in the segmentation region.

[0046] The execution module is configured to establish a physical space coordinate relationship between the camera and the punching surface of the workpiece by using a calibration plate, obtain an actual burr height according to the burr height line segment and the physical space coordinate relationship, and determine that the grade of the current burr is unqualified if the actual burr height is greater than a second threshold, or otherwise, the grade of the current burr is qualified.

[0047] In a third aspect, the present application provides an electronic device, comprising a processor and a memory connected with the processor in communication;

[0048] The memory stores computer execution instructions;

[0049] The processor executes the computer execution instructions stored in the memory to implement the burr detection processing method.

[0050] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the burr detection processing method.

[0051] The burr detection method, device and storage medium provided by the present application avoid the use of high-precision sensors and optical microscopes with high installation precision by using a monocular camera (i.e., a camera) and a low-angle light source arranged above a metal workpiece to capture a punching position of the metal workpiece and obtain a punching image. The punching image is sent into a trained segmentation model to detect whether there is a burr. When a burr is detected, the burr height value is extracted according to the edge information of the burr, and the burr height value is corresponded to the grade, so as to realize the automatic detection of the metal burr of the metal workpiece. The enterprise can evaluate the severity and grade of the burr according to the height of the burr while reducing the detection cost and the installation requirement of the detection device, thereby avoiding the influence of the metal burr on the use performance and working life of the equipment. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative effort.

[0053] Figure 1A flowchart of a burr detection method provided for an embodiment of the present application Figure 1 ;

[0054] Figure 2 A flowchart of a burr detection method provided for an embodiment of the present application Figure 2 ;

[0055] Figure 3 A block diagram of a collection system provided for an embodiment of the present application

[0056] Figure 4 An image segmentation diagram provided for an embodiment of the present application

[0057] Figure 5 An image traversal direction diagram provided for an embodiment of the present application

[0058] Figure 6 A traversal extraction diagram provided for an embodiment of the present application

[0059] Figure 7 A lower edge equation diagram provided for an embodiment of the present application

[0060] Figure 8 An intersection diagram provided for an embodiment of the present application

[0061] Figure 9 A crossing straight line diagram provided for an embodiment of the present application

[0062] Figure 10 A burr height line segment diagram provided for an embodiment of the present application

[0063] Figure 11 A structural diagram of a burr detection processing device provided for an embodiment of the present application

[0064] Figure 12 A structural diagram of an electronic device provided for an embodiment of the present application DETAILED DESCRIPTION

[0065] The exemplary embodiments will be described in detail herein below with reference to the drawings. In the following description, the same drawings reference numbers are used to denote like or similar elements. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work, fall within the scope of the present application.

[0066] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application and in the above-described drawings mean for distinguishing similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of data so designated is meant to be inter-changeable in order to demonstrate embodiments of the present application herein described without departing from the scope of the present application.

[0067] Drilling is one of the important methods in machining, widely exists in high-end equipment manufacturing, at the same time, due to the good ductility of metal, and the aging of machining tool or cutting force, etc., in the drilling process of metal workpiece, burr is easily formed at the outlet or inlet, which will cause the size error of the part edge, increase the complexity of assembly and cause the failure of assembly position stress meter, therefore, metal burr has become an important factor affecting the use performance and working life of equipment, and strict punching quality detection needs to be carried out on the processed workpiece to reduce the influence of metal burr on equipment.

[0068] In the prior art, the method for detecting metal burr includes manual detection of metal punching processing burr, such as hanging wire method and magnification method, but for the defects not obvious, such as small burr height, workers need to repeatedly touch by hand to determine whether the burr exists, which needs to stop the production line, and the production efficiency and detection efficiency are very low, the prior art also includes an accurate measurement method mainly based on high-precision sensors and optical microscopes, and a method for detecting metal punching burr based on machine vision, which adopts multiple light sources to light at the same time, and uses image algorithm to detect whether there is a defect, although the accurate measurement method mainly based on high-precision sensors and optical microscopes can accurately detect the shape, height and other related parameters of the burr, the measurement speed is slow, especially for large workpieces, a lot of time is needed for measurement, and at the same time, due to the limitation of production cost of enterprises, it is difficult to meet the high cost of high-precision sensors and the high-precision installation requirement of optical microscopes.

[0069] The present application provides a burr detection method, which adopts a monocular camera and a low-angle light source arranged above the metal workpiece to shoot the punching position of the metal part, obtains a punching image, avoids the use of high-precision sensors with high cost and optical microscopes with high installation precision, and sends the shooting punching image into a trained segmentation model to detect whether there is a burr, when the burr is detected, the burr height value is extracted according to the edge information of the burr, and the burr height value is corresponding to the grade, so as to realize the automatic detection operation of the metal burr of the metal part, so that the enterprise can evaluate the severity and grade of the burr according to the height of the burr while reducing the detection cost and installation requirement of the detection device, and avoid the influence of the metal burr on the use performance and working life of the equipment.

[0070] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0071] Example 1

[0072] Figure 1 Burr detection method flowchart provided for the embodiments of the present application Figure 1 , Figure 3 The system block diagram for collecting Figure 4 The image segmentation diagram. As shown in Figure 1 、 Figure 3 and Figure 4 , the method comprises:

[0073] S101, acquiring a shooting image of a workpiece shot by a camera, and acquiring a target rectangular region according to the shooting image, wherein the camera is vertically placed above the workpiece, a low-angle light source is further arranged above the workpiece, the light source is used to irradiate the punching edge of the workpiece, and the target rectangular region includes a punching image;

[0074] Specifically, as shown in Figure 3 , after drilling the metal workpiece, the light source is controlled to irradiate the punching edge of the metal workpiece, so that the light source directly irradiates the punching edge of the metal workpiece with burrs, a high-light region is formed on the side with burrs, and a relatively dark region is formed on the other side away from the burrs. At this time, it is easy to distinguish the burr region, and a shooting image is acquired by a vertically placed monocular camera, i.e., a camera, and the shooting image is detected by an image target detection network such as YOLO (You Only Look Once), Fast-RCNN (Convolutional neural networks), etc. Network to obtain the target rectangular region where the hole is located, thereby avoiding the interference of background object imaging on subsequent segmentation extraction.

[0075] S102, acquiring a segmentation region according to the target rectangular region, and acquiring the number of pixels of the segmentation region, the segmentation region being a high-light, irregular connected region in the target rectangular region;

[0076] Specifically, as shown in Figure 4As shown, after obtaining the target rectangular region where the hole is located through the image target detection network, in the obtained target rectangular region, the highlight and irregular connected region in the target rectangular region, that is, the region where the burr is imaged due to the reflection of the part perpendicular to the surface, is obtained through a segmentation network such as segformer and segnet. The obtained highlight and irregular connected region is taken as a segmentation region, and the number of pixels in the segmentation region is obtained.

[0077] S103, if the number of pixels is greater than a first threshold, a set of edge points in the segmentation region is extracted, an edge straight line equation in the segmentation region is obtained according to the set of edge points, and a burr height line segment is obtained according to the edge straight line equation and the upper edge point in the segmentation region.

[0078] Specifically, after obtaining the segmentation region through the segmentation network and obtaining the number of pixels in the segmentation region, when it is detected that the number of pixels obtained is greater than the first threshold, it is confirmed that there is a burr at the hole of the current metal workpiece, and the burr height needs to be further obtained. The coordinate set of the edge contour point in the segmentation region is extracted, and the edge point set of different edge regions is obtained by traversing the edge contour point from four directions respectively. The edge straight line equation corresponding to each edge region is obtained according to the edge point set of different edge regions, and the translated straight line equation is extracted according to the lower edge straight line equation corresponding to the lower edge region. The burr height line segment is obtained based on the lower edge straight line equation, the translated straight line equation and the upper edge point set of the upper edge region.

[0079] S104, the physical space coordinate relationship between the camera and the hole surface of the workpiece is established through the calibration plate, the actual height of the burr is obtained according to the burr height line segment and the physical space coordinate relationship, and if the actual height of the burr is greater than a second threshold, it is confirmed that the grade of the current burr is unqualified, otherwise it is qualified.

[0080] Specifically, after obtaining the burr height line segment reflecting the burr height in the image, the physical space coordinate relationship between the camera and the hole surface of the metal workpiece is established, and the image coordinates of the two endpoints in the burr height line segment are brought into the preset corresponding relationship between the image coordinates and the physical space coordinates to obtain the corresponding actual height of the burr. The grade of the burr is obtained according to the actual height of the burr, so as to realize the automatic detection of the hole defect of the metal workpiece.

[0081] This application provides a burr detection method. It employs a monocular camera positioned above a metal workpiece and a low-angle light source to capture images of the drilled hole location, thus avoiding the need for expensive high-precision sensors and high-precision optical microscopes. The captured images are then fed into a trained segmentation model to detect the presence of burrs. Upon detection, the burr height is extracted based on its edge information, and the height is correlated with a severity level. This automates the detection of metal burrs in drilled metal parts, reducing inspection costs and installation requirements while allowing companies to assess the severity and severity of burrs based on their height. This prevents metal burrs from negatively impacting equipment performance and lifespan.

[0082] The burr detection method of this application will be described in detail below using a specific embodiment.

[0083] Example 2

[0084] Figure 2 Schematic flowchart of the burr detection method provided in the embodiments of this application Figure 2 , Figure 5 For image traversal direction maps, Figure 6 To traverse and extract the graph, Figure 7 This is a schematic diagram of the lower edge equation. Figure 8 This is a diagram showing the intersection point. Figure 9 This is a diagram showing intersecting straight lines. Figure 10 This is a schematic diagram of the burr height line segment. (Example:) Figure 2 As shown, the method includes:

[0085] S201. Obtain an image of the workpiece captured by a camera, and obtain a target rectangular region based on the captured image;

[0086] Specifically, the implementation of step S201 is similar to that of step S101, and will not be described in detail here.

[0087] S202. Within the target rectangular area, a highlighted and irregular connected region is selected using a segmentation network, and the selected connected region is used as the segmentation region.

[0088] Specifically, since the burr is perpendicular to the punched surface of the metal workpiece, the light from the low-angle light source shines on the burr and is reflected, which appears as a bright area in the image. After obtaining the target rectangular area where the hole is located through the image target detection network, the bright and irregular connected area obtained by the segmentation network is used as the segmentation area. When the existence of the burr is confirmed, the greater the height of the burr, the larger the bright and irregular connected area obtained by the segmentation network will be. That is, the area of ​​the connected area is directly proportional to the height of the burr.

[0089] S203, acquire the number of pixels in the segmentation region;

[0090] Specifically, since the burr appears as a highlight and irregular region on the image, after obtaining the segmentation region through the segmentation network, the number of pixels in the segmentation region is counted. The pixels showing highlights in the segmentation region are used to indicate the existence of the identified reflection light source. By counting the number of pixels showing highlights in the irregular region, the size of the existence of the reflection light source is obtained. When the number of pixels showing highlights is greater than a first threshold, that is, the number of pixels in the segmentation region is greater than the first threshold, it is considered that the current metal workpiece has burrs at the punching position. When the number of pixels showing highlights is not greater than the first threshold, that is, the number of pixels in the segmentation region is not greater than the first threshold, it is considered that the current metal workpiece does not have burrs at the punching position, and the next workpiece punching edge is identified until the number of acquired pixels is greater than the first threshold.

[0091] S204, if the number of pixels is greater than the first threshold, an image coordinate relationship is established in the segmentation region, and a coordinate set of points where the edge contour is located in the segmentation region is extracted;

[0092] Specifically, when the number of pixels showing highlights is greater than the first threshold, that is, the number of pixels in the segmentation region is greater than the first threshold, an image coordinate relationship is established in the segmentation region, and the image coordinates of the pixels showing highlights in the segmentation region are recorded as the point set of the burr region. The points close to the edge of the burr region are selected as the points where the edge contour is located in the point set of the burr region, and the coordinates of the points where the edge contour is located are recorded, so as to obtain the coordinate set of the points where the edge contour is located in the segmentation region.

[0093] S205, the coordinate set of the points where the edge contour is located is traversed in turn from bottom to top, from top to bottom, from left to right, and from right to left to obtain a lower edge point set, an upper edge point set, a left edge point set, and a right edge point set;

[0094] Specifically, as Figure 5As shown, the image coordinate relationship is established in the segmentation region, and after the coordinate set of the point where the edge contour is located in the segmentation region is obtained, the point where the edge contour is located in the segmentation region is traversed from different directions. When the point where the edge contour is located is traversed from bottom to top, the first preset number of edge points detected are taken as lower edge points, and the coordinate set of the detected lower edge points is taken as a lower edge point set. When traversed from top to bottom, the second preset number of edge points detected are taken as upper edge points, and the coordinate set of the detected upper edge points is taken as an upper edge point set. When traversed from left to right, the third preset number of edge points detected are taken as left edge points, and the coordinate set of the detected left edge points is taken as a left edge point set. When traversed from right to left, the fourth preset number of edge points detected are taken as right edge points, and the coordinate set of the detected right edge points is taken as a right edge point set.

[0095] S206, obtaining the edge point set according to the lower edge point set, the upper edge point set, the left edge point set and the right edge point set;

[0096] Specifically, as shown in the figure, Figure 6 When the burr direction has a certain angle with the image horizontal coordinate, it may cause the edge regions collected in different directions to overlap, such as the lower edge point set and the left edge point set, so as to repeatedly traverse the edge points. After the coordinate set of the point where the edge contour is located is traversed in turn, in order to avoid repeated traversal of the edge points, so that the edge points are unique in space, it is also necessary to further distinguish through the intersection of the lower edge point set, the upper edge point set, the left edge point set and the right edge point set, and to confirm according to the number of edge points in the intersection, such as the number of edge points in the intersection of the lower edge point set and the left edge point set and the preset value H. The edge point is used to indicate the edge contour.

[0097] Further, a first intersection of the lower edge point set and the left edge point set is obtained. If the number of edge points in the first intersection is greater than or equal to a third threshold value, the first intersection is taken as a new lower edge point set, otherwise the first intersection is taken as a new left edge point set, and the expression is as follows:

[0098] Dt1=D1∩D3, if Dt1≥H, D1=Dt1, else D3=Dt1;

[0099] Where ∩ is the intersection operator symbol, Dt1 is the first intersection, D1 is the lower edge point set, and D3 is the left edge point set.

[0100] Further, a second intersection of the upper edge point set and the left edge point set is obtained. If the number of edge points in the second intersection is greater than or equal to a third threshold value, the second intersection is taken as a new upper edge point set, otherwise the second intersection is taken as a new left edge point set, and the expression is as follows:

[0101] Dt2=D2∩D3, if Dt2≥H, D1=Dt2, else D3=Dt2;

[0102] Where ∩ is the intersection operation symbol, Dt2 is the second intersection, D2 is the upper edge point set, and D3 is the left edge point set;

[0103] Furthermore, obtain the third intersection of the top edge point set and the right edge point set. If the number of edge points in the third intersection is greater than or equal to the third threshold, then the third intersection is used as the new top edge point set; otherwise, the third intersection is used as the new right edge point set. The expression is as follows:

[0104] Dt3=D2∩D4, if Dt3≥H, D2=Dt3, else D4=Dt3;

[0105] Where ∩ is the intersection operation symbol, Dt3 is the third intersection, D2 is the upper edge point set, and D4 is the right edge point set;

[0106] Furthermore, obtain the fourth intersection of the lower edge point set and the right edge point set. If the number of edge points in the fourth intersection is greater than or equal to the third threshold, then the fourth intersection is taken as the new upper edge point set; otherwise, the fourth intersection is taken as the new right edge point set. The expression is as follows:

[0107] Dt4=D1∩D4, if Dt4≥H, D1=Dt4, else D4=Dt4;

[0108] Where ∩ is the intersection operator, Dt4 is the fourth intersection, D1 is the lower edge point set, and D4 is the right edge point set.

[0109] S207. Obtain the equations of the edge lines in the segmented region based on the set of edge points;

[0110] Specifically, after obtaining the set of edge points of the edge region, the equations of the lines corresponding to the left edge contour, the lower edge contour, and the right edge contour are obtained by the least squares method based on the set of edge points corresponding to their respective edge contours.

[0111] Furthermore, such as Figure 7 As shown, the equation of the lower edge line is obtained from the lower edge point set in the edge point set of the burr region, such that the distance between the line indicated by the lower edge line equation and multiple lower edge points in the lower edge point set is minimized. The lower edge line equation is expressed as follows:

[0112] Y = k1X + b1;

[0113] Furthermore, the equation of the left edge line is obtained based on the left edge point set in the edge point set, such that the distance between the line indicated by the left edge line equation and multiple left edge points in the left edge point set is minimized. The equation of the lower edge line is expressed as follows:

[0114] Y = k3X + b3;

[0115] Further, a right edge straight line equation is obtained according to the right edge point set in the edge point set, so that the distance between the straight line indicated by the right edge straight line equation and the plurality of right edge points in the right edge point set is minimum, wherein the lower edge straight line equation is represented as follows:

[0116] Y = k4X + b4.

[0117] S208, confirming whether the straight line indicated by the lower edge straight line equation passes through the optical center, wherein the optical center is a point on the optical axis of the camera;

[0118] Specifically, in the actual detection process, since the placement position of the metal workpiece is random, the camera optical axis may be vertically downward to shoot the burr, so that an elongated straight line is formed on the photographed image, so that the height information of the burr cannot be reflected from the size of the segmented region. At this time, it is needed to judge whether the straight line of the lower edge of the burr passes through the optical center. If it passes through the optical center (X0, Y0), it is considered that the camera optical axis is vertically downward to shoot the burr.

[0119] S209, if the straight line indicated by the lower edge straight line equation passes through the optical center, sending prompt information to the user end to remind the user to adjust the position of the workpiece;

[0120] Specifically, the optical center (X0, Y0) is brought into the lower edge straight line equation. If

[0121] Y0-k1X0-b1≠0

[0122] It is considered that the burr is perpendicular to the camera imaging plane. At this time, prompt information is sent to the user end to remind the user to adjust the position of the metal workpiece.

[0123] S210, if the straight line indicated by the lower edge straight line equation does not pass through the optical center, the straight line indicated by the lower edge straight line equation in the edge straight line equation is translated upward, and a corresponding translation straight line equation is obtained according to the translated straight line;

[0124] Specifically, the optical center (X0, Y0) is brought into the lower edge straight line equation. If

[0125] Y0-k1X0-b1≠0

[0126] It is assumed that the line indicated by the lower edge line equation does not pass through the optical center, and the burr direction is not perpendicular to the camera imaging plane. The line indicated by the lower edge line equation is then translated upwards on the image, so that the target's upper edge point in the edge point set passes through the translated line. The translation line equation is obtained, where the distance between the target's upper edge point and the line indicated by the lower edge line equation is minimized. The translation line equation is expressed as follows:

[0127] Y = k1X + b12;

[0128] Where b12 is the shortest distance between the upper edge point of the target and the straight line indicated by the equation of the lower edge line.

[0129] S211. Obtain the vertices formed by the intersection of the lines indicated by the translation line equation and the lines indicated by the edge line equation, wherein the vertices include a first intersection point, a second intersection point, a third intersection point, and a fourth intersection point;

[0130] Specifically, such as Figure 8 As shown, after obtaining the translated line indicated by the translation line equation, the first, second, third, and fourth intersection points of the bottom edge line, left edge line, right edge line, and translated line are obtained, and the coordinates of the first, second, third, and fourth intersection points are obtained according to the bottom edge line equation, left edge line equation, right edge line equation, and translation line equation, respectively.

[0131] Furthermore, the coordinates of the first intersection point are represented as follows:

[0132] P1=((b12-b3) / (k3-k1), k3(b12-b3) / (k3-k1)+b3);

[0133] The coordinates of the second intersection point are represented as follows:

[0134] P2=((b12-b4) / (k4-k1), k4(b12-b4) / (k4-k1)+b4);

[0135] The coordinates of the third intersection point are represented as follows:

[0136] P3=((b1-b3) / (k3-k1), k3(b1-b3) / (k3-k1)+b3);

[0137] The coordinates of the fourth intersection point are represented as follows:

[0138] P4=((b1-b4) / (k4-k1), k4(b1-b4) / (k4-k1)+b4).

[0139] S212, acquire a first line segment composed of the first intersection point and the second intersection point, and a second line segment composed of the third intersection point and the fourth intersection point;

[0140] Specifically, after acquiring the first intersection point, the second intersection point, the third intersection point and the fourth intersection point formed by intersecting the straight line indicated by the translation straight line equation and each straight line indicated by the edge straight line equation, the first line segment is acquired according to the coordinates of the first intersection point and the coordinates of the second intersection point, and the second line segment is acquired according to the coordinates of the third intersection point and the coordinates of the fourth intersection point.

[0141] S213, respectively bisect the first line segment and the second line segment, and acquire a plurality of bisecting points on each line segment, select the plurality of bisecting points of the first line segment as a first bisecting point set, and select the plurality of bisecting points of the second line segment as a second bisecting point set.

[0142] Specifically, as shown in Figure 9 after acquiring the first line segment and the second line segment, bisecting the first line segment and the second line segment respectively, and acquiring N bisecting points on the first line segment and the second line segment respectively, so that two groups of first bisecting point sets and second bisecting point sets with the same number of bisecting points are obtained on the first line segment and the second line segment respectively, wherein the coordinates of the bisecting points in the first bisecting point set are as follows:

[0143] W1={x=P1.x+i×t×cosθ,y=P1.y+i×t×sinθ};

[0144] wherein W1 is the first bisecting point set, P1.x is the horizontal coordinate of the first intersection point, P1.y is the vertical coordinate of the first intersection point, i∈[0,N], i is used to indicate the order number of the bisecting point, θ=arctan(k1), t=|P1P2| / N, |P1P2| is the distance between the first intersection point and the second intersection point;

[0145] The coordinates of the bisecting points in the second bisecting point set are as follows:

[0146] W2={x=P3.x+i×t×cosθ,y=P3.y+i×t×sinθ};

[0147] wherein W2 is the second bisecting point set, P3.x is the horizontal coordinate of the third intersection point, P3.y is the vertical coordinate of the third intersection point, i∈[0,N], θ=arctan(k1), t=|P3P4| / N, |P3P4| is the distance between the third intersection point and the fourth intersection point.

[0148] S214, acquire a plurality of intersecting straight line equations according to the bisecting points in the first bisecting point set and the bisecting points in the second bisecting point set.

[0149] Specifically, after the first line segment and the second line segment are respectively bisected, and the bisecting points in the first bisecting point set and the bisecting points in the second bisecting point set and their corresponding coordinates are obtained, the bisecting points in the first bisecting point set and the corresponding bisecting points in the second bisecting point set are sequentially arranged in the bisecting order, and two-by-two to form a plurality of intersecting straight lines, wherein the number of intersecting straight lines is the same as the number of bisecting points on the respective first line segment and second line segment, that is, N intersecting straight lines, and the equation of the intersecting straight line is expressed as follows:

[0150] L={ki=(w1i.y-w2i.y) / (w1i.x-w2i.x),bi=w1i.y-ki×w1i.x,i∈[0,N]};

[0151] Wherein, w1i.y is the vertical coordinate of the bisecting point in the first bisecting point set, w2i.y is the vertical coordinate of the bisecting point in the second bisecting point set, w1i.x is the horizontal coordinate of the bisecting point in the first bisecting point set, and i is used to indicate the order number of the bisecting point.

[0152] S215, obtain a plurality of intersection points of a plurality of straight lines indicated by the intersecting straight line equations intersecting the upper edge point set in the segmentation region, and select the plurality of intersection points as a third bisecting point set.

[0153] Specifically, as shown in Figure 10 After obtaining N intersecting straight lines and their corresponding intersecting straight line equations, a plurality of intersection points of the N intersecting straight lines and the upper edge point set are obtained. Since the upper edge point set is not a continuous curve, a plurality of points most adjacent to the intersecting straight line in the upper edge point set need to be obtained, and the plurality of obtained points are selected as the plurality of intersection points of the intersecting straight line and the upper edge point set. The plurality of intersection points are selected as a third bisecting point set, wherein the third bisecting point set is expressed as follows:

[0154] W3={yi-Li.ki×xi-Li.bi≈0,i∈[0,N],(xi,yi)∈D2};

[0155] Wherein, W3 is the third bisecting point set, Li.ki is the slope parameter of the intersecting straight line equation corresponding to the bisecting point, Li.bi is the intercept parameter of the intersecting straight line equation corresponding to the bisecting point, D2 is the upper edge bisecting point set, and i is used to indicate the order number of the bisecting point.

[0156] S216, obtain a plurality of line segments formed by the bisecting points in the second bisecting point set and the corresponding intersection points in the third bisecting point set, and select the line segments as the burr height line segments;

[0157] Specifically, after obtaining the third set of intersection points, the second set of intersection points and the corresponding intersection points in the third set of intersection points are combined two by two according to the order number of the intersection points to form a plurality of line segments reflecting the burr height on the image, that is, the burr height line segments, and the image coordinates of the two end points of the burr height line segments are recorded, that is, the coordinates of the intersection points in the second set of intersection points and the corresponding intersection points in the third set of intersection points constituting the burr height line segments, wherein the set of two end point image coordinates of the plurality of burr height line segments is represented as follows:

[0158] M = {(W2i.x, W2i.y), (W3i.x, W3i.y), i ∈ [0, N]};

[0159] Wherein, M is the set of two end point image coordinates of the burr height line segments, W2i.x is the horizontal coordinate of the intersection point in the second set of intersection points, W2i.y is the vertical coordinate of the intersection point in the second set of intersection points, W3i.x is the horizontal coordinate of the intersection point in the third set of intersection points, W3i.y is the vertical coordinate of the intersection point in the third set of intersection points, and i is used to indicate the order number of the intersection point.

[0160] S217, establishing a physical space coordinate relationship between the camera and the workpiece punching surface through the calibration plate;

[0161] Specifically, after obtaining the image coordinates of the two end points of the burr height line segments, that is, obtaining the coordinates of the intersection points in the second set of intersection points and the corresponding intersection points in the third set of intersection points constituting the burr height line segments, a camera calibration method based on a planar calibration plate is used to establish a physical space coordinate relationship between the camera and the metal workpiece punching surface.

[0162] S218, obtaining the burr lower edge space coordinates through the corresponding relationship between the physical space coordinates and the image coordinates of the burr height line segments;

[0163] Wherein, the corresponding relationship between the physical space coordinates and the image coordinates of the burr height line segments is represented by the following formula:

[0164] λ[Mi1.x, Mi1.y, 1] T = Q[Xi, Yi, 0, 1];

[0165] Wherein, λ is a preset constant, Q is a constant matrix, Mi1.x is the horizontal coordinate of the intersection point in the second set of intersection points constituting the burr height line segments, Mi1.y is the vertical coordinate of the intersection point in the second set of intersection points constituting the burr height line segments, Xi is the burr lower edge space horizontal coordinate, and Yi is the burr lower edge space vertical coordinate;

[0166] Specifically, after obtaining the image coordinates of the two end points of the burr height line segment and establishing the physical space coordinate relationship between the camera and the punched surface of the metal workpiece, the image coordinates of the two end points of the burr height line segment are brought into the corresponding relationship to obtain the spatial horizontal coordinate of the lower edge of the burr and the spatial vertical coordinate of the lower edge of the burr, that is, to obtain the spatial coordinates of the lower edge of the burr.

[0167] S219, obtaining the actual height of the burr according to the spatial coordinates of the lower edge of the burr;

[0168] Specifically, after obtaining the spatial coordinates of the lower edge of the burr, the spatial horizontal coordinate of the lower edge of the burr and the spatial vertical coordinate of the lower edge of the burr, and the horizontal coordinate of the central point of the third equidistant point set of the burr height line segment and the vertical coordinate of the central point of the third equidistant point set of the burr height line segment are brought into the preset height conversion relationship to obtain the actual height of the burr, wherein the height conversion relationship is represented by the following formula:

[0169] λ[Mi2.x, Mi2.y, 1] T =Q[Xi, Yi, Zi, 1];

[0170] wherein λ is a preset constant, Q is a constant matrix, Mi2.x is the horizontal coordinate of the central point of the third equidistant point set of the burr height line segment, Mi2.y is the vertical coordinate of the central point of the third equidistant point set of the burr height line segment, Xi is the spatial horizontal coordinate of the lower edge of the burr, Yi is the spatial vertical coordinate of the lower edge of the burr, and Zi is the actual height of the burr.

[0171] S220, if the actual height of the burr is greater than the second threshold value, it is determined that the grade of the current burr is unqualified, otherwise it is qualified;

[0172] Specifically, after obtaining all the actual heights of the burrs according to the plurality of burr height line segments and the physical space coordinate relationship, the plurality of actual heights of the burrs obtained are compared with the second threshold value in sequence, and the actual heights of the burrs greater than the second threshold value are determined as unqualified, and the actual heights of the burrs not greater than the second threshold value are determined as qualified, and the ratio of the actual heights of the burrs with qualified grades to the total actual heights of the burrs is calculated, if the ratio is greater than a standard threshold value, it is determined that the burrs existing on the punched edge of the metal workpiece will not affect the assembly of the parts, and the burrs do not need to be removed by the mechanical arm, and it is determined that the tool bit does not need to be replaced, if the ratio is not greater than the standard threshold value, it is determined that the burrs existing on the punched edge of the metal workpiece will affect the assembly of the parts, and the burrs need to be removed by the mechanical arm, and it is determined that the tool bit needs to be replaced.

[0173] The application provides a burr detection method, which adopts a monocular camera and a low-angle light source arranged above a metal workpiece to shoot the punching position of the metal workpiece, and obtains a punching image, thereby avoiding the use of a high-precision sensor with high cost and an optical microscope with high installation precision, and the punching image is sent into a trained segmentation model to detect whether there is a burr, when the burr is detected, the burr height value is extracted according to the edge information of the burr, and the burr height value is corresponded with the grade, so that the automatic detection operation of the metal burr of the metal workpiece is realized, the detection cost and the installation requirement of the detection device are reduced, the severity and the grade of the burr can be evaluated according to the height of the burr, and the influence of the metal burr on the use performance and the service life of equipment is avoided.

[0174] The embodiments of the present application can divide the function modules of the electronic device or the host device according to the above-mentioned method examples, for example, each function module can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be realized in the form of hardware or in the form of a software function module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division, and another division mode can be used in actual implementation.

[0175] Figure 11 The structure schematic diagram of the burr detection processing device provided by the embodiments of the present application is shown in FIG. 1. Figure 11 As shown in the figure, the device 110 includes:

[0176] The acquisition module 111 is configured to acquire a shooting image of a workpiece shot by a camera, and acquire a target rectangular region according to the shooting image, wherein the camera is vertically placed above the workpiece, a low-angle light source is further arranged above the workpiece, the light source is used to irradiate the punching edge of the workpiece, and the target rectangular region includes a punching image.

[0177] The first processing module 112 is configured to acquire a segmentation region according to the target rectangular region, and acquire the number of pixels of the segmentation region, wherein the segmentation region is a highlight and irregular connected region in the target rectangular region.

[0178] The second processing module 113 is configured to extract a set of edge points in the segmentation region if the number of pixels is greater than a first threshold, acquire an edge straight line equation in the segmentation region according to the set of edge points, and acquire a burr height line segment according to the edge straight line equation and an upper edge point in the segmentation region.

[0179] The execution module 114 is configured to establish a physical space coordinate relationship between the camera and the workpiece punching surface through a calibration plate, obtain an actual burr height according to the burr height line segment and the physical space coordinate relationship, and determine that the level of the current burr is unqualified if the actual burr height is greater than a second threshold value, or otherwise, the level of the current burr is qualified.

[0180] Further, the first processing module 112 is specifically configured to select a highlighted and irregular connected region in the target rectangular region through a segmentation network, and take the selected connected region as a segmentation region, where the area of the connected region is in a proportional relationship with the height of the burr.

[0181] Further, the second processing module 113 is specifically configured to establish an image coordinate relationship in the segmentation region, extract a coordinate set of points where an edge contour is located in the segmentation region, and traverse the coordinate set of points where the edge contour is located from bottom to top, from top to bottom, from left to right and from right to left in sequence to obtain a lower edge point set, an upper edge point set, a left edge point set and a right edge point set, and obtain the edge point set according to the lower edge point set, the upper edge point set, the left edge point set and the right edge point set.

[0182] Further, the second processing module 113 is specifically configured to obtain a first intersection of the lower edge point set and the left edge point set, take the first intersection as a new lower edge point set if the number of edge points in the first intersection is greater than or equal to a third threshold value, otherwise, take the first intersection as a new left edge point set, obtain a second intersection of the upper edge point set and the left edge point set, take the second intersection as a new upper edge point set if the number of edge points in the second intersection is greater than or equal to the third threshold value, otherwise, take the second intersection as a new left edge point set, obtain a third intersection of the upper edge point set and the right edge point set, take the third intersection as a new upper edge point set if the number of edge points in the third intersection is greater than or equal to the third threshold value, otherwise, take the third intersection as a new right edge point set, obtain a fourth intersection of the lower edge point set and the right edge point set, take the fourth intersection as a new lower edge point set if the number of edge points in the fourth intersection is greater than or equal to the third threshold value, otherwise, take the fourth intersection as a new right edge point set, and obtain the edge point set according to the new edge point set and the edge point set that has not changed.

[0183] Further, the second processing module 113 is specifically configured to: acquire a lower edge straight line equation according to a lower edge point set in the edge point set, so that a straight line indicated by the lower edge straight line equation has minimum distance to a plurality of lower edge points in the lower edge point set; acquire a left edge straight line equation according to a left edge point set in the edge point set, so that a straight line indicated by the left edge straight line equation has minimum distance to a plurality of left edge points in the left edge point set; and acquire a right edge straight line equation according to a right edge point set in the edge point set, so that a straight line indicated by the right edge straight line equation has minimum distance to a plurality of right edge points in the right edge point set.

[0184] Further, the second processing module 113 is further configured to determine whether the straight line indicated by the lower edge straight line equation passes through an optical center, where the optical center is a point on an optical axis of the camera.

[0185] If the straight line indicated by the lower edge straight line equation passes through the optical center, a prompt information is sent to the user terminal to remind the user to adjust the position of the workpiece.

[0186] If the straight line indicated by the lower edge straight line equation does not pass through the optical center, a step of acquiring a burr height line segment according to the edge straight line equation and an upper edge point in the segmentation region is determined to be performed.

[0187] Further, the second processing module 113 is specifically configured to: translate the straight line indicated by the lower edge straight line equation in the edge straight line equation upward to acquire a translated straight line, so that a target upper edge point in the edge point set passes through the translated straight line, where the target upper edge point has minimum distance to the straight line indicated by the lower edge straight line equation; acquire a corresponding translated straight line equation according to the translated straight line; and acquire the burr height line segment according to the translated straight line equation, the edge straight line equation and the upper edge point.

[0188] Further, the second processing module 113 is specifically configured to obtain a vertex formed by intersection between a straight line indicated by the translation straight line equation and each straight line indicated by the edge straight line equation, wherein the vertex includes a first intersection point, a second intersection point, a third intersection point and a fourth intersection point, obtain a first line segment composed of the first intersection point and the second intersection point, and a second line segment composed of the third intersection point and the fourth intersection point, wherein the first line segment and the second line segment are parallel to the straight line indicated by the translation straight line equation, the second line segment is a line segment away from the upper edge point, the first line segment and the second line segment are equally divided respectively, and a plurality of equally divided points on the respective line segments are obtained, wherein the number of equally divided points of the first line segment is the same as the number of equally divided points of the second line segment, a plurality of equally divided points of the first line segment are selected as a first equally divided point set, a plurality of equally divided points of the second line segment are selected as a second equally divided point set, and a burr height line segment is obtained according to the first equally divided point set, the second equally divided point set and the upper edge point.

[0189] Further, the second processing module 113 is specifically configured to obtain a plurality of intersection straight line equations according to the equally divided points in the first equally divided point set and the equally divided points in the second equally divided point set, wherein the number of the intersection straight line equations is the same as the number of the equally divided points, obtain a plurality of intersection points of straight lines indicated by the plurality of intersection straight line equations and the upper edge point set in the segmentation region, and select the plurality of intersection points as a third equally divided point set, wherein the intersection points are upper edge points in the upper edge point set closest to the straight lines indicated by the intersection straight line equations, the number of the plurality of intersection points is the same as the number of the intersection straight line equations, obtain a plurality of line segments composed of the equally divided points in the second equally divided point set and the corresponding intersection points in the third equally divided point set, take the line segments as the burr height line segments, obtain a plurality of the burr height line segments, and record coordinates of the equally divided points in the second equally divided point set and the corresponding intersection points in the third equally divided point set constituting the burr height line segments.

[0190] Further, the second processing module 113 is specifically configured to obtain a burr lower edge space coordinate through a corresponding relationship between the physical space coordinate and an image coordinate of the burr height line segment, wherein the burr lower edge space coordinate includes a burr lower edge space abscissa and a burr lower edge space ordinate, and the corresponding relationship is realized through the following formula:

[0191] λ[Mi1.x,Mi1.y,1] T =Q[Xi,Yi,0,1];

[0192] Wherein, λ is a preset constant, Q is a constant matrix, Mi1.x is the horizontal coordinate of the midpoint of the second set of midpoints of the burr height line segment, Mi1.y is the vertical coordinate of the midpoint of the second set of midpoints of the burr height line segment, Xi is the horizontal coordinate of the burr lower edge space, and Yi is the vertical coordinate of the burr lower edge space.

[0193] After obtaining the burr lower edge space coordinates, the actual burr height is obtained according to the burr lower edge space coordinates by the following formula:

[0194] λ[Mi2.x,Mi2.y,1] T =Q[Xi,Yi,Zi,1] T ;

[0195] Wherein, λ is a preset constant, Q is a constant matrix, Mi2.x is the horizontal coordinate of the midpoint of the third set of midpoints of the burr height line segment, Mi2.y is the vertical coordinate of the midpoint of the third set of midpoints of the burr height line segment, Xi is the horizontal coordinate of the burr lower edge space, Yi is the vertical coordinate of the burr lower edge space, and Zi is the actual burr height.

[0196] The burr detection processing device provided in the embodiment can execute the burr detection method of the above embodiment, and has similar implementation principles and technical effects, which will not be described here again.

[0197] In the specific implementation of the foregoing gear control device based on heavy-load vehicles, each module can be implemented as a processor, and the processor can execute computer execution instructions stored in the memory, so that the processor executes the foregoing gear control method based on heavy-load vehicles.

[0198] Figure 12 The structure schematic diagram of the electronic device provided in the embodiment is shown in FIG. 1. Figure 12 As shown in the figure, the electronic device 120 includes at least one processor 121 and a memory 122. The electronic device 120 further includes a communication component 123. Wherein, the processor 121, the memory 122 and the communication component 123 are connected through a bus 124.

[0199] In the specific implementation process, the at least one processor 121 executes the computer execution instructions stored in the memory 122, so that the at least one processor 121 executes the burr detection method executed by the electronic device side as above.

[0200] The specific implementation process of the processor 121 can refer to the above method embodiment, which has similar implementation principles and technical effects, and will not be described here again.

[0201] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU) and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution or combined with hardware and software modules in the processor for execution.

[0202] The memory can include a high-speed RAM memory and can also include a non-volatile storage NVM, such as at least one disk memory.

[0203] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0204] The functions realized by the electronic device and the master device described above are introduced for the scheme provided by the embodiments of the present application. It can be understood that the electronic device or the master device contains the hardware structure and / or software module corresponding to the execution of each function in order to realize the above functions. The units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solution of the embodiments of the present application.

[0205] The present application also provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the method for detecting burr is realized.

[0206] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0207] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in an electronic device or a host device.

[0208] This application also provides a computer program product, comprising: a computer program stored in a readable storage medium, wherein at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the scheme provided in any of the above embodiments.

[0209] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0210] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting burrs, characterized in that, The method includes: The camera captures an image of the workpiece, and a target rectangular area is obtained based on the captured image. The camera is placed vertically above the workpiece, and a low-angle light source is also provided above the workpiece to illuminate the edge of the hole. The target rectangular area includes the hole image. The segmented region is obtained based on the target rectangular region, and the number of pixels in the segmented region is obtained. The segmented region is a highlighted and irregularly connected region in the target rectangular region. If the number of pixels is greater than the first threshold, then the set of edge points in the segmented region is extracted, and the equation of the edge line in the segmented region is obtained based on the set of edge points. The burr height line segment is obtained based on the equation of the edge line and the upper edge point in the segmented region. The physical space coordinate relationship between the camera and the workpiece drilling surface is established by calibration plate. The actual height of the burr is obtained according to the burr height line segment and the physical space coordinate relationship. If the actual height of the burr is greater than the second threshold, the current burr level is confirmed as unqualified; otherwise, it is qualified. The method for obtaining the burr height line segment based on the edge line equation and the upper edge point in the segmented region includes: The line indicated by the lower edge line equation in the edge line equation is translated upward to obtain the translated line, such that the target upper edge point in the edge point set passes through the translated line, wherein the distance between the target upper edge point and the line indicated by the lower edge line equation is the shortest. Obtain the corresponding equation of the translated line based on the translated line; Obtain the vertices formed by the intersections between the lines indicated by the translation line equation and the lines indicated by the edge line equation, wherein the vertices include a first intersection point, a second intersection point, a third intersection point, and a fourth intersection point; Obtain a first line segment formed by the first intersection point and the second intersection point, and a second line segment formed by the third intersection point and the fourth intersection point, wherein the first line segment and the second line segment are parallel to the line indicated by the translation line equation, and the second line segment is a line segment away from the upper edge point; The first line segment and the second line segment are divided into equal parts, and multiple division points are obtained on each line segment. The number of division points of the first line segment is the same as the number of division points of the second line segment. The multiple division points of the first line segment are selected as the first set of division points, and the multiple division points of the second line segment are selected as the second set of division points. Multiple intersecting line equations are obtained based on the division points in the first and second division point sets, wherein the number of intersecting line equations is the same as the number of division points. Obtain multiple intersection points where the lines indicated by the multiple intersecting line equations intersect with the upper edge point set in the segmented region, and select the multiple intersection points as the third equal division point set. The intersection points are the upper edge points of the upper edge point set that are closest to the lines indicated by the intersecting line equations, wherein the number of the multiple intersection points is the same as the number of intersecting line equations. Obtain multiple line segments formed by the intersection points of the second set of equal division points and the third set of equal division points. Use these line segments as the burr height line segments. Obtain multiple burr height line segments and record the coordinates of the intersection points of the second set of equal division points and the third set of equal division points that constitute the burr height line segments.

2. The burr detection method according to claim 1, characterized in that, The step of obtaining the segmented region based on the target rectangular region includes: Within the target rectangular area, a segmentation network is used to select highlighted and irregular connected regions, and these selected connected regions are used as segmentation regions, wherein the area of ​​the connected regions is proportional to the height of the burrs.

3. The burr detection method according to claim 1, characterized in that, The extraction of the set of edge points in the segmented region includes: Image coordinate relationships are established in the segmented region, and the coordinate set of the points where the edge contours are located in the segmented region is extracted. The coordinate set of the points where the edge contours are located is traversed in the order of bottom to top, top to bottom, left to right, and right to left to obtain the lower edge point set, upper edge point set, left edge point set, and right edge point set. The edge point set is obtained based on the lower edge point set, upper edge point set, left edge point set, and right edge point set.

4. The burr detection method according to claim 3, characterized in that, The step of obtaining the edge point set based on the lower edge point set, upper edge point set, left edge point set, and right edge point set includes: Obtain the first intersection of the lower edge point set and the left edge point set. If the number of lower edge points in the first intersection is greater than or equal to a third threshold, then the first intersection is taken as the new lower edge point set; otherwise, the first intersection is taken as the new left edge point set. Obtain the second intersection of the upper edge point set and the left edge point set. If the number of upper edge points in the second intersection is greater than or equal to a third threshold, then the second intersection is taken as the new upper edge point set; otherwise, the second intersection is taken as the new left edge point set. Obtain the third intersection of the upper edge point set and the right edge point set. If the number of upper edge points in the third intersection is greater than or equal to the third threshold, then the third intersection is taken as the new upper edge point set; otherwise, the third intersection is taken as the new right edge point set. Obtain the fourth intersection of the lower edge point set and the right edge point set. If the number of lower edge points in the fourth intersection is greater than or equal to the third threshold, then the fourth intersection is taken as the new lower edge point set; otherwise, the fourth intersection is taken as the new right edge point set. The edge point set is obtained based on the new edge point set and the unchanged edge point set.

5. The burr detection method according to claim 1, characterized in that, The step of obtaining the edge line equations in the segmented region based on the set of edge points includes: The equation of the lower edge line is obtained from the lower edge point set in the set of edge points, such that the distance between the line indicated by the equation of the lower edge line and multiple lower edge points in the set of lower edge points is minimized. The equation of the left edge line is obtained from the set of left edge points in the set of edge points, such that the distance between the line indicated by the equation of the left edge line and the multiple left edge points in the set of left edge points is minimized; The equation of the right edge line is obtained from the right edge point set in the edge point set, such that the distance between the line indicated by the right edge line equation and multiple right edge points in the right edge point set is minimized.

6. The burr detection method according to claim 5, characterized in that, Before obtaining the burr height line segment based on the edge line equation and the upper edge point in the segmented region, the method further includes: Confirm whether the line indicated by the equation of the lower edge line passes through the optical center, where the optical center is a point on the optical axis of the camera; If the straight line indicated by the equation of the lower edge line passes through the optical center, a prompt message is sent to the user terminal to remind the user to adjust the position of the workpiece; If the line indicated by the lower edge line equation does not pass through the optical center, then the step of obtaining the burr height line segment based on the edge line equation and the upper edge point in the segmented region is determined.

7. The burr detection method according to claim 1, characterized in that, The method for obtaining the actual height of the burr based on the relationship between the burr height line segment and the physical space coordinates includes: The spatial coordinates of the lower edge of the burr are obtained by the correspondence between the physical spatial coordinates and the image coordinates of the burr height line segment. The spatial coordinates of the lower edge of the burr include the horizontal coordinate and the vertical coordinate of the lower edge of the burr. The correspondence is realized by the following formula: λ[Mi1.x,Mi1.y,1] T =Q[Xi,Yi,0,1]; Wherein, λ is a preset constant, Q is a constant matrix, Mi1.x is the abscissa of the second division point of the burr height line segment, Mi1.y is the ordinate of the second division point of the burr height line segment, Xi is the abscissa of the lower edge space of the burr, Yi is the ordinate of the lower edge space of the burr. After obtaining the spatial coordinates of the lower edge of the burr, the actual height of the burr is obtained using the following formula based on these coordinates: λ[Mi2.x,Mi2.y,1] T =Q[Xi,Yi,Zi,1] T ; Wherein, λ is a preset constant, Q is a constant matrix, Mi2.x is the abscissa of the third division point of the burr height line segment, Mi2.y is the ordinate of the third division point of the burr height line segment, Xi is the abscissa of the lower edge of the burr, Yi is the ordinate of the lower edge of the burr, and Zi is the actual height of the burr.

8. A burr detection and processing device, characterized in that, include: The acquisition module is used to acquire images of the workpiece captured by the camera, and to acquire a target rectangular area based on the captured images. The camera is placed vertically above the workpiece, and a low-angle light source is also provided above the workpiece to illuminate the edge of the hole in the workpiece. The target rectangular area includes the hole image. The first processing module is used to obtain a segmented region based on the target rectangular region and to obtain the number of pixels in the segmented region, wherein the segmented region is a highlighted, irregularly connected region in the target rectangular region; The second processing module is used to extract the set of edge points in the segmented region if the number of pixels is greater than the first threshold, obtain the edge line equation in the segmented region based on the set of edge points, and obtain the burr height line segment based on the edge line equation and the upper edge point in the segmented region. The execution module is used to establish the physical space coordinate relationship between the camera and the workpiece drilling surface through the calibration plate, obtain the actual height of the burr according to the burr height line segment and the physical space coordinate relationship, and if the actual height of the burr is greater than the second threshold, the current burr level is confirmed as unqualified, otherwise it is qualified. The second processing module is specifically used to translate the line indicated by the lower edge line equation in the edge line equation upward to obtain the translated line, such that the target upper edge point in the edge point set passes through the translated line, wherein the distance between the target upper edge point and the line indicated by the lower edge line equation is the shortest. Obtain the corresponding equation of the translated line based on the translated line; Based on the translation line equation, the edge line equation, and the upper edge point, obtain the burr height line segment; The second processing module is specifically used to obtain the vertices formed by the intersection of the lines indicated by the translation line equation and the lines indicated by the edge line equation, wherein the vertices include a first intersection point, a second intersection point, a third intersection point, and a fourth intersection point; Obtain a first line segment formed by the first intersection point and the second intersection point, and a second line segment formed by the third intersection point and the fourth intersection point, wherein the first line segment and the second line segment are parallel to the line indicated by the translation line equation, and the second line segment is a line segment away from the upper edge point; The first line segment and the second line segment are divided into equal parts, and multiple division points are obtained on each line segment. The number of division points of the first line segment is the same as the number of division points of the second line segment. The multiple division points of the first line segment are selected as the first set of division points, and the multiple division points of the second line segment are selected as the second set of division points. Based on the first set of equal division points, the second set of equal division points, and the upper edge point, obtain the burr height line segment; The second processing module is specifically used to obtain multiple intersecting line equations based on the division points in the first set of division points and the second set of division points, wherein the number of intersecting line equations is the same as the number of division points; Obtain multiple intersection points where the lines indicated by the multiple intersecting line equations intersect with the upper edge point set in the segmented region, and select the multiple intersection points as the third equal division point set. The intersection points are the upper edge points of the upper edge point set that are closest to the lines indicated by the intersecting line equations, wherein the number of the multiple intersection points is the same as the number of intersecting line equations. Obtain multiple line segments formed by the intersection points of the second set of equal division points and the third set of equal division points. Use these line segments as the burr height line segments. Obtain multiple burr height line segments and record the coordinates of the intersection points of the second set of equal division points and the third set of equal division points that constitute the burr height line segments.

9. An electronic device, characterized in that, include: The memory stores the instructions that the computer executes; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Online detection method for circular plate casting based on machine vision

    CN109141232A

  • Method for detecting bur, bur detector and dimension inspecting device having bur detector

    JP2001256479A