A method for detecting and processing defects of static arc contact workpiece based on image detection and recognition

Through the method based on image detection and recognition, the SIFT model is used to extract and match the workpiece images, which solves the problem of low efficiency and reduced accuracy of workpiece detection time such as static arc contacts, and achieves fast and accurate defect recognition.

CN118052791BActive Publication Date: 2024-12-06HENAN XINFENG NEW MATERIALS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410199064.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2024-12-06
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

The existing workpiece detection methods have problems of low time efficiency and high complexity when detecting workpieces such as static arc contacts, and interference with lighting and shape factors lead to a decrease in detection accuracy, making it impossible to quickly identify defects.

Method used

Using an image detection and recognition method, the workpiece image is subjected to Gaussian convolution and descending order sampling through the SIFT model, edge area and local area images are divided, feature points are extracted and contours are formed, matching judgment is performed, and matching verification is performed using the brightness feature descriptor. Reduce data detection and improve efficiency.

Benefits of technology

It improves the time efficiency and accuracy of workpiece detection, can quickly identify defects of workpieces such as static arc contacts, and reduces interference due to light and shape factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118052791B_ABST
    Figure CN118052791B_ABST
Patent Text Reader

Abstract

The invention discloses a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition. The method comprises: collecting a sample workpiece image and a video image of a current workpiece to be detected, acquiring each video frame in the video image of the current workpiece to be detected to obtain a corresponding workpiece image to be detected, detecting feature points of the workpiece to be detected in the current workpiece image to be detected, and outputting a detection result of the feature points of the workpiece to be detected; the detection result of the feature points of the workpiece to be detected is used to divide the workpiece image into an inner region image of the workpiece to be detected and a global image of the workpiece to be detected from the video frame, the inner region image of the workpiece to be detected includes a workpiece surface image of a local region of the workpiece to be detected, and the global image of the workpiece to be detected is a workpiece surface image including an edge region of the workpiece to be detected; the sample workpiece image, the inner region image of the workpiece to be detected and the global image of the workpiece to be detected are respectively input into a SIFT model, and an output is used to judge whether the workpiece image to be detected has defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of workpiece damage defect detection, and in particular to a static arc contact workpiece defect detection and processing method based on image detection and recognition. Background Art

[0002] As image detection technology becomes more mature, more and more image application detection methods are used in factory detection; image application detection of processed parts is a detection method that uses various image processing technologies in the production process to ensure product quality and safety.

[0003] Therefore, image processing technology plays an increasingly important role in workpiece recognition technology in the industrial field; among them, the recognition and detection of defects and textures in workpiece images is the most prominent.

[0004] However, researchers have found that in actual applications, there are huge problems when detecting defects in workpieces; when detecting the entire image of the workpiece, the time efficiency of the detection is often reduced, and the workpiece will often be very complex depending on the type, which will further delay the detection time; it is impossible to quickly detect whether there are defects in the workpiece, for example: the surface of the static arc contact part is missing some threads, there are surface scratches, and there are dents in the tubular parts.

[0005] At the same time, the study found that lighting and different shapes and sizes may have a greater impact on the appearance of the workpiece, such as shadows, color distortion, spiral shapes, etc. These factors may interfere with the detection and recognition of the workpiece, thereby causing the accuracy of the detection algorithm to decrease. Most importantly, this influencing factor will further increase the detection time.

[0006] Therefore, there is an urgent need for a static arc contact workpiece defect detection and processing method based on image detection and recognition. By performing regional recognition on the full image of the workpiece, the image data for recognition can be reduced and the time efficiency can be reduced. Summary of the invention

[0007] The purpose of the present invention is to provide a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition, which solves the above-mentioned technical problems pointed out in the prior art.

[0008] The present invention proposes a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition, comprising the following steps:

[0009] Collect the sample workpiece image and the video image of the current workpiece to be detected, obtain each video frame in the video image of the current workpiece to be detected to obtain the corresponding workpiece image to be detected, then detect the feature points of the workpiece to be detected in the current workpiece image to be detected, and output the detection results of the feature points of the workpiece to be detected;

[0010] Based on the detection results of the feature points of the workpiece to be detected, the video frame is divided into an inner region image of the workpiece to be detected and a global image of the workpiece to be detected, wherein the inner region image of the workpiece to be detected includes a workpiece surface image of a local region of the workpiece to be detected, and the global image of the workpiece to be detected is a workpiece surface image including an edge region of the workpiece to be detected;

[0011] The sample workpiece image, the image of the area within the workpiece to be detected and the global image of the workpiece to be detected are respectively input into the SIFT model, and the defects of the sample workpiece image are matched and judged based on the image of the area within the workpiece to be detected and the global image of the workpiece to be detected, so as to judge whether the image of the workpiece to be detected has defects.

[0012] Preferably, the global image of the workpiece to be detected is input into the SIFT model, and feature points of the workpiece to be detected are extracted to form a workpiece surface image of the edge area contour of the workpiece to be detected. The specific operation steps are as follows:

[0013] The global image of the workpiece to be detected is sampled in descending order to form a pyramid image, the pyramid image is input into a SIFT model for Gaussian convolution, and a plurality of blurred image groups of different sizes are obtained, each group of blurred images is divided into a plurality of blurred image layers, and each layer of blurred images has the same size, so as to obtain a global Gaussian pyramid image of the workpiece to be detected; the global pyramid image of the workpiece to be detected is traversed through each group of adjacent blurred images of each layer of blurred images to obtain a global Gaussian difference image;

[0014] Filtering the pixel points of the global Gaussian difference image to obtain feature points of the workpiece to be detected, judging the pixel brightness of the pixel points of the global Gaussian difference image, and presetting the pixel brightness threshold t; if the pixel brightness is greater than the preset pixel brightness threshold t, retaining the pixel; if the pixel brightness is less than or equal to the preset pixel brightness threshold t, eliminating the pixel;

[0015] It is judged whether the brightness of the retained pixel point is greater than that of the adjacent pixel points that are also retained. If the brightness of the pixel point is greater than that of the adjacent pixel points, the pixel point is determined to be a feature point of the workpiece to be detected; if the brightness of the pixel point is less than or equal to the brightness of the adjacent pixel points, the pixel point is eliminated for a second time; the determined feature points of the workpiece to be detected are connected to obtain a workpiece surface image of the contour of the edge area of ​​the workpiece to be detected.

[0016] Preferably, the sample workpiece image is input into a SIFT model, and feature points of the sample workpiece are extracted to form a workpiece surface image of the edge area contour of the sample workpiece and a workpiece surface image of the local area contour of the sample workpiece. The specific operation steps are as follows:

