Visual-Aid-Based Method and System for Defect Inspection of Watch Cases

By performing multi-angle image acquisition and grayscale partition analysis on the watch case, abnormal index and trend are calculated, the accuracy of watch case defect detection under high gloss and curved surface design is solved, and more efficient defect detection is achieved.

CN119863453BActive Publication Date: 2025-05-30SHEN ZHEN SUNWAY IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510322496.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-05-30
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In the prior art, the visual inspection of defects in the watch case is affected by the reflection of the high-gloss surface, which makes it difficult for the image to clearly identify small defects. The curved surface design of the watch case makes the reflective area uneven, and some defects are hidden in the highlight or shadow, reducing the accuracy of defect detection.

Method used

By acquiring multiple images of the watch, using corner detection and grayscale partition matching, the abnormality index of each grayscale partition is calculated, and combined with the growth abnormal trend and the stable abnormal trend, the degree of abnormality of each grayscale partition is evaluated, and the defect inspection results of the watch case are finally obtained.

Benefits of technology

It improves the accuracy of the case defect detection, can more clearly identify and judge the small defects on the case, and reduces misjudgment caused by reflection and curved design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863453B_ABST
    Figure CN119863453B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and provides a method and system for inspecting defects on a watch case based on visual assistance, including: obtaining a comparison possibility and a comparison image according to a target watch image and other watch images; obtaining a probability of the same region according to the gray-scale partitioning of the watch; obtaining an abnormality index in combination with the comparison possibility; obtaining a growth abnormality trend and a stable abnormality trend according to the area of the gray-scale partitioning of the watch and the abnormality index; obtaining the degree of abnormality according to the growth abnormality trend, the stable abnormality trend, the abnormality index, and the area of the gray-scale partitioning of the watch; and obtaining the inspection result of the defects on the watch case according to the degree of abnormality. The present invention inspects the defects on the watch case through the degree of abnormality, improving the accuracy of the defect inspection result.
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 particularly to a method and system for inspecting defects of a watch case based on visual assistance. Background Art

[0002] During the manufacturing process of a watch, due to improper process control or external environmental factors during manufacturing, defects may occur in the watch case. For example, problems such as improper material selection, mold defects, uneven polishing, and imperfect coating treatment may cause scratches, bubbles, or spots on the case, resulting in the watch case not meeting the expected quality standards before leaving the factory. Therefore, it is necessary to inspect the watch case for defects.

[0003] In the prior art, since the defects of the watch case exist on the surface of the watch case, a method of visual image processing is used to detect the defects of the watch case. However, the reflection of the watch case will affect the visual inspection of the defects. Because a high-gloss surface is prone to form strong light reflections, making it difficult to clearly identify small defects in the images obtained by visual processing. The curved surface design of the watch case may cause light to be reflected at different angles, resulting in uneven reflection areas, making some defects hidden in the high-brightness or shadow areas and difficult to detect, thereby reducing the accuracy of defect detection. Summary of the Invention

[0004] The present invention provides a method and system for inspecting defects of a watch case based on visual assistance to solve the problem of the decreased accuracy of existing defect detection. The specific technical solutions adopted are as follows:

[0005] The present invention proposes a method for inspecting defects of a watch case based on visual assistance. The method includes the following steps:

[0006] Obtain a plurality of watch images of each watch;

[0007] Obtain a target watch and a target watch image. According to the similarity relationship of the corner point positions between the watch images of other watches except the target watch and the target watch image, obtain the comparison possibility between the target watch image and each watch image of each watch and a plurality of comparison images of the target watch image;

[0008] Obtain a plurality of watch gray-scale partitions in each watch image of each watch; According to the relative position relationship between the watch gray-scale partitions in the watch image, obtain the same-region probability of each watch gray-scale partition in the target watch image and each watch gray-scale partition in the comparison image of the target watch image; Combine the comparison possibility to obtain the anomaly index of each watch gray-scale partition of the target watch image;

[0009] Obtain the target watch gray-scale partition and its corresponding several watch gray-scale partitions; according to the change relationship of the area and abnormal index between the target watch gray-scale partition and its corresponding watch gray-scale partitions, obtain the growth abnormal trend and stable abnormal trend of the target watch gray-scale partition; according to the growth abnormal trend, stable abnormal trend and abnormal index of the target watch gray-scale partition, and combining the area between the target watch gray-scale partition and its corresponding watch gray-scale partitions, obtain the abnormal degree of the target watch gray-scale partition.

[0010] According to the abnormal degrees of all the watch gray-scale partitions of all the watch images of the target watch, obtain the inspection result of the watch case flaw of the target watch.

[0011] Furthermore, the specific method for obtaining the target watch and the target watch image, and obtaining the comparison possibility between the target watch image and each watch image of each watch and several comparison images of the target watch image according to the similarity relationship of the corner positions in the watch images of other watches except the target watch is as follows:

[0012] Perform corner detection processing on any watch image to obtain several corners in the watch image.

[0013] In each watch image, establish the same rectangular coordinate system with the direction of watch movement in the watch image as the abscissa, and the origin of coordinates is the starting point of the direction of watch movement.

[0014] Denote the watch to be inspected for case flaws as the target watch; denote any watch image of the target watch as the target watch image.

[0015] The comparison possibility between the target watch image and the th watch's th watch image is calculated as follows:

[0016]

