A method and system for detecting burrs of a hardware stamping

CN121437456BActive Publication Date: 2026-05-22DONGGUAN LONGHENGJUN PRECISION MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511599599.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-05-22
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

[0004]本发明提供一种五金冲压件的毛刺检测方法及系统,以解决现有的问题:传统的CA显著性算法难以检测出五金冲压件中的毛刺

Benefits of technology

[0036]The beneficial effects of the technical solution of the present invention are as follows: This application obtains pressure data and images of the stamped parts at each moment during the metal stamping process; when burrs or dirt appear on the surface of the metal stamped parts, the corresponding areas of the burrs or dirt will show obvious gray-scale changes. Therefore, the stamped parts image is first divided into several local areas by the gray-scale values ​​of the pixels in the stamped parts image to accurately reflect the differences in surface state. Then, the detection factor of each area is calculated to quantify the degree of gray-scale change and texture abnormality in the area. Then, the local areas that may contain burrs are selected from all local areas as detection areas. Therefore, the stamped parts image is divided into several local areas according to the gray-scale values ​​of the pixels in the stamped parts image, and several detection areas are selected from them.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121437456B_ABST
    Figure CN121437456B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of visual detection, and particularly relates to a kind of hardware stamping part burr detection method and system, comprising: obtaining the pressure data and the pressure part image under each time in hardware stamping process;According to the gray value of pixel in pressure part image, pressure part image is divided into several local areas, and several detection areas are selected from it;According to the gray distribution of pixel in detection area, the burr factor of detection area is obtained;According to the pressure data under each time, the burr coefficient of each pixel is obtained in combination with the burr factor of detection area;According to the burr coefficient of each pixel, the burr saliency of each pixel is obtained, and then the burr pixel point is detected in hardware stamping part burr.The present application is divided into several areas by pressure part image, the gray distribution of pixel in each area is analyzed, the burr coefficient is obtained in combination with the pressure data in stamping engineering, to accurately detect the burr in hardware stamping part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology, specifically to a method and system for detecting burrs on metal stamping parts. Background Technology

[0002] Metal stamping is a processing method that uses molds and stamping equipment to apply pressure to metal sheets, causing them to undergo plastic deformation or separation to obtain the required parts. However, during the stamping process, burrs may be generated on the surface or around the material due to unreasonable mold spacing, wear of mold cutting edges, etc. Burrs on metal stamping parts not only reduce the dimensional accuracy of metal stamping parts, but also become crack sources due to stress concentration during use, affecting structural strength. Therefore, in order to ensure the quality of metal stamping parts, it is necessary to accurately detect burrs on metal stamping parts.

[0003] Traditional CA saliency algorithms for detecting burrs in metal stampings cannot distinguish the significant differences caused by different properties such as burrs and dirt. In other words, traditional CA algorithms rely only on features such as image brightness and color contrast, and lack the ability to detect the gradual changes in burrs in metal stampings under the influence of lighting, thus failing to accurately detect burrs in metal stampings. Summary of the Invention

[0004] This invention provides a method and system for detecting burrs in metal stamping parts, in order to solve the existing problem that the traditional CA saliency algorithm is difficult to detect burrs in metal stamping parts.

[0005] The present invention provides a method and system for detecting burrs on metal stamping parts, which adopts the following technical solution:

[0006] One embodiment of the present invention provides a method for detecting burrs on metal stamping parts, the method comprising the following steps:

[0007] Acquire pressure data and images of pressed parts at each moment during the metal stamping process;

[0008] The pressing image is divided into several local regions based on the gray values ​​of the pixels in the pressing image. The gray difference coefficient of the local region is obtained based on the gray value difference between the pixels in the local region. Combined with the edges in the local region, the detection factor of the local region is obtained. Several detection regions are selected from all local regions based on the detection factor of each local region.

[0009] Based on the grayscale distribution of pixels in the detection area, several suspected shadow boundary points are selected from the detection area; based on the suspected shadow boundary points in the detection area, the detection area is divided into a gradient part and a suspected shadow part; based on the gradient part of the detection area, the shadow part of the detection area is obtained; based on the grayscale distribution of pixels in the gradient part of the detection area and the area of ​​the shadow part, the spur factor of the detection area is obtained.

[0010] Based on the pressure data at each moment and the burr factor of the detection area, the burr coefficient of each pixel is obtained; based on the burr coefficient of each pixel, the burr significance of each pixel is obtained, and then the burr pixel is obtained to detect burrs in the metal stamping parts.

[0011] Preferably, the specific method for dividing the pressing image into several local regions based on the grayscale values ​​of pixels in the pressing image, and obtaining the grayscale difference coefficient of the local regions based on the grayscale differences between pixels in the local regions, includes:

[0012] Using the grayscale difference between different pixels in the stamping image as the distance metric, the k-means clustering algorithm is used to cluster all pixels in the stamping image to obtain several pixel clusters; pixels that are eight-neighborly adjacent in the stamping image and belong to the same pixel cluster are assigned to the same local region to obtain several local regions.

[0013] For any local region, all pixels in the local region are matched in pairs to obtain several pixel matching pairs in the local region; for any pixel matching pair in the local region, the absolute value of the difference in gray value between the two pixels in the pixel matching pair in the local region is used as the gray difference factor of the pixel matching pair in the local region, and the mean of the gray difference factors of all pixel matching pairs in the local region is used as the gray difference coefficient of the local region.

[0014] Preferably, the specific method for obtaining the detection factor of the local region is as follows:

[0015] For any local region, edge detection is performed on the local region using the Canny edge detection algorithm to obtain several edges in the local region. All textures in the local region are matched in pairs to obtain several texture matching pairs in the local region. For any pixel in any texture in any texture matching pair in the local region, the shortest distance between the pixel in the texture matching pair in the local region and another texture in the texture matching pair in the local region is taken as the feature distance of the pixel in the texture matching pair in the local region.

[0016] The standard deviation of the feature distances of all pixels within all textures in the texture matching pairs of the local region is used as the misalignment factor of the texture matching pairs of the local region; the mean of the misalignment factors of all texture matching pairs of the local region is multiplied by the product of the gray-level difference coefficient of the local region, and used as the detection factor of the local region.

[0017] Preferably, the specific method for selecting several detection regions from all local regions based on the detection factors of each local region includes:

[0018] All local regions are sorted in ascending order according to the detection factors of all local regions to obtain a local region sequence. The absolute value of the difference between the detection factors of all adjacent local regions in the local region sequence is obtained. The position corresponding to the largest absolute value of the difference is taken as the dividing point, and all local regions in the local region sequence that are located after the dividing point are recorded as the detection regions.

[0019] Preferably, the specific method for selecting a number of suspected shadow boundary points from the detection area based on the grayscale distribution of pixels in the detection area includes:

[0020] For any pixel on the edge of any detection area, draw a line segment starting from the pixel with the largest gray value in the detection area and ending at the pixel on the edge of the detection area. The sequence of pixels in the line segment is denoted as the trend sequence of the pixels on the edge of the detection area.

[0021] For the trend sequence of the pixels on the edge of the detection region, the first... The nth pixel; the trend sequence of the pixels on the edge of the detection area. The grayscale value of the pixel is compared to the previous one. The ratio of the grayscale values ​​of the nth pixel is denoted as the trend sequence of the pixels on the edge of the detection region. The critical factor of the nth pixel; the trend sequence of the pixels on the edge of the detection region. The pixel and the The absolute value of the difference in grayscale values ​​between the nth pixels is denoted as the nth pixel in the trend sequence of the pixels on the edge of the detection region. The mitigation factor for the nth pixel; the trend sequence of the pixels on the edge of the detection region; The ratio of the critical factor to the mitigation factor of the nth pixel is used as the trend sequence of the pixels on the edge of the detection region. The suspected shadow boundary coefficient of each pixel;

[0022] Obtain the suspected shadow boundary coefficient of each pixel in the trend sequence of the pixels on the edge of the detection area, and take the pixel with the largest suspected shadow boundary coefficient as the suspected shadow boundary point of the trend sequence of the pixels on the edge of the detection area.

[0023] Preferably, the specific method for dividing the detection area into a gradient portion and a suspected shadow portion based on the suspected shadow boundary points in the detection area includes:

[0024] For any detection region, the suspected shadow boundary points of the trend sequence connecting all adjacent pixels on the edge of the detection region are used to divide the detection region into two parts. The part containing the pixel with the largest gray value in the detection region is recorded as the gradient part of the detection region, and the part not containing the pixel with the largest gray value in the detection region is recorded as the suspected shadow part of the detection region.

[0025] Preferably, the specific method for obtaining the shadow portion of the detection area based on the gradient portion of the detection area is as follows:

[0026] For any pixel on the edge of the gradient part of any detection area, take the pixel with the largest gray value in the gradient part of the detection area as the starting point and the pixel on the edge of the gradient part of the detection area as the ending point, and record the sequence of pixels in the line segment as the trend sequence of pixels on the edge of the gradient part of the detection area.

[0027] If the gray value of each pixel in the trend sequence of all pixels on the edge of the gradient portion of the detection area is greater than or equal to the gray value of its next pixel, then the suspected shadow portion of the detection area is the shadow portion of the detection area. If the gray value of any pixel in the trend sequence of any pixel on the edge of the gradient portion of the detection area is less than the gray value of its next pixel, then the suspected shadow portion of the detection area is not the shadow portion of the detection area.