[0017] The sample workpiece image is sampled in descending order to form a pyramid image, the pyramid image is input into a SIFT model for Gaussian convolution, and a plurality of blurred image groups of different sizes are obtained, each group of blurred images is divided into a plurality of blurred image layers, and each layer of blurred images has the same size, so as to obtain a sample workpiece Gaussian pyramid image; the adjacent blurred images of each layer of blurred images of each group of the sample workpiece pyramid image are differentiated to obtain a sample Gaussian difference image; the pixel points of the sample Gaussian difference image are screened to obtain sample workpiece feature points, and the brightness of adjacent identical pixels of the sample Gaussian difference image is directly clustered to form a plurality of pixel brightness clusters;

[0018] A preset brightness cluster threshold k is set for the pixel brightness cluster. If the pixel brightness cluster is greater than the preset brightness cluster threshold k, the pixel brightness cluster is determined as an edge sample workpiece feature point, and connected to form a workpiece surface image of the edge area contour of the sample workpiece;

[0019] If the pixel brightness cluster is less than the preset brightness cluster threshold k, the pixel brightness cluster is determined as the local sample workpiece feature point of the workpiece to be detected, and is connected to form a workpiece surface image of the local area contour of the sample workpiece; if the pixel brightness cluster is equal to the preset brightness cluster threshold k, the pixel brightness cluster is eliminated.

[0020] Preferably, based on the image of the area within the workpiece to be detected and the global image of the workpiece to be detected, the defects of the sample workpiece image are matched and judged to determine whether the image of the workpiece to be detected has defects. The specific operation steps are as follows:

[0021] Defect judgment is performed on the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected, and the contour of the local area of ​​the sample workpiece and the contour of the edge area of ​​the sample workpiece of the sample workpiece image; the contour of the local area of ​​the workpiece to be detected and the contour of the local area of ​​the sample workpiece are judged to see whether they match; the contour of the edge area of ​​the workpiece to be detected and the contour of the edge area of ​​the sample workpiece are judged to see whether they match;

[0022] When any one of the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected in the image of the workpiece to be detected fails to match, it is determined that a defect of the workpiece to be detected occurs in the image of the workpiece to be detected.

[0023] Preferably, the contour of the local area of ​​the workpiece to be detected is judged to be matched with the contour of the local area of ​​the sample workpiece; the contour of the edge area of ​​the workpiece to be detected is judged to be matched with the contour of the edge area of ​​the sample workpiece, and the specific operation steps are as follows:

[0024] The position, scale and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the workpiece image to be detected, and vectorized to generate a brightness feature descriptor to be detected; the regional contour generated by the sample workpiece image is composed of sample workpiece feature points connected, and the position, scale and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the sample workpiece image, and vectorized to generate a sample brightness feature descriptor;

[0025] Matching the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece with the sample brightness feature descriptor of the local area contour of the sample workpiece, and judging whether the brightness of the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are successfully matched, and judging that the to-be-detected workpiece local area contour and the sample workpiece local area contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece fail to match;

[0026] Matching the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour with the sample brightness feature descriptor of the sample workpiece edge region contour, and judging whether the brightness of the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour are successfully matched, and it is judged that the to-be-detected workpiece edge region contour and the sample workpiece edge region contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour fail to match;

[0027] The brightness feature descriptor to be detected that fails to match is further verified; a balanced histogram is obtained by using a histogram of uniform grayscale distribution for the brightness feature descriptor to be detected of the workpiece image to be detected that fails to match and a sample feature descriptor of the sample workpiece image that matches the workpiece image to be detected, so as to obtain a histogram balanced image to be detected and a sample histogram balanced image; the histogram balanced image to be detected and the sample histogram balanced image are matched, and if the match is successful, the workpiece image to be detected is intact; if the match is unsuccessful, the workpiece image to be detected has defects.

[0028] Preferably, a balanced histogram is obtained by using a histogram of uniform grayscale distribution to obtain a histogram of the brightness feature descriptor of the workpiece image to be detected that fails to match and a sample feature descriptor of the sample workpiece image that matches the workpiece image to be detected, so as to obtain a histogram-balanced image to be detected and a sample histogram-balanced image; the histogram-balanced image to be detected and the sample histogram-balanced image are matched, and the specific operation steps are as follows:

[0029] The brightness feature descriptor to be detected of the image of the workpiece to be detected that fails to match is converted into feature pixels to be detected, and the feature pixels to be detected are segmented into image blocks to obtain brightness image blocks to be detected; the brightness image blocks to be detected are converted into grayscale images to be detected by a histogram equalization algorithm, and the grayscale images to be detected are adjusted to have the same image size and image type as the sample brightness image blocks to obtain an adjusted grayscale image to be detected, and the adjusted grayscale image to be detected is histogram-equalized to obtain a histogram-equalized image to be detected;

[0030] According to the minimum pixel grayscale of the histogram-equalized image to be detected, the histogram-equalized image to be detected is stretched to obtain the stretched histogram-equalized image to be detected, and the number of highlight pixels of different brightness levels in each interval of the stretched histogram-equalized image to be detected and the number of all highlight pixels are identified and calculated:

[0031] The frequency Do of the jth highlighted pixel in the stretched histogram-equalized image to be detected is calculated based on the number of highlighted pixels of different brightness levels in each interval, the number of all highlighted pixels in each interval, and the total number of intervals;

[0032] Converting the sample brightness feature descriptor of the sample artifact image corresponding to the sample brightness feature descriptor of the sample artifact image that failed to match into sample feature pixel points, segmenting the sample feature pixel points into image blocks, and obtaining sample brightness image blocks; converting the sample brightness image blocks into sample grayscale images by using a histogram equalization algorithm, and performing histogram equalization on the sample grayscale images to obtain sample histogram equalized images;

[0033] According to the minimum pixel grayscale of the sample histogram-equalized image, the sample histogram-equalized image is stretched to obtain a stretched sample histogram-equalized image, and the number of highlight pixels of different brightness levels in each interval of the stretched sample histogram-equalized image and the number of all highlight pixels are identified and calculated:

[0034] Similarly, the frequency Su of the jth highlight pixel in the stretched sample histogram-equalized image is calculated based on the number of highlight pixels of different brightness levels in each interval, the number of all highlight pixels in each interval, and the total number of intervals;

[0035] The highlight pixel frequency difference is calculated by calculating the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected, and judging whether the highlight pixel frequency difference between the two is less than the preset highlight pixel frequency threshold z; when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is less than the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block successfully; when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is greater than or equal to the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block unsuccessfully.

[0036] Correspondingly, the present application also relates to a storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the static arc contact workpiece defect detection and processing method based on image detection and recognition are implemented.

[0037] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:

[0038] It can be seen from the analysis of the above-mentioned static arc contact workpiece defect detection and processing method based on image detection and recognition provided by the present invention that in specific applications, the image of the workpiece to be detected and the sample workpiece image are divided into edge area images and local area images, so that the detection of reduced data can be detected separately to improve the detection efficiency;

