Watch parts production quality inspection method and system based on machine vision

By analyzing the extension trend and smoothness of the gear edge in segments, the cog groove edges are screened out, which solves the problem of interference in the highlight area in traditional methods and improves the accuracy of gear quality detection.

CN119672021BActive Publication Date: 2025-05-02SHENZHEN GAOJIN IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510185666.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-05-02
Estimated Expiration
2045-02-20

AI Technical Summary

Technical Problem

The traditional gear quality detection method based on machine vision reduces detection accuracy due to interference in highlight area caused by specular reflection.

Method used

By obtaining the edges of the gear grayscale diagram and dividing them into several edge segments, the extension trend and smoothness of each edge segment are analyzed, the top edge of the tooth and concave edges are distinguished, and the gear edges are screened out, and the gear quality is then evaluated.

Benefits of technology

It effectively avoids interference from the edges of the highlighted area and improves the accuracy of gear quality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672021B_ABST
    Figure CN119672021B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a method and system for detecting the production quality of watch parts based on machine vision, including: obtaining a gear grayscale image and its edge, and recording its gear center; dividing the edge of the gear grayscale image into a number of edge segments, and obtaining the extension trend of the pixel points in each edge segment according to the distance between the adjacent pixel points in each edge segment and the gear center, so as to divide all edge segments into tooth top edges and concave edges; screening tooth groove edges according to the distance between the tooth root point of each concave edge and the gear center, and the symmetry of the suspected tooth groove edge; evaluating the gear quality according to the tooth top edge and the tooth groove edge. The present invention analyzes the difference between the edge of the highlight area generated at the gear groove and the edge at the actual gear groove, thereby avoiding interference from the edge of the highlight area when detecting the gear quality through the edge, thereby improving the accuracy of detecting the gear quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting the production quality of watch parts based on machine vision. Background Art

[0002] As the core component of a mechanical clock, the tiny gears inside the clock are mainly used to transmit the power stored in the spring to the escapement through a precise gear system, thereby driving the hands to move accurately. To ensure the accurate movement of the clock hands, it is necessary to detect the quality of the tiny gears inside the clock. The traditional method of obtaining the gear edge through machine vision and detecting the gear quality based on the gear edge will produce a highlight area at the gear groove due to mirror reflection. The highlight area will interfere with the detection of the gear quality, thereby reducing the accuracy of the gear quality detection. Summary of the invention

[0003] The present invention provides a method and system for detecting the production quality of watch parts based on machine vision, so as to solve the existing problem that the accuracy of detecting the quality of gears based on the traditional edge obtained by machine vision is low.

[0004] The watch parts production quality inspection method and system based on machine vision of the present invention adopts the following technical solutions:

[0005] An embodiment of the present invention provides a method for detecting the production quality of watch parts based on machine vision, the method comprising the following steps:

[0006] Get the gear grayscale image and its edge, and record its gear center;

[0007] The edge of the gear grayscale image is divided into several edge segments, and according to the change of the distance between the adjacent pixel points in each edge segment and the gear center, the extension trend of the pixel points in each edge segment is obtained, and then the extension direction of each pixel point in each edge segment is obtained; according to the extension direction of each pixel point in each edge segment, the pixel points in each edge segment are divided into several distant extension segments and close extension segments, and the smoothness of each edge segment is obtained; according to the distant extension segments and close extension segments in each edge segment, combined with the smoothness of each edge segment, the concave edge factor of each edge segment is obtained; according to the concave edge factors of all edge segments, all edge segments are divided into tooth top edges and concave edges;

[0008] Obtain the radius of the gear tooth root circle, and take the pixel point in each concave edge that is closest to the gear center as the tooth root point of each concave edge; obtain the tooth groove feature of each concave edge based on the distance between the tooth root point of each concave edge and the gear center, and the difference between the distance and the radius of the gear tooth root circle; filter out suspected tooth groove edges based on the tooth groove features of the concave edges; obtain the possibility that the suspected tooth groove edge is a tooth groove edge based on the symmetry of the suspected tooth groove edge, and filter out the tooth groove edge;

[0009] Evaluate gear quality based on tooth tip edges and tooth gap edges.

[0010] Preferably, the method of obtaining the extension trend of the pixel points in each edge segment according to the change in the distance between the adjacent pixel points in each edge segment and the gear center includes the following specific methods:

[0011] For The edge segment edge pixels, The edge segment The distance between the edge pixel and the gear center minus the The edge segment The difference between the distance between the edge pixel and the gear center is taken as the The edge segment The extension trend of edge pixels.