[0028] Preferably, the method for obtaining the spur factor of the detection region based on the grayscale distribution of pixels in the gradient portion of the detection region and the area of ​​the shadow portion includes:

[0029]

[0030] In the formula, The spur factor represents the detection area; This indicates the number of pixels on the edge of the gradient portion of the detection area; The first [value] on the edge of the gradient portion of the detection area The number of pixels in the trend sequence of pixels; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; This represents the area of ​​the shaded portion of the detection region.

[0031] Preferably, the specific method for obtaining the spur coefficient of each pixel based on the pressure data at each time moment and the spur factor of the detection area includes:

[0032] The difference between the pressure data at each moment and the pressure data at the next moment is recorded as the pressure change rate at each moment. The difference between the pressure change rate at each moment and the pressure change rate at the next moment is recorded as the pressure change acceleration at each moment. The metal stamping part corresponding to the stamping part image is obtained. The time period corresponding to stamping the metal stamping part is recorded as the stamping time period. The average pressure change acceleration at each moment in the stamping time period is multiplied by the number of detection areas in the stamping part image, and the product is used as the production correction weight of the stamping part image.

[0033] For any detection area, the product of the burr factor of the detection area and the production correction weight of the pressing image is normalized, and the normalized result is used as the burr coefficient of the detection area.

[0034] Set the spurt coefficient of each pixel in the detection area to be equal to the spurt coefficient of the detection area, and set the spurt coefficient of pixels not located in the detection area to 0.

[0035] Another embodiment of the present invention provides a burr detection system for metal stamping parts, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described burr detection methods for metal stamping parts.

[0036] The beneficial effects of the technical solution of the present invention are as follows: This application obtains pressure data and images of the stamped parts at each moment during the metal stamping process; when burrs or dirt appear on the surface of the metal stamped parts, the corresponding areas of the burrs or dirt will show obvious gray-scale changes. Therefore, the stamped parts image is first divided into several local areas by the gray-scale values ​​of the pixels in the stamped parts image to accurately reflect the differences in surface state. Then, the detection factor of each area is calculated to quantify the degree of gray-scale change and texture abnormality in the area. Then, the local areas that may contain burrs are selected from all local areas as detection areas. Therefore, the stamped parts image is divided into several local areas according to the gray-scale values ​​of the pixels in the stamped parts image, and several detection areas are selected from them.

[0037] Since burrs in metal stamping parts appear as extra protrusions on the surface, under illumination, the top of the protrusion receives the strongest light, resulting in the largest protrusion value, which decreases towards the edges. Simultaneously, the protrusions cast shadows under illumination. Therefore, the burr factor of the detection area is obtained based on the grayscale distribution of pixels in the detection area. Furthermore, since the uniformity of pressure changes during the stamping process affects the quality of the metal stamping parts, the burr coefficient of each pixel is obtained by combining the pressure data at each moment with the burr factor of the detection area. Based on the burr coefficient of each pixel, the burr saliency of each pixel is obtained to accurately detect burrs in the metal stamping parts. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart illustrating the steps of a method for detecting burrs on metal stamping parts according to the present invention. Detailed Implementation

[0040] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a burr detection method and system for metal stamping parts proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0042] The following description, in conjunction with the accompanying drawings, details the specific scheme of the burr detection method and system for metal stamping parts provided by the present invention.

[0043] Please see Figure 1 The diagram illustrates a flowchart of a method for detecting burrs on metal stamping parts according to an embodiment of the present invention. The method includes the following steps:

[0044] Step S001: Obtain pressure data and pressed part images at each moment during the metal stamping process.

[0045] It should be noted that burrs on metal stamping parts can reduce their precision and structural strength. To ensure the quality of metal stamping parts, it is necessary to accurately detect burrs in them. Therefore, this embodiment proposes a burr detection method for metal stamping parts. Specifically, it detects the presence of burrs by analyzing the surface image of the metal stamping parts. Therefore, it is necessary to first acquire an image of the stamping parts.

[0046] Specifically, the pressure data of the stamping equipment at each moment during the metal stamping process is obtained through pressure sensors, and the surface image of the metal stamping part is captured by a high-definition camera. The surface image of the metal stamping part is then processed into grayscale, and the grayscale processed surface image of the metal stamping part is recorded as the stamping image.

[0047] Step S002: Divide the pressing image into several local regions according to the gray values ​​of the pixels in the pressing image, and obtain the gray difference coefficient of the local region according to the gray difference between the pixels in the local region. Combine the edges in the local region to obtain the detection factor of the local region. Select several detection regions from all local regions according to the detection factor of each local region.

[0048] It should be noted that this embodiment, as a burr detection method for metal stamping parts, specifically analyzes the pixel distribution characteristics in the stamping part image to obtain areas in the stamping part image that may be burrs. These areas are then used as weights to increase the saliency of pixels at corresponding positions, thereby accurately detecting burrs in the corresponding metal stamping part. Normally, the grayscale value of the surface of a metal stamping part is stable. However, when burrs or dirt appear on the surface of the metal stamping part, the corresponding areas of the burrs or dirt will exhibit obvious grayscale abrupt changes. Therefore, the stamping part image is first divided into several local regions based on the grayscale values ​​of the pixels in the stamping part image to accurately reflect the differences in surface condition. Then, the detection factor for each region is calculated to quantify the degree of grayscale change and texture abnormality within the region. Finally, local regions that may contain burrs are selected from all local regions as detection areas.

[0049] Preferably, in a specific embodiment of the present invention, the grayscale difference between different pixels in the stamping image is used as the distance measurement, and the k-means clustering algorithm is used to cluster all pixels in the stamping image to obtain several pixel clusters. Since the k-means clustering algorithm is a well-known prior art, it will not be described in detail in this embodiment. Pixels in the stamping image that are eight-neighbor adjacent and belong to the same pixel cluster are grouped into the same local region to obtain several local regions.

[0050] Furthermore, for any local region, all pixels in the local region are matched in pairs to obtain several pixel matching pairs in the local region; for any pixel matching pair in the local region, the absolute value of the difference in grayscale value between the two pixels in the pixel matching pair in the local region is used as the grayscale difference factor of the pixel matching pair in the local region, and the mean of the grayscale difference factors of all pixel matching pairs in the local region is used as the grayscale difference coefficient of the local region.

[0051] It should be noted that the grayscale difference coefficient of a local area represents the degree of grayscale change within a local area. Under normal circumstances, the grayscale value of the surface of a metal stamping part is stable. Therefore, the grayscale difference coefficient of a local area can be used to quantify the possibility that a local area is the area corresponding to a burr.

[0052] Preferably, in a specific embodiment of the present invention, for any local region, edge detection is performed on the local region using the Canny edge detection algorithm to obtain several edges in the local region, which are used as several textures in the local region. Since the Canny edge detection algorithm is a well-known prior art, it will not be described in detail in this embodiment. All textures in the local region are matched pairwise to obtain several texture matching pairs in the local region. For any pixel in any texture of any texture matching pair in the local region, the shortest distance between the pixel in the texture of the texture matching pair in the local region and another texture in the texture matching pair in the local region is used as the feature distance of the pixel in the texture of the texture of the texture matching pair in the local region.

[0053] The standard deviation of the feature distances of all pixels within all textures in the texture matching pairs of the local region is used as the misalignment factor of the texture matching pairs of the local region; the mean of the misalignment factors of all texture matching pairs of the local region is multiplied by the product of the gray-level difference coefficient of the local region, and used as the detection factor of the local region.

[0054] It should be noted that the more parallel the two textures in a local texture matching pair are, the more consistent the feature distances of all pixels within all textures in the local texture matching pair are, and the smaller their standard deviation. Therefore, the larger the misalignment factor of the local texture matching pair, the less parallel the two textures are in the local texture matching pair. Since the texture inside the burr is disordered, the larger the misalignment factor of the texture matching pair in the local region, the more likely the local region is to be the corresponding region of the burr. Further, combined with the gray-level difference coefficient of the local region, the detection factor of the local region is obtained. The larger the detection factor of the local region, the more the local region has burr characteristics, the more likely it is to contain burrs, and the more it needs to be detected in subsequent steps. Therefore, based on this, several detection regions can be selected from all local regions.

[0055] Preferably, in a specific embodiment of the present invention, all local regions are sorted in ascending order according to the detection factors of all local regions to obtain a local region sequence. The absolute value of the difference between the detection factors of all adjacent local regions in the local region sequence is obtained. The position corresponding to the largest absolute value of the difference is taken as the dividing point, and all local regions in the local region sequence located after the dividing point are recorded as detection regions.

[0056] At this point, several detection areas have been obtained.

[0057] Step S003: Based on the grayscale distribution of pixels in the detection area, select several suspected shadow boundary points from the detection area; based on the suspected shadow boundary points in the detection area, divide the detection area into a gradient part and a suspected shadow part; obtain the shadow part of the detection area based on the gradient part; obtain the spur factor of the detection area based on the grayscale distribution of pixels in the gradient part and the area of ​​the shadow part.

[0058] It should be noted that burrs in metal stamping parts appear as extra protrusions on the surface of the parts. Therefore, under illumination, the top of the protrusion receives the strongest light, resulting in the largest protrusion value, which decreases towards the edges. Simultaneously, the protrusions cast shadows under illumination. This can be used to select several suspected shadow boundary points from the detection area, dividing the area into gradient and suspected shadow regions. Furthermore, since the detection area may not necessarily correspond to a burr area but could also be a dirt area, this embodiment, as a burr detection method for metal stamping parts, specifically targets burrs in metal stamping parts. Therefore, by analyzing the grayscale distribution characteristics of the gradient and shadow regions in the detection area, burrs and dirt are distinguished, and the burr factor of the detection area is obtained to accurately detect burrs in the metal stamping parts.