[0039] Furthermore, Gaussian convolution is performed on the workpiece image to be detected and the sample workpiece image through the SIFT model to form a Gaussian pyramid image; high-brightness pixels are first retained in the workpiece image to be detected through the Gaussian pyramid image, and high-brightness pixels can increase the recognition and accuracy of matching in subsequent matching; the feature points of the workpiece to be detected are confirmed through the brightness of the pixels to form the edge area contour of the workpiece to be detected and the local area contour of the workpiece to be detected of the workpiece image to be detected; sample workpiece feature points are clustered through the brightness of the pixels to form the sample workpiece edge area contour and the local area contour of the sample workpiece of the sample workpiece image; the area contours of the workpiece image to be detected and the sample workpiece image are matched, and the workpiece feature points in the area contours are vectorized to form a brightness feature descriptor, and the brightness feature descriptors of the two are matched. When the matching fails, there is a defect problem in the workpiece image to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 An overall flow chart of a method for detecting and processing static arc contact workpiece defects based on image detection and recognition provided in the first embodiment of the present invention;

[0042] Figure 2 A regional contour matching flow chart of a method for detecting and processing static arc contact workpiece defects based on image detection and recognition provided in the first embodiment of the present invention;

[0043] Figure 3 A global image of a workpiece to be detected in a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition provided in the first embodiment of the present invention;

[0044] Figure 4 An image of an area within a workpiece to be detected in a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition provided in the first embodiment of the present invention;

[0045] Figure 5 A matching flow chart using a brightness feature descriptor of a static arc contact workpiece defect detection and processing method based on image detection and recognition provided in the first embodiment of the present invention;

[0046] Figure 6 This is a schematic structural diagram of a storage medium for applying the above-mentioned static arc contact workpiece defect detection and processing method based on image detection and recognition in Example 2.

[0047] Processor 1110 ; communication interface 1120 ; memory 1130 ; computer storage medium 1140 . DETAILED DESCRIPTION

[0048] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.

[0049] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.

[0050] The present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings.

[0051] Embodiment 1

[0052] like Figure 1 As shown, the present invention proposes a static arc contact workpiece defect detection and processing method based on image detection and recognition, comprising the following operating steps:

[0053] S1: Collect the sample workpiece image and the video image of the current workpiece to be detected, obtain each video frame in the video image of the current workpiece to be detected to obtain the corresponding workpiece image to be detected, then detect the feature points of the workpiece to be detected in the current workpiece image to be detected, and output the detection results of the feature points of the workpiece to be detected;

[0054] It should be noted that the SIFT algorithm is used to extract the feature points of the workpiece to be detected (i.e., the feature points of the workpiece to be detected are the key feature points of the workpiece to be detected on the surface), and the feature points of the workpiece to be detected are used to divide the area of ​​the image to be detected for subsequent detection operations; the sample workpiece image is a sample workpiece image collected from a complete and defect-free workpiece to be detected, and the sample workpiece image is also used to extract the sample workpiece feature points using the SIFT algorithm, and the sample image area is divided using the sample workpiece feature points; the area divided by the sample workpiece image is used to match the area divided by the workpiece image to perform subsequent matching of the defects of the workpiece to be detected, so as to determine whether the image of the workpiece to be detected has defects.

[0055] S2: Based on the detection results of the feature points of the workpiece to be detected, the video frame is divided into an inner region image of the workpiece to be detected and a global image of the workpiece to be detected, wherein the inner region image of the workpiece to be detected includes a workpiece surface image of a local region of the workpiece to be detected, and the global image of the workpiece to be detected is a workpiece surface image including an edge region of the workpiece to be detected;

[0056] S3: Based on the sample workpiece image, the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, the SIFT model is respectively inputted, and the defects of the sample workpiece image are matched and judged based on the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, so as to judge whether the image of the workpiece to be detected has defects.

[0057] Figure 3 The global image of the workpiece to be detected in the first embodiment of the present invention; Figure 4 The global image of the workpiece to be detected and the image of the inner region of the workpiece to be detected are obtained by using the above-mentioned static arc contact workpiece defect detection and processing method based on image detection and recognition;

[0058] Specifically, Figure 2As shown, in step S3, based on the sample workpiece image, the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, the SIFT model is input respectively, and the defects of the sample workpiece image are matched and judged based on the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, and it is judged whether the image of the workpiece to be detected has defects. The specific operation steps are as follows:

[0059] S31: performing descending sampling on the image of the inner region of the workpiece to be detected to form a pyramid image, inputting the pyramid image into the SIFT model for Gaussian convolution to obtain a number of blurred image groups of different sizes; each group of blurred images is divided into a number of blurred image layers, and the blurred images of each layer have the same size, so as to obtain a Gaussian pyramid image of the inner region of the workpiece to be detected; performing differential analysis on adjacent blurred images of each layer of blurred images of each group of the pyramid image of the inner region of the workpiece to be detected to obtain a Gaussian difference image of the inner region; screening the pixel points of the Gaussian difference image of the inner region to obtain feature points of the workpiece to be detected, judging the pixel brightness of the pixel points of the Gaussian difference image of the inner region, and presetting the pixel brightness threshold t; if the pixel brightness is greater than the preset pixel brightness threshold t, retaining the pixel point; if the pixel brightness is less than or equal to the preset pixel brightness threshold t, eliminating the pixel point;

[0060] Clustering the adjacent pixels with the same brightness to form pixel brightness clusters with different brightness, judging whether the pixel brightness cluster is greater than a preset brightness cluster threshold L, retaining the pixel brightness cluster if the brightness is greater than the preset brightness cluster threshold L; removing the pixel brightness cluster if the brightness is less than or equal to the preset brightness cluster threshold L; the retained pixel brightness cluster is the feature point of the workpiece to be detected, connecting the feature points of the workpiece to be detected, and obtaining the workpiece surface image of the local area contour of the workpiece to be detected and the internal area image of the workpiece to be detected;

[0061] It should be noted that the pixel brightness threshold t is preset to determine whether to retain or remove pixels. The retained pixels are pixels with relatively high brightness. The higher pixels can form a clear outline for the subsequent pixel brightness clusters, so as to determine whether there may be darker pixel clusters in the contour area to be detected by comparing the contour area of ​​the sample workpiece image, so as to determine whether there are defects. Therefore, pixels with brightness greater than the preset pixel brightness threshold t are retained, and pixels with brightness less than the preset pixel brightness threshold t are removed.

[0062] Furthermore, by selecting a higher pixel brightness cluster through the preset brightness cluster threshold L, the clarity of the local contour area of ​​the workpiece to be detected is improved, and the pixels in the local area of ​​the workpiece to be detected are more concentrated, so clustering is performed using the same pixel brightness; therefore, pixel brightness clusters greater than the preset brightness cluster threshold L are retained, and pixel brightness clusters less than the preset brightness cluster threshold L are eliminated.