[0012] Preferably, the obtaining of the extension direction of each pixel point in each edge segment includes the following specific methods:

[0013] For The edge segment edge pixels, if the The edge segment The extension trend of the edge pixel is greater than 0. The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The extension trend of the edge pixel is less than 0. The edge segment The extension direction of the edge pixel is recorded as 0;

[0014] Jordi The edge segment The extension trend of the edge pixel is equal to 0, and the The edge segment The pixels adjacent to the edge pixels are recorded as expansion pixels; the average of the extension trends of all expansion pixels is recorded as The edge segment The expansion trend of edge pixels. The edge segment The expansion trend of the edge pixel is greater than 0. The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The expansion trend of the edge pixel is less than 0. The edge segment The extension direction of the edge pixel is recorded as 0;

[0015] Jordi The edge segment The expansion trend of the edge pixel is equal to 0, and the The pixels adjacent to the expanded pixel in the edge segment are classified as expanded pixels, and the extension trend average of all expanded pixels is recorded as The edge segment The expansion trend of the edge pixel after updating; and so on, until the The edge segment The expansion trend of the edge pixel is not equal to 0, and the The edge segment The extending direction of the edge pixels.

[0016] Preferably, the method of dividing the pixels in each edge segment into a plurality of distant extension segments and close extension segments according to the extension direction of each pixel in each edge segment, and obtaining the smoothness of each edge segment includes the following specific methods:

[0017] For edge segment, The edge pixels with the same and continuous extension direction in the edge segments are assigned to the same extension direction segment. The edge segments are divided into several extension direction segments; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 1 are recorded as the far extension segment; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 0 are recorded as the near extension segment; according to all the far extension segments and the near extension segments, the first The specific calculation formula for the smoothness of an edge segment is:

[0018]

[0019] In the formula, Indicates The smoothness of each edge segment; Indicates The length of the longest edge segment away from the extension segment; Indicates The length of the longest proximal extension segment among the edge segments; Indicates The number of segments far from the extension in each edge segment; Indicates The number of close extension segments in each edge segment; represents the linear normalization function.

[0020] Preferably, the concave edge factor of each edge segment is obtained according to the distal extension segment and the proximal extension segment in each edge segment and the smoothness of each edge segment, and the specific method includes:

[0021] For edge segment, The midpoint of the edge segment is taken as the segmentation point, and the The edge segment is divided into the front half and the back half. According to the approaching extension segment in the front half and the distance extension segment in the back half, the The smoothness of the edge segment is obtained The concave edge factor of an edge segment is calculated as follows:

[0022]

[0023] In the formula, Indicates The concave edge factor of the edge segment; Indicates The number of segments close to the extension in the first half of each edge segment; Indicates In the first half of the edge segment A length close to the extension; Indicates The number of segments away from the extension in the second half of each edge segment; Indicates The second half of the edge segment The length away from the extension section; Indicates The smoothness of each edge segment; represents the linear normalization function.

[0024] Preferably, the method of dividing all edge segments into top edges and concave edges according to the concave edge factors of all edge segments includes:

[0025] Preset a concave edge factor threshold , for any edge segment, if the concave edge factor of the edge segment is less than or equal to , the edge segment is recorded as the tooth top edge; if the concave edge factor of the edge segment is greater than , and the edge segment is recorded as a concave edge.

[0026] Preferably, the tooth groove feature of each concave edge is obtained according to the distance between the tooth root point of each concave edge and the gear center, and the difference between the distance between the tooth root point of each concave edge and the radius of the gear tooth root circle, including the specific method of:

[0027]

[0028] In the formula, Represents the tooth feature of any concave edge; represents the distance between the root point of the concave edge and the center of the gear; Indicates the radius of the gear tooth root circle; Represents the absolute value function.

[0029] Preferably, the method of obtaining the possibility that the suspected alveolar edge is the alveolar edge according to the symmetry of the suspected alveolar edge comprises the following specific methods:

[0030] For any suspected tooth groove edge, the point closest to the center of the gear in the suspected tooth groove edge is used as the segmentation point, and the suspected tooth groove edge is divided into two segments to obtain two sub-segments of the suspected tooth groove edge; the sub-segment with the shortest length is the reference segment;

[0031] Starting from the segmentation point, a portion with the same length as the reference segment is cut from the longest sub-segment of the two sub-segments as the corresponding portion of the reference segment; the possibility that the suspected tooth groove edge is the tooth groove edge is obtained through the difference in extension trend between the reference segment and the corresponding portion of the reference segment, and the specific calculation formula is:

[0032]

[0033] In the formula, Indicates the possibility that the suspected alveolar edge is an alveolar edge; Represents the mean of the extension trends of all edge pixels in the reference segment; represents the mean value of the extension trend of all edge pixels in the corresponding part of the reference segment; Represents the absolute value function.

[0034] Preferably, the gear quality is evaluated based on the tooth top edge and the tooth groove edge, and the specific method includes:

[0035] For any tooth groove edge, Fourier transform is performed on the tooth groove edge according to the position coordinates of the tooth groove edge in the gear grayscale image to obtain a frequency spectrum of the tooth groove edge;

[0036] Preset a high frequency threshold , the spectrum graph of the tooth edge is greater than or equal to The frequency is recorded as the high frequency frequency, and the amplitude corresponding to the high frequency frequency is taken as the proportion of the amplitude corresponding to all frequencies in the frequency spectrum of the tooth groove edge as the defect degree of the tooth groove edge;

[0037] Get the defect degree of any tooth top edge; preset a defect degree threshold , if the defect degree of any tooth top edge or tooth groove edge is greater than , the gear quality is unqualified.

[0038] Another embodiment of the present invention provides a watch parts production quality inspection system based on machine vision, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of the above-mentioned watch parts production quality inspection method based on machine vision when executing the computer program.

[0039] The beneficial effect of the technical solution of the present invention is as follows: the present application divides the edge of the gear grayscale image into several edge segments, and obtains the extension trend of the pixel points in each edge segment according to the distance between the adjacent pixel points in each edge segment and the gear center. Since the edge of the gear in the gear grayscale image and the edge of the highlight area are always connected as one, in order to better distinguish the gear edge from the highlight edge, it is necessary to segment the edge of the gear grayscale image. Since the opening of the tooth top edge faces the gear center, and the opening of the highlight area edge and the tooth groove edge faces away from the gear center, all edge segments can be divided into tooth top edges and concave edges, wherein the concave edge includes the tooth groove edge and the highlight area edge. The edge of the bright area; obtain the radius of the gear root circle, and take the point in each concave edge closest to the gear center as the root point of each concave edge; according to the distance between the root point of each concave edge and the gear center, and the symmetry of the suspected tooth groove edge, the tooth groove edge is screened out. Since the point closest to the gear center in each tooth groove edge is located on the gear root circle, and since the highlighted area will be blocked by the adjacent gear teeth, resulting in asymmetric edges of the highlighted area, while the tooth groove edge is symmetrical, the tooth groove edge can be screened out; the gear quality is evaluated based on the tooth top edge and the tooth groove edge, which can avoid the interference of the edge of the highlighted area and improve the accuracy of the gear quality evaluation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A flowchart of the steps of the watch parts production quality inspection method based on machine vision of the present invention;

[0042] Figure 2 This is a local example of a gear grayscale image. DETAILED DESCRIPTION

[0043] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the watch parts production quality inspection method and system based on machine vision proposed by the present invention, its specific implementation method, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0044] 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.

[0045] The specific scheme of the watch parts production quality inspection method and system based on machine vision provided by the present invention is described in detail below with reference to the accompanying drawings.

[0046] See also Figure 1 , which shows a flowchart of a method for detecting the production quality of watch parts based on machine vision according to an embodiment of the present invention, the method comprising the following steps:

[0047] Step S001: Obtain a gear grayscale image and its edge, and record its gear center.

[0048] It should be noted that the tiny gears inside the watch are the core components of the mechanical watch. Their main function is to realize the transmission and distribution of energy, and transmit the power stored in the spring to the escapement through a precise gear system, thereby driving the hands to operate accurately. When there are defects in the tiny gears inside the watch, it will seriously affect the accuracy and operational stability of the watch. Therefore, this embodiment proposes a method for detecting the production quality of watch parts based on machine vision, specifically, identifying the edges of the tiny gears in the watch based on machine vision, and detecting whether there are defects in the tiny gears. To this end, it is first necessary to capture an image of the tiny gears inside the watch, and further obtain the edges of the tiny gears.

[0049] Specifically, an image of a tiny gear inside a clock is collected by a microscope camera, and the image of the tiny gear inside the clock is grayed to obtain a gear grayscale image; and the gear center is recorded.

[0050] Furthermore, the edge of the gear grayscale image is obtained through an edge detection operator; the edge calculation can be set by itself according to actual conditions, and this embodiment does not make a rigid requirement. In this embodiment, the edge of the gear grayscale image is obtained through a Sobel edge detection operator. Since the Sobel edge detection operator is a well-known prior art, it will not be repeated in this embodiment.

