CN114998341B - Gear defect detection method and system based on template matching - Google Patents

Gear defect detection method and system based on template matching Download PDF

Info

Publication number
CN114998341B
CN114998341B CN202210929595.3A CN202210929595A CN114998341B CN 114998341 B CN114998341 B CN 114998341B CN 202210929595 A CN202210929595 A CN 202210929595A CN 114998341 B CN114998341 B CN 114998341B
Authority
CN
China
Prior art keywords
tooth
gear
tooth body
arc curve
image
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.)
Active
Application number
CN202210929595.3A
Other languages
Chinese (zh)
Other versions
CN114998341A (en
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.)
Qidong Wanhui Machinery Manufacturing Co ltd
Original Assignee
Qidong Wanhui Machinery Manufacturing 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 Qidong Wanhui Machinery Manufacturing Co ltd filed Critical Qidong Wanhui Machinery Manufacturing Co ltd
Priority to CN202210929595.3A priority Critical patent/CN114998341B/en
Publication of CN114998341A publication Critical patent/CN114998341A/en
Application granted granted Critical
Publication of CN114998341B publication Critical patent/CN114998341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • 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

Abstract

The invention relates to the technical field of data processing, in particular to a gear defect detection method and a system based on template matching, wherein the method respectively acquires gear images of each gear in the same batch to obtain corresponding gray images, divides each gray image into a tooth body image and a tooth image, and analyzes the similarity degree of the tooth body in each tooth body image based on the circular characteristic of the tooth body to obtain a tooth body standard template; analyzing the abnormal degree of the teeth according to the symmetry difference value of the tooth profile and the length difference value of the tooth root straight line length of the teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth image; and detecting defects of gears in each gear image based on the tooth body standard template and the tooth standard template. And the gear body template and the tooth template of the gear are obtained in a self-adaptive manner by carrying out feature analysis on the gears in the same batch, and the gear is subjected to defect detection based on the tooth body template and the tooth template, so that the accuracy of gear defect detection is ensured, and the throwing use of unqualified gears is reduced.

Description

