CN117635615A - Defect detection method and system for realizing punching die based on deep learning - Google Patents

Defect detection method and system for realizing punching die based on deep learning Download PDF

Info

Publication number
CN117635615A
CN117635615A CN202410107861.3A CN202410107861A CN117635615A CN 117635615 A CN117635615 A CN 117635615A CN 202410107861 A CN202410107861 A CN 202410107861A CN 117635615 A CN117635615 A CN 117635615A
Authority
CN
China
Prior art keywords
image
pixel
die
region
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410107861.3A
Other languages
Chinese (zh)
Inventor
杨明卫
贺云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Changfeng Laser Knife Mould Co ltd
Original Assignee
Shenzhen Changfeng Laser Knife Mould Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Changfeng Laser Knife Mould Co ltd filed Critical Shenzhen Changfeng Laser Knife Mould Co ltd
Priority to CN202410107861.3A priority Critical patent/CN117635615A/en
Publication of CN117635615A publication Critical patent/CN117635615A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of product defect detection, and provides a defect detection method and system for realizing a punching die based on deep learning, wherein the defect detection method comprises the following steps: image acquisition is carried out on the punching grinding tool to obtain a punching die image, and image distortion correction is carried out on the punching die image to obtain a corrected die image; denoising the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and performing image optimization on the denoised die image to obtain an optimized die image; extracting super pixel units in the optimized die image, calculating the segmentation contrast of each unit in the super pixel units, and carrying out image segmentation processing on the optimized die image to obtain a segmented die image; and identifying a defect area in the connected area, extracting defect parameters corresponding to the defect area, and generating a defect detection report corresponding to the punching die. The invention aims to improve the defect detection accuracy of the punching die.

Description