[0051] Step S002: Divide the edge of the gear grayscale image into several edge segments, and obtain the extension trend of the pixels in each edge segment according to the change in the distance between the adjacent pixels in each edge segment and the gear center, and then obtain the extension direction of each pixel in each edge segment; according to the extension direction of each pixel in each edge segment, divide the pixels in each edge segment into several away extension segments and close extension segments, and obtain the smoothness of each edge segment; according to the away extension segments and close extension segments in each edge segment, combined with the smoothness of each edge segment, obtain the concave edge factor of each edge segment; according to the concave edge factors of all edge segments, divide all edge segments into tooth top edges and concave edges.

[0052] It should be noted that when the image of a small gear is captured through a microscope camera, mirror reflection will occur at the gear groove, resulting in a highlight area at the gear groove, and the edge of the highlight area will interfere with the detection of whether the small gear has defects through the edge of the small gear. Therefore, this embodiment proposes a watch parts production quality inspection method based on machine vision. Specifically, the edge of the gear groove is obtained by the difference between the edge of the highlight area and the edge of the actual gear groove, so as to avoid the interference caused by the highlight area, thereby improving the accuracy of gear quality detection.

[0053] It should be further explained that since the edge of the gear in the gear grayscale image is always connected to the edge of the highlight area, in order to better distinguish the gear edge from the highlight edge, it is necessary to segment the edge of the gear grayscale image; and the edge of the highlight area is always located at the gear groove, such as Figure 2 As shown, Figure 2 This is a local example of a gear grayscale image; this embodiment mainly distinguishes the highlight edge from the tooth groove edge to avoid interference from the highlight edge, and the highlight edge and the tooth groove edge always have the feature of opening back to the center of the gear. Therefore, the highlight edge and the tooth groove edge can be recorded as a concave edge through the edge opening direction feature, so as to prepare for better distinguishing the highlight edge from the tooth groove edge in the future.

[0054] Preferably, in a specific embodiment of the present invention, for any edge in the gear grayscale image, if an edge pixel in the edge has three or more edge pixels in an eight-neighborhood, the edge pixel is used as a segmentation point of the edge to divide the edge into a plurality of edge segments;

[0055] For The edge segment edge pixels ( ), the first The edge segment The distance between the edge pixel and the gear center minus the The edge segment The difference between the distance between the edge pixel and the gear center is taken as the The edge segment The extension trend of edge pixels It should be noted that, in this embodiment, the traversal order of the pixel points in the edge segment is in a clockwise direction, including the subsequent segmentation points that divide the edge segment into two halves, the front and back halves, and the front and back halves are also defined in a clockwise direction.

[0056] Similarly, get The extension trend of all edge pixels in an edge segment.

[0057] It should be noted that The larger the value, the The edge segment The more the edge pixels extend away from the center of the gear; The smaller the value, the The edge segment The closer the edge pixels are to the center of the gear, the closer they are to the center of the gear. If the value is greater than 0, it means The edge segment When the edge pixels extend away from the center of the gear, If the value is less than 0, it means The edge segment The edge pixels extend toward the center of the gear.

[0058] Furthermore, for the The edge segment edge pixels ( ), if The edge segment The extension trend of the edge pixel is greater than 0, then The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The extension trend of the edge pixel is less than 0, then The edge segment The extension direction of the edge pixel is recorded as 0;

[0059] Jordi The edge segment The extension trend of the edge pixel is equal to 0, then the The edge segment The pixels adjacent to the edge pixels are recorded as expansion pixels; the average of the extension trends of all expansion pixels is recorded as The edge segment The expansion trend of edge pixels. The edge segment The expansion trend of the edge pixel is greater than 0, then The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The expansion trend of the edge pixel is less than 0, then The edge segment The extension direction of the edge pixel is recorded as 0;

[0060] Jordi The edge segment The expansion trend of the edge pixel is equal to 0, then The pixels adjacent to the expanded pixel in the edge segment are classified as expanded pixels, and the extension trend average of all expanded pixels is recorded as The edge segment The expansion trend of the edge pixel after updating; and so on, until the The edge segment The expansion trend of the edge pixel is not equal to 0, and the The edge segment The extending direction of the edge pixels.

[0061] Similarly, get The extension direction of all edge pixels in an edge segment.

[0062] It should be noted that, since the tooth groove edge is a smooth edge with an opening facing away from the center of the gear, the smoothness of the short edge can be analyzed as a basis for evaluating whether the edge segment is a tooth groove edge.

