CN114022441A - Defect detection method for irregular hardware - Google Patents
Defect detection method for irregular hardware Download PDFInfo
- Publication number
- CN114022441A CN114022441A CN202111293673.7A CN202111293673A CN114022441A CN 114022441 A CN114022441 A CN 114022441A CN 202111293673 A CN202111293673 A CN 202111293673A CN 114022441 A CN114022441 A CN 114022441A
- Authority
- CN
- China
- Prior art keywords
- hardware
- irregular
- stamping part
- image
- detection
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/155—Segmentation; Edge detection involving morphological operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/30—Determination of transform parameters for the alignment of images, i.e. image registration
- G06T7/33—Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a defect detection method of irregular hardware, which comprises the steps of collecting an image of the irregular hardware; enhancing edge information by adopting a fuzzy set, and judging image edge points according to the membership degree; punching holes are preset in the hardware, and irregular hardware is positioned by using the point and line characteristics of the outline; probability Hough transformation is introduced to improve the detection speed; according to the included angle and the circle center parameter, the rotation angle and the translation distance of the to-be-detected hardware stamping part with the template stamping part are obtained through comparison calculation; obtaining expected pose characteristics of the stamping workpiece template images according to the rotation point, the rotation amount and the translation amount, and correcting the stamping workpiece images to be detected in real time to realize image registration; identifying the contour defects by adopting a similar matching algorithm; the quality inspection process of the irregular hardware is converted into rapid intelligent detection through traditional manual detection, the yield and the product quality of the sold products are greatly improved, the enterprise cost is reduced, the detection efficiency is also improved, and the technical problem that the irregular hardware is difficult to automatically detect is solved.
Description
Technical Field
The invention relates to the technical field of defect detection, in particular to a defect detection method for irregular hardware.
Background
With the upgrading and modification of the manufacturing industry and the improvement of the living standard, people pay more attention to the appearance quality of products, so that a product manufacturer is forced to carry out stricter quality detection on the products before the products leave a factory, 100% complete detection on the products is guaranteed, and zero-defect products are provided for customers. The profile defects not only affect the appearance of the product, but also reduce the service life, reliability and safety of the final product. The manual detection cannot ensure that the product is lost due to factors such as high cost, low speed, visual fatigue and the like. Visual inspection of the product is an important part of the manufacturing process.
The traditional detection method is human eye detection, and the detection method has great limitation in practical use. Firstly, the human eyes detect that the influences of objective factors such as mood and thinking and subjective and objective factors such as illumination and scenes have instability and unreliability; secondly, the eyes of people cannot realize high-speed online detection of products and cannot meet the requirement of real-time production monitoring; finally, from a safety perspective, concentrated eye use for a long period of time can cause significant harm to a person's body. Therefore, the human eye cannot continuously and stably complete the repetitive quality inspection work, and the search for a new product defect inspection method to replace the human eye inspection becomes a problem to be solved by many enterprises urgently. Both the software and hardware technologies of machine vision systems have advanced accordingly. Hardware aspect: a camera with large resolution and high scanning speed, a high-performance computer; software aspect: the study of a number of image processing algorithms. These advances in hardware and software technology have ultimately led to widespread use of machine vision in product inspection, particularly in on-line product defect inspection and the like. The existing visual detection is an effective detection means with the advantages of objectivity, high efficiency, accuracy, reliability and the like, and has great value and significance for guaranteeing the product quality and improving the intelligent manufacturing level of the stamping hardware industry.
Disclosure of Invention
To achieve the above-mentioned problems in the background art, the present invention is implemented by the following steps:
a defect detection method of irregular hardware comprises the following steps:
s1, collecting image of the irregular hardware;
s2, reinforcing edge information by adopting a fuzzy set, converting the contour detection problem into calculation of membership degree, and judging image edge points according to the membership degree;
s3, presetting punched holes in the hardware, detecting a punched hole circle and a straight line through Hough transformation by using the point and line characteristics of the outline, and returning coordinates of two end points of the line segment and the circle center parameter of the punched hole circle so as to position the irregular hardware;
s4, introducing probability Hough transformation to improve detection speed;
s5, according to the included angle and the circle center parameter, comparing and calculating to obtain the rotation angle and the translation distance of the to-be-detected hardware stamping part in the form of a template stamping part;
s6, obtaining expected pose characteristics of the stamping workpiece template image according to the rotation point, the rotation amount and the translation amount, and correcting the stamping workpiece image to be detected in real time to realize image registration;
and s7, identifying the contour defects by adopting a similarity matching algorithm.
In step S3, I (x, y) is set as the straight line segment having the longest outline, c (x, y) is set as a circular curve, and an angle θ between the straight line and the positive direction of the y-axis is calculated.
Further, in the calculation of S5, it is obtained that the stamping part to be detected rotates clockwise around the center based on the template stamping part, and the increment of the rotation angle is represented as:
Δθ=θ′-θ
the translation amount can be obtained by subtracting the coordinate of the circle center O' of the stamping part to be detected from the coordinate of the circle center O of the standard template stamping part, and the translation amount in the horizontal direction along the x-axis direction is as follows:
Δx=x-x′
translation amount in the vertical direction along the y-axis direction:
Δy=y-y′。
further, in step S7, the two grayscale images with a size of M × N are differentiated to obtain a difference image, a similarity distance is defined as a sum D of squares of grayscale differences corresponding to the two images, a value D is used as a metric for measuring matching degrees of the images, a threshold TH is set in the calculation, and a result R is:
judging whether the hardware stamping part has the contour defect or not according to the result, wherein when R is 1, the stamping part is judged to be qualified; and when R is 0, judging that the hardware stamping part has the contour defect.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
fig. 2 is an auxiliary illustration of the present invention.
The invention discloses a defect detection method of irregular hardware, which relates to the principle of fuzzy set contour recognition and Hough transform positioning algorithm based on, introduces a fuzzy set, refines the judgment standard according to the membership degree, and extracts the edge of a digital image under the condition of not determining a threshold value to obtain a contour. The image registration is realized according to the point and line characteristics of the contour and the Hough transformation, the contour defects can be effectively identified, positioned and marked through a similar matching algorithm, and the classification of the irregular hardware stamping parts to be detected is completed.
According to the invention, the quality inspection process of irregular hardware is converted from traditional manual detection into rapid intelligent detection, so that the yield and the product quality of sold products are greatly improved, the enterprise cost is reduced, the detection efficiency is also improved, and the technical problem that the irregular hardware is difficult to automatically detect is solved; the cost of manpower detection is reduced, the efficiency and the reliability are high, and the detection precision is greatly improved; the invention solves the common technical problems of the industry, aiming at the two technical problems that the gray scales of the real object of the image and the background pixel are gradually transited, the ambiguity exists, the outline is difficult to position, one of the shapes of the irregular hardware stamping parts is irregular, the outline defect is small, and the detection is difficult.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step are within the scope of the present invention.
With reference to the flow diagram of the method shown in fig. 1, the method for detecting the defect of the irregular hardware is a method for detecting the defect of the irregular hardware based on fuzzy set contour recognition and hough transform positioning algorithm, and comprises the following steps:
s1, collecting image of the irregular hardware;
s2, reinforcing edge information by adopting a fuzzy set, converting the contour detection problem into calculation of membership degree, and judging image edge points according to the membership degree;
s3, presetting punched holes in the hardware, detecting a punched hole circle and a straight line through Hough transformation by using the point and line characteristics of the outline, and returning coordinates of two end points of the line segment and the circle center parameter of the punched hole circle so as to position the irregular hardware;
s4, introducing probability Hough transformation to improve detection speed;
s5, according to the included angle and the circle center parameter, comparing and calculating to obtain the rotation angle and the translation distance of the to-be-detected hardware stamping part with the template stamping part as expected values;
s6, obtaining expected pose characteristics of the stamping workpiece template image according to the rotation point, the rotation amount and the translation amount, and correcting the stamping workpiece image to be detected in real time to realize image registration;
and S7, identifying the contour defects by adopting a similarity matching algorithm.
In S1 and S2, the gray values of the object and background pixels at the object boundary in the image are not abrupt but gradually transited because the object is affected by the external illumination and the imaging resolution. Therefore, the fuzzy set is adopted to strengthen the edge information, and the irregular contour is accurately and effectively extracted under the condition of not determining a threshold value. And converting the contour detection problem into calculation of membership degree, and judging the image edge points according to the membership degree.
In S3, the punched holes are preset in the hardware, and the position of the center of the circle can represent the position of the punched holes in the image, and with reference to the auxiliary illustration chart of the present invention shown in fig. 2, the circle and the straight line can be detected by using the point and line characteristics of the contour through Hough transformation, and the coordinates of the two end points of the line segment and the center parameter of the circle are returned, so as to position the irregular hardware stamping part. Wherein I (x, y) is the straight line segment with the longest outline, c (x, y) is a circular curve, and the included angle theta between the straight line and the positive direction of the y axis is calculated.
In s5, according to the included angle and the circle center parameter, the rotation angle and the translation distance of the hardware stamping part to be detected with the template stamping part are obtained through comparison calculation, so that the rotation angle increment of the stamping part to be detected based on the clockwise rotation angle of the template stamping part around the center is expressed as follows:
Δ θ ═ θ — θ
The translation amount can be obtained by subtracting the coordinate of the center O' of the stamping part to be detected from the coordinate of the center O of the stamping part of the standard template. Translation amount in the x-axis direction in the horizontal direction:
Δx=x-x′
translation amount in the vertical direction along the y-axis direction:
Δy=y-y′。
in S7, the two grayscale images with size M × N are finally differentiated to obtain a difference image, a similarity distance is defined as the sum of squares D of the grayscale differences corresponding to the two images, the value of D is used as a metric for measuring the matching degree of the images, a threshold TH is set in the calculation, and the result R is:
judging whether the hardware stamping part has the contour defect or not according to the result, wherein when R is 1, the stamping part is judged to be qualified; and when R is 0, judging that the hardware stamping part has the contour defect.
The invention discloses a defect detection method of irregular hardware, which relates to the principle of fuzzy set contour recognition and Hough transform positioning algorithm based on, introduces a fuzzy set, refines the judgment standard according to the membership degree, and extracts the edge of a digital image under the condition of not determining a threshold value to obtain a contour. The image registration is realized according to the point and line characteristics of the contour and the Hough transformation, the contour defects can be effectively identified, positioned and marked through a similar matching algorithm, and the classification of the irregular hardware stamping parts to be detected is completed.
According to the invention, the quality inspection process of irregular hardware is converted from traditional manual detection into rapid intelligent detection, so that the yield and the product quality of sold products are greatly improved, the enterprise cost is reduced, the detection efficiency is also improved, and the technical problem that the irregular hardware is difficult to automatically detect is solved; the cost of manpower detection is reduced, the efficiency and the reliability are high, and the detection precision is greatly improved; the invention solves the common technical problems of the industry, aiming at the two technical problems that the gray scales of the real object of the image and the background pixel are gradually transited, the ambiguity exists, the outline is difficult to position, one of the shapes of the irregular hardware stamping parts is irregular, the outline defect is small, and the detection is difficult.
The above description is an exemplary embodiment of the present invention, but the present invention should not be limited to the disclosure of the embodiment and the accompanying drawings, and therefore, all equivalent or modifications that can be made without departing from the spirit of the present invention, such as using different structures to have the same function of the manual puncture positioning assembly, and transmitting the navigation signal to an external computer or other electronic devices with display function by wire or wirelessly, etc., fall within the protection scope of the present invention.
Claims (4)
1. A defect detection method for irregular hardware is characterized by comprising the following steps:
s1, collecting image of the irregular hardware;
s2, reinforcing edge information by adopting a fuzzy set, converting the contour detection problem into calculation of membership degree, and judging image edge points according to the membership degree;
s3, presetting punched holes in the hardware, detecting a punched hole circle and a straight line through Hough transformation by using the point and line characteristics of the outline, and returning coordinates of two end points of the line segment and the circle center parameter of the punched hole circle so as to position the irregular hardware;
s4, introducing probability Hough transformation to improve detection speed;
s5, according to the included angle and the circle center parameter, comparing and calculating to obtain the rotation angle and the translation distance of the to-be-detected hardware stamping part in the form of a template stamping part;
s6, obtaining expected pose characteristics of the stamping workpiece template image according to the rotation point, the rotation amount and the translation amount, and correcting the stamping workpiece image to be detected in real time to realize image registration;
and S7, identifying the contour defects by adopting a similarity matching algorithm.
2. The method for detecting defects in irregular hardware according to claim 1, wherein in step S3, l (x, y) is set as the straight line segment with the longest outline, c (x, y) is set as a circular curve, and an included angle θ between the straight line and the positive direction of the y-axis is calculated.
3. The method for detecting the defects of the irregular hardware according to claim 1, wherein in the calculation of the step S5, the obtained clockwise rotation angle of the stamping part to be detected around the center based on the template stamping part is obtained, and the increment of the rotation angle is represented as:
Δθ=θ′-θ
the translation amount can be obtained by subtracting the coordinate of the circle center O' of the stamping part to be detected from the coordinate of the circle center O of the standard template stamping part, and the translation amount in the horizontal direction along the x-axis direction is as follows:
Δx=x-x′
translation amount in the vertical direction along the y-axis direction:
Δy=y-y′。
4. the method for detecting defects of irregular hardware according to claim 1, wherein in step S7, the difference is finally performed on two grayscale images with size M × N to obtain a difference image, the similarity distance is defined as the square sum D of the grayscale difference values corresponding to the two images, the value of D is used as a measure for measuring the matching degree of the images, in the calculation, a threshold TH is set, and the result R is:
judging whether the hardware stamping part has the contour defect or not according to the result, wherein when R is 1, the stamping part is judged to be qualified; and when R is 0, judging that the hardware stamping part has the contour defect.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111293673.7A CN114022441A (en) | 2021-11-03 | 2021-11-03 | Defect detection method for irregular hardware |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111293673.7A CN114022441A (en) | 2021-11-03 | 2021-11-03 | Defect detection method for irregular hardware |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114022441A true CN114022441A (en) | 2022-02-08 |
Family
ID=80060071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111293673.7A Pending CN114022441A (en) | 2021-11-03 | 2021-11-03 | Defect detection method for irregular hardware |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114022441A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116342606A (en) * | 2023-05-30 | 2023-06-27 | 中色创新研究院(天津)有限公司 | Defect traceability analysis method based on copper alloy processing finished product |
CN116523900A (en) * | 2023-06-19 | 2023-08-01 | 东莞市新通电子设备有限公司 | Hardware processing quality detection method |
-
2021
- 2021-11-03 CN CN202111293673.7A patent/CN114022441A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116342606A (en) * | 2023-05-30 | 2023-06-27 | 中色创新研究院(天津)有限公司 | Defect traceability analysis method based on copper alloy processing finished product |
CN116342606B (en) * | 2023-05-30 | 2023-10-17 | 中色创新研究院(天津)有限公司 | Defect traceability analysis method based on copper alloy processing finished product |
CN116523900A (en) * | 2023-06-19 | 2023-08-01 | 东莞市新通电子设备有限公司 | Hardware processing quality detection method |
CN116523900B (en) * | 2023-06-19 | 2023-09-08 | 东莞市新通电子设备有限公司 | Hardware processing quality detection method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112419297B (en) | Bolt loosening detection method, device, equipment and storage medium | |
CN104992449B (en) | Information identification and surface defect online test method based on machine vision | |
CN108917593B (en) | Intelligent measurement system and method based on element configuration of workpiece to be measured | |
CN114022441A (en) | Defect detection method for irregular hardware | |
CN112037203A (en) | Side surface defect detection method and system based on complex workpiece outer contour registration | |
CN111062940B (en) | Screw positioning and identifying method based on machine vision | |
CN115984271B (en) | Metal burr identification method based on corner detection | |
CN110260818B (en) | Electronic connector robust detection method based on binocular vision | |
CN113012098B (en) | Iron tower angle steel punching defect detection method based on BP neural network | |
CN111311618A (en) | Circular arc workpiece matching and positioning method based on high-precision geometric primitive extraction | |
CN112304957A (en) | Machine vision-based intelligent detection method and system for appearance defects | |
CN114494045A (en) | Large-scale straight gear geometric parameter measuring system and method based on machine vision | |
CN113689415A (en) | Steel pipe wall thickness online detection method based on machine vision | |
CN112884746A (en) | Character defect intelligent detection algorithm based on edge shape matching | |
Wankhede et al. | A low cost surface strain measurement system using image processing for sheet metal forming applications | |
CN113139943B (en) | Method and system for detecting appearance defects of open circular ring workpiece and computer storage medium | |
CN111539951B (en) | Visual detection method for outline size of ceramic grinding wheel head | |
CN111768423A (en) | Automatic fiber angle measuring method based on image recognition | |
CN111815575A (en) | Bearing steel ball part detection method based on machine vision | |
CN116823708A (en) | PC component side mold identification and positioning research based on machine vision | |
CN115388785A (en) | Flexible wire harness measuring method and system based on vision | |
CN114549420A (en) | Workpiece identification and positioning method based on template matching | |
CN114994072A (en) | Magnetic bar end surface defect detection method based on machine vision | |
CN113313122A (en) | Pointer type instrument automatic reading identification method based on computer vision | |
Lan et al. | Weld Recognition of Pressure Vessel Based on Texture Feature |
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 |