[0063] S32: performing descending sampling on the global image of the workpiece to be detected to form a pyramid image, inputting the pyramid image into the SIFT model for Gaussian convolution to obtain a number of blurred image groups of different sizes; each group of blurred images is divided into a number of blurred image layers, and the blurred images of each layer have the same size, so as to obtain a global Gaussian pyramid image of the workpiece to be detected; performing differential analysis on adjacent blurred images of each layer of blurred images of each group of the global pyramid image of the workpiece to be detected to obtain a global Gaussian difference image; screening the pixel points of the global Gaussian difference image to obtain feature points of the workpiece to be detected, judging the pixel brightness of the pixel points of the global Gaussian difference image, and presetting the pixel brightness threshold t; if the pixel brightness is greater than the preset pixel brightness threshold t, retaining the pixel point; if the pixel brightness is less than or equal to the preset pixel brightness threshold t, eliminating the pixel point;

[0064] Determine whether the brightness of the retained pixel is greater than that of the adjacent pixel that is also retained. If the brightness of the pixel is greater than that of the adjacent pixel, determine that the pixel is a feature point of the workpiece to be detected; if the brightness of the pixel is less than or equal to that of the adjacent pixel, eliminate the pixel for a second time; connect the determined feature points of the workpiece to be detected to obtain a workpiece surface image of the contour of the edge area of ​​the workpiece to be detected;

[0065] It should be noted that, in order to obtain the contour of the edge area of ​​the workpiece to be detected, the pixel points in the edge area of ​​the workpiece to be detected are more dispersed, so by judging the brightness of adjacent pixels, the pixel points with higher brightness are retained, and the pixel points with higher brightness are connected to form the contour of the edge area of ​​the workpiece to be detected, and the contour of the edge area of ​​the workpiece to be detected is clearer.

[0066] S33: performing descending sampling on the sample workpiece image to form a pyramid image, inputting the pyramid image into a SIFT model for Gaussian convolution to obtain a number of blurred image groups of different sizes; each group of blurred images is divided into a number of blurred image layers, each layer of blurred images has the same size, and a sample workpiece Gaussian pyramid image is obtained; performing differential analysis on adjacent blurred images of each layer of blurred images of each group of the sample workpiece pyramid image to obtain a sample Gaussian difference image; screening the pixel points of the sample Gaussian difference image to obtain sample workpiece feature points, and directly clustering the brightness of adjacent identical pixels on the sample Gaussian difference image to form a number of pixel brightness clusters;

[0067] A preset brightness cluster threshold k is set for the pixel brightness cluster. If the pixel brightness cluster is greater than the preset brightness cluster threshold k, the pixel brightness cluster is determined as an edge sample workpiece feature point, and connected to form a workpiece surface image of the edge area contour of the sample workpiece; if the pixel brightness cluster is less than the preset brightness cluster threshold k, the pixel brightness cluster is determined as a local sample workpiece feature point of the workpiece to be detected, and connected to form a workpiece surface image of the local area contour of the sample workpiece; if the pixel brightness cluster is equal to the preset brightness cluster threshold k, the pixel brightness cluster is eliminated;

[0068] It should be noted that when the sample workpiece image is subjected to the sample Gaussian difference image and then the feature points of the workpiece to be detected are screened, unlike the operation of first eliminating low-brightness pixels in step S31, the brightness of adjacent identical pixels of the sample Gaussian difference image is directly clustered; when the brightness of the pixel brightness cluster is determined by the preset brightness cluster threshold k, when the brightness is less than (that is, the brightness value is less than the preset brightness cluster threshold k), it is proved that the pixel brightness cluster is low-brightness (because the sample workpiece image is a complete and defect-free workpiece, the pixel brightness of the sample workpiece image will be very high, and the sample workpiece image has dense pixels due to the integrity of the workpiece, and the low-brightness pixel brightness cluster of the sample workpiece image will be higher than or equal to the pixel cluster of the general workpiece image to be detected, and therefore the low-brightness pixel brightness cluster is used to form the local area contour of the sample workpiece);

[0069] When the brightness is greater than the preset brightness cluster threshold k, it proves that the pixel brightness cluster is high brightness (different from the outer edge area contour of the workpiece to be detected in step S32 by selecting the brightness of adjacent pixels, the sample workpiece image is densely populated with intact pixels of the workpiece, so the pixel brightness clusters with higher brightness can be connected by clustering method); therefore, the contour lines of the local area of ​​the workpiece to be detected and the edge area of ​​the workpiece to be detected are judged by low-brightness and high-brightness pixel brightness clusters; when the brightness is equal to the preset brightness cluster threshold k, it is eliminated (when the pixel brightness cluster is equal to, it means that the brightness of the pixel brightness cluster belongs to medium brightness, which does not conform to the formation of the sample local area contour of the low-brightness pixel brightness cluster, nor does it conform to the formation of the sample edge area contour of the high-brightness pixel brightness cluster, so it is eliminated); therefore, the low-brightness pixels are retained at the beginning in order to form low-brightness pixel brightness clusters, thereby forming the workpiece surface image of the local area contour of the sample workpiece, so the high and low brightness of the pixel brightness clusters are judged by the preset brightness cluster threshold k to form the contours of each area of ​​the sample workpiece.

[0070] S34: Defect judgment is performed on the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected; the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the sample workpiece of the sample workpiece image are judged; whether the contour of the local area of ​​the workpiece to be detected matches the contour of the local area of ​​the sample workpiece; whether the contour of the edge area of ​​the workpiece to be detected matches the contour of the edge area of ​​the sample workpiece;

[0071] S35: when any one of the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected in the image of the workpiece to be detected fails to match, it is determined that the image of the workpiece to be detected has a defect of the workpiece to be detected;

[0072] It should be noted that: when the contour of the workpiece area to be detected is matched with the contour of the sample workpiece area, the feature points of the workpiece to be detected and the feature points of the sample workpiece determined by the pixel brightness or pixel brightness cluster are matched first; when the brightness of the two are all the same, it means that the area contours of the two can also be matched identically; when any one or more of the brightness of the two are different, it means that the area contours of the two are neither the same nor matched, and there is a defect in the image of the workpiece to be detected.

[0073] Specifically, Figure 5 As shown, in step S34, the contour of the local area of ​​the workpiece to be detected is judged to see whether it matches the contour of the local area of ​​the sample workpiece; the contour of the edge area of ​​the workpiece to be detected is judged to see whether it matches the contour of the edge area of ​​the sample workpiece. The specific operation steps are as follows:

[0074] S341: The position, scale, and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the workpiece image to be detected, and vectorized to generate a brightness feature descriptor to be detected; the regional contour generated by the sample workpiece image is composed of sample workpiece feature points connected, and the position, scale, and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the sample workpiece image, and vectorized to generate a sample brightness feature descriptor;

[0075] It should be noted that the feature points of the workpiece to be detected, which are composed of the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected of the workpiece image, are obtained by the output of the SIFT model; the feature points of the sample workpiece, which are composed of the contour of the local area of ​​the sample workpiece and the contour of the edge area of ​​the sample workpiece, are obtained by the output of the SIFT model; the position, scale, and direction information of the feature points of the workpiece to be detected and the sample workpiece feature points are determined by the SIFT model, and the feature points of the workpiece to be detected and the sample workpiece feature points are vectorized by these information to form a brightness feature descriptor and a sample brightness feature descriptor; the feature descriptor is an algorithm for extracting and describing the features of key points in an image or video, and it is used to convert the local information of the key points into a mathematical description in the form of a vector or matrix, so as to facilitate computer applications such as image recognition, target tracking, and image matching.

[0076] S342: Matching the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece with the sample brightness feature descriptor of the local area contour of the sample workpiece, and judging whether the brightness of the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are successfully matched, and it is judged that the to-be-detected workpiece local area contour and the sample workpiece local area contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece fail to match;

[0077] It should be noted that the local area contour of the workpiece to be detected and the local area contour of the sample workpiece are adjusted to be consistent in the same direction, and the brightness feature descriptor to be detected of the local area contour of the workpiece to be detected and the sample brightness feature descriptor of the local area contour of the sample workpiece at the same position are made to correspond to each other; the brightness of the brightness feature descriptor to be detected of the local area contour of the workpiece to be detected and the sample brightness feature descriptor of the local area contour of the sample workpiece are used to judge whether they match; if the match is successful, it proves that the workpiece surface image of the local area of ​​the workpiece to be detected has no defects; if the match fails, it means that the local area contour of the workpiece to be detected lacks the brightness feature descriptor to be detected or the brightness of the brightness feature descriptor to be detected is low, therefore, the matching fails, which proves that the workpiece surface image of the local area of ​​the workpiece to be detected has defects.

[0078] S343: Matching the to-be-detected brightness feature descriptor of the edge region contour of the to-be-detected workpiece with the sample brightness feature descriptor of the edge region contour of the sample workpiece, and determining whether the brightness of the to-be-detected brightness feature descriptor of the edge region contour of the to-be-detected workpiece and the sample brightness feature descriptor of the edge region contour of the sample workpiece are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the edge region contour of the to-be-detected workpiece and the sample brightness feature descriptor of the edge region contour of the sample workpiece are successfully matched, and it is determined that the to-be-detected workpiece edge region contour and the sample workpiece edge region contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the edge region contour of the to-be-detected workpiece and the sample brightness feature descriptor of the edge region contour of the sample workpiece fail to match (if it is determined that the to-be-detected workpiece edge region contour and the sample workpiece edge region contour are unsuccessful in matching, further verification is performed, and after further verification, it is determined whether the to-be-detected workpiece has a defect, and the specific operation is shown in the following step S344);

[0079] S344: further verifying the brightness feature descriptor to be detected that failed to match (i.e., the brightness feature descriptor to be detected of the local area contour of the workpiece to be detected or the edge area contour to be detected that failed to match); obtaining a balanced histogram of the brightness feature descriptor to be detected of the workpiece image to be detected that failed to match and the sample feature descriptor of the sample workpiece image that matched the workpiece image that failed to match through a histogram of uniform grayscale distribution, to obtain a histogram balanced image to be detected and a sample histogram balanced image; matching the histogram balanced image to be detected and the sample histogram balanced image, if the match is successful, the workpiece image to be detected is intact; if the match is unsuccessful, the workpiece image to be detected has defects.

[0080] It should be noted that, when the brightness feature descriptor to be detected matches the sample brightness feature descriptor successfully, it proves that the brightness of the brightness feature descriptor to be detected is the same as the brightness of the sample brightness feature descriptor; when the brightness feature descriptor to be detected matches the sample brightness feature descriptor unsuccessfully, there will be a regional contour of the image of the workpiece to be detected that lacks the brightness feature descriptor to be detected and a low-brightness brightness feature descriptor to be detected; the matching may be affected by image noise, etc., resulting in inconsistent brightness during matching; therefore, the embodiment of the present invention believes that verification is needed again to determine the final matching result, see steps S3441-S3443 for details.

[0081] Specifically, in step S344, a balanced histogram is obtained by using a histogram of uniform grayscale distribution for the brightness feature descriptor of the to-be-detected workpiece image that fails to match and a sample feature descriptor of the sample workpiece image that matches the to-be-detected workpiece image, so as to obtain a histogram-balanced image to be detected and a sample histogram-balanced image; the histogram-balanced image to be detected and the sample histogram-balanced image are matched, and the specific operation steps are as follows:

[0082] S3441: converting the brightness feature descriptor to be detected of the image of the workpiece to be detected that fails to match into feature pixels to be detected, segmenting the feature pixels to be detected into image blocks to obtain brightness image blocks to be detected (i.e., each segmented image block can be divided into multiple intervals to be detected, forming a total of n intervals); converting the brightness image blocks to be detected into grayscale images to be detected by using a histogram equalization algorithm, adjusting the grayscale images to be detected to an image with the same image size and image type as the sample brightness image blocks, obtaining an adjusted grayscale image to be detected, and performing histogram equalization on the adjusted grayscale image to be detected to obtain a histogram equalized image to be detected;

[0083] According to the minimum pixel grayscale of the histogram-equalized image to be detected, the histogram-equalized image to be detected is stretched (the purpose of stretching the histogram-equalized image to be detected is to more clearly show the distribution of data), and the stretched histogram-equalized image to be detected is obtained (firstly, the brightness value is screened to determine the pre-screened high-brightness pixels), and the number of highlighted pixels of different brightness levels in each interval of the stretched histogram-equalized image to be detected and the number of all highlighted pixels are identified and calculated:

[0084] The study believes that by screening the brightness values ​​in each interval, it can be determined that the pixels above the minimum standard brightness threshold are all high-brightness pixels, but the brightness levels of the high-brightness pixels are different, so they can be divided into the j-th brightness level, that is, the j-th brightness level of the highlighted pixels, and the k-th brightness level, that is, the k-th brightness level of the highlighted pixels; therefore, evaluating the high-brightness pixels of a specific brightness level separately can avoid a large number of redundant calculations of all highlighted pixel identifications, further saving the time of verification calculations; for example: the j-th highlighted pixel refers to the number of highlighted pixels of the j-th high brightness level;

[0085] The frequency Do of the jth highlighted pixel in the stretched histogram-equalized image to be detected is calculated based on the number of highlighted pixels of different brightness levels in each interval, the number of all highlighted pixels in each interval, and the total number of intervals;

[0086] First, we need to calculate the total number of highlighted pixels in each interval, that is, the total number of highlighted pixels in the ith interval is: Ti = Σ(Wa i ), where Σ represents the sum of all highlighted pixel points Wai in the i-th interval;

[0087] Then, calculate the proportion mj of the jth (or jth brightness level highlighted pixel) highlighted pixel in each interval, that is, the proportion of the jth highlighted pixel in the ith interval is: mij = Wai / Ti;

[0088] Next, calculate the frequency Do of the jth highlight pixel of the stretched histogram-equalized image to be detected, that is: Doj = Σ(mij * Wai) / N;

[0089] Among them, Σ represents the sum of the proportion mij of all intervals multiplied by the corresponding number of highlight pixels Wai, and then divided by the total number of intervals N.

[0090] Therefore, in the above formula, Wai represents the number of highlighted pixels (at a certain brightness level) falling within the i-th interval; Do is the frequency of the j-th highlighted pixel in the histogram-equalized image to be detected after stretching (or the frequency of highlighted pixels at a certain brightness level);

[0091] S3442: converting the sample brightness feature descriptor of the sample artifact image corresponding to the sample brightness feature descriptor of the sample artifact image that failed to match into sample feature pixel points, segmenting the sample feature pixel points into image blocks to obtain sample brightness image blocks (i.e., each segmented image block can be divided into multiple sample intervals, forming a total of nth intervals); converting the sample brightness image blocks into sample grayscale images through a histogram equalization algorithm, and performing histogram equalization on the sample grayscale image to obtain a sample histogram equalized image;

[0092] According to the minimum pixel grayscale of the sample histogram-equalized image, the sample histogram-equalized image is stretched (the purpose of stretching the sample histogram-equalized image is to show the distribution of data more clearly), and the stretched sample histogram-equalized image is obtained (firstly, the brightness value is screened to determine the pre-screened high-brightness pixels), and the number of highlighted pixels of different brightness levels in each interval of the stretched sample histogram-equalized image and the number of all highlighted pixels are identified and calculated:

[0093] Similarly, the frequency Su of the jth highlight pixel in the stretched sample histogram-equalized image is calculated based on the number of highlight pixels of different brightness levels in each interval, the number of all highlight pixels in each interval, and the total number of intervals;

[0094] Calculate the total number of highlighted pixels in each interval, that is, the total number of highlighted pixels in the ith interval is: Ri = Σ(Qei); where Σ represents the sum of all highlighted pixel numbers Qii in the ith interval;

[0095] Then, calculate the proportion mj of the jth (or jth brightness level highlighted pixel) highlighted pixel in each interval, that is, the proportion of the jth highlighted pixel in the ith interval is: cij = Qei / Ri;

[0096] Next, calculate the frequency Su of the jth highlight pixel of the stretched sample histogram-equalized image, that is: Suj = Σ(cij * Qei) / N;

[0097] Among them, Σ represents the sum of the proportion cij of all intervals multiplied by the corresponding number of highlight pixels Qii, and then divided by the total number of intervals N.

[0098] Therefore, in the above formula, Qe i represents the number of highlighted pixels (at a certain brightness level) falling within the i-th interval; Su is the frequency of the j-th highlighted pixel in the stretched sample histogram-equalized image (or the frequency of highlighted pixels at a certain brightness level);

[0099] It should be noted that, by dividing the area of ​​the brightness feature descriptor to be detected where the matching fails and its corresponding sample brightness feature descriptor into image blocks, and dividing the divided image blocks again to form multiple intervals to be detected, only the part of the workpiece image to be detected where the matching fails and the part of the sample workpiece image at the corresponding position can be matched, thereby reducing the detection time of the entire workpiece image to be detected; at the same time, the calculation of image parameters is also reduced, and there is no need to match the entire workpiece image to be detected again, and the image's contrast, brightness, hue and other features can be enhanced after the stretched equalized histogram; the highlighted pixel frequency of the stretched histogram-equalized image to be detected and the highlighted pixel frequency of the stretched histogram-equalized image to be detected are calculated through the above-mentioned highlighted pixel counts, and the highlighted pixel frequencies of the two are compared to see if they are similar; the highlighted pixel frequency is usually used to describe the distribution of data and can be represented by a histogram.

[0100] S3443: Calculate the highlight pixel frequency difference by the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected, and determine whether the highlight pixel frequency difference between the two is less than the preset highlight pixel frequency threshold z; when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is less than the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block successfully (that is, the regional contour of the workpiece image to be detected matches the regional contour of the sample workpiece image successfully); when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is greater than or equal to the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block unsuccessfully (that is, the regional contour of the workpiece image to be detected matches the regional contour of the sample workpiece image unsuccessfully);

[0101] It should be noted that the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is finally compared with the highlight pixel frequency Su of the stretched sample histogram-equalized image; the difference in the highlight pixel frequency can counteract the brightness change of the stretched histogram-equalized image, and has a certain robustness against interference such as image noise, distortion and blur; due to the integrity of the sample artifact image, the number of highlight pixels in the stretched sample histogram-equalized image may be higher than the number of highlight pixels in the stretched histogram-equalized image to be detected, but by calculating the highlight pixel frequency, the difference between the two will be equal or close, so it is necessary to calculate the difference in the highlight pixel frequency of the two to make a final judgment on whether it is less than the preset highlight pixel frequency threshold z.

[0102] like Figure 4As shown, on the other hand, this second embodiment is based on the invention embodiment, a static arc contact workpiece defect detection and processing method based on image detection and recognition, and also provides a computer storage medium 1140 (referred to as storage medium).

[0103] A schematic diagram of a computer storage medium structure framework provided in Embodiment 2 of the present invention includes:

[0104] A memory 1130, used for storing computer programs;

[0105] The communication interface 1120 is used to connect the memory 1130 to the processor 1110;

[0106] The processor 1110 is used to execute a computer program to implement a static arc contact workpiece defect detection and processing method based on image detection and recognition as disclosed in an embodiment of any combination of the above-mentioned implementation modes.

[0107] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits, digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0108] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0109] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0111] In summary, the static arc contact workpiece defect detection and processing method based on image detection and recognition provided by the present invention in the example of the present invention can be known to divide the image of the workpiece to be detected and the sample workpiece image into edge area images and local area images, so that the detection of reduced data can be detected separately to improve the detection efficiency;