[0063] Preferably, in a specific embodiment of the present invention, for edge segment, The edge pixels with the same and continuous extension direction in the edge segments are assigned to the same extension direction segment. The edge segments are divided into several extension direction segments; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 1 are recorded as the far extension segment; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 0 are recorded as the near extension segment; according to all the far extension segments and the near extension segments, the first The specific calculation formula for the smoothness of an edge segment is:

[0064]

[0065] In the formula, Indicates The smoothness of each edge segment; Indicates The length of the longest edge segment away from the extension segment; Indicates The length of the longest proximal extension segment among the edge segments; Indicates The number of segments far from the extension in each edge segment; Indicates The number of close extension segments in each edge segment; Represents a linear normalization function; its normalization range is all edge segments .

[0066] It should be noted that the extension direction of each extension direction segment is different from that of the adjacent extension direction segment, and the fewer the number of extension segments in the edge segment, the less the change in the extension direction of the pixel points in the edge segment, and the smoother the edge segment. The smaller the value is, the smoother the edge segment is. At the same time, when the length of the edge segment away from the extension segment and the length of the edge segment close to the extension segment are longer, it means that the edge segment can maintain its extension direction without drastic changes; therefore The larger the value, the smoother the edge segments.

[0067] It should be further explained that when the distance between the pixels at both ends of the edge segment and the gear center is far, and the distance between the middle pixel and the gear center is close, the opening of the edge segment faces away from the gear center. When the opening of the edge segment faces away from the gear center and the edge segment is smooth, the edge segment may be a tooth groove edge. In this way, all edge segments are initially screened to obtain concave edge segments.

[0068] Preferably, in a specific embodiment of the present invention, for edge segment, The midpoint of the edge segment is taken as the segmentation point, and the The edge segment is divided into the front half and the back half. According to the approaching extension segment in the front half and the distance extension segment in the back half, the The smoothness of the edge segment is obtained The concave edge factor of an edge segment is calculated as follows:

[0069]

[0070] In the formula, Indicates The concave edge factor of the edge segment; Indicates The number of segments close to the extension in the first half of each edge segment; Indicates In the first half of the edge segment A length close to the extension; Indicates The number of segments away from the extension in the second half of each edge segment; Indicates The second half of the edge segment The length away from the extension section; Indicates The smoothness of each edge segment; Represents a linear normalization function, whose specific normalization range is all edge segments .

[0071] It should be noted that when the edge segment is divided into two parts, the longer the approaching extension segment in the front half is, the closer the front half of the edge segment extends to the center of the gear; the longer the away extension segment in the rear half is, the closer the front half of the edge segment extends to the center of the gear. The larger the value of , and the smoother the edge segment, the more the edge segment has the characteristics of a toothed edge. Therefore, the concave edge is obtained based on .

[0072] Specifically, a concave edge factor threshold is preset , The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. For any edge segment, if the concave edge factor of the edge segment is less than or equal to , then the edge segment is recorded as the tooth top edge; if the concave edge factor of the edge segment is greater than , then the edge segment is recorded as a concave edge.

[0073] It should be noted that the edge of the highlighted area also has the characteristics of an edge opening facing away from the center of the gear and being smooth, and this step only performs a preliminary screening of the edge segment based on the opening direction and smoothness of the edge segment. Therefore, the concave edge includes the edge of the highlighted area and the tooth groove edge, and further screening of the concave edge is required.

[0074] At this point, all concave edges are obtained.

[0075] Step S003: Obtain the radius of the gear root circle, and take the pixel point in each concave edge that is closest to the gear center as the root point of each concave edge; obtain the tooth groove feature of each concave edge based on the distance between the root point of each concave edge and the gear center, and the difference between the distance and the radius of the gear root circle; filter out suspected tooth groove edges based on the tooth groove features of the concave edges; obtain the possibility that the suspected tooth groove edges are tooth groove edges based on the symmetry of the suspected tooth groove edges, and filter out the tooth groove edges.

[0076] It should be noted that, since the concave edge obtained in step S002 is only preliminarily screened according to the opening direction and smoothness of the edge segment, and the edge of the highlight area also has the characteristics of the edge opening facing away from the gear center and being smooth, the concave edge includes the edge of the highlight area and the tooth groove edge, and further screening of the concave edge is required. Since the point closest to the center of the gear in each tooth groove edge is located on the gear tooth root circle (the gear tooth root circle is the bottom circle of the gear tooth groove, and the tooth root circle is an important parameter of the gear), the edge segment can be further screened according to the distance between the point closest to the center of the gear in each edge segment and the gear, and the difference between the radius of the gear tooth root circle. In addition, since the highlight area will be blocked by the adjacent gear teeth, resulting in the asymmetry of the edge of the highlight area, while the tooth groove edge is symmetrical, the edge segment can be screened again based on this, and all tooth groove edges can be obtained.

