CN114998341A - 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
CN114998341A
CN114998341A CN202210929595.3A CN202210929595A CN114998341A CN 114998341 A CN114998341 A CN 114998341A CN 202210929595 A CN202210929595 A CN 202210929595A CN 114998341 A CN114998341 A CN 114998341A
Authority
CN
China
Prior art keywords
tooth
gear
circle
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.)
Granted
Application number
CN202210929595.3A
Other languages
Chinese (zh)
Other versions
CN114998341B (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.)
Chizhou Guiqian Information Technology 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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Pathology (AREA)
  • Chemical & Material Sciences (AREA)
  • Signal Processing (AREA)
  • Biochemistry (AREA)
  • Quality & Reliability (AREA)
  • Immunology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of data processing, in particular to a gear defect detection method and a gear defect detection system based on template matching, wherein the method respectively collects gear images of each gear in the same batch to obtain corresponding gray level images, divides each gray level 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 the defects of the gear in each gear image based on the gear body standard template and the gear tooth standard template. The gear defect detection method has the advantages that the characteristic analysis is carried out on gears in the same batch, the gear body template and the gear tooth template of the gear are obtained in a self-adaptive mode, the defect detection is carried out on the gear based on the gear body template and the gear tooth template, the accuracy of the defect detection of the gear is guaranteed, 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 the gear used as a basic part of an electromechanical product directly influences the performance of a mechanical system. Therefore, strict inspection and control of product quality is necessary during the manufacturing process of the gear. However, in the existing defect detection scheme based on image information, the image to be detected is often matched with the standard template image, however, in the part processing process, parts are processed based on production requirements, the standard template image cannot be obtained in advance, and then 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 method and a system for detecting the defects of the gear 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 collecting gear images of each gear in the same batch to obtain corresponding gray level images;