[0112] Further, Gaussian convolution is performed on the workpiece image to be detected and the sample workpiece image through the SIFT model to form a Gaussian pyramid image; high-brightness pixels are first retained for the workpiece image to be detected through the Gaussian pyramid image, and the high-brightness pixels can increase the recognition and accuracy of the matching in the subsequent matching; the feature points of the workpiece to be detected are confirmed by the brightness of the pixel points to form the edge area contour of the workpiece to be detected and the local area contour of the workpiece to be detected of the workpiece image to be detected; and the sample workpiece feature points are clustered by the brightness of the pixel points to form the edge area contour of the sample workpiece and the local area contour of the sample workpiece of the sample workpiece image; the area contours of the workpiece image to be detected and the sample workpiece image are used for matching;

[0113] Furthermore, the workpiece feature points in the area contour are vectorized to form a brightness feature descriptor, and the brightness feature descriptors of the two are matched; if the match fails, the brightness feature descriptors of the two are verified, the feature pixels of the two brightness feature descriptors are converted, the failed feature pixels are divided into a brightness image block to be detected and a sample brightness image block, and only the area of ​​the image block is detected to reduce the time wasted due to excessive image data during detection, and the brightness image block to be detected and the sample brightness image block are histogram-equalized to obtain a histogram-equalized image to be detected and a sample histogram-equalized image, the number of highlight pixels of the two are calculated by a formula to obtain the final highlight pixel frequency, and the final verification is performed through the highlight pixel frequency, thereby reducing the possibility of misjudgment.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. A person skilled in the art may modify the technical solutions described in the above embodiments, or replace part or all of the technical features therein with equivalents. However, these modifications or replacements 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 and processing defects of a static arc contact workpiece based on image detection and recognition, characterized in that: The steps are as follows: Collect the sample workpiece image and the video image of the current workpiece to be detected, obtain each video frame in the video image of the current workpiece to be detected to obtain the corresponding workpiece image to be detected, then detect the feature points of the workpiece to be detected in the current workpiece image to be detected, and output the detection results of the feature points of the workpiece to be detected; Based on the detection results of the feature points of the workpiece to be detected, the video frame is divided into an inner region image of the workpiece to be detected and a global image of the workpiece to be detected, wherein the inner region image of the workpiece to be detected includes a workpiece surface image of a local region of the workpiece to be detected, and the global image of the workpiece to be detected is a workpiece surface image including an edge region of the workpiece to be detected; Based on the sample workpiece image, the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, the SIFT model is inputted respectively, and the defects of the sample workpiece image are matched and judged based on the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, so as to judge whether the image of the workpiece to be detected has defects; The image of the inner region of the workpiece to be detected is input into the SIFT model, and the feature points of the workpiece to be detected are extracted to form the workpiece surface image of the local region contour of the workpiece to be detected of the image of the inner region of the workpiece to be detected. The specific operation steps are as follows: The image of the inner region of the workpiece to be detected is sampled in descending order to form a pyramid image, the pyramid image is input into the SIFT model for Gaussian convolution, and a plurality of blurred image groups of different sizes are obtained, each group of blurred images is divided into a plurality of blurred image layers, and each layer of blurred images has the same size, so as to obtain a Gaussian pyramid image of the inner region of the workpiece to be detected; the adjacent blurred images of each layer of blurred images of each group of the pyramid image of the inner region of the workpiece to be detected are traversed to perform difference, so as to obtain a Gaussian difference image of the inner region; Filtering the pixel points of the inner region Gaussian difference image to obtain feature points of the workpiece to be detected, judging the pixel brightness of the pixel points of the inner region Gaussian difference image, and presetting the pixel brightness threshold t; if the pixel brightness is greater than the preset pixel brightness threshold t, retaining the pixel; If the brightness of the pixel is less than or equal to the preset brightness threshold t of the pixel, the pixel is removed; Clustering the adjacent pixels with the same brightness to form pixel brightness clusters with different brightness, and judging whether the brightness of the pixel brightness cluster is greater than a preset brightness cluster threshold L, if the brightness of the pixel brightness cluster is greater than the preset brightness cluster threshold L, retaining the pixel brightness cluster; If the brightness of the pixel point brightness cluster is less than or equal to the preset brightness cluster threshold L, the pixel point brightness cluster is eliminated; The retained pixel brightness clusters are feature points of the workpiece to be detected. The feature points of the workpiece to be detected are connected to obtain a workpiece surface image of the local area contour of the workpiece to be detected and an internal area image of the workpiece to be detected.

2. According to claim 1, a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition, characterized in that: The global image of the workpiece to be detected is input into the SIFT model, and the feature points of the workpiece to be detected are extracted to form the workpiece surface image of the edge area contour of the workpiece to be detected. The specific operation steps are as follows: The global image of the workpiece to be detected is sampled in descending order to form a pyramid image, the pyramid image is input into a SIFT model for Gaussian convolution, and a plurality of blurred image groups of different sizes are obtained, each group of blurred images is divided into a plurality of blurred image layers, and each layer of blurred images has the same size, so as to obtain a global Gaussian pyramid image of the workpiece to be detected; the global pyramid image of the workpiece to be detected is traversed through each group of adjacent blurred images of each layer of blurred images to obtain a global Gaussian difference image; Filtering the pixel points of the global Gaussian difference image to obtain feature points of the workpiece to be detected, judging the pixel brightness of the pixel points of the global Gaussian difference image, and presetting the pixel brightness threshold t; if the pixel brightness is greater than the preset pixel brightness threshold t, retaining the pixel; If the brightness of the pixel is less than or equal to the preset brightness threshold t of the pixel, the pixel is removed; Determine whether the brightness of the retained pixel is greater than that of the adjacent pixel that is also retained. If the brightness of the pixel is greater than that of the adjacent pixel, determine that the pixel is a feature point of the workpiece to be detected; if the brightness of the pixel is less than or equal to that of the adjacent pixel, remove the pixel for the second time. The determined feature points of the workpiece to be detected are connected to obtain a workpiece surface image of the edge area contour of the workpiece to be detected.

3. According to claim 2, a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition, characterized in that: The sample workpiece image is input into the SIFT model, and the feature points of the sample workpiece are extracted to form the workpiece surface image of the edge area contour of the sample workpiece and the workpiece surface image of the local area contour of the sample workpiece. The specific operation steps are as follows: The sample workpiece image is sampled in descending order to form a pyramid image, the pyramid image is input into a SIFT model for Gaussian convolution, and a plurality of blurred image groups of different sizes are obtained, each group of blurred images is divided into a plurality of blurred image layers, and each layer of blurred images has the same size, so as to obtain a sample workpiece Gaussian pyramid image; the sample workpiece Gaussian pyramid image is traversed through adjacent blurred images of each layer of blurred images of each group to perform difference, so as to obtain a sample Gaussian difference image; the pixel points of the sample Gaussian difference image are screened to obtain the sample workpiece feature points, and the brightness of adjacent identical pixels of the sample Gaussian difference image is directly clustered to form a plurality of pixel brightness clusters; A preset brightness cluster threshold k is set for the pixel brightness cluster. If the pixel brightness cluster is greater than the preset brightness cluster threshold k, the pixel brightness cluster is determined as an edge sample workpiece feature point, and connected to form a workpiece surface image of the edge area contour of the sample workpiece; If the pixel brightness cluster is less than the preset brightness cluster threshold k, the pixel brightness cluster is determined as the local sample workpiece feature point of the workpiece to be detected, and is connected to form a workpiece surface image of the local area contour of the sample workpiece; if the pixel brightness cluster is equal to the preset brightness cluster threshold k, the pixel brightness cluster is eliminated.