[0077] Specifically, for any concave edge, the point in the concave edge closest to the gear center is obtained as the tooth root point of the concave edge. According to the distance between the tooth root point of the concave edge and the gear center, and the difference between the distance between the tooth root point of the concave edge and the radius of the gear tooth root circle, the tooth groove feature of the concave edge is obtained. The specific calculation formula is:

[0078]

[0079] In the formula, a tooth groove feature representing said concave edge; represents the distance between the root point of the concave edge and the center of the gear; Indicates the radius of the gear tooth root circle; Represents the absolute value function.

[0080] It should be noted that The smaller the value, the closer the concave edge is to the gear center, and the closest point to the gear center is located on the root circle edge, while the closest point to the gear center on the tooth groove edge is located on the root circle edge. The smaller the value is, the more the concave edge has the characteristics of the alveolar edge. Therefore, the suspected alveolar edge can be screened out from the concave edge.

[0081] Specifically, preset a tooth groove feature , The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. For any concave edge, if the tooth groove feature of the concave edge is less than or equal to , then the concave edge is recorded as a non-toothed edge; if the toothed feature of the concave edge is greater than , then the concave edge is recorded as a suspected alveolar edge.

[0082] It should be noted that since the highlight area is blocked by the adjacent gear teeth, the edge of the highlight area is asymmetric, while the edge of the tooth groove has a symmetrical feature, so this can be used as a basis to further distinguish the edge of the highlight area from the edge of the tooth groove.

[0083] Specifically, for any suspected tooth groove edge, the point closest to the center of the gear in the suspected tooth groove edge is used as a segmentation point, and the suspected tooth groove edge is divided into two segments to obtain two sub-segments of the suspected tooth groove edge; the reference segment of the sub-segment with the shortest length is selected;

[0084] Furthermore, starting from the segmentation point, a portion having the same length as the reference segment is intercepted from the longest sub-segment of the two sub-segments as the corresponding portion of the reference segment; the possibility that the suspected tooth groove edge is a tooth groove edge is obtained through the difference in extension trend between the reference segment and the corresponding portion of the reference segment, and the specific calculation formula is:

[0085]

[0086] In the formula, Indicates the possibility that the suspected alveolar edge is an alveolar edge; Represents the mean of the extension trends of all edge pixels in the reference segment; represents the mean value of the extension trend of all edge pixels in the corresponding part of the reference segment; Represents the absolute value function.

[0087] It should be noted that The smaller the value is, the more symmetrical the reference segment of the suspected tooth groove edge and the corresponding part of the reference segment are, that is, the better the symmetry of the suspected tooth groove edge is. The larger the value of is, the more likely the suspected alveolar edge is to be the alveolar edge. Therefore, the alveolar edge can be screened out from the suspected alveolar edges.

[0088] Specifically, set a probability threshold , The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. For any suspected alveolar edge, if the probability that the suspected alveolar edge is an alveolar edge is less than or equal to , then the suspected alveolar edge is a non-alveolar edge; if the probability that the suspected alveolar edge is an alveolar edge is greater than , then the suspected alveolar edge is the alveolar edge.

[0089] At this point, the tooth groove edge is obtained.

[0090] Step S004: Evaluate the gear quality based on the tooth top edge and the tooth groove edge.

[0091] It should be noted that after obtaining the tooth top edge and tooth groove edge respectively through step S002 and step S003, the gear quality can be detected only by evaluating the defect degree of the tooth top edge and tooth groove edge, thereby avoiding interference from the edge of the highlight area and improving the accuracy of evaluating the gear quality.

[0092] It should be further explained that, since the process of evaluating the defect degree of the tooth top edge and the tooth groove edge is the same, the present embodiment is described by taking the evaluation of the defect degree of the tooth groove edge as an example.

[0093] Specifically, for any tooth groove edge, Fourier transform is performed on the tooth groove edge according to the position coordinates of the tooth groove edge in the gear grayscale image to obtain a frequency spectrum of the tooth groove edge. Since Fourier transform is a well-known prior art, it will not be described in detail in this embodiment.