performing image segmentation on the current gray level image to obtain a tooth body image and a tooth image, and acquiring the similarity between the tooth body and a 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 based on the circular characteristic of the tooth body, wherein the standard circle is 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 lengths of two tooth roots of one tooth in the tooth image; carrying out angular point detection on the tooth profile to divide a curve corresponding to an addendum into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, carrying out self-adaptive adjustment on an accumulator threshold value in the 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 through the adjusted accumulator threshold value; based on the symmetry of the tooth profile, calculating a symmetry difference value of the tooth profile according to the position deviation of a plurality of first circle centers, and acquiring a non-circular arc curve abnormal value according to 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 the teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth in each gray level image;
and detecting the defects of the gear in each gear image based on the gear body standard template and the gear tooth standard template.
Further, the method for obtaining the similarity 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 includes:
carrying out Hough circle detection on the tooth body to obtain the radius of the tooth body, and comparing the radius of the tooth body with the radius of a standard tooth body 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 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 circle difference index to obtain the similarity degree.
Further, the method for dividing the plurality of sub-curves into circular-arc curves and non-circular-arc curves comprises the following steps:
and calculating the average angle difference value corresponding to each sub-curve, and dividing the sub-curves into circular arc curves and non-circular arc curves by using a k-means clustering method according to the difference of the average angle difference values between any two sub-curves.
Further, the method for adaptively adjusting the threshold of the accumulator in the hough gradient method according to the number of the pixels on the circular arc curve or the non-circular arc curve comprises the following steps:
obtaining an initial accumulator threshold 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 of the non-circular-arc curve according to the number of pixels on the non-circular-arc curve and the minimum number of pixels 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 arc curve and the non-arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
Further, the method for calculating the symmetry difference value of the tooth profile according to the position deviation of the plurality of first circle centers comprises the following steps:
and obtaining a symmetry line of the tooth profile according to two tooth root straight lines of the teeth, respectively calculating the distance between each first circle center and the symmetry line, arranging the distances from small to large to obtain a distance sequence, and obtaining the symmetry difference value according to a distance difference value between two adjacent distances in the distance sequence.
Further, the method for obtaining the abnormal value of the non-circular arc curve according to the distance between each second circle center and the adjacent first circle center thereof comprises the following steps:
acquiring the Euclidean distance between any two circle centers of the second circle center and two adjacent first circle centers to obtain a position characteristic value of the second circle center; and combining the position characteristic value of each second circle center to obtain the abnormal value of the non-circular arc curve.
Further, the method for detecting the defects of the gear in each gear image based on the gear body standard template and the gear 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 teeth 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.
Further, an embodiment of the present invention further provides a gear defect detecting system based on template matching, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the steps of any one of the above-mentioned gear defect detecting methods based on template matching when executing the computer program.
The embodiment of the invention at least has the following beneficial effects: the gear body template and the gear template of the gear are obtained in a self-adaptive mode through characteristic analysis of the gears in the same batch, and defect detection is carried out on the gears in the batch based on the gear body template and the gear template, so that the accuracy of the defect detection of the gears is guaranteed, and the use of unqualified gears is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating steps of a method for detecting gear defects 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
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the method and system for detecting gear defects based on template matching according to the present invention will be made with reference to the accompanying drawings and preferred embodiments. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
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 following describes a specific scheme of the gear defect detection method and system based on template matching in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of a method for detecting gear defects based on template matching according to an embodiment of the present invention is shown, where the method includes the following steps:
and S001, respectively collecting the gear images of each gear in the same batch to obtain corresponding gray level images.
Specifically, in the embodiment of the present invention, an industrial camera is used to collect a corresponding gear image for each gear in the same batch in a form of a fixed light source, the collected gear image is an RGB image, and a graying process is performed on each RGB image in a weighted manner to obtain a corresponding grayscale image, where the graying process is performed in a manner of:
Figure 469738DEST_PATH_IMAGE001
wherein,
Figure 744468DEST_PATH_IMAGE002
is a gray value;
Figure 445577DEST_PATH_IMAGE003
pixel values of three channels in the RGB image, respectively.
Step S002, performing image segmentation on the current gray level image to obtain a tooth body image and a tooth image, and acquiring the similarity between the tooth body and a 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 based on the circular characteristic of the tooth body, wherein the standard circle refers to the circular standard of the tooth body required by production; and acquiring a tooth body standard template according to the similarity of the tooth body in each gray level image.
Specifically, the gear can be divided into two main parts, one part is the gear body of the gear, and the other part is the gear teeth of the gear, so that canny operator detection is carried out on the gray level image to obtain edge information of the gear, and the gray level image is divided into the gear body image and the gear teeth image according to the edge information.
According to priori knowledge, the gear body of the gear is usually circular, the closer the gear body is to the circular shape, the more standard the gear body is, the smaller defects are, therefore, the similarity between the gear body and a standard circle is analyzed according to the circular characteristic of the gear body, wherein the standard circle refers to the circular standard of the gear body required by production, and the analysis process of the similarity is as follows:
(1) and carrying out Hough circle detection on the tooth body to obtain the radius of the tooth body, and comparing the radius of the tooth body with the radius of a standard tooth body to obtain a radius difference index.
Specifically, a minimum circumscribed circle of the tooth body is obtained by using a Hough circle detection method, and then the radius of the minimum circumscribed circle is obtained and is used as the radius of the tooth body. Because gear production has the size requirement, then calculate the radius difference index of tooth body according to the difference between the standard tooth body radius that production required and the tooth body radius, then the computational formula of radius difference index is:
Figure 575207DEST_PATH_IMAGE004
wherein,
Figure 77995DEST_PATH_IMAGE005
is an index of radius difference;
Figure 572561DEST_PATH_IMAGE006
is the tooth body radius;
Figure 698649DEST_PATH_IMAGE007
is a standard tooth body radius.
(2) Every two adjacent pixel points on the edge of the tooth body form a straight line, the straight line angle difference between the two straight lines corresponding to each pixel point is calculated to obtain the average angle difference corresponding to the edge of the tooth body, and the circular difference index is obtained according to the difference between the straight line angle difference and the average angle difference of each pixel point.
Specifically, according to the priori knowledge, the change of the circular edge is smooth and uniform, so that in the embodiment of the invention, each pixel point and the adjacent pixel points in front and back of each pixel point form a straight line respectively, the straight line angle formed between each straight line and the horizontal straight line is obtained, and the straight line angle difference value between the straight line angles of the two straight lines corresponding to each pixel point is calculated
Figure 340893DEST_PATH_IMAGE008
(ii) a Calculating the average angle according to the linear angle difference of each pixel point on the edge of the tooth bodyAnd (3) the difference value is further analyzed to obtain a circular difference index of the tooth body by analyzing the difference between the linear angle difference value and the average angle difference value of each pixel point, and the calculation formula of the circular difference index is as follows:
Figure 947455DEST_PATH_IMAGE009
wherein,
Figure 924507DEST_PATH_IMAGE010
is a circular difference index;
Figure 350941DEST_PATH_IMAGE011
is as follows
Figure 448472DEST_PATH_IMAGE012
The linear angle difference of each pixel point;
Figure 158808DEST_PATH_IMAGE013
is the average angle difference;
Figure 260756DEST_PATH_IMAGE014
the number of pixel points on the edge of the tooth body.
(3) And combining the radius difference index and the circle difference index to obtain the similarity.
In particular, degree of similarity
Figure 984605DEST_PATH_IMAGE015
The calculation formula of (2) is as follows:
Figure 931832DEST_PATH_IMAGE016
wherein the degree of similarity
Figure 434358DEST_PATH_IMAGE015
The larger the size, the more satisfactory the tooth body.
Further, by using the analysis method of the similarity degree, the similarity degree of the tooth body in each gray level image is obtained, and then the tooth body image corresponding to the maximum value of the similarity degree is used as a tooth body standard template.
Step S003, acquiring a length difference value of the teeth according to the straight line length of two tooth roots of one tooth in the tooth image; carrying out angular point detection on the tooth profile to divide a curve corresponding to an addendum into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, carrying out self-adaptive adjustment on an accumulator threshold value in the 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 through the adjusted accumulator threshold value; based on the symmetry of the tooth profile, calculating a symmetry difference value of the tooth profile according to the position deviation of a plurality of first circle centers, and acquiring a non-circular arc curve abnormal value according to 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 acquiring 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 a straight line and a circular arc, and referring to fig. 2, a schematic diagram of a tooth profile is shown, where the tooth is composed of a tooth root straight line 1, a tooth root straight line 2, and sub-curves 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 by a chain code method, and a length abnormal value of the tooth is obtained by comparing a standard tooth root straight line length required by production, and then a calculation formula of the length abnormal value is:
Figure 457940DEST_PATH_IMAGE017
wherein,
Figure 124544DEST_PATH_IMAGE018
in the form of a length outlier,
Figure 124730DEST_PATH_IMAGE019
is a standardThe length of the straight line of the tooth root,
Figure 560391DEST_PATH_IMAGE020
for the first root straight length,
Figure 548682DEST_PATH_IMAGE021
the second root linear length.
Furthermore, since the tooth profile is formed of irregular curves, the curve corresponding to the tooth crest can be divided into a plurality of sub-curves by detecting the corner point of the tooth profile. Considering that a small irregular curve appears on an addendum due to machining defects in the gear machining process, and the smaller the curve is, the smaller the influence on the quality of the gear is, the sub-curves are divided into arc curves and non-arc curves, and the dividing method is as follows: and calculating the average angle difference corresponding to each sub-curve by using the method for acquiring the linear angle difference of each pixel point in the step S002, and dividing the plurality of sub-curves into arc curves and non-arc curves by using a k-means clustering method according to the difference of the average angle differences between any two sub-curves.
The circle center corresponding to each sub-curve is obtained by using a Hough gradient method for the circular arc curve and the non-circular arc curve, the Hough gradient method finds the circle center according to the modulus vector of each pixel point, and the circle center is determined by voting, namely, the circle center is determined based on the threshold value of an accumulator in the Hough gradient method, so that the threshold value of the accumulator in the Hough gradient method is adaptively adjusted according to the number of the pixel points on the circular arc curve or the non-circular arc curve, and the adjusting process is as follows:
(1) obtaining an initial accumulator threshold 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 the initial accumulator threshold of the non-circular arc curve according to the number of the pixel points on the non-circular arc curve and the minimum number of the pixel points required by the circle.
Specifically, when circle detection is performed, a circle can be determined by 3 pixels on the circumference, and therefore initial accumulator threshold values are respectively performed on an arc curve and a non-arc curve according to the minimum number of pixels required for determining the circleObtaining, for the arc curve, firstly counting the number of pixels on the arc curve, and obtaining the initial accumulator threshold of the arc curve by combining the number of pixels and the minimum number, where the calculation formula of the initial accumulator threshold is:
Figure 922157DEST_PATH_IMAGE022
wherein, in the process,
Figure 726034DEST_PATH_IMAGE023
the initial accumulator threshold for the circular arc curve,
Figure 812938DEST_PATH_IMAGE024
the number of pixel points on the arc curve; for a non-circular arc curve, firstly counting the number of pixels on the non-circular arc curve, and obtaining an initial accumulator threshold of the non-circular arc curve by combining the number of the pixels and the minimum number, wherein the calculation formula of the initial accumulator threshold is as follows:
Figure 175393DEST_PATH_IMAGE025
wherein
Figure 551011DEST_PATH_IMAGE026
the initial accumulator threshold for the circular arc curve,
Figure 830683DEST_PATH_IMAGE027
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 arc curve and the non-arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
Specifically, under an ideal condition, each circular arc curve or non-circular arc curve has only one circle center, and an oversize or undersize threshold of the initial accumulator affects circle center detection, that is, an oversize threshold of the initial accumulator causes no circle center to be detected, and an undersize causes an oversize shadow of the calculated circle center to be subsequently determined, so that the initial accumulator thresholds of the circular arc curve and the non-circular arc curve are respectively adjusted according to a plurality of initial circle centers corresponding to tooth profiles obtained by the initial accumulator threshold to obtain corresponding new accumulator thresholds, and then the adjustment formula is as follows:
Figure 726088DEST_PATH_IMAGE028
wherein,
Figure 573959DEST_PATH_IMAGE029
in order for the new accumulator threshold to be reached,
Figure 92665DEST_PATH_IMAGE030
an initial accumulator threshold for a curved arc or a non-curved arc,
Figure 736879DEST_PATH_IMAGE031
Figure 532797DEST_PATH_IMAGE032
the number of the initial circle centers.
And performing corresponding circle center detection on 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, according to the priori knowledge, the left and right profiles of the teeth are usually left-right symmetrical, so that the stronger the obtained circle center symmetry is, the more the production of the teeth meets the standard. Based on the symmetry of the tooth profile, calculating the symmetry difference value of the tooth profile according to the position deviation of a plurality of first circle centers corresponding to the circular arc curve, wherein the method comprises the following steps: the method comprises the steps of obtaining a symmetry line of a tooth profile according to two straight tooth root lines of teeth, respectively calculating the distance between each first circle center and the symmetry line, arranging the distances from small to large to obtain a distance sequence, and obtaining a symmetry difference value according to a 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 line
Figure 738519DEST_PATH_IMAGE033
Making a vertical line based on the central position, wherein the vertical line is a symmetrical line of the tooth profile; respectively calculating the distance from each first circle center to the symmetry line, knowing the calculated distance from the symmetry of the tooth profile as an even number, then arranging the distances from small to large to obtain a distance sequence, setting every two adjacent distances in the distance sequence as a group, respectively calculating the distance difference between two distances in each group, and accumulating the distance differences in each group to obtain a symmetry difference value
Figure 245986DEST_PATH_IMAGE034
Considering that a non-circular arc curve generally exists between two circular arc curves, when the distance between the second center of the non-circular arc curve and the first center of the circular arc curve is close enough, the non-circular arc curve does not affect the performance of the gear, therefore, the abnormal value of the non-circular arc curve is calculated according to the distance between the second center of the non-circular arc curve and the adjacent first center, and the method comprises the following steps: acquiring the Euclidean distance between any two circle centers of the second circle center and two adjacent first circle centers to obtain a position characteristic value of the second circle center; and combining the position characteristic value of each second circle center to obtain a non-circular arc curve abnormal value.
As an example, assume that the second center of the circle is (
Figure 742827DEST_PATH_IMAGE035
Figure 783464DEST_PATH_IMAGE036
) The first circle center is respectively (
Figure 393043DEST_PATH_IMAGE037
Figure 27287DEST_PATH_IMAGE038
) And (a) and (b)
Figure 514769DEST_PATH_IMAGE039
Figure 176957DEST_PATH_IMAGE040
) Respectively calculate the second circle center (
Figure 209635DEST_PATH_IMAGE035
Figure 580442DEST_PATH_IMAGE036
) And a first center of a circle
Figure 622348DEST_PATH_IMAGE037
Figure 198429DEST_PATH_IMAGE038
) European distance between
Figure 854538DEST_PATH_IMAGE041
The second circle center (
Figure 401057DEST_PATH_IMAGE035
Figure 997386DEST_PATH_IMAGE036
) And a first center of a circle
Figure 742488DEST_PATH_IMAGE039
Figure 897395DEST_PATH_IMAGE040
) European distance between
Figure 931210DEST_PATH_IMAGE042
And a first center of a circle
Figure 62721DEST_PATH_IMAGE037
Figure 786963DEST_PATH_IMAGE038
) And a first center of a circle
Figure 597924DEST_PATH_IMAGE039
Figure 869768DEST_PATH_IMAGE040
) European distance between
Figure 853904DEST_PATH_IMAGE043
Combined with Euclidean distance
Figure 760549DEST_PATH_IMAGE041
European style distance
Figure 451335DEST_PATH_IMAGE042
And Euclidean distance
Figure 459742DEST_PATH_IMAGE043
Calculating the position characteristic value of the second circle center
Figure 434520DEST_PATH_IMAGE044
The calculation formula is as follows:
Figure 743142DEST_PATH_IMAGE045
(ii) a Then, the position characteristic values of a plurality of second circle centers are added to obtain abnormal values of the non-circular arc curves
Figure 584321DEST_PATH_IMAGE046
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 determining the abnormal degree
Figure 798134DEST_PATH_IMAGE047
The calculation formula of (2) is as follows:
Figure 389652DEST_PATH_IMAGE048
further, the abnormal degree of each tooth in each gray level image is obtained by using the method for obtaining the abnormal degree of the tooth, and then the tooth image corresponding to the maximum abnormal degree is selected as a tooth standard template.
And step S004, detecting the defects of the gear in each gear image based on the gear body standard template and the gear tooth standard template.
Specifically, a first similarity calculation is carried out on a tooth body and a tooth body standard template in each gear image, and a second similarity calculation is carried out on teeth and the tooth standard template; and setting a similarity threshold, respectively comparing the first similarity and the second similarity with the similarity threshold, and determining whether the gear has defects according to the comparison result, namely when the first similarity and the second similarity are both greater than the similarity threshold, determining that the gear has no defects and meets the production requirements.
In summary, the embodiment of the present invention provides a method for detecting gear defects based on template matching, which includes acquiring gear images of each gear in the same batch to obtain corresponding grayscale images, dividing each grayscale image into a tooth body image and a tooth image, and analyzing the similarity of the tooth body in each tooth body image based on the circular characteristics 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 the defects of the gear in each gear image based on the gear body standard template and the gear tooth standard template. The gear defect detection method has the advantages that the gear of the same batch is subjected to characteristic analysis, the gear body template and the gear template of the gear are obtained in a self-adaptive mode, the gear is subjected to defect detection based on the gear body template and the gear template, accuracy of the gear defect detection is guaranteed, and the use of unqualified gears is reduced.
Based on the same inventive concept as the method, the 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, and is characterized in that the processor implements the steps of any one of the above gear defect detection methods based on template matching when executing the computer program.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may 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 may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (7)

1. A gear defect detection method based on template matching is characterized by comprising the following steps:
respectively collecting gear images of each gear in the same batch to obtain corresponding gray level images;
performing image segmentation on the current gray level image to obtain a tooth body image and a tooth image, and acquiring the similarity between the tooth body and a 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 based on the circular characteristic of the tooth body, wherein the standard circle is 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 linear lengths of two tooth roots of one tooth in the tooth image; carrying out angular point detection on the tooth profile to divide a curve corresponding to an addendum into a plurality of sub-curves, dividing the plurality of sub-curves into an arc curve and a non-arc curve, carrying out self-adaptive adjustment on an accumulator threshold value in the 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 through the adjusted accumulator threshold value; based on the symmetry of the tooth profile, calculating a symmetry difference value of the tooth profile according to the position deviation of a plurality of first circle centers, and acquiring a non-circular arc curve abnormal value according to 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 the teeth, and obtaining a tooth standard template according to the abnormal degree of each tooth in each gray level image;
detecting the defects of the gear in each gear image based on the gear body standard template and the gear tooth standard template;
the method for calculating the symmetry difference value of the tooth profile according to the position deviation of the plurality of first circle centers comprises the following steps:
and obtaining a symmetry line of the tooth profile according to two tooth root straight lines of the teeth, respectively calculating the distance from each first circle center to the symmetry line, arranging the distances from small to large to obtain a distance sequence, and accumulating the distance difference between every two adjacent distances in the distance sequence to obtain the symmetry difference value.
2. The method for detecting the gear defect based on the template matching as claimed in 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 the adjacent pixel points on the tooth body edge comprises the following steps:
carrying out Hough circle detection on the tooth body to obtain the radius of the tooth body, and comparing the radius of the tooth body with the radius of a standard tooth body 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 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 circle difference index to obtain the similarity degree.
3. The method for detecting the gear defect based on the template matching as claimed in claim 2, wherein the method for dividing the plurality of sub-curves into the circular arc curves and the non-circular arc curves comprises the following steps:
and calculating the average angle difference value corresponding to each sub-curve, and dividing the sub-curves into circular arc curves and non-circular arc curves by using a k-means clustering method according to the difference of the average angle difference values between any two sub-curves.
4. The method for detecting the gear defect based on the template matching as claimed in claim 1, wherein the method for adaptively adjusting the threshold of the accumulator in the hough gradient method according to the number of the pixel points on the circular arc curve or the non-circular arc curve comprises the following steps:
obtaining an initial accumulator threshold 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 of the non-circular-arc curve according to the number of pixels on the non-circular-arc curve and the minimum number of pixels 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 arc curve and the non-arc curve according to the number of the initial circle centers to obtain a corresponding new accumulator threshold.
5. The method for detecting the gear defect based on the template matching as claimed in claim 1, wherein the method for obtaining the abnormal value of the non-circular arc curve from the distance between each second circle center and the adjacent first circle center comprises:
acquiring the Euclidean distance between any two circle centers of the second circle center and two adjacent first circle centers to obtain a position characteristic value of the second circle center; and combining the position characteristic value of each second circle center to obtain the abnormal value of the non-circular arc curve.
6. The method for detecting the defects of the gear based on the template matching as claimed in claim 1, wherein the method for detecting the defects of the gear 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 teeth and the tooth standard template; setting a similarity threshold, respectively comparing the first similarity and the second similarity with the similarity threshold, and determining whether the gear has defects according to the comparison result.
7. A gear defect detection system based on template matching, 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 one 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 true CN114998341A (en) 2022-09-02
CN114998341B 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)