[0059] Preferably, in a specific embodiment of the present invention, for any pixel on the edge of any detection area, a line segment is drawn starting from the pixel with the largest gray value in the detection area and ending at the pixel on the edge of the detection area. The sequence of pixels in the line segment is recorded as the trend sequence of the pixels on the edge of the detection area (with the pixel with the largest gray value in the detection area as the first pixel).

[0060] Furthermore, for the trend sequence of the pixels on the edge of the detection region, the first... 1 pixel ( , , (representing the number of pixels in the trend sequence of the pixels on the edge of the detection region); and the number of pixels in the trend sequence of the pixels on the edge of the detection region. The grayscale value of the pixel is compared to the previous one. The ratio of the grayscale values ​​of the nth pixel is denoted as the trend sequence of the pixels on the edge of the detection region. The critical factor of the nth pixel; the trend sequence of the pixels on the edge of the detection region. The pixel and the The absolute value of the difference in grayscale values ​​between the nth pixels is denoted as the nth pixel in the trend sequence of the pixels on the edge of the detection region. The mitigation factor for the nth pixel; the trend sequence of the pixels on the edge of the detection region; The ratio of the critical factor to the mitigation factor of the nth pixel is used as the trend sequence of the pixels on the edge of the detection region. The suspected shadow boundary coefficient of each pixel;

[0061] Obtain the suspected shadow boundary coefficient of each pixel in the trend sequence of the pixels on the edge of the detection area, and take the pixel with the largest suspected shadow boundary coefficient as the suspected shadow boundary point of the trend sequence of the pixels on the edge of the detection area.

[0062] As an example, the trend sequence of the pixels on the edge of the detection region is obtained. The specific formula for calculating the suspected shadow boundary coefficient of each pixel is as follows:

[0063]

[0064] In the formula, The trend sequence of the pixels on the edge of the detection region is represented by the first... The suspected shadow boundary coefficient of each pixel; The trend sequence of the pixels on the edge of the detection region is represented by the first... The grayscale value of each pixel; The trend sequence of the pixels on the edge of the detection region is represented by the first... The grayscale value of each pixel; The trend sequence of the pixels on the edge of the detection region is represented by the first... The grayscale value of each pixel; This represents the function that takes the absolute value.

[0065] It should be noted that when a shadow exists in the detection area, the grayscale value of pixels in the shadowed portion of the detection area is much smaller than the grayscale value of pixels in the non-shadowed portion. The larger the value, the higher the trend sequence of the pixels on the edge of the detection region. The more likely a pixel is to be located at the boundary between shadow and non-shadow areas, and since pixels belonging to the same shadow area have similar grayscale values, the more likely the trend sequence of pixels on the edge of the detection area is to be located at the boundary between shadow and non-shadow areas. When a pixel is located at the boundary between shadow and non-shadow, The larger the value, therefore The larger the value, the higher the trend sequence of the pixels on the edge of the detection region. Each pixel is located at the boundary between shadow and non-shadow; therefore, we can further iterate through the trend sequence of pixels on the edge of the detection area to obtain the suspected shadow boundary coefficient of each pixel, and filter out the suspected shadow boundary points in the detection area, thus dividing the detection area into a gradient part and a suspected shadow part.

[0066] Preferably, in a specific embodiment of the present invention, for any detection region, the suspected shadow boundary points of the trend sequence connecting all adjacent pixels on the edge of the detection region divide the detection region into two parts (e.g., the first...). The suspected shadow boundary points of the trend sequence of pixels, and the first pixel on the edge of the detection area. The pixel and the (Connecting the suspected shadow boundary points of the trend sequence of pixels), and recording the part containing the pixel with the largest gray value in the detection area as the gradient part of the detection area, and recording the part that does not contain the pixel with the largest gray value in the detection area as the suspected shadow part of the detection area;

[0067] Furthermore, for any pixel on the edge of the gradient portion of the detection area, a line segment is drawn starting from the pixel with the largest gray value in the gradient portion of the detection area and ending at the pixel on the edge of the gradient portion of the detection area. The sequence of pixels formed by the line segment is recorded as the trend sequence of the pixels on the edge of the gradient portion of the detection area (with the pixel with the largest gray value in the gradient portion of the detection area as the first pixel).

[0068] If the gray value of each pixel in the trend sequence of all pixels on the edge of the gradient portion of the detection area is greater than or equal to the gray value of its next pixel, then the suspected shadow portion of the detection area is the shadow portion of the detection area. If the gray value of any pixel in the trend sequence of any pixel on the edge of the gradient portion of the detection area is less than the gray value of its next pixel, then the suspected shadow portion of the detection area is not the shadow portion of the detection area (the detection area has no shadow portion, and the area of ​​its shadow portion is 0).

[0069] It should be noted that, due to the raised shape of burrs, their surface grayscale gradually decreases from the center outwards, forming shadows at the edges. By connecting the suspected shadow boundary points of the trend sequences of adjacent pixels on the edge of the detection area, the detection area is divided into a gradient part and a suspected shadow part. If the detection area contains burrs, its gradient area conforms to the grayscale detection characteristics under illumination. Therefore, when the grayscale value of each pixel in the trend sequence of all pixels on the edge of the gradient part of the detection area is greater than or equal to the grayscale value of its next pixel, its gradient part conforms to the grayscale gradient characteristics of burrs under illumination, and its suspected shadow part is the real shadow part, thus distinguishing burrs from dirt. Furthermore, based on the grayscale distribution of pixels in the gradient part of the detection area and the area of ​​the shadow part, the burr factor of the detection area can be obtained to quantify the burr characteristics of the detection area.

[0070] Preferably, in a specific embodiment of the present invention, for any detection region, the grayscale values ​​of adjacent pixels in the trend sequence of each pixel on the edge of the gradient portion of the detection region are obtained, and the spur factor of the detection region is obtained by combining it with the area of ​​the shadow portion of the detection region. The specific calculation formula is as follows:

[0071]

[0072] In the formula, The spur factor represents the detection area; This indicates the number of pixels on the edge of the gradient portion of the detection area; The first [value] on the edge of the gradient portion of the detection area The number of pixels in the trend sequence of pixels; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; This represents the area of ​​the shaded portion of the detection region.

[0073] It should be noted that the burr factor in the detection area indicates the probability that the detection area contains burrs. A larger value indicates that the pixels in the gradient portion of the detection area more closely follow the gradient feature of decreasing grayscale value from the pixel with the largest grayscale value. The larger the value, the more likely burrs are to exist in the detection area; since burrs in metal stamping parts appear as extra protrusions on the surface of the metal stamping parts, and these protrusions will form shadows under the action of light, the larger the area of ​​the shadow in a part of the detection area, the more likely burrs are to be present in the detection area.

[0074] At this point, the spur factor of the detection area is obtained.

[0075] Step S004: Based on the pressure data at each moment and the burr factor of the detection area, obtain the burr coefficient of each pixel; based on the burr coefficient of each pixel, obtain the burr significance of each pixel, and then obtain the burr pixel detection of burrs in the metal stamping parts.

[0076] It should be noted that this embodiment is a method for detecting burrs in metal stamping parts. Specifically, it detects burrs in the stamped metal parts. The uniformity of pressure changes during the stamping process affects the quality of the metal stamping parts. For example, if the stamping equipment jams during the stamping process, causing a sudden increase or decrease in pressure, burrs may be generated in the metal stamping parts at the moment of pressure change. Therefore, in order to accurately detect burrs in the metal stamping parts, it is necessary to further obtain the production correction weight of the stamping part image based on the changes in pressure data during the stamping process, and combine it with the burr factor of the detection area obtained in step S003 to accurately detect burrs in the metal stamping parts.

[0077] Preferably, in a specific embodiment of the present invention, the difference between the pressure data at each moment and the pressure data at the next moment is recorded as the pressure change rate at each moment, and the difference between the pressure change rate at each moment and the pressure change rate at the next moment is recorded as the pressure change acceleration at each moment; the metal stamping part corresponding to the stamping image is obtained, the time period corresponding to stamping the metal stamping part is recorded as the stamping time period, and the average value of the pressure change acceleration at each moment in the stamping time period is multiplied by the number of detection areas in the stamping image as the production correction weight of the stamping image.

[0078] It should be noted that after obtaining the production correction weight of the pressing image, the burr factor of the detection area obtained in step S003 can be corrected according to the production correction weight of the pressing image, so as to accurately detect burrs in the metal stamping parts.

[0079] Specifically, for any detection area, the product of the burr factor of the detection area and the production correction weight of the pressing image is normalized (normalization can be performed using the sigmoid function), and the normalized result is used as the burr coefficient of the detection area.

[0080] Set the spurt coefficient of each pixel in the detection area to be equal to the spurt coefficient of the detection area, and set the spurt coefficient of pixels not located in the detection area to 0.

[0081] Furthermore, the saliency of each pixel in the pressing image is obtained using the CA saliency algorithm. Since the CA saliency algorithm is a well-known existing technology, it will not be described in detail in this embodiment. For each pixel, the saliency of the pixel is obtained by adding 1 to the saliency coefficient of the pixel and multiplying it by the product of the saliency of the pixel. The saliency of the pixel is obtained by applying the saliency of all pixels.

[0082] Preset a spurious significance threshold With burr area threshold The and The specific value can be set according to the actual situation. This embodiment does not make a hard requirement. In this embodiment, it is used as... , Taking square millimeters as an example, if the burr of the pixel is significantly smaller than... Then the pixel is a burr pixel. If the burr significance of the pixel is greater than or equal to... The pixel is considered a normal pixel. The burr pixels in the pressed part image are marked, and the area of ​​the region formed by the burr pixels in the pressed part image is obtained. If the area of ​​the region formed by the burr pixels in the pressed part image is greater than or equal to... If the area of ​​the region formed by burr pixels in the stamping image is smaller than 0. If the image of the pressed part is correct, then the corresponding metal stamping part is qualified.

[0083] It should be noted that, for all fractional operations in this embodiment, in order to avoid the denominator being zero during the fractional operation, 0.1 is added to both the numerator and denominator during the fractional operation. This embodiment accurately detects burrs in metal stamping parts by performing grayscale partitioning, calculating local detection factors, constructing burr saliency, and performing saliency segmentation based on a fixed threshold on the image of the metal stamping parts. Then, it utilizes the grayscale distribution characteristics of burrs under illumination, which presents "highlight-gradient-shadow", and combines the pressure data of the stamping equipment during the actual production of metal stamping parts.

[0084] Another embodiment of the present invention provides a burr detection system for metal stamping parts, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a burr detection method for metal stamping parts in steps S001 to S004.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting burrs on metal stamping parts, characterized in that, The method includes the following steps: Acquire pressure data and images of pressed parts at each moment during the metal stamping process; The pressing image is divided into several local regions based on the gray values ​​of the pixels in the pressing image. The gray difference coefficient of the local region is obtained based on the gray value difference between the pixels in the local region. Combined with the edges in the local region, the detection factor of the local region is obtained. Several detection regions are selected from all local regions based on the detection factor of each local region. Based on the grayscale distribution of pixels in the detection area, several suspected shadow boundary points are selected from the detection area; based on the suspected shadow boundary points in the detection area, the detection area is divided into a gradient part and a suspected shadow part; based on the gradient part of the detection area, the shadow part of the detection area is obtained; based on the grayscale distribution of pixels in the gradient part of the detection area and the area of ​​the shadow part, the spur factor of the detection area is obtained. Based on the pressure data at each moment and the burr factor of the detection area, the burr coefficient of each pixel is obtained; based on the burr coefficient of each pixel, the burr significance of each pixel is obtained, and then the burr pixel is obtained to detect burrs in the metal stamping parts. The specific method for dividing the pressing image into several local regions based on the grayscale values ​​of pixels in the pressing image, and obtaining the grayscale difference coefficient of the local regions based on the grayscale differences between pixels in the local regions, includes: Using the grayscale difference between different pixels in the stamping image as the distance metric, the k-means clustering algorithm is used to cluster all pixels in the stamping image to obtain several pixel clusters; pixels that are eight-neighborly adjacent in the stamping image and belong to the same pixel cluster are assigned to the same local region to obtain several local regions. For any local region, all pixels in the local region are matched in pairs to obtain several pixel matching pairs in the local region; for any pixel matching pair in the local region, the absolute value of the difference in gray value between the two pixels in the pixel matching pair in the local region is used as the gray difference factor of the pixel matching pair in the local region, and the mean of the gray difference factors of all pixel matching pairs in the local region is used as the gray difference coefficient of the local region. The specific method for obtaining the detection factors of the local region is as follows: For any local region, edge detection is performed on the local region using the Canny edge detection algorithm to obtain several edges in the local region. All textures in the local region are matched in pairs to obtain several texture matching pairs in the local region. For any pixel in any texture in any texture matching pair in the local region, the shortest distance between the pixel in the texture matching pair in the local region and another texture in the texture matching pair in the local region is taken as the feature distance of the pixel in the texture matching pair in the local region. The standard deviation of the feature distances of all pixels within all textures in the texture matching pairs of the local region is used as the misalignment factor of the texture matching pairs of the local region; the mean of the misalignment factors of all texture matching pairs of the local region is multiplied by the product of the gray-level difference coefficient of the local region, and used as the detection factor of the local region. The method for obtaining the spur factor of the detection region based on the grayscale distribution of pixels in the gradient portion of the detection region and the area of ​​the shadow portion includes: In the formula, The spur factor represents the detection area; This indicates the number of pixels on the edge of the gradient portion of the detection area; The first [value] on the edge of the gradient portion of the detection area The number of pixels in the trend sequence of pixels; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; The first [value] on the edge of the gradient portion of the detection area In the trend sequence of the nth pixel The grayscale value of each pixel; This represents the area of ​​the shaded portion of the detection region; The method for obtaining the spur coefficient of each pixel by combining the pressure data at each time moment with the spur factor of the detection area includes the following specific steps: The difference between the pressure data at each moment and the pressure data at the next moment is recorded as the pressure change rate at each moment. The difference between the pressure change rate at each moment and the pressure change rate at the next moment is recorded as the pressure change acceleration at each moment. The metal stamping part corresponding to the stamping part image is obtained. The time period corresponding to stamping the metal stamping part is recorded as the stamping time period. The average pressure change acceleration at each moment in the stamping time period is multiplied by the number of detection areas in the stamping part image, and the product is used as the production correction weight of the stamping part image. For any detection area, the product of the burr factor of the detection area and the production correction weight of the pressing image is normalized, and the normalized result is used as the burr coefficient of the detection area. Set the spurt coefficient of each pixel in the detection area to be equal to the spurt coefficient of the detection area, and set the spurt coefficient of pixels not located in the detection area to 0.

2. The method for detecting burrs on metal stamping parts according to claim 1, characterized in that, The specific method for selecting several detection regions from all local regions based on the detection factors of each local region is as follows: All local regions are sorted in ascending order according to the detection factors of all local regions to obtain a local region sequence. The absolute value of the difference between the detection factors of all adjacent local regions in the local region sequence is obtained. The position corresponding to the largest absolute value of the difference is taken as the dividing point, and all local regions in the local region sequence that are located after the dividing point are recorded as the detection regions.

3. The method for detecting burrs on metal stamping parts according to claim 1, characterized in that, The specific method for selecting several suspected shadow boundary points from the detection area based on the grayscale distribution of pixels in the detection area includes: For any pixel on the edge of any detection area, draw a line segment starting from the pixel with the largest gray value in the detection area and ending at the pixel on the edge of the detection area. The sequence of pixels in the line segment is denoted as the trend sequence of the pixels on the edge of the detection area. For the trend sequence of the pixels on the edge of the detection region, the first... The nth pixel; the trend sequence of the pixels on the edge of the detection area. The grayscale value of the pixel is compared to the previous one. The ratio of the grayscale values ​​of the nth pixel is denoted as the trend sequence of the pixels on the edge of the detection region. The critical factor of the nth pixel; the trend sequence of the pixels on the edge of the detection region. The pixel and the The absolute value of the difference in grayscale values ​​between the nth pixels is denoted as the nth pixel in the trend sequence of the pixels on the edge of the detection region. The mitigation factor for the nth pixel; the trend sequence of the pixels on the edge of the detection region; The ratio of the critical factor to the mitigation factor of the nth pixel is used as the trend sequence of the pixels on the edge of the detection region. The suspected shadow boundary coefficient of each pixel; Obtain the suspected shadow boundary coefficient of each pixel in the trend sequence of the pixels on the edge of the detection area, and take the pixel with the largest suspected shadow boundary coefficient as the suspected shadow boundary point of the trend sequence of the pixels on the edge of the detection area.

4. The method for detecting burrs on metal stamping parts according to claim 1, characterized in that, The method for dividing the detection area into a gradient portion and a suspected shadow portion based on the suspected shadow boundary points in the detection area includes the following specific methods: For any detection region, the suspected shadow boundary points of the trend sequence connecting all adjacent pixels on the edge of the detection region are used to divide the detection region into two parts. The part containing the pixel with the largest gray value in the detection region is recorded as the gradient part of the detection region, and the part not containing the pixel with the largest gray value in the detection region is recorded as the suspected shadow part of the detection region.

5. The method for detecting burrs on metal stamping parts according to claim 1, characterized in that, The specific method for obtaining the shadow portion of the detection area based on the gradient portion of the detection area includes: For any pixel on the edge of the gradient part of any detection area, take the pixel with the largest gray value in the gradient part of the detection area as the starting point and the pixel on the edge of the gradient part of the detection area as the ending point, and record the sequence of pixels in the line segment as the trend sequence of pixels on the edge of the gradient part of the detection area. If the gray value of each pixel in the trend sequence of all pixels on the edge of the gradient portion of the detection area is greater than or equal to the gray value of its next pixel, then the suspected shadow portion of the detection area is the shadow portion of the detection area. If the gray value of any pixel in the trend sequence of any pixel on the edge of the gradient portion of the detection area is less than the gray value of its next pixel, then the suspected shadow portion of the detection area is not the shadow portion of the detection area.

6. A burr detection system for metal stamping parts, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the burr detection method for metal stamping parts as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Hardware stamping defect visual detection method and system

    CN118552524A

  • Hardware processing quality inspection method, electronic equipment and system

    CN118657740A