[0017] In the formula, is the comparison possibility between the target watch image and the th watch's th watch image; is the number of corners in the target watch image; is the number of corners in the th watch's th watch image; is the absolute value of the difference in the ordinate between the th corner in the target watch image and the th watch's th watch image's th corner; is the The Euclidean distance between the corner points and the coordinate positions of the corner points in the th watch image of the th watch;

[0018] For any watch other than the target watch, the watch image with the highest likelihood of comparison with the target watch image among all the watch images of that watch is denoted as the comparison image of the target watch image.

[0019] Furthermore, the specific method for obtaining several watch gray-scale partitions in each watch image of each watch includes:

[0020] Cluster the pixel points in any watch image according to their gray-scale values using DBSCAN, and denote the connected domain formed by the pixel points belonging to the same cluster as a watch gray-scale partition in that watch image.

[0021] Furthermore, the specific method for obtaining the same-region probability of each watch gray-scale partition in the target watch image and each watch gray-scale partition in the comparison image of the target watch image based on the relative positional relationship between the watch gray-scale partitions in the watch image includes:

[0022] The th watch gray-scale partition in the target watch image and the th watch gray-scale partition in the th comparison image of the target watch image, the calculation method of their same-region probability is:

[0023]

[0024] In the formula, is the same-region probability of the th watch gray-scale partition in the target watch image and the th watch gray-scale partition in the th comparison image of the target watch image; is the number of watch gray-scale partitions in the target watch image; is the number of watch gray-scale partitions in the th comparison image of the target watch image; is the vector from the centroid of the th watch gray-scale partition in the target watch image to the centroid of the th watch gray-scale partition; is the vector from the centroid of the th watch gray-scale partition in the th comparison image of the target watch image to the centroid of the The vector of the centroid of the gray-scale partitions of a watch; is the average gray scale of the th gray-scale partition of the target watch image; is the average gray scale of the th gray-scale partition of the th reference image of the target watch image; is the exponential function with the natural constant as the base;

[0025] Further, the specific method for obtaining the anomaly index of each gray-scale partition of the target watch image includes:

[0026]

[0027] In the formula, is the anomaly index of the th gray-scale partition of the target watch image; is the number of reference images of the target watch image; is the comparison possibility between the target watch image and its th reference image; is the maximum value of the same-region probabilities between the th gray-scale partition of the target watch image and all gray-scale partitions of the th reference image of the target watch image; is the linear normalization function; is the exponential function with the natural constant as the base.

[0028] Further, the specific method for obtaining the target gray-scale partition of the watch and several corresponding gray-scale partitions of the watch includes:

[0029] Denote any one gray-scale partition in the target watch image as the target gray-scale partition of the watch;

[0030] Perform SIFT corner matching between the target watch image and any watch image of the target watch other than the target watch image, obtain the distance between any corner point in the target watch image and its matching corner point in this watch image, and denote it as the matching distance of this corner point; Denote the mode of the matching distances of all corner points in the target watch image as the displacement distance from the target watch image to this watch image;

[0031] Obtain the coordinates of the centroid of the target watch gray-scale partition. Denote the sum of the abscissa of the centroid of the target watch gray-scale partition and the displacement distance from the target watch image to this watch image as the corresponding centroid abscissa of the target watch gray-scale partition in this watch image; Denote the ordinate of the centroid of the target watch gray-scale partition as the corresponding centroid ordinate of the target watch gray-scale partition in this watch image; Denote the watch gray-scale partition where the pixel point is located at the position of the corresponding centroid abscissa and the corresponding centroid ordinate of the target watch gray-scale partition in this watch image as a corresponding watch gray-scale partition of the target watch gray-scale partition.

[0032] Furthermore, the specific method for obtaining the growth abnormal trend is as follows:

[0033] For any corresponding watch gray-scale partition of the target watch gray-scale partition, denote the maximum value between the difference obtained by subtracting the abnormal index of this corresponding watch gray-scale partition from the abnormal index of the target watch gray-scale partition and 0 as the abnormal reduction degree of this corresponding watch gray-scale partition;

[0034] Denote the weight normalization result of the maximum value between the difference obtained by subtracting the area of the target watch gray-scale partition from the area of this corresponding watch gray-scale partition and 0 as the area increase weight of this corresponding watch gray-scale partition;

[0035] Denote the product of the abnormal reduction degree and the area increase weight of this corresponding watch gray-scale partition as the growth abnormal index of this corresponding watch gray-scale partition;

[0036] Denote the sum of the growth abnormal indexes of all corresponding watch gray-scale partitions of the target watch gray-scale partition as the growth abnormal trend of the target watch gray-scale partition.

[0037] Furthermore, the specific method for obtaining the stable abnormal trend is as follows:

[0038] For any corresponding watch gray-scale partition of the target watch gray-scale partition, denote the inverse normalization result of the absolute value of the difference between the abnormal index of the target watch gray-scale partition and the abnormal index of this corresponding watch gray-scale partition as the abnormal similarity index of this corresponding watch gray-scale partition;

[0039] Denote the weight normalization result of the inverse normalization of the absolute value of the area difference between this corresponding watch gray-scale partition and the target watch gray-scale partition as the area change weight of this corresponding watch gray-scale partition;

[0040] Denote the product of the abnormal similarity index and the area change weight of this corresponding watch gray-scale partition as the stable abnormal index of this corresponding watch gray-scale partition;