Gear defect detection method and system based on template matching
Technical Field
The invention relates to the technical field of data processing, in particular to a gear defect detection method and system based on template matching.
Background
The quality of gears, which are used as basic components of electromechanical products, directly affects the performance of mechanical systems. Therefore, strict detection and control of product quality is necessary during gear manufacturing. However, in the processing process of the parts, the parts are processed based on production requirements, and the standard template images cannot be obtained in advance, so that whether the parts in the same batch have defects or not cannot be accurately detected, and the real-time requirement of industrial detection cannot be met.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a gear defect detection method and a system based on template matching, and the adopted technical scheme is as follows:
the embodiment of the invention provides a gear defect detection method based on template matching, which comprises the following specific steps:
respectively acquiring gear images of each gear in the same batch to obtain corresponding gray level images;
image segmentation is carried out on the current gray level image to obtain a tooth body image and a tooth image, and the similarity degree between the tooth body and a standard circle is obtained by combining the tooth body radius in the tooth body image and the position difference between adjacent pixel points on the edge of the tooth body based on the circular characteristic of the tooth body, wherein the standard circle refers to the tooth body circular standard required by production; acquiring a tooth body standard template according to the similarity degree of the tooth body in each gray level image;
acquiring a length difference value of teeth according to the straight line length of two tooth roots of one tooth in the tooth image; performing corner detection on tooth profile to divide the curve corresponding to the tooth crest into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, adaptively adjusting an accumulator threshold value in a Hough gradient method according to the number of pixel points on the arc curve or the non-arc curve, and obtaining a first circle center corresponding to each arc curve and a second circle center corresponding to each non-arc curve according to the adjusted accumulator threshold value; calculating symmetry difference values of tooth profiles according to the position deviations of the first circle centers based on the symmetry of the tooth profiles, and acquiring non-circular arc curve abnormal values from the distance between each second circle center and the adjacent first circle center; combining the length difference value, the symmetry difference value and the non-circular arc curve abnormal value to obtain the abnormal degree of teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth in each gray level image;
and detecting defects of gears in each gear image based on the tooth body standard template and the tooth standard template.
Further, the method for obtaining the similarity degree between the tooth body and the standard circle by combining the tooth body radius in the tooth image and the position difference between the adjacent pixel points on the edge of the tooth body comprises the following steps:
carrying out Hough circle detection on the tooth body to obtain the tooth body radius, and comparing the tooth body radius with the standard tooth body radius to obtain a radius difference index;
forming a straight line by every two adjacent pixel points on the edge of the tooth body, calculating a straight line angle difference value between the two straight lines corresponding to each pixel point to obtain an average angle difference value corresponding to the edge of the tooth body, and obtaining a circular difference index according to the difference between the straight line angle difference value and the average angle difference value of each pixel point;
and combining the radius difference index and the circular difference index to obtain the similarity degree.
Further, the method for dividing the plurality of sub-curves into an arc curve and a non-arc curve comprises the following steps:
and calculating an average angle difference value corresponding to each sub-curve, and dividing the plurality of sub-curves into an arc curve and a non-arc curve by using a k-means clustering method according to the difference of the average angle difference value between any two sub-curves.
Further, the method for adaptively adjusting the accumulator threshold in the hough gradient method according to the number of pixels on the arc curve or the non-arc curve comprises the following steps:
obtaining an initial accumulator threshold value of the arc curve according to the number of the pixel points on the arc curve and the minimum number of the pixel points required by the circle; obtaining an initial accumulator threshold value of the non-circular curve according to the number of the pixel points on the non-circular curve and the minimum number of the pixel points required by the circle;
and obtaining a plurality of initial circle centers corresponding to the tooth profile based on the initial accumulator threshold, and respectively adjusting the initial accumulator threshold of the circular arc curve and the non-circular arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
Further, the method for calculating symmetry difference values of tooth profiles according to the position deviations of a plurality of first circle centers comprises the following steps:
and respectively calculating the distance from each first circle center to the symmetry line according to the symmetry line of the tooth profile obtained by the straight lines of the two tooth roots of the tooth, arranging the distances from small to large to obtain a distance sequence, and obtaining the symmetry difference value according to the distance difference value between two adjacent distances in the distance sequence.
Further, the method for obtaining the non-circular arc curve abnormal value by the distance between each second circle center and the adjacent first circle center comprises the following steps:
the Euclidean distance between any two circle centers is obtained for the second circle center and the two adjacent first circle centers, so that the position characteristic value of the second circle center is obtained; and combining the position characteristic values of each second circle center to obtain the non-circular arc curve abnormal value.
Further, the method for detecting the defects of the gears in each gear image based on the tooth body standard template and the tooth standard template comprises the following steps:
performing first similarity calculation on the tooth body and the tooth body standard template in each gear image, and performing second similarity calculation on the tooth and the tooth standard template; setting a similarity threshold, comparing the first similarity and the second similarity with the similarity threshold respectively, and determining whether the gear has defects according to a comparison result.
Further, an embodiment of the present invention further provides a gear defect detection system based on template matching, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above methods for detecting a gear defect based on template matching when executing the computer program.
The embodiment of the invention has at least the following beneficial effects: by carrying out characteristic analysis on gears in the same batch, the tooth body template and the tooth template of the gears are obtained in a self-adaptive mode, and defect detection is carried out on the gears in the batch based on the tooth body template and the tooth template, so that the accuracy of gear defect detection is ensured, and the throwing use of unqualified gears is reduced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for detecting a gear defect based on template matching according to an embodiment of the present invention;
fig. 2 is a schematic view of a tooth profile according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description refers to the specific implementation, structure, characteristics and effects of the gear defect detection method and system based on template matching according to the invention by combining the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The invention provides a gear defect detection method and a gear defect detection system based on template matching, which are specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for detecting a gear defect based on template matching according to an embodiment of the invention is shown, the method includes the following steps:
step S001, respectively acquiring gear images of each gear in the same batch to obtain corresponding gray level images.
Specifically, in the embodiment of the invention, through an industrial camera, corresponding gear images are acquired for each gear in the same batch in a fixed light source mode, the acquired gear images are RGB images, and each RGB image is subjected to gray processing in a weighted mode to obtain a corresponding gray image, wherein the gray processing mode is as follows:
wherein,is a gray value; />The pixel values of the three channels in the RGB image, respectively.
Step S002, image segmentation is carried out on the current gray level image to obtain a tooth body image and a tooth image, and the similarity degree between the tooth body and a standard circle is obtained by combining the tooth body radius in the tooth body image and the position difference between adjacent pixel points on the edge of the tooth body based on the circular characteristic of the tooth body, wherein the standard circle refers to the tooth body circular standard required by production; and obtaining a tooth body standard template according to the similarity degree of the tooth body in each gray level image.
Specifically, the gear can be divided into two main parts, one part is a tooth body of the gear, and the other part is a tooth of the gear, so that the gray image is subjected to canny operator detection to obtain the edge information of the gear, and the gray image is divided into a tooth body image and a tooth image according to the edge information.
According to priori knowledge, the tooth body of the gear is usually circular, and the closer the tooth body is to the circular, the more accords with the standard, and the smaller the defect is, so that the similarity degree between the tooth body and the standard circle is analyzed according to the circular characteristic of the tooth body, wherein the standard circle is the tooth body circular standard required by production, and the analysis process of the similarity degree is as follows:
(1) And carrying out Hough circle detection on the tooth body to obtain the tooth body radius, and comparing the tooth body radius with the standard tooth body radius to obtain the radius difference index.
Specifically, a Hough circle detection method is utilized to obtain the minimum circumcircle of the tooth body, and then the radius of the minimum circumcircle is obtained, and the radius is taken as the radius of the tooth body. Because the gear production has the size requirement, the radius difference index of the gear body is calculated according to the difference between the standard gear body radius and the gear body radius required by the production, and the calculation formula of the radius difference index is as follows:
wherein,is the difference of radiusAn index; />The radius of the tooth body is; />Is the standard tooth radius.
(2) And forming a straight line by every two adjacent pixel points on the edge of the tooth body, calculating a straight line angle difference value between the two straight lines corresponding to each pixel point, obtaining an average angle difference value corresponding to the edge of the tooth body, and obtaining a circular difference index according to the difference between the straight line angle difference value and the average angle difference value of each pixel point.
Specifically, according to priori knowledge, the circular edge variation is gentle and uniform, so that the embodiment of the invention respectively forms each pixel point and the front and rear adjacent pixel points into a straight line, acquires the straight line angle formed between each straight line and the horizontal straight line, and calculates the straight line angle difference value between the straight line angles of the two straight lines corresponding to each pixel pointThe method comprises the steps of carrying out a first treatment on the surface of the Calculating an average angle difference value according to the linear angle difference value of each pixel point on the edge of the tooth body, and further analyzing the difference between the linear angle difference value and the average angle difference value of each pixel point to obtain a circular difference index of the tooth body, wherein the calculation formula of the circular difference index is as follows:
wherein,is a circular difference index; />Is->The linear angle difference of each pixel point; />Is the average angle difference; />Is the number of pixels on the edge of the tooth body.
(3) And combining the radius difference index and the circular difference index to obtain the similarity degree.
In particular, the degree of similarityThe calculation formula of (2) is as follows:
wherein the degree of similarityThe bigger the tooth body, the more satisfactory.
Further, by using the above analysis method of the similarity, the similarity is obtained for the tooth body in each gray level image, and then the tooth body image corresponding to the maximum value of the similarity is used as the tooth body standard template.
Step S003, obtaining a tooth length difference value according to the two tooth root straight line lengths of one tooth in the tooth image; performing corner detection on tooth profile to divide the curve corresponding to the tooth crest into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, adaptively adjusting an accumulator threshold value in a Hough gradient method according to the number of pixel points on the arc curve or the non-arc curve, and obtaining a first circle center corresponding to each arc curve and a second circle center corresponding to each non-arc curve according to the adjusted accumulator threshold value; calculating symmetry difference values of tooth profiles according to the position deviations of the first circle centers based on the symmetry of the tooth profiles, and acquiring non-circular arc curve abnormal values from the distance between each second circle center and the adjacent first circle center; and combining the length difference value, the symmetry difference value and the non-circular arc curve abnormal value to obtain the abnormal degree of the teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth in each gray level image.
Specifically, the tooth profile itself is composed of straight lines and circular arcs, referring to fig. 2, which shows a schematic diagram of a tooth profile, where the tooth is composed of a tooth root straight line 1, a tooth root straight line 2 and a subcurve 3-10, so that hough straight line detection is performed on any tooth in a tooth image to obtain two tooth root straight lines, the lengths of the two tooth root straight lines are obtained through a chain code method, and the length outlier of the tooth is obtained by comparing the standard tooth root straight line length required by production, and then the calculation formula of the length outlier is as follows:
wherein,is a length outlier ++>For the standard tooth root straight line length, < >>For the first root straight length, +.>Is the second root straight length.
Further, since the tooth profile is formed by irregular curves, the curve corresponding to the tooth tip can be divided into a plurality of sub-curves by detecting the corner points of the tooth profile. Considering that a machining defect in the gear machining process can cause a small section of irregular curve of the tooth top, and the smaller the curve is, the smaller the influence on the quality of the gear is, so that a plurality of sub-curves are divided into an arc curve and a non-arc curve, and the dividing method is as follows: calculating the average angle difference value corresponding to each sub-curve by using the method for acquiring the linear angle difference value of each pixel point in the step S002, and dividing the plurality of sub-curves into an arc curve and a non-arc curve by using a k-means clustering method according to the difference of the average angle difference value between any two sub-curves.
The circle center corresponding to each sub-curve is obtained by using a Hough gradient method for the arc curve and the non-arc curve, and the circle center is found according to the modulo vector of each pixel point, and the circle center is determined by voting, namely, the circle center is determined based on the accumulator threshold value in the Hough gradient method, so that the accumulator threshold value in the Hough gradient method is adaptively adjusted according to the number of the pixel points on the arc curve or the non-arc curve, and the adjusting process is as follows:
(1) Obtaining an initial accumulator threshold value of the arc curve according to the number of the pixel points on the arc curve and the minimum number of the pixel points required by the circle; and obtaining an initial accumulator threshold value of the non-circular arc curve from the number of the pixels on the non-circular arc curve and the minimum number of the pixels required for determining the circle.
Specifically, when circle detection is performed, 3 pixel points on the circumference can determine a circle, so that the initial accumulator threshold value of the circular arc curve and the non-circular arc curve is respectively obtained according to the minimum number of the pixel points required by determining the circle, for the circular arc curve, the number of the pixel points on the circular arc curve is counted first, and the initial accumulator threshold value of the circular arc curve is obtained by combining the number of the pixel points and the minimum number, and then the calculation formula of the initial accumulator threshold value is as follows:wherein->An initial accumulator threshold value for a circular curve, +.>The number of the pixel points on the arc curve; for the non-circular curve, firstly, counting the non-circular curveThe initial accumulator threshold value of the non-circular curve is obtained by combining the number of the pixel points and the minimum number, and then the calculation formula of the initial accumulator threshold value is as follows: />Wherein->An initial accumulator threshold value for a circular curve, +.>Is the number of pixels on the arc curve.
(2) And obtaining a plurality of initial circle centers corresponding to the tooth profile based on the initial accumulator threshold, and respectively adjusting the initial accumulator threshold of the circular arc curve and the non-circular arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
Specifically, in an ideal case, each circular arc curve or non-circular arc curve has only one circle center, and the threshold value of the initial accumulator is too large or too small to influence circle center detection, that is, the initial accumulator is too large to detect the circle center, and too small to cause the calculated circle center to be excessively large for subsequent judgment, so that the initial accumulator threshold values of the circular arc curve and the non-circular arc curve are respectively adjusted according to a plurality of initial circle centers corresponding to the tooth profile obtained by the initial accumulator threshold value, and a corresponding new accumulator threshold value is obtained, and an adjustment formula is:
wherein,for the new accumulator threshold +.>An initial accumulator threshold value of circular curve or non-circular curve,/->Is the number of initial circle centers.
And detecting the corresponding circle centers of the arc curves and the non-arc curves by using the new accumulator threshold value to obtain a first circle center corresponding to each arc curve and a second circle center corresponding to each non-arc curve.
Further, the left and right contours of the tooth are usually symmetric left and right according to the priori knowledge, so that the stronger the obtained center symmetry is, the more the tooth production meets the standard. Based on the symmetry of the tooth profile, calculating the symmetry difference value of the tooth profile according to the position deviations of a plurality of first circle centers corresponding to the arc curves, wherein the method comprises the following steps: and (3) obtaining symmetry lines of tooth profiles according to the two tooth root straight lines of the tooth, respectively calculating the distance from each first circle center to the symmetry lines, arranging the distances from small to large to obtain a distance sequence, and obtaining a symmetry difference value according to the distance difference value between two adjacent distances in the distance sequence.
As an example, the center position between two center points is obtained from the center point of each root straight lineMaking a vertical line based on the central position, wherein the vertical line is a symmetry line of the tooth profile; the distance between each first circle center and the symmetry line is calculated respectively, the calculated distance is an even number according to the symmetry of the tooth profile, then the distances are arranged from small to large to obtain a distance sequence, each two adjacent distances in the distance sequence are a group, the distance difference value between the two distances in each group is calculated respectively, and the distance difference value of each group is calculated in an accumulated way to obtain a symmetry difference value->
Considering that the non-circular arc curve usually exists between two circular arc curves, when the distance between the second circle center of the non-circular arc curve and the first circle center of the circular arc curve is close enough, the non-circular arc curve is explained not to influence the performance of the gear, so that the abnormal value of the non-circular arc curve is calculated according to the distance between the second circle center of the non-circular arc curve and the adjacent first circle center of the non-circular arc curve, and the method comprises the following steps: the Euclidean distance between any two circle centers is obtained for the second circle center and the two adjacent first circle centers, so that the position characteristic value of the second circle center is obtained; and combining the position characteristic values of each second circle center to obtain the abnormal value of the non-circular arc curve.
As an example, assume that the second center is,/>) The first circle centers are respectively (/ ->,/>) And (/ ->,/>) Calculating the second circle center (++>,/>) And a first centre (+)>,/>) European distance between->A second center ()>,/>) And a first centre (+)>,/>) European distance between->And a first centre (>,/>) And a first centre (+)>,/>) European distance between->In combination with European distance->European distance->And European distance->Calculating the position characteristic value of the second circle center +.>The calculation formula is as follows: />The method comprises the steps of carrying out a first treatment on the surface of the Then the position characteristic values of a plurality of second circle centers are added to obtain non-circular arc curve abnormal values +.>
Combining the length difference value, the symmetry difference value and the non-circular arc curve abnormal value to obtain the abnormal degree of the teeth, and then obtaining the abnormal degreeThe calculation formula of (2) is as follows:
further, by using the method for acquiring the abnormal degree of the teeth, the abnormal degree of each tooth in each gray level image is obtained, and then the tooth image corresponding to the maximum abnormal degree is selected as the tooth standard template.
And S004, detecting defects of gears in each gear image based on the tooth body standard template and the tooth standard template.
Specifically, performing first similarity calculation on the tooth body and the tooth body standard template in each gear image, and performing second similarity calculation on the tooth and the tooth standard template; setting a similarity threshold, comparing the first similarity and the second similarity with the similarity threshold respectively, and determining whether the gear has defects according to the comparison result, namely, when the first similarity and the second similarity are both larger than the similarity threshold, considering that the gear has no defects, and meeting the production requirement.
In summary, the embodiment of the invention provides a gear defect detection method based on template matching, which is characterized in that gear images of each gear in the same batch are respectively collected to obtain corresponding gray images, each gray image is divided into a tooth body image and a tooth image, and the similarity degree of the tooth body in each tooth body image is analyzed based on the circular characteristic of the tooth body to obtain a tooth body standard template; analyzing the abnormal degree of the teeth according to the symmetry difference value of the tooth profile and the length difference value of the tooth root straight line length of the teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth image; and detecting defects of gears in each gear image based on the tooth body standard template and the tooth standard template. And the gear body template and the tooth template of the gear are obtained in a self-adaptive manner by carrying out feature analysis on the gears in the same batch, and the gear is subjected to defect detection based on the tooth body template and the tooth template, so that the accuracy of gear defect detection is ensured, and the throwing use of unqualified gears is reduced.
Based on the same inventive concept as the above method, the embodiment of the invention further provides a gear defect detection system based on template matching, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any one of the above gear defect detection methods based on template matching.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (7)