Defect detection method and system for realizing punching die based on deep learning
Technical Field
The invention relates to the technical field of product defect detection, in particular to a defect detection method and system for realizing a punching die based on deep learning.
Background
A punching die is composed of upper die, lower die and guide part, and is made of steel or other antiwear material.
The existing defect detection method of the punching die mainly adopts an ultrasonic detection method, wherein ultrasonic waves are transmitted into the punching die by using an ultrasonic probe, and defects are detected according to returned acoustic wave signals, but the ultrasonic detection is influenced by various factors in the use process of the method, such as the material, the geometric shape, the thickness and the like of the punching die, and the propagation mode and the attenuation characteristic of ultrasonic waves, so that errors are caused in the result, the defect detection accuracy of the punching die is reduced, and a method capable of improving the defect detection accuracy of the punching die is needed.
Disclosure of Invention
The invention provides a method and a system for realizing defect detection of a punching die based on deep learning, and mainly aims to improve the defect detection accuracy of the punching die.
In order to achieve the above object, the present invention provides a defect detection method for realizing a punching die based on deep learning, comprising:
scheduling a shooting camera corresponding to a punching grinder, calculating a distortion coefficient corresponding to the shooting camera, acquiring an image of the punching grinder by using the shooting camera to obtain a punching die image, and correcting the image distortion of the punching die image according to the distortion coefficient to obtain a corrected die image;
denoising the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and performing image optimization on the denoised die image according to the smooth pixel value to obtain an optimized die image;
extracting super pixel units in the optimized die image, calculating a unit gray value and a gray standard deviation of each single unit in the super pixel units, calculating a segmentation contrast of each unit in the super pixel units according to the unit gray value and the gray standard deviation, and performing image segmentation processing on the optimized die image according to the segmentation contrast to obtain a segmented die image;
Dividing a connected region in the segmented mold image, extracting region characteristics corresponding to the connected region, identifying a defect region in the connected region according to the region characteristics, extracting defect parameters corresponding to the defect region, and generating a defect detection report corresponding to the punching mold according to the defect parameters and the defect region.
Optionally, the calculating the distortion coefficient corresponding to the shooting camera includes:
configuring a calibration plate corresponding to the shooting camera, and setting shooting requirements corresponding to the shooting camera;
according to the shooting requirements, the shooting camera is utilized to acquire images of the calibration plate, and a calibration plate image is obtained;
respectively constructing physical coordinates corresponding to the calibration plate and the calibration plate image to obtain a first physical coordinate and a second physical coordinate;
respectively carrying out corner detection on the calibration plate and the calibration plate image to obtain a first corner and a second corner;
calculating a deviation coefficient between the first corner point and the second corner point by combining the first physical coordinate and the second physical coordinate;
and obtaining a distortion coefficient corresponding to the shooting camera according to the deviation coefficient.
Optionally, the performing image distortion correction on the punching die image according to the distortion coefficient to obtain a corrected die image includes:
the distortion coefficients comprise radial distortion coefficients and tangential distortion coefficients;
constructing a radial distortion model and a tangential distortion model corresponding to the punching die image according to the radial distortion coefficient and the tangential distortion coefficient;
extracting distortion characteristics in the punching die image, and determining a distortion type corresponding to each image in the punching die image according to the distortion characteristics;
and respectively carrying out distortion correction on the punching die image by using the radial distortion model and the tangential distortion model according to the distortion type to obtain a corrected die image.
Optionally, the calculating a smoothed pixel value corresponding to each pixel in the denoised mold image includes:
measuring a pixel value and the number of pixels corresponding to each pixel in the denoising mold image;
distributing a pixel weight corresponding to each pixel in the corrected die image according to the pixel value;
setting a convolution matrix corresponding to each pixel in the corrected die image according to the pixel number;
And calculating a smooth pixel value corresponding to each pixel in the denoising mold image according to the pixel weight and the convolution matrix.
Optionally, the calculating, according to the pixel weight and the convolution matrix, a smoothed pixel value corresponding to each pixel in the denoising mold image includes:
and calculating a smooth pixel value corresponding to each pixel in the denoising mold image through the following formula:
wherein A represents a smooth pixel value corresponding to each pixel in the denoising mold image, and BRepresenting the i-th pixel coordinate, +.>Represents the convolution matrix, a and b represent the number of rows and columns of the convolution matrix, +.>And the pixel weight of the ith pixel point is represented.
Optionally, the performing image optimization processing on the denoising mold image according to the smooth pixel value to obtain an optimized mold image, including:
according to the smooth pixel value, performing pixel updating processing on the denoising mold image to obtain an updated mold image;
identifying image features in the updated mold image, and carrying out enhancement processing on the image features to obtain enhanced image features;
detecting an image edge in the updated mold image, and sharpening the image edge to obtain a sharpened image edge;
And combining the enhanced image features and the sharpened image edges, and performing optimization treatment on the denoising mold to obtain an optimized mold image.
Optionally, the dividing the connected region in the split mold image includes:
extracting image size parameters corresponding to the segmentation die image, wherein the image size parameters comprise image height and image width;
calculating a binarization threshold value of the segmentation mould image according to the image height and the image width;
according to the binarization threshold value, carrying out binarization processing on the segmented mold image to obtain a binarization image;
extracting pixel attributes corresponding to each pixel in the binarized image, and analyzing attribute similarity among the pixel attributes;
determining a pixel relationship corresponding to each pixel in the binarized image according to the attribute similarity;
and dividing the connected areas in the split mold image according to the pixel relation.
Optionally, the calculating the binarization threshold of the segmented mold image according to the image height and the image width includes:
calculating a binarization threshold of the segmented mold image by the following formula:
Wherein F represents a binarization threshold value of the split mold image, G represents an image height, K represents an image width,representing the coordinate point in the divided mold image as +.>Is a pixel value of (a).
Optionally, the extracting the region feature corresponding to the connected region includes:
performing contour detection on the communication region to obtain a region contour;
calculating the area of the region corresponding to the connected region according to the region outline, and constructing a gray level histogram of the connected region;
extracting regional texture features corresponding to the connected region according to the gray level histogram;
extracting the regional color characteristics of the communication region by using a preset color space model;
and obtaining the region characteristics corresponding to the communication region according to the region area, the texture characteristics and the region color characteristics.
A defect detection system for realizing a punching die based on deep learning, the system comprising:
the image correction module is used for scheduling shooting cameras corresponding to the punching grinding tool, calculating distortion coefficients corresponding to the shooting cameras, carrying out image acquisition on the punching grinding tool by utilizing the shooting cameras to obtain a punching die image, and carrying out image distortion correction on the punching die image according to the distortion coefficients to obtain a corrected die image;
The image optimization module is used for carrying out denoising treatment on the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and carrying out image optimization treatment on the denoised die image according to the smooth pixel value to obtain an optimized die image;
the image segmentation module is used for extracting super pixel units in the optimized die image, calculating a unit gray value and a gray standard deviation of each single unit in the super pixel units, calculating segmentation contrast of each unit in the super pixel units according to the unit gray value and the gray standard deviation, and carrying out image segmentation processing on the optimized die image according to the segmentation contrast to obtain a segmented die image;
the defect identification module is used for dividing the connected region in the segmented mold image, extracting region characteristics corresponding to the connected region, identifying a defect region in the connected region according to the region characteristics, extracting defect parameters corresponding to the defect region, and generating a defect detection report corresponding to the punching mold according to the defect parameters and the defect region.
The invention is convenient for correcting and processing the image shot by the shooting camera and improving the accuracy of the image of the punching die by calculating the distortion coefficient corresponding to the shooting camera, and is convenient for improving the quality of the image of the denoising die and improving the definition of the image of the denoising die by calculating the smooth pixel value corresponding to each pixel in the image of the denoising die. Therefore, the defect detection method and system for realizing the punching die based on deep learning provided by the embodiment of the invention can improve the defect detection accuracy of the punching die.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting defects of a punching die based on deep learning according to an embodiment of the invention;
fig. 2 is a functional block diagram of a defect detection system for implementing a punching die based on deep learning according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a defect detection method for realizing a punching die based on deep learning. In the embodiment of the present application, the execution body of the method for implementing defect detection of a punching die based on deep learning includes, but is not limited to, at least one of a server, a terminal, and an electronic device capable of being configured to execute the method provided in the embodiment of the present application. In other words, the defect detection method for realizing the punching die based on deep learning can be executed by software or hardware installed in the terminal equipment or the server equipment, wherein the software can be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a schematic flow chart of a method for implementing defect detection of a punching die based on deep learning according to an embodiment of the invention is shown. In this embodiment, the method for detecting defects of the punching die based on deep learning includes steps S1 to S4.
S1, dispatching a shooting camera corresponding to a punching grinding tool, calculating a distortion coefficient corresponding to the shooting camera, utilizing the shooting camera to acquire images of the punching grinding tool to obtain a punching die image, and carrying out image distortion correction on the punching die image according to the distortion coefficient to obtain a corrected die image.
The invention facilitates the subsequent correction processing of the image shot by the shooting camera by calculating the distortion coefficient corresponding to the shooting camera, and improves the accuracy of the image of the punching die, wherein the punching grinding tool is a tool for processing the punching aperture and the shape on a workpiece and is usually made of hard materials such as high-speed steel, hard alloy or ceramic, and the distortion coefficient is the degree of difference between the image of the object shot by the shooting camera and the actual object.
As one embodiment of the present invention, the calculating the distortion coefficient corresponding to the photographing camera includes: configuring a calibration plate corresponding to the shooting camera, setting shooting requirements corresponding to the shooting camera, carrying out image acquisition on the calibration plate by utilizing the shooting camera according to the shooting requirements to obtain a calibration plate image, respectively constructing physical coordinates corresponding to the calibration plate and the calibration plate image to obtain a first physical coordinate and a second physical coordinate, respectively carrying out angular point detection on the calibration plate and the calibration plate image to obtain a first angular point and a second angular point, combining the first physical coordinate and the second physical coordinate, calculating a deviation coefficient between the first angular point and the second angular point, and obtaining a distortion coefficient corresponding to the shooting camera according to the deviation coefficient.
Wherein the calibration plate is a calibration plate typically consisting of a series of parallel black and white squares, each square having a known size and a regular shape, the photographing requirements being photographing rules corresponding to the photographing camera, such as different photographing angles and photographing positions, etc., the first physical coordinates and the second physical coordinates being coordinate systems corresponding to the calibration plate and the calibration plate image, respectively, the first corner point and the second corner point being intersection points in the calibration plate and the calibration plate image, respectively, the deviation coefficient representing a degree of deviation between the first corner point and the second corner point.
Optionally, the physical coordinates corresponding to the calibration board and the calibration board image may be respectively constructed and implemented by a coordinate tool, such as AutoCAD, and the corner detection of the calibration board and the calibration board image may be implemented by a corner detection algorithm, such as a findchessbard markers function, according to the first physical coordinates and the second physical coordinates, coordinate values corresponding to the first corner and the second corner are determined, a difference value between the coordinate values is calculated, and a deviation coefficient of the first corner and the second corner is obtained according to the difference value.
According to the invention, the image distortion correction is carried out on the punching die image according to the distortion coefficient, so that the real shape of the punching die image can be recovered, and the image quality is improved.
As one embodiment of the present invention, the performing image distortion correction on the punching die image according to the distortion coefficient to obtain a corrected die image includes: the distortion coefficients comprise radial distortion coefficients and tangential distortion coefficients, a radial distortion model and a tangential distortion model corresponding to the punching die image are constructed according to the radial distortion coefficients and the tangential distortion coefficients, distortion characteristics in the punching die image are extracted, distortion types corresponding to each image in the punching die image are determined according to the distortion characteristics, and the radial distortion model and the tangential distortion model are used for carrying out distortion correction on the punching die image according to the distortion types, so that a corrected die image is obtained.
The radial distortion coefficient and the tangential distortion coefficient are the corresponding deformation degrees of the image shot by the shooting camera in the transverse direction and the longitudinal direction, the radial distortion model is used for correcting radial distortion in the punching die image, the tangential distortion model is used for correcting tangential distortion in the punching die image, the distortion characteristic is the distortion type of the punching die image, and a straight line in the image is in a bent or contracted shape.
Optionally, the construction of the radial distortion model and the tangential distortion model corresponding to the punching die image can be realized through a model construction tool, the model construction tool is compiled by a scripting language, and the extraction of the distortion features in the punching die image can be realized through a grid distortion analysis method.
S2, denoising the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and performing image optimization on the denoised die image according to the smooth pixel value to obtain an optimized die image.
According to the method, the smooth pixel value corresponding to each pixel in the denoising mold image is calculated so as to facilitate the subsequent improvement of the quality of the denoising mold image and improve the definition of the denoising mold image, wherein the denoising mold image is an image obtained by removing noise interference in the correction mold image, the smooth pixel value is a stable pixel value in the denoising mold image, and optionally, denoising of the correction mold image can be achieved through a low-pass filter.
As one embodiment of the present invention, the calculating a smoothed pixel value corresponding to each pixel in the denoised mold image includes: and measuring a pixel value and the number of pixels corresponding to each pixel in the denoising mold image, distributing a pixel weight corresponding to each pixel in the correction mold image according to the pixel value, setting a convolution matrix corresponding to each pixel in the correction mold image according to the number of pixels, and calculating a smooth pixel value corresponding to each pixel in the denoising mold image according to the pixel weight and the convolution matrix.
The pixel weight value represents the importance degree corresponding to each pixel in the denoising mold image, the convolution matrix is a pixel square matrix of each pixel in the correction mold image, optionally, the pixel weight value corresponding to each pixel in the correction mold image can be distributed according to the ratio by calculating the ratio of the pixel value to all pixel values, the pixel density of the correction mold image can be calculated according to the pixel number, the convolution matrix corresponding to each pixel in the correction mold image is set according to the pixel density, for example, for a region with higher pixel density, a smaller convolution matrix can be selected to capture details more accurately; for areas with lower pixel density, a larger convolution matrix may be selected.
Optionally, as an optional embodiment of the present invention, the calculating, according to the pixel weight and the convolution matrix, a smoothed pixel value corresponding to each pixel in the denoised mold image includes:
and calculating a smooth pixel value corresponding to each pixel in the denoising mold image through the following formula:
wherein A represents a smooth pixel value corresponding to each pixel in the denoising mold image, and B Representing the i-th pixel coordinate, +.>Represents the convolution matrix, a and b represent the number of rows and columns of the convolution matrix, +.>And the pixel weight of the ith pixel point is represented.
According to the method, the image optimization processing is carried out on the denoising mold image according to the smooth pixel value, so that the visual perception of the denoising mold image can be improved, and a basis is provided for subsequently improving the extraction accuracy of the super pixel unit.
As one embodiment of the present invention, the performing image optimization processing on the denoising mold image according to the smoothed pixel value to obtain an optimized mold image includes: and carrying out pixel updating processing on the denoising mold image according to the smooth pixel value to obtain an updated mold image, identifying image features in the updated mold image, carrying out enhancement processing on the image features to obtain enhanced image features, detecting image edges in the updated mold image, carrying out sharpening processing on the image edges to obtain sharpened image edges, and carrying out optimization processing on the denoising mold by combining the enhanced image features and the sharpened image edges to obtain an optimized mold image.
The image features are image features in the updated mold image, the enhanced image features are features obtained by enhancing the image features, the image edges are positions which change obviously in the updated mold image, and the sharpened image edges are edges obtained by enhancing the image edges.
Optionally, identifying the image features in the updated mold image may be implemented by a Sobel algorithm, performing enhancement processing on the image features may be implemented by a histogram equalization method, detecting the image edges in the updated mold image may be implemented by an edge detection algorithm, such as a Canny operator, and performing sharpening processing on the image edges may be implemented by a laplace filtering method.
S3, extracting super pixel units in the optimized die image, calculating a unit gray value and a gray standard deviation of each unit in the super pixel units, calculating a segmentation contrast of each unit in the super pixel units according to the unit gray value and the gray standard deviation, and performing image segmentation processing on the optimized die image according to the segmentation contrast to obtain a segmented die image.
The invention can know the difference degree between the super pixel unit and the optimized die image by calculating the segmentation contrast of each unit in the super pixel unit, thereby being convenient for improving the accuracy of image segmentation, wherein the super pixel unit is an advanced unit formed by a plurality of pixels in the image, the segmentation contrast is a measure in an image segmentation task and reflects the brightness variation degree of different areas in the optimized die image, the gray level of the unit is the average gray level of each unit in the super pixel unit, and the steps of extracting the super pixel unit in the optimized die image are as follows: the method comprises the steps of selecting a plurality of seed pixels as starting points, wherein the seed pixels can be randomly selected pixels or pixels selected according to attributes such as colors, textures and the like, gradually adding neighborhood pixels similar to the seed pixels into a super-pixel unit by using a similarity principle, calculating similarity measurement based on characteristics such as colors, textures, gradients and the like of the pixels, iterating until all the similar pixels are added into the super-pixel unit, merging adjacent super-pixel units to reduce redundant and overlapped areas, merging, performing isolated point removing operation on the extracted super-pixel units according to the similarity between the adjacent super-pixel units to improve the quality of the super-pixel units, calculating the gray level value of each single unit in the super-pixel unit by using an average function, and enabling the gray level standard deviation to be realized by using a standard deviation calculator which is compiled by JAVA language.
As one embodiment of the present invention, the calculating the division contrast of each of the super pixel units according to the unit gray value and the gray standard deviation includes:
calculating the segmentation contrast of each of the super pixel units by the following formula:
where E represents the segmentation contrast of each of the super-pixel cells, d and d+1 each represent the serial number of the super-pixel cell,a cell gray value representing the d-th cell of the super pixel cell, ">Single representing the (d+1) th cell of a super pixel cellMeta gray value->Gray standard deviation of the d-th cell of the super pixel cell is indicated,/->The gray standard deviation of the (d+1) th cell of the super pixel cell is represented.
According to the invention, the image segmentation processing is carried out on the optimized die image according to the segmentation contrast, the interested part in the optimized die image can be reserved, and the accuracy is improved for the identification of the subsequent communication area, wherein the segmentation die image is an image obtained after the segmentation processing of the optimized die image according to the segmentation contrast, and optionally, the image segmentation processing is carried out on the optimized die image by a threshold segmentation method.
S4, dividing a connected region in the segmented mold image, extracting region characteristics corresponding to the connected region, identifying a defect region in the connected region according to the region characteristics, extracting defect parameters corresponding to the defect region, and generating a defect detection report corresponding to the punching mold according to the defect parameters and the defect region.
The invention can obtain the closed region formed in the divided mold image by dividing the connected region in the divided mold image, thereby facilitating the identification processing of the subsequent defect region, wherein the connected region is the closed region in the divided mold image.
As one embodiment of the present invention, the dividing the connected region in the divided mold image includes: extracting image size parameters corresponding to the segmented mold image, wherein the image size parameters comprise image height and image width, calculating a binarization threshold of the segmented mold image according to the image height and the image width, performing binarization processing on the segmented mold image according to the binarization threshold to obtain a binarization image, extracting pixel attributes corresponding to each pixel in the binarization image, analyzing attribute similarity among the pixel attributes, determining a pixel relationship corresponding to each pixel in the binarization image according to the attribute similarity, and dividing a communication area in the segmented mold image according to the pixel relationship.
The binary threshold is a standard value set for pixel color when the binary processing is performed on the segmented mold image, if the pixel color is higher than the binary threshold, the pixel is set to be white, otherwise, the pixel color is set to be black, the binary image is an image expressed by the segmented mold image through black and white, the pixel attribute is a specific attribute of each pixel in the binary image, such as coordinate information or pixel direction, the attribute similarity is a similarity degree between the pixel attributes, and the pixel relationship is a relationship, such as a spatial relationship or a similarity relationship, between each pixel in the binary image.
Optionally, extracting an image size parameter corresponding to the segmented mold image may be implemented by a parameter extracting tool, the parameter extracting tool is compiled by a programming language, performing binarization processing on the segmented mold image may be implemented by an adaptive thresholding method, extracting a pixel attribute corresponding to each pixel in the binarized image may be implemented by a GetPixel method and a SetPixel method, performing vectorization processing on the pixel attribute to obtain an attribute vector, calculating a similarity between the attribute vectors, analyzing the attribute similarity of the pixel attribute according to the similarity, determining an adjacent relation between each pixel in the binarized image and an adjacent pixel according to the attribute similarity, and further determining a pixel relation corresponding to each pixel in the binarized image, for example, determining a relation between each pixel and an adjacent pixel in the binarized image according to a coordinate similarity in the attribute similarity, where the steps of dividing the communication area in the segmented mold image are as follows: initializing a connected region list for storing the identified connected regions, traversing each pixel in the binarized image according to the pixel relationship, starting progressive scanning from the upper left corner, judging whether each foreground pixel belongs to a certain connected region or not, if not, creating a new connected region, and adding the pixel into the region; if it already belongs to a certain connected region, the pixel is added to the region, when the pixel is added to the connected region, whether the adjacent pixel of the pixel is also a foreground pixel needs to be judged, if so, the adjacent pixel is also added to the same connected region, the process can be realized through a depth-first search (DFS) or a breadth-first search (BFS) algorithm, and after the traversal is completed, all the pixels are distributed to different connected regions.
Optionally, as an optional embodiment of the present invention, the calculating a binarization threshold of the segmented mold image according to the image height and the image width includes:
calculating a binarization threshold of the segmented mold image by the following formula:
where F denotes a binarization threshold value of the divided mold image, G denotes an image height, K denotes an image width, and H (m, n) denotes a pixel value of (m, n) as a coordinate point in the divided mold image.
According to the invention, the region characteristics corresponding to the communication region are extracted, so that the region characterization of the communication region can be obtained, and a basis is provided for the subsequent defect region identification, so that the defect detection accuracy of the punching die is improved, wherein the region characteristics are the region characterization in the communication region.
As an embodiment of the present invention, the extracting the region feature corresponding to the connected region includes: and carrying out contour detection on the connected region to obtain a region contour, calculating a region area corresponding to the connected region according to the region contour, constructing a gray level histogram of the connected region, extracting region texture features corresponding to the connected region according to the gray level histogram, extracting region color features of the connected region by using a preset color space model, and obtaining the region features corresponding to the connected region according to the region area, the texture features and the region color features.
The region outline is a region shape corresponding to the connected region, the gray level histogram is the number or frequency of pixels of each gray level in the connected region, the region texture feature is a texture representation corresponding to the connected region, and the color space model is a model for feature extraction, such as an HSV model.
Optionally, the contour detection of the connected region may be implemented by a K-probability edge detection method, the number of pixels in the contour of the region is identified by a scan line algorithm, where the number of pixels is the area of the region corresponding to the connected region, the gray level histogram of the connected region may be constructed by counting the number of gray levels in the connected region and the corresponding gray level value, combining the gray level value and the number of gray levels, and calculating the parameters corresponding to the gray level histogram, such as the average value, the variance, the skewness, and other statistical features.
The invention can obtain the description information related to the defect area by extracting the defect parameters corresponding to the defect area, thereby realizing quantification, classification and evaluation of defects and providing basis for subsequent processing and decision, wherein the defect parameters are the description parameters of the defect area, such as size parameters, shape parameters, color parameters, spatial relation parameters and the like, and the method for extracting the defect parameters corresponding to the defect area comprises the following steps: the size parameter is extracted by calculating parameters such as the number, perimeter, area, length, width and the like of pixels of the defect area to describe the size characteristics of the defect, the shape parameter can be extracted by using shape descriptors such as Hu moment, zernike moment, direction gradient histogram and the like, the descriptors can be obtained by processing and analyzing the boundaries of the defect area, the color parameter can be extracted by using color information of the color characteristics to describe the color information of the defect, common methods comprise calculating the color histogram, the color distribution characteristic, the color texture characteristic and the like of the defect area, the statistical parameter is extracted to carry out statistical analysis on the pixel values of the defect area such as mean value, variance, skewness, kurtosis and the like, the parameters can be used for describing the brightness characteristic of the defect area, the shape fitting parameter can be extracted by fitting the defect area into basic geometric shapes (such as ellipse, rectangle, circle and the like), and the parameters obtained after fitting such as fitting error, length-width ratio, eccentricity and the like are extracted to describe the defect shape.
The invention is convenient for correcting and processing the image shot by the shooting camera and improving the accuracy of the image of the punching die by calculating the distortion coefficient corresponding to the shooting camera, and is convenient for improving the quality of the image of the denoising die and improving the definition of the image of the denoising die by calculating the smooth pixel value corresponding to each pixel in the image of the denoising die. Therefore, the defect detection method for realizing the punching die based on deep learning provided by the embodiment of the invention can improve the defect detection accuracy of the punching die.
Fig. 2 is a functional block diagram of a defect detection system for implementing a punching die based on deep learning according to an embodiment of the present invention.
The defect detection system 100 for realizing the punching die based on deep learning can be installed in electronic equipment. Depending on the implementation, the defect detection system 100 for implementing the punching die based on deep learning may include an image correction module 101, an image optimization module 102, an image segmentation module 103, and a defect identification module 104. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the image correction module 101 is configured to schedule a shooting camera corresponding to a punching die, calculate a distortion coefficient corresponding to the shooting camera, acquire an image of the punching die by using the shooting camera, obtain a punching die image, and correct image distortion of the punching die image according to the distortion coefficient, so as to obtain a corrected die image;
The image optimization module 102 is configured to perform denoising processing on the corrected mold image to obtain a denoised mold image, calculate a smooth pixel value corresponding to each pixel in the denoised mold image, and perform image optimization processing on the denoised mold image according to the smooth pixel value to obtain an optimized mold image;
the image segmentation module 103 is configured to extract a superpixel unit in the optimized mold image, calculate a unit gray value and a gray standard deviation of each single unit in the superpixel unit, calculate a segmentation contrast of each unit in the superpixel unit according to the unit gray value and the gray standard deviation, and perform image segmentation processing on the optimized mold image according to the segmentation contrast to obtain a segmented mold image;
the defect identifying module 104 is configured to divide a connected region in the segmented mold image, extract a region feature corresponding to the connected region, identify a defect region in the connected region according to the region feature, extract a defect parameter corresponding to the defect region, and generate a defect detection report corresponding to the punching mold according to the defect parameter and the defect region.
In detail, each module in the defect detection system 100 for implementing a punching die based on deep learning in the embodiment of the present application adopts the same technical means as the defect detection method for implementing a punching die based on deep learning described in fig. 1, and can produce the same technical effects, which are not described herein.
In several embodiments provided by the present invention, it should be understood that the methods and systems provided may be implemented in other ways. For example, the above-described method embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and other manners of division may be implemented in practice.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. The defect detection method for realizing the punching die based on deep learning is characterized by comprising the following steps of:
Scheduling a shooting camera corresponding to a punching grinder, calculating a distortion coefficient corresponding to the shooting camera, acquiring an image of the punching grinder by using the shooting camera to obtain a punching die image, and correcting the image distortion of the punching die image according to the distortion coefficient to obtain a corrected die image;
denoising the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and performing image optimization on the denoised die image according to the smooth pixel value to obtain an optimized die image;
extracting super pixel units in the optimized die image, calculating a unit gray value and a gray standard deviation of each single unit in the super pixel units, calculating a segmentation contrast of each unit in the super pixel units according to the unit gray value and the gray standard deviation, and performing image segmentation processing on the optimized die image according to the segmentation contrast to obtain a segmented die image;
dividing a connected region in the segmented mold image, extracting region characteristics corresponding to the connected region, identifying a defect region in the connected region according to the region characteristics, extracting defect parameters corresponding to the defect region, and generating a defect detection report corresponding to the punching mold according to the defect parameters and the defect region.
2. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the calculating a distortion coefficient corresponding to the photographing camera comprises:
configuring a calibration plate corresponding to the shooting camera, and setting shooting requirements corresponding to the shooting camera;
according to the shooting requirements, the shooting camera is utilized to acquire images of the calibration plate, and a calibration plate image is obtained;
respectively constructing physical coordinates corresponding to the calibration plate and the calibration plate image to obtain a first physical coordinate and a second physical coordinate;
respectively carrying out corner detection on the calibration plate and the calibration plate image to obtain a first corner and a second corner;
calculating a deviation coefficient between the first corner point and the second corner point by combining the first physical coordinate and the second physical coordinate;
and obtaining a distortion coefficient corresponding to the shooting camera according to the deviation coefficient.
3. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the performing image distortion correction on the punching die image according to the distortion coefficient to obtain a corrected die image comprises:
The distortion coefficients comprise radial distortion coefficients and tangential distortion coefficients;
constructing a radial distortion model and a tangential distortion model corresponding to the punching die image according to the radial distortion coefficient and the tangential distortion coefficient;
extracting distortion characteristics in the punching die image, and determining a distortion type corresponding to each image in the punching die image according to the distortion characteristics;
and respectively carrying out distortion correction on the punching die image by using the radial distortion model and the tangential distortion model according to the distortion type to obtain a corrected die image.
4. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the calculating a smooth pixel value corresponding to each pixel in the denoising die image comprises:
measuring a pixel value and the number of pixels corresponding to each pixel in the denoising mold image;
distributing a pixel weight corresponding to each pixel in the corrected die image according to the pixel value;
setting a convolution matrix corresponding to each pixel in the corrected die image according to the pixel number;
and calculating a smooth pixel value corresponding to each pixel in the denoising mold image according to the pixel weight and the convolution matrix.
5. The method for detecting defects of a punching die based on deep learning according to claim 4, wherein the calculating a smooth pixel value corresponding to each pixel in the denoising die image according to the pixel weight and the convolution matrix comprises:
and calculating a smooth pixel value corresponding to each pixel in the denoising mold image through the following formula:
wherein A represents a smooth pixel value corresponding to each pixel in the denoising mold image, and BRepresenting the i-th pixel coordinate, +.>Represents the convolution matrix, a and b represent the number of rows and columns of the convolution matrix, +.>And the pixel weight of the ith pixel point is represented.
6. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the performing image optimization processing on the denoising die image according to the smooth pixel value to obtain an optimized die image comprises:
according to the smooth pixel value, performing pixel updating processing on the denoising mold image to obtain an updated mold image;
identifying image features in the updated mold image, and carrying out enhancement processing on the image features to obtain enhanced image features;
Detecting an image edge in the updated mold image, and sharpening the image edge to obtain a sharpened image edge;
and combining the enhanced image features and the sharpened image edges, and performing optimization treatment on the denoising mold to obtain an optimized mold image.
7. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the dividing the connected areas in the divided die image comprises:
extracting image size parameters corresponding to the segmentation die image, wherein the image size parameters comprise image height and image width;
calculating a binarization threshold value of the segmentation mould image according to the image height and the image width;
according to the binarization threshold value, carrying out binarization processing on the segmented mold image to obtain a binarization image;
extracting pixel attributes corresponding to each pixel in the binarized image, and analyzing attribute similarity among the pixel attributes;
determining a pixel relationship corresponding to each pixel in the binarized image according to the attribute similarity;
and dividing the connected areas in the split mold image according to the pixel relation.
8. The method for detecting defects of a punching die based on deep learning according to claim 7, wherein calculating the binarization threshold of the divided die image based on the image height and the image width comprises:
calculating a binarization threshold of the segmented mold image by the following formula:
wherein F represents a binarization threshold value of the split mold image, G represents an image height, K represents an image width,representing the coordinate point in the divided mold image as +.>Is a pixel value of (a).
9. The method for detecting defects of a punching die based on deep learning according to claim 1, wherein the extracting the region features corresponding to the connected regions comprises:
performing contour detection on the communication region to obtain a region contour;
calculating the area of the region corresponding to the connected region according to the region outline, and constructing a gray level histogram of the connected region;
extracting regional texture features corresponding to the connected region according to the gray level histogram;
extracting the regional color characteristics of the communication region by using a preset color space model;
and obtaining the region characteristics corresponding to the communication region according to the region area, the texture characteristics and the region color characteristics.
10. A defect detection system for realizing a punching die based on deep learning, the system comprising:
the image correction module is used for scheduling shooting cameras corresponding to the punching grinding tool, calculating distortion coefficients corresponding to the shooting cameras, carrying out image acquisition on the punching grinding tool by utilizing the shooting cameras to obtain a punching die image, and carrying out image distortion correction on the punching die image according to the distortion coefficients to obtain a corrected die image;
the image optimization module is used for carrying out denoising treatment on the corrected die image to obtain a denoised die image, calculating a smooth pixel value corresponding to each pixel in the denoised die image, and carrying out image optimization treatment on the denoised die image according to the smooth pixel value to obtain an optimized die image;
the image segmentation module is used for extracting super pixel units in the optimized die image, calculating a unit gray value and a gray standard deviation of each single unit in the super pixel units, calculating segmentation contrast of each unit in the super pixel units according to the unit gray value and the gray standard deviation, and carrying out image segmentation processing on the optimized die image according to the segmentation contrast to obtain a segmented die image;
The defect identification module is used for dividing the connected region in the segmented mold image, extracting region characteristics corresponding to the connected region, identifying a defect region in the connected region according to the region characteristics, extracting defect parameters corresponding to the defect region, and generating a defect detection report corresponding to the punching mold according to the defect parameters and the defect region.
CN202410107861.3A 2024-01-26 2024-01-26 Defect detection method and system for realizing punching die based on deep learning Pending CN117635615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410107861.3A CN117635615A (en) 2024-01-26 2024-01-26 Defect detection method and system for realizing punching die based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410107861.3A CN117635615A (en) 2024-01-26 2024-01-26 Defect detection method and system for realizing punching die based on deep learning

