CN-122023336-A - Heating wire defect detection method and system based on machine vision
Abstract
The invention relates to the technical field of machine vision detection, in particular to a heating wire defect detection method and system based on machine vision, comprising the following steps that S1, an original image dataset is constructed by utilizing an industrial camera to collect a high-resolution gray level image of the surface of a heating wire; the method comprises the steps of S2, preprocessing an image by adopting an adaptive filtering and threshold segmentation algorithm, removing background noise and extracting a heating line shape contour, S3, extracting a central skeleton path based on the shape contour, calculating the normal cross section width of the path, constructing a defect judging model by combining gray gradient information, S4, inputting the characteristic parameters obtained by calculation into the judging model, identifying broken circuit, abnormal line diameter and insulation breakage defects, and generating a detection result. According to the invention, the traditional manual visual inspection is replaced by a non-contact visual algorithm, a quantitative evaluation system based on morphology and gray scale characteristics is established, the problem that tiny defects are difficult to identify is effectively solved, and the detection precision and the automation level in the production process of the heating line are remarkably improved.
Inventors
- GU YIMING
- ZHONG WEIQIN
- YU JIAYANG
- CHEN JUNCHENG
- ZHOU SHIYING
- GUO JIAJUN
Assignees
- 东莞市源热电业有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (10)
- 1. The heating wire defect detection method based on machine vision is characterized by comprising the following steps of: S1, acquiring an original gray image of a heating line in a region to be detected, and transmitting the original gray image to an image processing unit; S2, denoising and binarizing the original gray level image, separating a heating line foreground area and a heating line background area, and generating a heating line binarization mask image; s3, carrying out skeleton extraction on the heating line binarization mask image to obtain a heating line central path coordinate set, and calculating a normal width data set and a local gray gradient value distributed along a path based on the central path coordinate set; S4, calculating a defect characteristic index according to the normal width data set and the local gray gradient value, comparing the defect characteristic index with a preset defect threshold value, judging whether a heating wire has defects or not, and outputting a detection result.
- 2. The machine vision-based heating wire defect detection method according to claim 1, wherein the step S1 specifically includes: Continuous scanning acquisition is carried out in the uniform motion process of the heating wire by matching the linear array CCD camera with a high-frequency backlight source; and splicing the acquired multi-frame local images into the complete original gray-scale image, and carrying out brightness equalization correction on the original gray-scale image to eliminate the influence of uneven illumination on the gray-scale distribution of the image.
- 3. The machine vision-based heating wire defect detection method according to claim 2, wherein the step S2 specifically includes: Smoothing the original gray level image by adopting a Gaussian filter algorithm, and inhibiting high-frequency random noise in the image; calculating an optimal segmentation threshold value by using an Otsu self-adaptive threshold value segmentation algorithm, and converting the smoothed image into the heating line binarization mask image; And carrying out morphological open operation processing on the heating wire binarization mask image, breaking off tiny adhesion noise points and filling tiny holes in the heating wire.
- 4. The machine vision-based heating wire defect detection method according to claim 3, wherein the process of extracting the heating wire center path coordinate set in step S3 specifically includes: iteratively stripping the heating wire binarization mask image subjected to morphological processing by using a thinning algorithm until a communication line with single pixel width is reserved, so as to generate a heating wire skeleton diagram; and traversing all pixel points in the heating line skeleton diagram, and establishing an ordered pixel coordinate sequence according to a communication relation to form the central path coordinate set.
- 5. The machine vision-based heating wire defect detection method according to claim 4, wherein the calculating of the defect characteristic index in step S4 is performed according to the following formula: ; Wherein, the Representing the calculated defect characteristic index, Representing the total number of skeleton pixels within the current detection window, Represents the first The normal width values at the individual skeleton pixel points, Representing a preset reference value of the width of the standard heating wire, Represents the first Local gray gradient values corresponding to the skeleton pixel points, Representing the weight coefficient of the width deviation, Representing a gray gradient weight coefficient; the normal width value is obtained by the following steps: And searching the edge of the foreground region along the normal direction of the framework tangent line by taking the framework pixel point as the center, and calculating the Euclidean distance between the edge points at the two sides.
- 6. The machine vision-based heating wire defect detection method according to claim 5, wherein the determining process in step S4 specifically includes: Acquiring a preset width abnormal threshold and a fracture judgment threshold; If the calculated defect characteristic index exceeds the width abnormality threshold and is smaller than the fracture judgment threshold, judging that the heating wire has the defect of uneven wire diameter; If the defect characteristic index exceeds the fracture judgment threshold value, judging that the heating wire has broken or serious breakage defects; and generating a detection report containing defect types, defect position coordinates and defect image screenshots.
- 7. The machine vision-based heating wire defect detection method of claim 6, further comprising: After judging that the heating line has defects, generating a shutdown control instruction or a rejection instruction, and sending the instruction to a production line PLC controller; and marking the defect position in real time on the display terminal, and selecting a defect area by using a red highlighting frame.
- 8. The machine vision-based heating wire defect detection method according to claim 7, wherein the step S2 further comprises: Counting the number of connected domains in the heating line binarization mask image; if the number of the connected domains is larger than 1, calculating the area and the length-width ratio characteristic of each connected domain; And eliminating the connected domain with the area smaller than the preset noise area threshold value, and reserving the main heating line area as a subsequent processing object.
- 9. The machine vision-based heating wire defect detection method of claim 8, further comprising: Storing the history detection data to a local database, wherein the history detection data comprises an original gray level image, a defect characteristic index and a judging result; and regularly calling historical data to iteratively optimize the width deviation weight coefficient and the gray gradient weight coefficient.
- 10. A machine vision-based heating wire defect detection system for implementing the machine vision-based heating wire defect detection method of any one of claims 1-9, the system comprising: The image acquisition module is configured to drive the industrial camera to shoot the heating line and output an original gray image; The preprocessing module is configured to receive the original gray level image, and perform denoising, binarization and morphological operation to generate a heating line binarization mask image; The characteristic analysis module is configured to extract a heating wire skeleton path, calculate a normal width and a local gray gradient, and calculate a defect characteristic index according to a formula; The defect judging module is configured to compare the defect characteristic index with a preset threshold value and generate a detection result comprising the defect type and the position.
Description
Heating wire defect detection method and system based on machine vision Technical Field The invention relates to the technical field of machine vision detection, in particular to a heating wire defect detection method and system based on machine vision. Background The machine vision detection technology is a technology for acquiring an image of a real object by using an optical imaging device, analyzing, measuring and judging image information by using a computer processing system, and further controlling industrial equipment to execute specific actions. In the field of industrial manufacturing, the technology is widely applied to links such as product appearance detection, dimension measurement, guiding and positioning, and the like, and becomes a core means for realizing intelligent manufacturing and quality control. The traditional heating wire detection is mainly based on manual visual inspection under a microscope or a magnifying glass, or a simple resistance on-off test is performed by using a universal meter. However, the manual detection mode is obviously influenced by subjective experience and visual fatigue of inspectors, is extremely easy to cause missed detection and misjudgment on micro cracks, local line diameter thinning or insulating layer micro damage, and can not sense physical defects of the heating line appearance structure by simple resistance test, so that strict requirements of modern high-speed production lines on the full detection rate and quality consistency of products are difficult to meet. Disclosure of Invention The invention aims to solve the defects in the prior art, and provides a heating wire defect detection method and system based on machine vision. In order to achieve the above purpose, the invention adopts the following technical scheme that the heating wire defect detection method based on machine vision comprises the following steps: S1, acquiring an original gray image of a heating line in a region to be detected, and transmitting the original gray image to an image processing unit; S2, denoising and binarizing the original gray level image, separating a heating line foreground area and a heating line background area, and generating a heating line binarization mask image; s3, carrying out skeleton extraction on the heating line binarization mask image to obtain a heating line central path coordinate set, and calculating a normal width data set and a local gray gradient value distributed along a path based on the central path coordinate set; S4, calculating a defect characteristic index according to the normal width data set and the local gray gradient value, comparing the defect characteristic index with a preset defect threshold value, judging whether a heating wire has defects or not, and outputting a detection result. As a further aspect of the present invention, the step S1 specifically includes: Continuous scanning acquisition is carried out in the uniform motion process of the heating wire by matching the linear array CCD camera with a high-frequency backlight source; and splicing the acquired multi-frame local images into the complete original gray-scale image, and carrying out brightness equalization correction on the original gray-scale image to eliminate the influence of uneven illumination on the gray-scale distribution of the image. As a further aspect of the present invention, the step S2 specifically includes: Smoothing the original gray level image by adopting a Gaussian filter algorithm, and inhibiting high-frequency random noise in the image; calculating an optimal segmentation threshold value by using an Otsu self-adaptive threshold value segmentation algorithm, and converting the smoothed image into the heating line binarization mask image; And carrying out morphological open operation processing on the heating wire binarization mask image, breaking off tiny adhesion noise points and filling tiny holes in the heating wire. As a further aspect of the present invention, the process of extracting the set of coordinates of the central path of the heating wire in the step S3 specifically includes: iteratively stripping the heating wire binarization mask image subjected to morphological processing by using a thinning algorithm until a communication line with single pixel width is reserved, so as to generate a heating wire skeleton diagram; and traversing all pixel points in the heating line skeleton diagram, and establishing an ordered pixel coordinate sequence according to a communication relation to form the central path coordinate set. As a further aspect of the present invention, the calculating the defect characteristic index in the step S4 is performed according to the following formula: ; Wherein, the Representing the calculated defect characteristic index,Representing the total number of skeleton pixels within the current detection window,Represents the firstThe normal width values at the individual skeleton pixel points,Representing a preset r