[0094] Preset a high frequency threshold , The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. Hz is taken as an example, and the frequency spectrum of the tooth edge is greater than or equal to The frequency is recorded as the high frequency frequency, and the amplitude corresponding to the high frequency frequency accounts for the amplitude corresponding to all frequencies in the frequency spectrum of the tooth groove edge as the defect degree of the tooth groove edge.

[0095] It should be noted that when the amplitude corresponding to the high frequency frequency accounts for a larger proportion of the amplitude corresponding to all frequencies in the spectrum diagram of the tooth slot edge, it means that the tooth slot edge has a more rapid and uneven feature, while the intact tooth top edge and tooth slot edge are smooth. Therefore, when the amplitude corresponding to the high frequency frequency accounts for a larger proportion of the amplitude corresponding to all frequencies in the spectrum diagram of the tooth slot edge, it is more likely that there are defects in the tooth slot edge. Therefore, this can be used to evaluate the quality of gears.

[0096] Furthermore, the defect degree of any tooth top edge is obtained in the same way; a defect degree threshold is preset , The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. If the defect degree of any tooth top edge or tooth groove edge is greater than , the gear quality is unqualified.

[0097] At this point, this embodiment is completed.

[0098] Another embodiment of the present invention provides a watch parts production quality inspection system based on machine vision, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the watch parts production quality inspection method based on machine vision in steps S001 to S004 when executing the computer program.