[0041] Denote the sum of the stable abnormal indexes of all corresponding watch gray-scale partitions of the target watch gray-scale partition as the stable abnormal trend of the target watch gray-scale partition.

[0042] Further, based on the abnormal growth trend, stable abnormal trend, and abnormal index of the target watch gray-scale partition, and combining the area of the target watch gray-scale partition with the area of its corresponding watch gray-scale partition, the abnormal degree of the target watch gray-scale partition is obtained. The specific method includes:

[0043]

[0044] In the formula, is the abnormal degree of the target watch gray-scale partition; is the abnormal index of the target watch gray-scale partition; is the variance of the difference obtained by subtracting the area of the target watch gray-scale partition from the areas of all corresponding watch gray-scale partitions of the target watch gray-scale partition; is the abnormal growth trend of the target watch gray-scale partition; is the stable abnormal trend of the target watch gray-scale partition; is the linear normalization function.

[0045] The present invention also proposes a watch case flaw inspection system based on visual assistance. The system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the above method are implemented.

[0046] The beneficial effects of the present invention are as follows: During the process of inspecting the defects of the watch case, it is necessary to compare the watch cases. Since the watch process specifications are the same and the positions of the watches relative to the light inspection facilities are the same, the reflective contents on the watch cases are the same. The present invention obtains the comparison possibility between the target watch image and each watch image of each watch and several comparison images of the target watch image through the similarity relationship of the corner point positions in the watch images of other watches except the target watch, determines the comparable degree of each watch image to the target watch image, and selects the comparison images for the target watch image to conduct defect comparison inspection; Since under suitable lighting conditions, the gray value of the defective area will be different from the gray value of the area at the same position in the comparison image, the present invention first obtains several watch gray value partitions in each watch image of each watch, and then obtains the same area probability of each watch gray value partition in the target watch image and each watch gray value partition in the comparison image of the target watch image according to the relative position relationship between the watch gray value partitions in the watch image. Since the defect will form a separate watch gray value partition in the watch image, and the watch cases with defects are in the minority, and since the watch gray value partitions formed by the defects do not exist in other comparison images without defects, the same area probability of the separate watch gray value partitions caused by the defects and all watch gray value partitions in the comparison image will be relatively low. The present invention obtains the abnormality index of each watch gray value partition of the target watch image through the comparison possibility and the same area probability; Since during the transmission of the watch, due to the curved surface design of the watch case, the reflective area is uneven, making some defects hidden in the highlights or shadows at some watch transmission positions and difficult to detect, the present invention obtains the abnormality degree of the target watch gray value partition according to the growth abnormality trend, stable abnormality trend and abnormality index of the target watch gray value partition, combined with the area of the target watch gray value partition and its corresponding watch gray value partition. Thus far, the present invention obtains the inspection result of the watch case defect through the abnormality degree of all watch gray value partitions of all watch images of the target watch, improving the accuracy of the inspection result of the watch case defect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0048] Figure 1 It is a schematic flowchart of a method for inspecting defects of a watch case based on visual assistance provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0050] Please refer to Figure 1 , which shows a flowchart of a method for inspecting defects on the watch case based on visual assistance provided by an embodiment of the present invention. The method includes the following steps:

[0051] Step S001: Obtain a plurality of watch images for each watch.

[0052] It should be noted that since the defects on the watch case exist on the surface of the watch case, it is first necessary to collect watch images using an industrial camera.

[0053] Specifically, a conveyor belt is arranged at the quality inspection process position of the watch production line, and an industrial camera is arranged directly above the conveyor belt so that the lens of the industrial camera is aligned with the conveyor belt. The watches are evenly placed on the conveyor belt in an arbitrary fixed direction, so that there is only one watch in the lens of the industrial camera. During the transmission of the conveyor belt, the industrial camera continuously collects watch images at a frequency of times per second to obtain a plurality of watch RGB images for each watch; all the watch RGB images of each watch are grayscale processed to obtain a plurality of watch images for each watch; among them, grayscale processing is a well-known technology, and the specific method will not be introduced here; it should be noted that the collection of all watch images for each watch is continuous collection, so all the watch images of each watch are arranged according to the obtained time sequence; among them, is the preset collection frequency, and this embodiment will be described by taking as an example.

[0054] Step S002: Obtain the target watch and the target watch image. According to the similarity relationship between the watch images of other watches except the target watch and the corner point positions in the target watch image, obtain the comparison possibility between the target watch image and each watch image of each watch and a plurality of comparison images of the target watch image.

[0055] It should be noted that during the process of conveyor belt transportation, since the position of the industrial camera is fixed and the position of the quality inspection lighting facility also remains unchanged, but as the position of the watch changes during transportation on the conveyor belt, the position of the watch relative to the quality inspection lighting facility changes. Due to the curved surface design of the watch case, the light reflection situation on the watch case also changes accordingly. Therefore, the closer the positions of different watches are in the watch image and the more consistent the positions of the watches relative to the quality inspection lighting facility are, the more consistent the reflective content on the watch case will be. In order to reference the images of different watches at the same position with each other, it is first necessary to determine whether two watches are at the same position.

[0056] It should be further noted that since the watch surface has process texture features, when matching different watch images, corner detection processing is first performed on the watch images.

[0057] Specifically, for any watch image, corner detection processing is performed to obtain several corners in the watch image; among them, corner detection is a well-known technology, and the specific method will not be introduced here.