1. The gear defect detection method based on template matching is characterized by comprising the following steps of:
respectively acquiring gear images of each gear in the same batch to obtain corresponding gray level images;
image segmentation is carried out on the current gray level image to obtain a tooth body image and a tooth image, and the similarity degree between the tooth body and a standard circle is obtained by combining the tooth body radius in the tooth body image and the position difference between adjacent pixel points on the edge of the tooth body based on the circular characteristic of the tooth body, wherein the standard circle refers to the tooth body circular standard required by production; obtaining a tooth body standard template according to the similarity degree between the tooth body and the standard circle in each gray level image;
acquiring a length difference value of teeth according to the straight line length of two tooth roots of one tooth in the tooth image; performing corner detection on tooth profile to divide the curve corresponding to the tooth crest into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, adaptively adjusting an accumulator threshold value in a Hough gradient method according to the number of pixel points on the arc curve or the non-arc curve, and obtaining a first circle center corresponding to each arc curve and a second circle center corresponding to each non-arc curve according to the adjusted accumulator threshold value; calculating symmetry difference values of tooth profiles according to the position deviations of the first circle centers based on the symmetry of the tooth profiles, and acquiring non-circular arc curve abnormal values from the distance between each second circle center and the adjacent first circle center; combining the length difference value, the symmetry difference value and the non-circular arc curve abnormal value to obtain the abnormal degree of teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth in each gray level image;
performing defect detection on gears in each gear image based on the gear body standard template and the gear standard template;
the method for calculating the symmetry difference value of the tooth profile according to the position deviation of a plurality of first circle centers comprises the following steps:
and respectively calculating the distance from each first circle center to the symmetry line according to the symmetry line of the tooth profile obtained by the straight line of the two tooth roots of the tooth, arranging the distances from small to large to obtain a distance sequence, and accumulating the distance difference value between every two adjacent distances in the distance sequence to obtain the symmetry difference value.
2. The method for detecting gear defect based on template matching according to claim 1, wherein the method for obtaining the similarity degree between the tooth body and the standard circle by combining the tooth body radius in the tooth image and the position difference between adjacent pixel points on the edge of the tooth body comprises the following steps:
carrying out Hough circle detection on the tooth body to obtain the tooth body radius, and comparing the tooth body radius with the standard tooth body radius to obtain a radius difference index;
forming a straight line by every two adjacent pixel points on the edge of the tooth body, calculating a straight line angle difference value between the two straight lines corresponding to each pixel point to obtain an average angle difference value corresponding to the edge of the tooth body, and obtaining a circular difference index according to the difference between the straight line angle difference value and the average angle difference value of each pixel point;
and combining the radius difference index and the circular difference index to obtain the similarity degree.
3. The method for detecting gear defects based on template matching according to claim 2, wherein the method for dividing the plurality of sub-curves into an arc curve and a non-arc curve comprises the steps of:
and calculating an average angle difference value corresponding to each sub-curve, and dividing the plurality of sub-curves into an arc curve and a non-arc curve by using a k-means clustering method according to the difference of the average angle difference value between any two sub-curves.
4. The method for detecting gear defects based on template matching according to claim 1, wherein the method for adaptively adjusting the accumulator threshold in the hough gradient method according to the number of pixels on the arc curve or the non-arc curve comprises the following steps:
obtaining an initial accumulator threshold value of the arc curve according to the number of the pixel points on the arc curve and the minimum number of the pixel points required by the circle; obtaining an initial accumulator threshold value of the non-circular curve according to the number of the pixel points on the non-circular curve and the minimum number of the pixel points required by the circle;
and obtaining a plurality of initial circle centers corresponding to the tooth profile based on the initial accumulator threshold, and respectively adjusting the initial accumulator threshold of the circular arc curve and the non-circular arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
5. The method for detecting gear defect based on template matching according to claim 1, wherein the method for obtaining the non-circular arc curve outlier from the distance between each second circle center and the adjacent first circle center comprises the following steps:
the Euclidean distance between any two circle centers is obtained for the second circle center and the two adjacent first circle centers, so that the position characteristic value of the second circle center is obtained; and combining the position characteristic values of each second circle center to obtain the non-circular arc curve abnormal value.
6. The method for detecting defects of gears based on template matching according to claim 1, wherein the method for detecting defects of gears in each gear image based on the tooth body standard template and the tooth standard template comprises the following steps:
performing first similarity calculation on the tooth body and the tooth body standard template in each gear image, and performing second similarity calculation on the tooth and the tooth standard template; setting a similarity threshold, comparing the first similarity and the second similarity with the similarity threshold respectively, and determining whether the gear has defects according to a comparison result.
7. A template matching based gear defect detection system comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-6 when executing the computer program.
CN202210929595.3A 2022-08-04 2022-08-04 Gear defect detection method and system based on template matching Active CN114998341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210929595.3A CN114998341B (en) 2022-08-04 2022-08-04 Gear defect detection method and system based on template matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210929595.3A CN114998341B (en) 2022-08-04 2022-08-04 Gear defect detection method and system based on template matching

Publications (2)

Publication Number Publication Date
CN114998341A CN114998341A (en) 2022-09-02
CN114998341B true CN114998341B (en) 2024-01-05

Family

ID=83022549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210929595.3A Active CN114998341B (en) 2022-08-04 2022-08-04 Gear defect detection method and system based on template matching

Country Status (1)

Country Link
CN (1) CN114998341B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272946B (en) * 2022-09-30 2022-12-23 江苏三通科技有限公司 Method for identifying damage of common rail fuel injector by using electronic equipment
CN115310238B (en) * 2022-09-30 2023-01-24 牡丹汽车股份有限公司 Fault diagnosis and analysis method for planetary gear box

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113658133A (en) * 2021-08-16 2021-11-16 江苏鑫丰源机电有限公司 Gear surface defect detection method and system based on image processing
CN114359275A (en) * 2022-03-16 2022-04-15 南通俊朗智能科技有限公司 Hydraulic gear pump defect detection method and system based on artificial intelligence

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11010888B2 (en) * 2018-10-29 2021-05-18 International Business Machines Corporation Precision defect detection based on image difference with respect to templates

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113658133A (en) * 2021-08-16 2021-11-16 江苏鑫丰源机电有限公司 Gear surface defect detection method and system based on image processing
CN114359275A (en) * 2022-03-16 2022-04-15 南通俊朗智能科技有限公司 Hydraulic gear pump defect detection method and system based on artificial intelligence