[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting the production quality of watch parts based on machine vision, characterized in that: The method comprises the following steps: Get the gear grayscale image and its edge, and record its gear center; The edge of the gear grayscale image is divided into several edge segments, and according to the change of the distance between the adjacent pixel points in each edge segment and the gear center, the extension trend of the pixel points in each edge segment is obtained, and then the extension direction of each pixel point in each edge segment is obtained; according to the extension direction of each pixel point in each edge segment, the pixel points in each edge segment are divided into several distant extension segments and close extension segments, and the smoothness of each edge segment is obtained; according to the distant extension segments and close extension segments in each edge segment, combined with the smoothness of each edge segment, the concave edge factor of each edge segment is obtained; according to the concave edge factors of all edge segments, all edge segments are divided into tooth top edges and concave edges; Obtain the radius of the gear tooth root circle, and take the pixel point in each concave edge that is closest to the gear center as the tooth root point of each concave edge; obtain the tooth groove feature of each concave edge based on the distance between the tooth root point of each concave edge and the gear center, and the difference between the distance and the radius of the gear tooth root circle; filter out suspected tooth groove edges based on the tooth groove features of the concave edges; obtain the possibility that the suspected tooth groove edge is a tooth groove edge based on the symmetry of the suspected tooth groove edge, and filter out the tooth groove edge; Evaluate gear quality based on tooth top edge and tooth groove edge; The method of dividing the pixel points in each edge segment into a plurality of distant extension segments and close extension segments according to the extension direction of each pixel point in each edge segment, and obtaining the smoothness of each edge segment includes the following specific methods: For edge segment, The edge pixels with the same and continuous extension direction in the edge segments are assigned to the same extension direction segment. The edge segments are divided into several extension direction segments; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 1 are recorded as the far extension segment; the extension direction segments in which the average extension direction of all edge pixels in the extension direction segment is 0 are recorded as the near extension segment; according to all the far extension segments and the near extension segments, the first The specific calculation formula for the smoothness of an edge segment is: In the formula, Indicates The smoothness of each edge segment; Indicates The length of the longest edge segment away from the extension segment; Indicates The length of the longest proximal extension segment among the edge segments; Indicates The number of segments far from the extension in each edge segment; Indicates The number of close extension segments in each edge segment; represents the linear normalization function; The method of obtaining the concave edge factor of each edge segment according to the far-extending segment and the close-extending segment in each edge segment and the smoothness of each edge segment includes the following specific methods: For edge segment, The midpoint of the edge segment is taken as the segmentation point, and the The edge segment is divided into the front half and the back half. According to the approaching extension segment in the front half and the distance extension segment in the back half, the The smoothness of the edge segment is obtained The concave edge factor of an edge segment is calculated as follows: In the formula, Indicates The concave edge factor of the edge segment; Indicates The number of segments close to the extension in the first half of each edge segment; Indicates In the first half of the edge segment A length close to the extension; Indicates The number of segments away from the extension in the second half of each edge segment; Indicates The second half of the edge segment The length of the extension section.

2. The watch parts production quality inspection method based on machine vision according to claim 1 is characterized in that: The specific method of obtaining the extension trend of the pixel points in each edge segment according to the change in the distance between the adjacent pixel points in each edge segment and the gear center is as follows: For The edge segment edge pixels, The edge segment The distance between the edge pixel and the gear center minus the The edge segment The difference between the distance between the edge pixel and the gear center is taken as the The edge segment The extension trend of edge pixels.

3. The method for detecting the production quality of watch parts based on machine vision according to claim 1, characterized in that: The specific method of obtaining the extension direction of each pixel point in each edge segment includes: For The edge segment edge pixels, if the The edge segment The extension trend of the edge pixel is greater than 0. The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The extension trend of the edge pixel is less than 0. The edge segment The extension direction of the edge pixel is recorded as 0; Jordi The edge segment The extension trend of the edge pixel is equal to 0, and the The edge segment The pixels adjacent to the edge pixels are recorded as expansion pixels; the average of the extension trends of all expansion pixels is recorded as The edge segment The expansion trend of edge pixels. The edge segment The expansion trend of the edge pixel is greater than 0. The edge segment The extension direction of the edge pixel is recorded as 1; if the The edge segment The expansion trend of the edge pixel is less than 0. The edge segment The extension direction of the edge pixel is recorded as 0; Jordi The edge segment The expansion trend of the edge pixel is equal to 0, and the The pixels adjacent to the expanded pixel in the edge segment are classified as expanded pixels, and the extension trend average of all expanded pixels is recorded as The edge segment The expansion trend of the edge pixel after updating; and so on, until the The edge segment The expansion trend of the edge pixel is not equal to 0, and the The edge segment The extending direction of the edge pixels.

4. The method for detecting the production quality of watch parts based on machine vision according to claim 1, characterized in that: The specific method of dividing all edge segments into tooth top edges and concave edges according to the concave edge factors of all edge segments includes: Preset a concave edge factor threshold , for any edge segment, if the concave edge factor of the edge segment is less than or equal to , the edge segment is recorded as the tooth top edge; if the concave edge factor of the edge segment is greater than , and the edge segment is recorded as a concave edge.

5. The method for detecting the production quality of watch parts based on machine vision according to claim 1, characterized in that: The method of obtaining the tooth groove feature of each concave edge according to the distance between the tooth root point of each concave edge and the gear center and the difference between the distance between the tooth root point of each concave edge and the radius of the gear tooth root circle includes: In the formula, Represents the tooth feature of any concave edge; represents the distance between the root point of the concave edge and the center of the gear; Indicates the radius of the gear tooth root circle; Represents the absolute value function.

6. The method for detecting the production quality of watch parts based on machine vision according to claim 1, characterized in that: The method of obtaining the possibility that the suspected alveolar edge is the alveolar edge according to the symmetry of the suspected alveolar edge includes: For any suspected tooth groove edge, the point closest to the center of the gear in the suspected tooth groove edge is used as the segmentation point, and the suspected tooth groove edge is divided into two segments to obtain two sub-segments of the suspected tooth groove edge; the sub-segment with the shortest length is the reference segment; Starting from the segmentation point, a portion having the same length as the reference segment is cut from the longest sub-segment of the two sub-segments as the corresponding portion of the reference segment; The possibility that the suspected tooth groove edge is the tooth groove edge is obtained by the difference in extension trend between the reference segment and the corresponding part of the reference segment. The specific calculation formula is: In the formula, Indicates the possibility that the suspected alveolar edge is an alveolar edge; Represents the mean of the extension trends of all edge pixels in the reference segment; represents the mean value of the extension trend of all edge pixels in the corresponding part of the reference segment; Represents the absolute value function.

7. The method for detecting the production quality of watch parts based on machine vision according to claim 1, characterized in that: The specific method for evaluating the gear quality based on the tooth top edge and the tooth groove edge is as follows: For any tooth groove edge, Fourier transform is performed on the tooth groove edge according to the position coordinates of the tooth groove edge in the gear grayscale image to obtain a frequency spectrum of the tooth groove edge; Preset a high frequency threshold , the spectrum graph of the tooth edge is greater than or equal to The frequency is recorded as the high frequency frequency, and the amplitude corresponding to the high frequency frequency is taken as the proportion of the amplitude corresponding to all frequencies in the frequency spectrum of the tooth groove edge as the defect degree of the tooth groove edge; Obtain the defect degree of any tooth top edge; Preset a defect level threshold , if the defect degree of any tooth top edge or tooth groove edge is greater than , the gear quality is unqualified.

8. A machine vision-based watch parts production quality inspection system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting the production quality of watch parts based on machine vision as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Gear defect detection method and system based on computer vision

    CN114723701A

  • Visual technology-based clock spare and accessory part quality detection method

    CN117132506A