[0058] It should be noted that since the watches are evenly placed on the conveyor belt in a fixed direction and the moving paths of different watches in the lens of the industrial camera are the same during transportation, a rectangular coordinate system is established with the moving direction of the watch as the abscissa. Since the specifications of different watches in continuous production are the same, the ordinates of the corners of the same part of different watches are similar. When judging whether the watches in different images are at the same position, the distance between the corners with similar ordinates is mainly concerned. The smaller the overall distance, the closer the positions of the two watches in these two images, the more consistent the positions of the watches relative to the quality inspection lighting facility, and the greater the possibility of comparing the two images. Therefore, based on this, the comparison possibility between any two watches' respective watch images is obtained.

[0059] Specifically, in each watch image, a same rectangular coordinate system is established with the moving direction of the watch in the watch image as the abscissa, and the origin of coordinates is the starting point of the moving direction of the watch;

[0060] The watch to be inspected for case defects is denoted as the target watch; any watch image of the target watch is denoted as the target watch image;

[0061] The target watch image and the th watch's th watch image's comparison possibility calculation method is:

[0062]

[0063] In the formula, is the target watch image and the The comparison possibility of the th watch image; is the number of corner points in the target watch image; is the th number of corner points in the th watch image; is the th corner point in the target watch image and the th th corner point in the th watch image; is the absolute value of the difference in the ordinate between the two corner points; is the th corner point in the target watch image and the th th corner point in the th watch image; is the Euclidean distance between the coordinate positions of the two corner points; is the exponential function with the natural constant as the base; is a linear normalization function, and the normalization object is all corner points between the th corner point in the target watch image and the th th watch image; .

[0064] It should be noted that the smaller the th corner point and the th th corner point in the th watch image, the more similar their ordinates are, and the more likely they are to be matching points; when is smaller, and at the same time is smaller, it means that the Euclidean distance between the corner points that are more likely to be matching points is smaller, and the target watch image and the th th th watch image are more likely to be in the same position, that is, the target watch and the th th watch are closer in position in the image, that is, the target watch and the

[0065] th watch are more consistent in position relative to the lighting facilities for quality inspection in these two images, and the reflective content on the watch cases of the two watches is more consistent, and the two can be compared for defect detection.

[0066] Specifically, for any watch other than the target watch, the watch image with the highest comparison possibility among all the watch images of this watch is recorded as the comparison image of the target watch image.

[0067] Step S003: Obtain several watch gray-scale partitions in each watch image of each watch; according to the relative position relationship between the watch gray-scale partitions in the watch image, obtain the same-region probability of each watch gray-scale partition in the target watch image and each watch gray-scale partition in the comparison image of the target watch image; combine the said comparison possibility to obtain the anomaly index of each watch gray-scale partition of the target watch image.

[0068] It should be noted that the curved surface design of the watch case may cause light to be reflected at different angles, resulting in uneven reflective areas, making some defects hidden in highlights or shadows and difficult to detect. In order to distinguish normal areas from highlight or shadow areas where defects are difficult to distinguish, the area is divided according to the gray value, and the watch image is divided into several watch gray-scale partitions according to the gray scale. And when different watches have the same size specifications and similar positions relative to the quality inspection lighting facilities, that is, when different watches are in the same positions in their respective corresponding images, the distribution of the watch gray-scale partitions in the watch images should be similar. Therefore, the watch gray-scale partitions in different watch images are matched.

[0069] Specifically, the pixel points in any watch image are subjected to DBSCAN clustering according to the gray value, and the connected domain formed by the pixel points belonging to the same cluster is recorded as a watch gray-scale partition in this watch image; among them, DBSCAN clustering is a well-known technology, and the specific method will not be introduced here.

[0070] It should be further noted that for the watch gray-scale partitions that match each other in the target watch image and the comparison image of the target watch image, that is, the areas at the same position on the target watch and other watches, the gray scales of the watch gray-scale partitions existing in the similar directions are similar. Therefore, the more similar the gray scales and positions of the watch gray-scale partitions around a certain watch gray-scale partition in the target watch image and a certain watch gray-scale partition in the comparison image of the target watch image are, the more likely these two watch gray-scale partitions are to be mutually matching watch gray-scale partitions, that is, the more likely they are to be watch gray-scale partitions at the same position of different watches.

[0071] Specifically, the th watch gray-scale partition in the target watch image and the th watch gray-scale partition in the th comparison image of the target watch image, the calculation method of the same-region probability is:

[0072]

[0073] In the formula, is the probability of the same region between the th watch gray-scale partition in the target watch image and the th watch gray-scale partition in the th reference image; is the number of watch gray-scale partitions in the target watch image; is the number of watch gray-scale partitions in the th reference image of the target watch image; is the vector from the centroid of the th watch gray-scale partition in the target watch image to the centroid of the th watch gray-scale partition; is the vector from the centroid of the th watch gray-scale partition in the th reference image of the target watch image to the centroid of the th watch gray-scale partition; is the average gray value of the th watch gray-scale partition in the target watch image; is the average gray value of the th watch gray-scale partition in the th reference image of the target watch image; is the exponential function with the natural constant as the base; is the weight normalization function, and the object to be normalized is the vector from the centroid of the th watch gray-scale partition in the target watch image to the centroid of the th watch gray-scale partition and the vector from the centroid of the th watch gray-scale partition in the th reference image of the target watch image to the centroid of all watch gray-scale partitions ; is the absolute value function.

[0074] It should be noted that The larger is, the closer the vector from the centroid of the th watch gray-scale partition in the target watch image to the centroid of the th watch gray-scale partition is to the vector from the centroid of the th watch gray-scale partition in the th reference image of the target watch image to the centroid of the th watch gray-scale partition, that is, the position of the th watch gray-scale partition relative to the th watch gray-scale partition in the target watch image is the same as the position of the th watch gray-scale partition relative to the The positions of the gray-scale partitions of the watches are more similar; the gray-scale partition of the watch in the target watch image and the gray-scale partition of the watch in the th control image of the target watch image are in the same area. On the premise of similar positions, the gray levels of the gray-scale partitions of the watches are also similar, that is the larger, so on the premise that the larger, the larger, then the larger.

[0075] It should be noted that when there are defects on the watch case, due to the reflection of the watch case, the existence of the defects will be observed when the light is appropriate, and the defects will form separate gray-scale partitions of the watch in the watch image. However, since the watch cases with defects are in the minority, and the gray-scale partitions of the watch formed by the defects do not exist in other control images without defects, the probability of the same area of the separate gray-scale partitions of the watch caused by the defects and all the gray-scale partitions of the watch in the control image is relatively low. Therefore, the anomaly index of each gray-scale partition of the watch is judged accordingly.

[0076] It should be further noted that for control images with more similar environments, the more reference the control image has. When the probability of the same area of the gray-scale partitions of the watch in the target watch image and all the gray-scale partitions of the watch in the control image is relatively small, it indicates that the gray-scale partition of the watch in the target watch image is more abnormal.

[0077] Specifically, the calculation method of the anomaly index of the th gray-scale partition of the target watch image is as follows:

[0078]

[0079] In the formula, is the anomaly index of the th gray-scale partition of the target watch image; is the number of control images of the target watch image; is the control possibility between the target watch image and its th control image; is the maximum value of the probability of the same area of the th gray-scale partition of the target watch image and all the gray-scale partitions of the th control image of the target watch image; is a linear normalization function, and the normalization object is the control possibility between the target watch image and all its control images; is an exponential function with the natural constant as the base.

[0080] Step S004: Obtain the target watch gray-scale partition and several corresponding watch gray-scale partitions; based on the variation relationships of the areas and anomaly indices between the target watch gray-scale partition and its corresponding watch gray-scale partitions, obtain the growth anomaly trend and stability anomaly trend of the target watch gray-scale partition; based on the growth anomaly trend, stability anomaly trend, and anomaly index of the target watch gray-scale partition, and combining the areas of the target watch gray-scale partition and its corresponding watch gray-scale partitions, obtain the anomaly degree of the target watch gray-scale partition.

[0081] It should be noted that since the reflection of the watch case will affect the visual inspection of defects, because a high-gloss surface is prone to form strong light reflections, making it difficult to clearly distinguish small defects in the images obtained by visual processing. The curved surface design of the watch case may cause the light to be reflected at different angles, resulting in uneven reflection areas, making some defects hidden in the highlights or shadows and difficult to detect. Therefore, at certain positions where the watch is located, the defects on the watch case cannot be observed very clearly. However, during the conveying process, due to the change in the position of the watch, the light environment where the watch is located also changes. At certain positions, the defects of the watch will be more obvious. Therefore, it is necessary to analyze by combining the change in the anomaly degree of the watch during the conveying process.

[0082] It should be further noted that due to the change in the position of the watch during the conveying process, the light conditions of the watch will change, and the watch gray-scale partitions on the frame of the watch case of the same watch will change. Therefore, it is necessary to match the watch gray-scale partitions between different frames. Since the watches all move forward with the conveyor belt, after performing corner point matching on the watches, the displacement distances of the matching corner points in the image after a period of time are the same. Therefore, the displacement distance of the watch is obtained accordingly, and then the target watch gray-scale partition is displaced correspondingly to obtain the corresponding watch gray-scale partition, realizing the correspondence of the watch gray-scale partitions in the images of the same watch at different positions.

[0083] Specifically, any watch gray-scale partition in the target watch image is denoted as the target watch gray-scale partition;

[0084] Perform SIFT corner point matching on the target watch image and any other watch image of the target watch except the target watch image, obtain the distance between any corner point in the target watch image and its matching corner point in this watch image, and denote it as the matching distance of this corner point; denote the mode of the matching distances of all corner points in the target watch image as the displacement distance from the target watch image to this watch image; among them, SIFT corner point matching is a well-known technology, and the specific method will not be introduced here;

[0085] Obtain the coordinates of the centroid of the target watch gray-scale partition. Denote the sum of the abscissa of the centroid of the target watch gray-scale partition and the displacement distance from the target watch image to the watch image as the corresponding centroid abscissa of the target watch gray-scale partition in the watch image. Denote the ordinate of the centroid of the target watch gray-scale partition as the corresponding centroid ordinate of the target watch gray-scale partition in the watch image. Denote the watch gray-scale partition where the pixel point is located at the position of the corresponding centroid abscissa and the corresponding centroid ordinate of the target watch gray-scale partition in the watch image as a corresponding watch gray-scale partition of the target watch gray-scale partition.

[0086] It should be noted that if the target watch gray-scale partition is a defective watch gray-scale partition formed by a defect, during the transmission process, when the defective watch gray-scale partition is under suitable lighting conditions, the defective watch gray-scale partition will be relatively obvious and the anomaly index will be relatively high. If the defective watch gray-scale partition is in a high-brightness or shadow area, the defective watch gray-scale partition may disappear, and the obtained corresponding watch gray-scale partition will be a watch gray-scale partition formed by high-brightness or shadow, and the anomaly index of the corresponding watch gray-scale partition will become lower. The range of the watch gray-scale partition formed by high-brightness and shadow is relatively large compared to the range of the watch gray-scale partition formed by the defect, that is, when the defective watch gray-scale partition is in a high-brightness or shadow area, the area of the corresponding watch gray-scale partition will change significantly. Therefore, when the area of the corresponding watch gray-scale partition increases significantly compared to the defective watch gray-scale partition, the anomaly index of the corresponding watch gray-scale partition will decrease, but when the area of the corresponding watch gray-scale partition is similar to that of the defective watch gray-scale partition, the anomaly index of the corresponding watch gray-scale partition will be as high as that of the defective watch gray-scale partition.

[0087] It should be further noted that when the area of the corresponding watch gray-scale partition increases significantly relative to the target watch gray-scale partition, the anomaly index also decreases significantly, indicating that it is affected by light after reaching the corresponding watch position from the target watch gray-scale partition. However, the anomaly index has decreased significantly, indicating that the anomaly index of the target watch gray-scale partition is relatively large, which means that the target watch gray-scale partition is more abnormal.

[0088] Specifically, the calculation method of the growth anomaly trend of the target watch gray-scale partition is as follows:

[0089]

[0090] In the formula, is the growth anomaly trend of the target watch gray-scale partition; is the number of corresponding watch gray-scale partitions of the target watch gray-scale partition; is the target watch gray-scale partition of the th corresponding watch gray-scale partition, and the difference obtained by subtracting the area of the target watch gray-scale partition; is the anomaly index of the target watch gray-scale partition; is the th anomaly index corresponding to the watch gray-scale partition of the target watch gray-scale partition; is the maximum value function; is the weight normalization function, and the normalization object is all the corresponding watch gray-scale partitions of the target watch gray-scale partition .

[0091] In the formula, is the reduction degree of anomaly of the th corresponding watch gray-scale partition of the target watch gray-scale partition; is the area increase weight of the th corresponding watch gray-scale partition of the target watch gray-scale partition; is the growth anomaly index of the th corresponding watch gray-scale partition of the target watch gray-scale partition.

[0092] It should be noted that the larger is, the greater the increase in the area of the th corresponding watch gray-scale partition relative to the area of the target watch gray-scale partition. At the same time, the larger is, the greater the reduction in the anomaly index of the

[0093] th corresponding watch gray-scale partition relative to the anomaly index of the target watch gray-scale partition, indicating that the target watch gray-scale partition may be a defective watch gray-scale partition. During the process from the target watch gray-scale partition to the

[0094] th corresponding watch gray-scale partition, there is a situation where the defective watch gray-scale partition is affected by the lighting conditions and the anomaly index drops.

[0095]

[0096] In the formula, is the stable abnormal trend of the gray-scale partition of the target watch; is the number of corresponding watch gray-scale partitions of the gray-scale partition of the target watch; is the difference obtained by subtracting the area of the gray-scale partition of the target watch from the area of the is the abnormal index of the gray-scale partition of the target watch; is the abnormal index of the corresponding watch gray-scale partition of the gray-scale partition of the target watch; ; is the absolute value function; is the exponential function with the natural constant as the base.

[0097] In the formula, is the abnormal similarity index of the corresponding watch gray-scale partition of the gray-scale partition of the target watch; is the area change weight of the corresponding watch gray-scale partition of the gray-scale partition of the target watch; is the stable abnormal index of the corresponding watch gray-scale partition of the gray-scale partition of the target watch.

[0098] It should be noted that the larger is, the smaller the area difference between the corresponding watch gray-scale partition of the gray-scale partition of the target watch and the gray-scale partition of the target watch, indicating that the structure from the gray-scale partition of the target watch to its corresponding watch gray-scale partition is stable. The gray-scale partition of the target watch may be a defective watch gray-scale partition. If at the same time is large, it indicates that the abnormal indexes of the corresponding watch gray-scale partition of the gray-scale partition of the target watch and the gray-scale partition of the target watch are relatively close, and the gray-scale partition of the target watch is more likely to be a defective watch gray-scale partition.

[0099] It should be noted that the growth abnormal trend of the gray-scale partition of the target watch is used to judge the situation where the gray-scale partition of the target watch is blocked by shadow or highlight during transmission and conforms to the defective watch gray-scale partition, while the stable abnormal trend of the gray-scale partition of the target watch is used to judge the situation where the gray-scale partition of the target watch is not blocked by shadow or highlight during transmission and conforms to the defective watch gray-scale partition. When both the growth abnormal trend and the stable abnormal trend of the gray-scale partition of the target watch are relatively large, and the abnormal index of the gray-scale partition of the target watch itself is relatively large, it indicates that there is a defect in the gray-scale partition of the target watch.

[0100] It should be further noted that, due to possible defects, the gray-scale partitioning of defective watches has always been relatively obvious. That is, the gray-scale partitioning of defective watches may not be affected by light, the gray-scale partitioning of defective watches has always been relatively obvious, the area of the corresponding watch gray-scale partitioning of the defective watch gray-scale partitioning has not changed much, resulting in a relatively low abnormal growth trend of the defective watch gray-scale partitioning. Therefore, the variance of the area change of the corresponding watch gray-scale partitioning of the target watch gray-scale partitioning during the transmission of the target watch is used to adjust the degree of abnormality. The larger the area change variance, the greater the change in the area of the target watch gray-scale partitioning during transmission, indicating that the target watch gray-scale partitioning is affected by light during transmission, and the abnormal growth trend of the target watch gray-scale partitioning needs to be considered.

[0101] Specifically, the calculation method for the degree of abnormality of the target watch gray-scale partitioning is as follows:

[0102]

[0103] In the formula, is the degree of abnormality of the target watch gray-scale partitioning; is the abnormality index of the target watch gray-scale partitioning; is the variance of the difference obtained by subtracting the area of the target watch gray-scale partitioning from the areas of all corresponding watch gray-scale partitionings of the target watch gray-scale partitioning; is the abnormal growth trend of the target watch gray-scale partitioning; is the stable abnormal trend of the target watch gray-scale partitioning; is a linear normalization function, and the normalization object is the variance of the area difference between all corresponding watch gray-scale partitionings of each watch gray-scale partitioning and the target watch gray-scale partitioning.

[0104] Step S005: Obtain the inspection result of the watch case defect of the target watch according to the degree of abnormality of all watch gray-scale partitionings of all watch images of the target watch.

[0105] It should be noted that if there is a watch gray-scale partitioning with a relatively high degree of abnormality in the watch image of the target watch, it indicates that there may be a defect in the watch case of the target watch.

[0106] Specifically, if there is a watch gray-scale partitioning with a degree of abnormality greater than the preset abnormality threshold in the watch image of the target watch, it indicates that there is a defect on the watch case of the target watch, and the target watch is sorted; among them, the preset abnormality threshold is 0.7, and this embodiment is described by taking this as an example; all watches are detected for watch case defects according to the above method and sorted.

[0107] This embodiment uses a model to present the inverse proportional relationship and normalization processing, As the input of the model, the implementer can set the inverse proportional function and the normalization function according to the actual situation.

[0108] Another embodiment of the present invention provides a watch case defect inspection system based on visual assistance. The system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the above method steps S001 to S005 are implemented.

[0109] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A watch case defect inspection method based on visual assistance, characterized in that: The method comprises the following steps: Obtain several watch images for each watch; Obtain a target watch and a target watch image, and obtain a comparison possibility between the target watch image and each watch image of each watch and several comparison images of the target watch image based on a similarity relationship between the watch images of other watches except the target watch and the positions of corner points in the target watch image; Obtain several watch grayscale partitions in each watch image of each watch; obtain the probability of each watch grayscale partition in the target watch image and each watch grayscale partition in the comparison image of the target watch image being in the same area according to the relative position relationship between the watch grayscale partitions in the watch image; obtain the abnormality index of each watch grayscale partition of the target watch image in combination with the comparison probability; Obtain a target watch grayscale partition and several corresponding watch grayscale partitions; obtain a growth abnormality trend and a stable abnormality trend of the target watch grayscale partition according to the relationship between the area and the abnormality index of the target watch grayscale partition and its corresponding watch grayscale partition; obtain the abnormality degree of the target watch grayscale partition according to the growth abnormality trend, stable abnormality trend and abnormality index of the target watch grayscale partition, combined with the area of ​​the target watch grayscale partition and its corresponding watch grayscale partition; According to the abnormality degree of all watch grayscale partitions of all watch images of the target watch, the case defect inspection result of the target watch is obtained; The specific method for obtaining the abnormal growth trend is as follows: For any corresponding watch grayscale partition of the target watch grayscale partition, the maximum value between the difference between the abnormal index of the target watch grayscale partition and the abnormal index of the corresponding watch grayscale partition and 0 is recorded as the abnormal reduction degree of the corresponding watch grayscale partition; The weight normalization result of the maximum value between the difference obtained by subtracting the area of ​​the target watch grayscale partition from the area of ​​the corresponding watch grayscale partition and 0 is recorded as the area increase weight of the corresponding watch grayscale partition; The product of the abnormal reduction degree of the corresponding watch grayscale partition and the area increase weight is recorded as the growth abnormality index of the corresponding watch grayscale partition; The sum of the growth anomaly indexes of all corresponding watch grayscale partitions of the target watch grayscale partition is recorded as the growth anomaly trend of the target watch grayscale partition; The specific method for obtaining the stable abnormal trend is as follows: For any corresponding watch grayscale partition of the target watch grayscale partition, the inverse proportional normalization result of the absolute value of the difference between the abnormal index of the target watch grayscale partition and the abnormal index of the corresponding watch grayscale partition is recorded as the abnormal similarity index of the corresponding watch grayscale partition; The weight normalization result of the inverse proportion normalization of the absolute value of the area difference between the corresponding watch grayscale partition and the target watch grayscale partition is recorded as the area change weight of the corresponding watch grayscale partition; The product of the abnormal similarity index of the corresponding watch grayscale partition and the area change weight is recorded as the stable abnormal index of the corresponding watch grayscale partition; The sum of the stability anomaly indexes of all corresponding watch grayscale partitions of the target watch grayscale partition is recorded as the stability anomaly trend of the target watch grayscale partition.

2. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The method of acquiring the target watch and the target watch image, and obtaining the possibility of comparing the target watch image with each watch image of each watch and several comparison images of the target watch image according to the similarity relationship between the watch images of other watches except the target watch and the positions of the corner points in the target watch image, includes the following specific methods: Perform corner point detection processing on any watch image to obtain several corner points in the watch image; In each watch image, the same rectangular coordinate system is established with the direction of movement of the watch in the watch image as the horizontal coordinate, and the origin of the coordinate system is the starting point of the direction of movement of the watch; The watch with case defects to be inspected is recorded as the target watch; Record any watch image of the target watch as the target watch image; Target watch image and The first watch The comparison probability of the watch images is calculated as: In the formula, For the target watch image and The first watch Possibility of comparing images of watches; is the number of corner points in the target watch image; For the The first watch The number of corner points in the watch image; The target watch image Corner point and The first watch Watch image The absolute value of the difference in ordinate between the corner points; The target watch image Corner point and The first watch Watch image The Euclidean distance between the coordinate positions of the corner points; is an exponential function with a natural constant as base; is a linear normalization function; For any watch other than the target watch, the watch image that has the highest probability of being compared with the target watch image among all the watch images of the watch is recorded as the comparison image of the target watch image.

3. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The specific method of obtaining a plurality of watch grayscale partitions in each watch image of each watch includes: The pixels in any watch image are clustered by DBSCAN according to their grayscale values, and the connected domain formed by the pixels belonging to the same cluster is recorded as a watch grayscale partition in the watch image.

4. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The specific method of obtaining the probability of each watch grayscale partition in the target watch image and each watch grayscale partition in the reference image of the target watch image being in the same area according to the relative position relationship between the watch grayscale partitions in the watch image is as follows: The target watch image The grayscale partition of the watch and the target watch image The first The calculation method of the same area probability of the grayscale partition of each watch is: In the formula, is the first The grayscale partition of the watch and the target watch image The first The probability of the same area of ​​the grayscale partition of each watch; is the number of watch grayscale partitions in the target watch image; The target watch image The number of grayscale partitions of the watch in the control image; is the first The centroid of the grayscale partition of the watch to the The vector of the centroid of the grayscale partitions of each watch; The target watch image The first The centroid of the grayscale partition of the watch to the The vector of the centroid of the grayscale partitions of each watch; is the first The average grayscale of each grayscale partition of the watch; The target watch image The first The average grayscale of each grayscale partition of the watch; is an exponential function with a natural constant as base; is the weight normalization function; is the absolute value function.

5. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The specific method of obtaining the abnormal index of each watch grayscale partition of the target watch image includes: In the formula, The target watch image Abnormal index of grayscale partition of each watch; is the number of comparison images of the target watch image; The target watch image and its The comparison probability of the comparison images; is the first The grayscale partition of the watch and the target watch image The maximum value of the same region probability of all the watch grayscale partitions in the comparison image; is a linear normalization function; is an exponential function with a natural constant as its base.

6. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The specific method of obtaining the target watch grayscale partition and several corresponding watch grayscale partitions includes: Record any watch grayscale partition in the target watch image as the target watch grayscale partition; Perform SIFT corner point matching on the target watch image and any watch image of the target watch except the target watch image, obtain the distance between any corner point in the target watch image and the matching corner point of the corner point in the watch image except the target watch image, and record it as the matching distance of the corner point; record the mode of the matching distances of all corner points in the target watch image as the displacement distance from the target watch image to the watch image except the target watch image; Obtain the coordinates of the centroid of the target watch grayscale partition, and record the sum of the abscissa of the centroid of the target watch grayscale partition and the displacement distance from the target watch image to the watch image other than the target watch image as the abscissa of the corresponding centroid of the target watch grayscale partition in the watch image other than the target watch image; The ordinate of the centroid of the target watch grayscale partition is recorded as the ordinate of the corresponding centroid of the target watch grayscale partition in the watch image other than the target watch image; The watch grayscale partition where the pixel point corresponding to the horizontal coordinate of the center of mass and the vertical coordinate of the center of mass of the target watch grayscale partition in the watch image other than the target watch image is located is recorded as a corresponding watch grayscale partition of the target watch grayscale partition.

7. The visually assisted watch case defect inspection method according to claim 1, characterized in that: The specific method of obtaining the abnormal degree of the target watch grayscale partition according to the abnormal growth trend, stable abnormal trend and abnormal index of the target watch grayscale partition and combining the target watch grayscale partition with the area of ​​its corresponding watch grayscale partition is as follows: In the formula, is the abnormality degree of the grayscale partition of the target watch; is the abnormal index of the grayscale partition of the target watch; The variance of the difference between the area of ​​all corresponding watch grayscale partitions of the target watch grayscale partition and the area of ​​the target watch grayscale partition; Abnormal growth trend of grayscale partition for target watch; The stable abnormal trend of the grayscale partition of the target watch; is a linear normalization function.

8. A watch case defect inspection system based on visual assistance, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the visually assisted watch case defect inspection method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Industrial product anomaly detection method, system and device and storage medium

    CN114066811A

  • Intelligent detection method for smudginess of carbon electrode under vision assistance

    CN116758071A