Also Published As

Publication number Publication date
CN114998341A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN114998341B (en) Gear defect detection method and system based on template matching
CN116205919B (en) Hardware part production quality detection method and system based on artificial intelligence
CN116385439B (en) Motor rubber shock pad quality detection method based on image processing
CN115633259B (en) Automatic regulation and control method and system for intelligent camera based on artificial intelligence
CN116823826B (en) Numerical control machine tool tipping abnormity detection method
CN116912261B (en) Plastic mold injection molding surface defect detection method
CN112579823B (en) Video abstract generation method and system based on feature fusion and incremental sliding window
CN109540917B (en) Method for extracting and analyzing yarn appearance characteristic parameters in multi-angle mode
CN116385472B (en) Hardware stamping part deburring effect evaluation method
CN111401449A (en) Image matching method based on machine vision
CN114359190A (en) Plastic product molding control method based on image processing
CN116503403B (en) Defect detection method of metal cutting tool bit based on image processing
CN116309577A (en) Intelligent detection method and system for high-strength conveyor belt materials
CN114119603A (en) Image processing-based snack box short shot defect detection method
CN116188468A (en) HDMI cable transmission letter sorting intelligent control system
CN116735612A (en) Welding defect detection method for precise electronic components
CN117314940B (en) Laser cutting part contour rapid segmentation method based on artificial intelligence
CN107330906A (en) Improvement thinning algorithm based on curve matching
CN116823820B (en) Aluminum-carbon integral stopper rod contour bending detection method
CN117314901A (en) Scale-adaptive chip detection neural network system
CN115294314B (en) Electronic component surface defect identification method
CN115082465B (en) Wool and cashmere classification method based on scanning electron microscope image processing
CN111325789B (en) Curvature discontinuous point detection method based on discrete direction change sequence
CN117764981B (en) Injection mold quality on-line measuring system based on machine vision
CN117314910B (en) Accurate wristband material cutting control method based on machine vision

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
GR01 Patent grant
GR01 Patent grant