Publications (1)

Publication Number Publication Date
CN117635615A true CN117635615A (en) 2024-03-01

Family

ID=90035910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410107861.3A Pending CN117635615A (en) 2024-01-26 2024-01-26 Defect detection method and system for realizing punching die based on deep learning

Country Status (1)

Country Link
CN (1) CN117635615A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117974665A (en) * 2024-04-01 2024-05-03 深圳市深奇浩实业有限公司 Metal mold on-line detection method and equipment based on computer vision
CN117974665B (en) * 2024-04-01 2024-05-31 深圳市深奇浩实业有限公司 Metal mold on-line detection method and equipment based on computer vision

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103292701A (en) * 2013-06-24 2013-09-11 哈尔滨工业大学 Machine-vision-based online dimensional measurement method of precise instrument
CN105334219A (en) * 2015-09-16 2016-02-17 湖南大学 Bottleneck defect detection method adopting residual analysis and dynamic threshold segmentation
US20170004612A1 (en) * 2015-07-03 2017-01-05 Yuan Ze University Optical film defect detection method and system thereof
US20170116765A1 (en) * 2014-06-12 2017-04-27 Thomson Licensing Methods and systems for color processing of digital images
CN109190628A (en) * 2018-08-15 2019-01-11 东北大学 A kind of plate camber detection method based on machine vision
CN109682839A (en) * 2019-01-25 2019-04-26 中国船舶重工集团公司第七一六研究所 A kind of metal arc Surface Flaw online test method
CN113744270A (en) * 2021-11-05 2021-12-03 南京市特种设备安全监督检验研究院 Unmanned aerial vehicle visual detection and identification method for crane complex steel structure surface defects
CN114972329A (en) * 2022-07-13 2022-08-30 江苏裕荣光电科技有限公司 Image enhancement method and system of surface defect detector based on image processing
CN115063421A (en) * 2022-08-16 2022-09-16 成都数联云算科技有限公司 Pole piece region detection method, system and device, medium and defect detection method
CN115909079A (en) * 2023-01-09 2023-04-04 深圳大学 Crack detection method combining depth feature and self-attention model and related equipment
CN117036259A (en) * 2023-07-27 2023-11-10 苏州虹尔德金属制品有限公司 Metal plate surface defect detection method based on deep learning

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103292701A (en) * 2013-06-24 2013-09-11 哈尔滨工业大学 Machine-vision-based online dimensional measurement method of precise instrument
US20170116765A1 (en) * 2014-06-12 2017-04-27 Thomson Licensing Methods and systems for color processing of digital images
US20170004612A1 (en) * 2015-07-03 2017-01-05 Yuan Ze University Optical film defect detection method and system thereof
CN105334219A (en) * 2015-09-16 2016-02-17 湖南大学 Bottleneck defect detection method adopting residual analysis and dynamic threshold segmentation
CN109190628A (en) * 2018-08-15 2019-01-11 东北大学 A kind of plate camber detection method based on machine vision
CN109682839A (en) * 2019-01-25 2019-04-26 中国船舶重工集团公司第七一六研究所 A kind of metal arc Surface Flaw online test method
CN113744270A (en) * 2021-11-05 2021-12-03 南京市特种设备安全监督检验研究院 Unmanned aerial vehicle visual detection and identification method for crane complex steel structure surface defects
CN114972329A (en) * 2022-07-13 2022-08-30 江苏裕荣光电科技有限公司 Image enhancement method and system of surface defect detector based on image processing
CN115063421A (en) * 2022-08-16 2022-09-16 成都数联云算科技有限公司 Pole piece region detection method, system and device, medium and defect detection method
CN115909079A (en) * 2023-01-09 2023-04-04 深圳大学 Crack detection method combining depth feature and self-attention model and related equipment
CN117036259A (en) * 2023-07-27 2023-11-10 苏州虹尔德金属制品有限公司 Metal plate surface defect detection method based on deep learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHIHONG HUANG ET AL.: "Subpixel-Pixel-Superpixel Guided Fusion for Hyperspectral Anomaly Detection", IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING, vol. 58, no. 9, 28 February 2020 (2020-02-28), pages 5998 - 6007 *
廖苗 等: "一种新的图像超像素分割方法", 电子与信息学报, vol. 42, no. 2, 20 September 2019 (2019-09-20), pages 364 - 370 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117974665A (en) * 2024-04-01 2024-05-03 深圳市深奇浩实业有限公司 Metal mold on-line detection method and equipment based on computer vision
CN117974665B (en) * 2024-04-01 2024-05-31 深圳市深奇浩实业有限公司 Metal mold on-line detection method and equipment based on computer vision