4. According to claim 1, a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition, characterized in that: Based on the image of the area inside the workpiece to be detected and the global image of the workpiece to be detected, the defects of the sample workpiece image are matched and judged to determine whether the image of the workpiece to be detected has defects. The specific operation steps are as follows: Defect judgment is performed on the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected, and the contour of the local area of ​​the sample workpiece and the contour of the edge area of ​​the sample workpiece of the sample workpiece image; the contour of the local area of ​​the workpiece to be detected and the contour of the local area of ​​the sample workpiece are judged to see whether they match; the contour of the edge area of ​​the workpiece to be detected and the contour of the edge area of ​​the sample workpiece are judged to see whether they match; When any one of the contour of the local area of ​​the workpiece to be detected and the contour of the edge area of ​​the workpiece to be detected in the image of the workpiece to be detected fails to match, it is determined that a defect of the workpiece to be detected occurs in the image of the workpiece to be detected.

5. The method for detecting and processing static arc contact workpiece defects based on image detection and recognition according to claim 4 is characterized in that: The contour of the local area of ​​the workpiece to be detected is judged to be matched with the contour of the local area of ​​the sample workpiece; the contour of the edge area of ​​the workpiece to be detected is judged to be matched with the contour of the edge area of ​​the sample workpiece. The specific operation steps are as follows: The position, scale and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the workpiece image to be detected, and vectorized to generate a brightness feature descriptor to be detected; the regional contour generated by the sample workpiece image is composed of sample workpiece feature points connected, and the position, scale and direction information of the feature points of the workpiece to be detected are determined by the SIFT model of the sample workpiece image, and vectorized to generate a sample brightness feature descriptor; Matching the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece with the sample brightness feature descriptor of the local area contour of the sample workpiece, and judging whether the brightness of the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece are successfully matched, and judging that the to-be-detected workpiece local area contour and the sample workpiece local area contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the local area contour of the to-be-detected workpiece and the sample brightness feature descriptor of the local area contour of the sample workpiece fail to match; Matching the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour with the sample brightness feature descriptor of the sample workpiece edge region contour, and judging whether the brightness of the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour are the same; if the brightness is the same, the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour are successfully matched, and it is judged that the to-be-detected workpiece edge region contour and the sample workpiece edge region contour are successfully matched; if the brightness is not the same, the to-be-detected brightness feature descriptor of the to-be-detected workpiece edge region contour and the sample brightness feature descriptor of the sample workpiece edge region contour fail to match; The brightness feature descriptor to be detected that fails to match is further verified; a balanced histogram is obtained for the brightness feature descriptor to be detected of the workpiece image to be detected that fails to match and the sample feature descriptor of the sample workpiece image that matches the workpiece image through a histogram with uniform grayscale distribution, so as to obtain a histogram balanced image to be detected and a sample histogram balanced image; the histogram balanced image to be detected and the sample histogram balanced image are matched, and if the match is successful, the workpiece image to be detected is intact; if the match is unsuccessful, the workpiece image to be detected has defects.

6. According to claim 5, a method for detecting and processing defects of a static arc contact workpiece based on image detection and recognition is characterized in that: The brightness feature descriptor of the to-be-detected workpiece image that failed to match and the sample feature descriptor of the sample workpiece image that matched the to-be-detected workpiece image are obtained by using a histogram with uniform grayscale distribution to obtain a balanced histogram, so as to obtain a histogram balanced image to be detected and a sample histogram balanced image; the histogram balanced image to be detected and the sample histogram balanced image are matched, and the specific operation steps are as follows: The brightness feature descriptor to be detected of the image of the workpiece to be detected that fails to match is converted into feature pixels to be detected, and the feature pixels to be detected are segmented into image blocks to obtain brightness image blocks to be detected; the brightness image blocks to be detected are converted into grayscale images to be detected by a histogram equalization algorithm, and the grayscale images to be detected are adjusted to have the same image size and image type as the sample brightness image blocks to obtain an adjusted grayscale image to be detected, and the adjusted grayscale image to be detected is histogram-equalized to obtain a histogram-equalized image to be detected; According to the minimum pixel grayscale of the histogram-equalized image to be detected, the histogram-equalized image to be detected is stretched to obtain the stretched histogram-equalized image to be detected, and the number of highlight pixels of different brightness levels in each interval of the stretched histogram-equalized image to be detected and the number of all highlight pixels are identified and calculated: The frequency Do of the jth highlighted pixel in the stretched histogram-equalized image to be detected is calculated based on the number of highlighted pixels of different brightness levels in each interval, the number of all highlighted pixels in each interval, and the total number of intervals; Converting the sample brightness feature descriptor of the sample artifact image corresponding to the sample brightness feature descriptor of the sample artifact image that failed to match into sample feature pixel points, segmenting the sample feature pixel points into image blocks, and obtaining sample brightness image blocks; converting the sample brightness image blocks into sample grayscale images by using a histogram equalization algorithm, and performing histogram equalization on the sample grayscale images to obtain sample histogram equalized images; According to the minimum pixel grayscale of the sample histogram-equalized image, the sample histogram-equalized image is stretched to obtain a stretched sample histogram-equalized image, and the number of highlight pixels of different brightness levels in each interval of the stretched sample histogram-equalized image and the number of all highlight pixels are identified and calculated: Similarly, the frequency Su of the jth highlight pixel in the stretched sample histogram-equalized image is calculated based on the number of highlight pixels of different brightness levels in each interval, the number of all highlight pixels in each interval, and the total number of intervals; The highlight pixel frequency difference is calculated by calculating the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected, and judging whether the highlight pixel frequency difference between the two is less than the preset highlight pixel frequency threshold z; when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is less than the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block successfully; when the difference between the highlight pixel frequency Su of the stretched sample histogram-equalized image and the highlight pixel frequency Do of the stretched histogram-equalized image to be detected is greater than or equal to the preset highlight pixel frequency threshold z, the brightness image block to be detected matches the sample brightness image block unsuccessfully.

7. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of a static arc contact workpiece defect detection and processing method based on image detection and recognition as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Transparent part surface defect rapid detection method and device

    CN114998216A

  • Hardware part defect detection method and system based on image recognition technology

    CN115620061A

  • Method for adaptive flawdetection on an inhomogeneous surface

    EP1486918A2