Cited By (2)

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

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200134800A1 (en) * 2018-10-29 2020-04-30 International Business Machines Corporation Precision defect detection based on image difference with respect to templates
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200134800A1 (en) * 2018-10-29 2020-04-30 International Business Machines Corporation Precision defect detection based on image difference with respect to templates
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN114998341B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
CN114998341A (en) Gear defect detection method and system based on template matching
CN115829883B (en) Surface image denoising method for special-shaped metal structural member
CN115311270B (en) Plastic product surface defect detection method
CN116823826B (en) Numerical control machine tool tipping abnormity detection method
CN115633259B (en) Automatic regulation and control method and system for intelligent camera based on artificial intelligence
CN116611748B (en) Titanium alloy furniture production quality monitoring system
CN114170228B (en) Computer image edge detection method
CN116740070B (en) Plastic pipeline appearance defect detection method based on machine vision
CN115330767B (en) Method for identifying production abnormity of corrosion foil
CN116385472B (en) Hardware stamping part deburring effect evaluation method
CN114897896B (en) Building wood defect detection method based on gray level transformation
CN116934763B (en) Medical rubber plug defect detection method based on visual characteristics
CN115311262A (en) Printed circuit board defect identification method
CN116993742B (en) Nickel alloy rolling defect detection method based on machine vision
CN116912261A (en) Plastic mold injection molding surface defect detection method
CN114119603A (en) Image processing-based snack box short shot defect detection method
CN116977329A (en) Photovoltaic grid line detection method based on machine vision
CN116385450A (en) PS sheet wear resistance detection method based on image processing
CN115311267A (en) Method for detecting abnormity of check fabric
CN116703251A (en) Rubber ring production quality detection method based on artificial intelligence
CN116309577A (en) Intelligent detection method and system for high-strength conveyor belt materials
CN118096796B (en) Visual inspection method for appearance of radial forging titanium rod based on machine learning
CN117764982B (en) Stamping die carrier abrasion detection method based on three-dimensional point cloud technology
CN117274405B (en) LED lamp working color detection method based on machine vision
CN115294314B (en) Electronic component surface defect identification method

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
TR01 Transfer of patent right

Effective date of registration: 20240905

Address after: 247100 Plot A, Zhanqian District, Chizhou City, Anhui Province, China. International Trade City Phase I Professional Market Comprehensive Building 5, 130th, 130th, 2nd, and 3rd floors

Patentee after: Chizhou Guiqian Information Technology Co.,Ltd.

Country or region after: China

Address before: 226000 Wusi village, Huilong Town, Qidong City, Nantong City, Jiangsu Province (No. 20, Qingnian East Road, Qidong City)

Patentee before: QIDONG WANHUI MACHINERY MANUFACTURING Co.,Ltd.

Country or region before: China