Similar Documents

Publication Publication Date Title
CN115861135B (en) Image enhancement and recognition method applied to panoramic detection of box body
CN113538433B (en) Mechanical casting defect detection method and system based on artificial intelligence
CN113781402B (en) Method and device for detecting scratch defects on chip surface and computer equipment
CN110148130B (en) Method and device for detecting part defects
CN110378313B (en) Cell cluster identification method and device and electronic equipment
CN116664559B (en) Machine vision-based memory bank damage rapid detection method
CN110033516B (en) Needle flake particle content detection method based on binocular camera image acquisition and recognition
CN113109368B (en) Glass crack detection method, device, equipment and medium
CN110781885A (en) Text detection method, device, medium and electronic equipment based on image processing
CN107808138B (en) Communication signal identification method based on FasterR-CNN
CN111797744B (en) Multimode remote sensing image matching method based on co-occurrence filtering algorithm
CN116740072B (en) Road surface defect detection method and system based on machine vision
CN111354047B (en) Computer vision-based camera module positioning method and system
CN112288760B (en) Adherent cell image screening method and system and cell image analysis method
CN115294527A (en) Subway tunnel damage detection method based on computer vision
CN114862861A (en) Lung lobe segmentation method and device based on few-sample learning
CN114742849B (en) Leveling instrument distance measuring method based on image enhancement
CN115761606A (en) Box electric energy meter identification method and device based on image processing
CN117635615A (en) Defect detection method and system for realizing punching die based on deep learning
CN113780421B (en) Brain PET image identification method based on artificial intelligence
CN116403245B (en) Poultry breeding data analysis method and system
CN116883401B (en) Industrial product production quality detection system
CN114842021B (en) SAR image segmentation method based on region structure information and edge geometric penalty
CN117911409B (en) Mobile phone screen bad line defect diagnosis method based on machine vision
CN109271986B (en) Digital identification method based on Second-Confirm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination