Machine vision-based watch production quality detection method and system
By using machine vision technology, combined with multispectral image fusion and an improved YOLOv5s model and Zernike moment edge localization algorithm, the problems of low efficiency and low accuracy in traditional watch inspection methods have been solved, achieving efficient automated inspection and quality control.
Patent Information
- Application Number
- CN202511064669.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-07-31
AI Technical Summary
Traditional watch inspection methods rely on manual visual inspection, which is susceptible to fatigue and has large subjective errors, making it difficult to adapt to large-scale production. Furthermore, existing technologies are unable to effectively distinguish minute defects or detect real-time dynamic defects in moving parts of watches, resulting in low inspection efficiency and low accuracy.
A machine vision-based inspection method is adopted, which eliminates surface reflection through multispectral image acquisition and fusion technology. Combined with an improved YOLOv5s convolutional neural network model and Zernike moment edge localization algorithm, the method detects watch defects. The method also analyzes the movement trajectory of the hands through optical flow and Kalman filter, generates an inspection report and recommends polishing process parameters.
It has achieved automated testing, improved testing accuracy, reduced false detection rate, and can detect internal structural parameters non-contactly, assisting enterprises in quality grading and process adjustment, and improving product qualification rate.
Smart Images

Figure CN120912562B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for quality inspection in watch production based on machine vision. Background Technology
[0002] As precision mechanical products, the appearance quality and internal structural accuracy of watches directly affect their performance and market competitiveness. Traditional inspection methods rely on manual visual inspection or single-spectrum imaging technology. Manual inspection is susceptible to fatigue and subjective judgment errors, making it difficult to meet the needs of large-scale production. Existing technologies mostly use visible light imaging, which is difficult to distinguish between minute defects (oxidation spots, subsurface cracks) or is affected by reflected light interference. There is a lack of effective means for real-time dynamic defect detection of watch moving parts (balance wheel, gears). As a result, watch defect detection is inefficient and has low accuracy. Summary of the Invention
[0003] The purpose of this invention is to solve the above-mentioned problems by designing a method and system for quality inspection in watch production based on machine vision.
[0004] To achieve the above objectives, the technical solution of the present invention further includes the following steps in the above-mentioned machine vision-based watch production quality inspection method: Multispectral images are acquired, surface reflections are eliminated using polarization filters, and defect features are enhanced using multispectral fusion technology to obtain an initial feature image. Based on the YOLOv5s convolutional neural network model, dual-channel data of visible light and infrared images are fused in the input layer, and an SPP-F spatial pyramid pooling layer is added to the network structure to obtain an improved YOLOv5s convolutional neural network model. The initial feature image is input into the improved YOLOv5s convolutional neural network model, and the part location region is output; the sub-pixel edge analysis of the part location region is performed based on the Zernike moment edge localization algorithm to obtain the watch defect detection result; The movement trajectory of the clock hands is collected by sensors, and the trajectory is analyzed by combining optical flow method and Kalman filter to obtain trajectory analysis results; Based on the trajectory analysis results and watch defect detection results, an inspection report is generated, the defect location is marked, and polishing process parameters are recommended.
[0005] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the acquisition of multispectral images, the elimination of surface reflections using polarization filters, and the enhancement of defect features using multispectral fusion technology to obtain an initial feature image include: Using a multispectral image sensor and an adjustable angle light source array, multi-angle, multi-band images of watch samples are acquired. The multispectral image sensor includes at least ultraviolet, visible, and near-infrared bands to obtain multispectral images. Based on the polarization state decomposition of the Stokes vector, the optimal polarization angle of the multispectral image is calculated, and the polarization images are fused to obtain the first multispectral image; The second multispectral image is obtained by fusing images of light sources from different angles in the first multispectral image using a weighted least squares algorithm and then adaptively adjusting the weight coefficients using the maximum entropy criterion. By utilizing the improved NSCT non-subsampled contour wave transform, adaptive weighted averaging is applied to the low-frequency subband, and Laplace energy and criterion are applied to the high-frequency subband, to perform illumination equalization based on Retinex theory on the second multispectral image, thus obtaining the initial feature image.
[0006] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the YOLOv5s convolutional neural network model, by fusing dual-channel data of visible light and infrared images at the input layer and adding an SPP-F spatial pyramid pooling layer to the network structure, yields an improved YOLOv5s convolutional neural network model, including: Spatial discrepancies between the two types of images are corrected by coordinate mapping, and features at the same physical location are aligned at the pixel level, keeping the discrepancy within 1 pixel. A channel attention mechanism is introduced to dynamically assign weights to the feature maps of the visible light channel and the infrared channel; The fused feature maps are then integrated using a 3×3 convolutional layer to compress dual-channel information into a single-channel feature map.
[0007] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the YOLOv5s convolutional neural network model, which fuses dual-channel data of visible light and infrared images at the input layer and adds an SPP-F spatial pyramid pooling layer to the network structure to obtain an improved YOLOv5s convolutional neural network model, further includes: Four pooling kernels of different sizes are used to correspond to the large-scale contour features and minute defect details of watch parts, respectively; By halving the number of multi-scale feature channels after pooling through convolution, the SPP-F layer is used to capture large-scale contour features of the case edge, medium-scale features of the pointer assembly, and small-scale defects such as tiny scratches.
[0008] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the initial feature image is input into the improved YOLOv5s convolutional neural network model to output the part location region; sub-pixel edge analysis is performed on the part location region based on the Zernike moment edge localization algorithm to obtain the watch defect detection result, including: Gaussian filtering is applied to the part positioning area, and the size of the filter kernel is dynamically adjusted according to the defect density in the area. The edge features of low-contrast areas between the dial print and the metal substrate are enhanced by local histogram equalization. Based on the principle of gradient direction consistency, false edges caused by surface reflection and stains are eliminated, and the true edge contours that are continuous and consistent in direction are retained to obtain the watch defect detection results.
[0009] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the step of acquiring the movement trajectory of the watch hands through sensors, and analyzing the movement trajectory of the watch hands using optical flow and Kalman filters to obtain trajectory analysis results includes: The tip and central bushing of the metal pointer are selected as dual tracking points, and the midpoint of the skeleton line is extracted by contour analysis of the hollow pointer; An adaptive threshold segmentation algorithm was used to separate the pointer from the background, and the Lucas-Kanade optical flow algorithm was used to calculate the trajectory analysis results for consecutive frames of images.
[0010] Furthermore, in the aforementioned machine vision-based watch production quality inspection method, the step of generating an inspection report based on the trajectory analysis results and watch defect detection results, marking defect locations, and recommending polishing process parameters includes: A mapping table is established based on historical process data, and the polishing effect is predicted through a random forest model. The parameters of the rule base are dynamically adjusted within a range of 10%.
[0011] Furthermore, in the machine vision-based watch production quality inspection system, the watch production quality inspection system includes the following modules: The multispectral image acquisition module is used to acquire multispectral images, eliminate surface reflections through a polarization filter, enhance defect features using multispectral fusion technology, and obtain an initial feature image. The network model building module is used to improve the YOLOv5s convolutional neural network model by fusing dual-channel data of visible light and infrared images in the input layer and adding SPP-F spatial pyramid pooling layers to the network structure. The watch defect detection module is used to input the initial feature image into the improved YOLOv5s convolutional neural network model and output the part location area; and to perform sub-pixel edge analysis on the part location area based on the Zernike moment edge localization algorithm to obtain the watch defect detection result. The clock trajectory analysis module is used to collect the movement trajectory of the clock hands through sensors, and analyze the movement trajectory of the clock hands by combining optical flow method and Kalman filter to obtain the trajectory analysis results; The inspection report generation module is used to generate an inspection report based on the trajectory analysis results and the watch defect detection results, mark the defect location, and recommend polishing process parameters.
[0012] Furthermore, in the machine vision-based watch production quality inspection system, the watch trajectory analysis module includes the following sub-modules: The analysis submodule is used to select the tip and central shaft sleeve of the metal pointer as dual tracking points, and extract the midpoint of the skeleton line through contour analysis of the hollow pointer; The calculation submodule is used to separate the pointer from the background using an adaptive threshold segmentation algorithm and to calculate the trajectory analysis results by using the pyramid Lucas-Kanade optical flow algorithm on consecutive frames of images.
[0013] Furthermore, in the machine vision-based watch production quality inspection system, the inspection report generation module includes the following sub-modules: The adjustment submodule is used to build a mapping table based on historical process data, predict the polishing effect through a random forest model, and dynamically adjust the rule base parameters within a range of 10%.
[0014] Its beneficial effects are as follows: 1. Compared with traditional manual visual inspection or single visible light imaging methods, the detection accuracy is improved and the false detection rate is reduced. At the same time, the entire process is automated, significantly reducing reliance on human experience and improving detection efficiency. 2. It can non-contactly detect key structural parameters of watches, such as gear meshing and balance wheel movement, avoiding the efficiency losses and product damage risks associated with traditional disassembly and inspection. 3. The system can output watch quality scores and defect repair suggestions, assisting companies in achieving quality grading, process parameter adjustment, and production process control, thereby improving the overall product qualification rate. Attached Figure Description
[0015] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.
[0016] Figure 1 This is a schematic diagram of the first embodiment of the watch production quality inspection method based on machine vision in this invention. Figure 2 This is a schematic diagram of the second embodiment of the watch production quality inspection method based on machine vision in this invention. Figure 3 This is a schematic diagram of the first embodiment of the watch production quality inspection system based on machine vision in this invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0019] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 As shown, a machine vision-based method for inspecting the quality of watch production includes the following steps: Step 101: Acquire multispectral images, eliminate surface reflections using a polarization filter, and enhance defect features using multispectral fusion technology to obtain an initial feature image; Specifically, in this embodiment, a multispectral image sensor and an adjustable angle light source array are used to acquire multi-angle, multi-band images of the watch sample. The multispectral image sensor includes at least ultraviolet, visible, and near-infrared bands to obtain multispectral images. Based on the polarization state decomposition of Stokes vectors, the optimal polarization angle of the multispectral image is calculated, and the polarization images are fused to obtain the first multispectral image; The second multispectral image is obtained by fusing images of light sources from different angles in the first multispectral image using a weighted least squares algorithm and then adaptively adjusting the weight coefficients using the maximum entropy criterion. By utilizing the improved NSCT non-subsampled contour wave transform, adaptive weighted averaging is applied to the low-frequency subband, and Laplace energy and criterion are applied to the high-frequency subband, to perform illumination equalization based on Retinex theory on the second multispectral image, thus obtaining the initial feature image.
[0020] Specifically, I. Multispectral Image Acquisition Unit; Multispectral camera parameters: Spectral range: ultraviolet (200-400nm), visible light (400-760nm), near-infrared (760-1100nm); Sensor type: Back-illuminated CMOS, 5 megapixel resolution (2592×1944). Frame rate: ≥30fps at full resolution, supports windowing acceleration in ROI areas; Interface: GigEVision, data transfer rate 10Gbps; Adjustable angle light source array: Light source type: High-brightness LED array (UV 365nm, white light 6500K, infrared 940nm); Illumination angle: -45°~+45° continuously adjustable, with a step accuracy of 0.5°; Light intensity control: 16-bit PWM adjustment, range 1%~100%; Layout: Eight ring-shaped light sources, each with three LEDs of different wavelengths, to achieve 360° illumination without blind spots; Polarization imaging module: Polarizing filter: Depolarization degree ≥99%, transmittance ≥85%; Adjustment method: Electric rotation, continuously adjustable from 0° to 360°, with an accuracy of ±0.5°; Synchronization control: Linked with the camera shutter, supporting single-frame multi-polarization state acquisition; 2.2 Motion trajectory detection unit; Track acquisition sensor: High-speed camera: 12 megapixels, frame rate ≥200fps, global shutter; Auxiliary light source: infrared dot matrix light source, wavelength 850nm, to avoid glare; Encoder: Incremental rotary encoder, resolution 1024 lines / revolution, response frequency ≥10kHz; Mechanical positioning device: Rotary platform: Positioning accuracy ±0.01°, repeatability ±0.005°; Clamping mechanism: Adaptive pneumatic clamp, compatible with watch parts with diameters of φ20~φ60mm.
[0021] II. Algorithm Module Design; 3.1 Multispectral image preprocessing; Reflection Removal Algorithm: Polarization image fusion: Calculate the optimal polarization angle based on the polarization state decomposition of the Stokes vector; Multi-source image synthesis: A weighted least squares algorithm is used to fuse images from light sources at different angles, and the weighting coefficients are adaptively adjusted using the maximum entropy criterion; Multispectral fusion technology: Fusion strategy: An improved non-subsampled contourlet transform (NSCT) is adopted, using adaptive weighted averaging in the low-frequency subband and Laplace energy and criterion in the high-frequency subband; Feature enhancement: The fused image is subjected to illumination equalization based on Retinex theory to improve the contrast between defects and the background.
[0022] Step 102: Based on the YOLOv5s convolutional neural network model, dual-channel data of visible light and infrared images are fused in the input layer, and an SPP-F spatial pyramid pooling layer is added to the network structure to obtain an improved YOLOv5s convolutional neural network model. Specifically, in this embodiment, spatial deviation between the two types of images is corrected by coordinate mapping, and features at the same physical location are aligned at the pixel level, so that the deviation is within 1 pixel. A channel attention mechanism is introduced to dynamically assign weights to the feature maps of the visible light channel and the infrared channel; The fused feature maps are then integrated using a 3×3 convolutional layer to compress dual-channel information into a single-channel feature map.
[0023] Four pooling kernels of different sizes are used to correspond to the large-scale contour features and minute defect details of watch parts, respectively; By halving the number of multi-scale feature channels after pooling through convolution, the SPP-F layer is used to capture large-scale contour features of the case edge, medium-scale features of the pointer assembly, and small-scale defects such as tiny scratches.
[0024] Specifically, I. Input Layer Dual-Channel Fusion Module 1. Data Preprocessing Flow Visible light and infrared images undergo separate preprocessing channels: first, pixel normalization (compressing pixel values to the 0-1 range) eliminates differences in illumination intensity, and then edge-preserving filtering removes high-frequency noise. For residual metallic reflections on the watch surface, dynamic thresholding weakens the impact of highlight areas, ensuring that the features of both image types are at the same feature level before fusion.
[0025] 2. Dual-channel feature fusion mechanism; Feature alignment: Spatial deviation between two types of images is corrected by coordinate mapping to ensure that features at the same physical location are aligned at the pixel level, with the deviation controlled within 1 pixel; Weighting: A channel attention mechanism is introduced to dynamically assign weights to the feature maps of the visible light channel (emphasizing surface texture) and the infrared channel (emphasizing internal defects). When detecting metal casings, the weight of the infrared channel is automatically increased by 30%-50%. Dimensional compression: The fused feature map is integrated through a 3×3 convolutional layer to compress the dual-channel information into a single-channel feature map, reducing the amount of subsequent computation; III. SPP-F Spatial Pyramid Pooling Layer Design; 1. Key points of structural improvement Based on the original YOLOv5s SPP layer, a 1×1 convolutional module is added to achieve channel compression: Pooling core configuration: Four sizes of pooling cores are used: 13×13, 9×9, 5×5 and 1×1, which correspond to the large-scale outline features and small defect details of watch parts, respectively; Channel compression: The number of multi-scale feature channels after pooling is halved by 1×1 convolution, which reduces the computational cost by 30% while maintaining the feature expressive power. Parallel computing: Each pooling branch adopts a parallel processing mode to avoid information delay in the feature extraction process; 2. Advantages of multi-scale feature extraction; For the multi-dimensional inspection needs of watch parts, the SPP-F layer can capture simultaneously: Large-scale contour features of the case edge (13×13 pooling kernel). Medium-scale features of pointer assembly (9×9, 5×5 pooling kernels); Small-scale defects such as micro-scratches and pinholes (1×1 pooling cores); By combining multi-scale features, the model's adaptability to detecting defects of different sizes is improved by more than 40%. IV. Optimized design of the Neck section; 4.1 CSP2 structural alternatives; The number of residual blocks in the original CSP1 structure was reduced from 3 to 2 by adjusting the connection method of the convolutional layers: It employs a compact combination of "convolution-batch normalization-activation" units; Increase cross-layer skip connections to enhance the transmission of shallow features to deeper layers; Reduce the number of shortcut connections by 50% to reduce memory usage; While maintaining the same feature extraction capability, the inference time for a single frame image is reduced by 25%. 4.2 Feature fusion method; A Bidirectional Feature Pyramid Network (BiFPN) structure is adopted: High-resolution features are transferred from bottom to top (focusing on defect location). High semantic features are passed down from top to bottom (with an emphasis on defect type identification). Weighted fusion is applied to cross-layer features to automatically increase the feature weights of key defect areas; Step 103: Input the initial feature image into the improved YOLOv5s convolutional neural network model and output the part location area; perform sub-pixel edge analysis on the part location area based on the Zernike moment edge localization algorithm to obtain the watch defect detection result; Specifically, in this embodiment, Gaussian filtering is applied to the part positioning area, and the size of the filter kernel is dynamically adjusted according to the defect density within the area. The edge features of low-contrast areas between the dial print and the metal substrate are enhanced by local histogram equalization. Based on the principle of gradient direction consistency, false edges caused by surface reflection and stains are eliminated, and the true edge contours that are continuous and consistent in direction are retained to obtain the watch defect detection results.
[0026] Specifically, 1.1 Model output post-processing mechanism; The improved YOLOv5s model outputs part positioning regions in the form of bounding boxes, which require three levels of filtering and optimization: Confidence filtering: Set dynamic confidence thresholds (case parts ≥ 0.85, pointer parts ≥ 0.8, dial parts ≥ 0.75) to remove low-confidence prediction boxes and initially filter invalid detection results; Non-maximum suppression (NMS): For candidate boxes with an overlap of more than 50%, retain the bounding box with the highest IoU (Intersection over Union) and eliminate duplicate annotations of the same part. It is especially suitable for dense detection scenarios of multi-hand clocks. Size verification: Based on the standard size range of watch parts (case diameter φ20-60mm, hands length 5-20mm), abnormal frames that exceed the reasonable size range are filtered out to further reduce the false detection rate; 1.2 Fine-tuning of the positioning area; Based on the structural characteristics of watch parts, a classification and positioning strategy is adopted: Case positioning: Perform roundness analysis on the rectangular bounding box output by the model, fit the elliptical contour of the outer edge of the case using the least squares method, and correct the positioning deviation caused by tilting, so that the center positioning error is ≤ ±0.02mm. Pointer positioning: For the slender structure of the hour, minute, and second hands, the skeleton lines within the bounding box are extracted, and the rotation center and tip position of the pointer are determined by endpoint detection, with an angle measurement accuracy of ±0.1°; Dial positioning: Combining the periodic characteristics of the printed scale, the Hough transform is used to detect the center and radius of the dial, and compared with the standard CAD model, the concentricity deviation is controlled within 0.05mm. II. Implementation of the sub-pixel edge localization algorithm; 2.1 Edge detection preprocessing; To eliminate the interference of image noise on sub-pixel analysis, a multi-stage preprocessing workflow is adopted: Adaptive smoothing: Gaussian filtering is applied to the part positioning area, and the size of the filter kernel is dynamically adjusted according to the defect density in the area (3×3 kernel is used in the defect-dense area, and 5×5 kernel is used in the smooth area). Contrast Enhancement: Edge features are enhanced through local histogram equalization, especially for low-contrast areas between the dial printed pattern and the metal substrate, improving the edge signal-to-noise ratio by ≥20dB; False edge suppression: Based on the principle of gradient direction consistency, it eliminates false edges caused by surface reflection and dirt, and retains the true edge contours that are continuous and have consistent direction. 2.2 Zernike rectangular edge positioning implementation; Step-by-step subpixel-level edge extraction: Coarse edge localization: The Canny operator is used to obtain pixel-level edge contours, which are used as the initial boundaries for Zernike moment calculation, with an edge extraction integrity rate of ≥98%; Rectangular region division: A 3×3 pixel analysis window is defined around the coarse edge, with each window corresponding to an edge micro-element, ensuring coverage of all potential defect areas; Zernike moment calculation: An 8th-order Zernike polynomial is selected as the basis function. The moment values of the gray-level distribution within each window are solved, and the sub-pixel coordinates of the edge are located by the extreme points of the moment values. Edge fitting optimization: B-spline curve fitting is performed on discrete sub-pixel points to eliminate the influence of isolated noise points, with a fitting error ≤ 0.05 pixels; 2.3 Multi-part edge feature extraction; Customized extraction strategies based on the material characteristics of different watch components: Metal watch case: The focus is on extracting the outline of the outer edge and the lug mounting holes. Defects such as deformation and gaps are identified by changes in edge curvature. The curvature measurement accuracy reaches 0.01mm⁻¹. Glass dial: Dual threshold edge detection is used to distinguish between the printed scale edge and the glass edge, eliminating edge breakage caused by glass reflection; Pointer bushing: Detects the roundness error of the inner hole edge. The concentricity of the bushing is judged by the difference between the smallest circumscribed circle and the largest inscribed circle. The measurement accuracy is ≤0.002mm. III. Generation and Quality Control of Test Results; 3.1 Defect identification and classification; Defect detection based on anomaly analysis of edge features: Geometric deviation: By comparing the measured edge with the standard CAD model, defects such as out-of-tolerance case diameter (allowable range ±0.03mm) and pointer length deviation (allowable range ±0.05mm) can be identified; Surface defects: Scratches (length ≥ 0.1 mm) and dents (depth ≥ 0.02 mm) are judged based on edge continuity, and surface problems such as color difference and stains are located through grayscale change areas; Assembly defects: Check the relative positional deviation between the pointer and the dial (allowable range ±0.1°), and the perpendicularity error of the pointer; Step 104: Collect the movement trajectory of the clock hands using sensors, and analyze the movement trajectory of the clock hands using optical flow method and Kalman filter to obtain the trajectory analysis results; Specifically, in this embodiment, the tip and central bushing of the metal pointer are selected as dual tracking points, and the midpoint of the skeleton line is extracted by contour analysis of the hollow pointer; An adaptive threshold segmentation algorithm was used to separate the pointer from the background, and the Lucas-Kanade optical flow algorithm was used to calculate the trajectory analysis results for consecutive frames of images.
[0027] Specifically, 4.1 Deployment of the trajectory acquisition system; 4.1.1 Hardware configuration and installation; High-speed imaging unit: It adopts a 12-megapixel global shutter camera, paired with an 850nm infrared dot array light source (to avoid interference from dial reflections), a lens focal length of 50mm, and a working distance of 300mm, ensuring that the imaging resolution of the pointer movement area reaches 2μm / pixel.
[0028] 4.1.2 Data Acquisition Process; The movement of the hands is collected in three stages: the acceleration phase (0-2 seconds), the constant speed phase (2-10 seconds), and the deceleration and stop phase (10-12 seconds), covering the entire working condition of the clock. The sampling frequency for the constant speed segment is increased to 200 frames per second, ensuring that at least 5 frames of images correspond to each degree of rotation, thus fully capturing the trajectory details of high-speed moving parts such as the second hand; Before each batch of data is collected, the system is calibrated using a standard pointer (with known motion accuracy), and the inherent system delay (≤1ms) is recorded and compensated for in subsequent analyses.
[0029] 4.2 Optical flow trajectory extraction; 4.2.1 Selection of pointer feature points; Dynamically select trace points for different pointer types: Metal pointer: The tip (the point of maximum curvature) and the central bushing (circular feature) are selected as dual tracking points to improve trajectory stability; Hollowed-out pointer: The midpoint of the skeleton line is extracted through contour analysis to ensure that the feature points do not leave the pointer area during movement; An adaptive threshold segmentation algorithm is used to separate the pointer from the background, and the tracking point positioning accuracy is ≤1 pixel (corresponding to 2μm).
[0030] 4.2.2 Calculation and optimization of optical flow field; The Lucas-Kanade optical flow algorithm is used for consecutive frames of images: The initial window size is set to 15×15 pixels (to cover the pointer feature points and surrounding texture), and the number of pyramid layers is 5 (to balance computation speed and tracking robustness). Perform consistency checks on the optical flow vectors, remove abnormal vectors (points with deviations exceeding 3σ) caused by pointer reflection flicker, and retain valid trajectory points with a confidence level ≥ 95%; To address the characteristics of pointer rotation, polar coordinate transformation is used to convert the trajectory points in the Cartesian coordinate system into "angle-radius" coordinates, simplifying the subsequent uniformity analysis.
[0031] 4.3 Kalman filter trajectory optimization; 4.3.1 Filtering Model Design; State equation: Based on the pointer's uniform rotation motion model, the state vector includes angular position, angular velocity, and angular acceleration. The model parameters are initialized using the trajectory data from the first 30 frames. Observation equation: The angle measurement value output by the optical flow method is fused with the speed feedback of the encoder, and the observation noise weight is dynamically adjusted (the encoder weight is increased in the high-speed segment, and the optical flow measurement weight is increased in the low-speed segment).
[0032] 4.3.2 Trajectory Analysis Indicators; Uniformity error: Calculate the standard deviation of angular velocity during the uniform velocity segment (5-8 seconds), with an allowable range of ≤0.5° / s (corresponding to a daily clock difference of ≤2 seconds); Stuttering detection: When the angular velocity change exceeds 5° / s for 3 consecutive frames, it is judged as a stuttering defect, and the angle position of occurrence is recorded (accuracy ±0.1°). Eccentricity: The deviation between the center of the circle and the rotation center is calculated by fitting a circle to the trajectory of the bushing tracking point. The allowable range is ≤0.01mm (to avoid radial runout when the pointer rotates).
[0033] 4.4 Output of trajectory analysis results; Recorded in a structured data format: Trajectory Visualization: Generates a 2D trajectory diagram of the pointer movement (overlaid on the dial image), using different colors to mark normal segments (green), stuttering segments (red), and off-center areas (yellow). Quantitative Indicator Table: Includes 12 key parameters such as average angular velocity, maximum velocity deviation, number and location of stutters, and off-center amount, with data precision retained to 4 decimal places.
[0034] Step 105: Generate an inspection report based on the trajectory analysis results and watch defect detection results, mark the defect location, and recommend polishing process parameters.
[0035] Specifically, in this embodiment, a mapping table is established based on historical process data, and the polishing effect is predicted through a random forest model, with dynamic adjustments made to the rule base parameters within a range of 10%.
[0036] Specifically, 5.1 Multi-source data fusion and report generation 5.1.1 Data Integration Framework Establish a defect database: link image detection results (defect type, location, size) with trajectory analysis data (motion anomaly parameters), and achieve full lifecycle traceability through the unique part ID (laser marking number).
[0037] Data verification rules: When the defect detection confidence is ≥90% and the spatial overlap between the trajectory anomaly and the defect location is ≥80%, it is judged as a deterministic defect; otherwise, it is marked as "pending verification" (requires manual confirmation).
[0038] 5.1.2 Report content and format; Basic Information Area: Includes management information such as inspection time (accurate to milliseconds), part model, production batch, equipment number, and inspection personnel ID.
[0039] Defect details area: Defect list: sorted by severity (fatal defect → serious defect → minor defect), each item includes type ("case scratches" "hand jamming"), position coordinates (polar coordinates based on the center of the case, accuracy ±0.01mm), dimensional parameters (length / area / angle), and judgment criteria (referencing watch industry standard QB / T1249-2021).
[0040] Defect images: labeled multispectral fusion images (marked defect region bounding boxes and magnified views), and screenshots of trajectory anomaly segments (labeled with timestamps).
[0041] Comprehensive Judgment Area: Automatically rated based on the number and severity of defects (A: No defects; B: Minor defects that can be repaired; C: Severe defects that require rework; D: Scrap).
[0042] 5.2 Defect location marking and visualization; Coordinate System 1: Using the center of the fitted circle of the outer casing as the origin, a polar coordinate system (angle 0°-360°, radius 0-30mm) is established. All defect locations are converted to coordinates under this coordinate system to facilitate the positioning of subsequent grinding equipment.
[0043] Marking method: Overlay defect markers onto the 3D model of the part: Surface defects: marked with a solid red circle (diameter proportional to the size of the defect), with the defect code ("SC01" represents a scratch on the case) next to it.
[0044] Motion defects: Abnormal trajectory segments are marked with blue dashed lines, and arrows indicate the direction in which the stuttering occurs.
[0045] It supports exporting DXF format marker files and directly connecting to the path planning system of CNC grinding equipment.
[0046] 5.3 Recommended grinding process parameters; 5.3.1 Parameter recommendation logic; A hybrid model combining a rule base based on defect type and size with machine learning: Basic parameters of the rule base: A mapping table is established based on historical process data (0.1-0.3mm case scratches correspond to 5000# grinding wheel and 1500rpm speed).
[0047] Machine learning optimization: The grinding effect is predicted by a random forest model (input defect parameters, material hardness, output pressure compensation value), and the parameters of the rule base are dynamically adjusted within ±10%.
[0048] 5.3.2 Recommended parameter output; Generate an independent process card for each repairable defect: Equipment parameters: grinding wheel type (800#-5000#), spindle speed (1000-3000rpm), feed rate (0.01-0.1mm / s).
[0049] Operating parameters: Grinding pressure (0.1-0.5N, dynamically adjusted according to material thickness), grinding path (spiral / reciprocating line, selected based on defect shape), number of grinding passes (1-3 passes, determined by defect depth).
[0050] Its beneficial effects are as follows: 1. Compared with traditional manual visual inspection or single visible light imaging methods, the detection accuracy is improved and the false detection rate is reduced. At the same time, the entire process is automated, significantly reducing reliance on human experience and improving detection efficiency. 2. It can non-contactly detect key structural parameters of watches, such as gear meshing and balance wheel runout, avoiding the efficiency losses and product damage risks associated with traditional disassembly and inspection. 3. The system can output watch quality scores and defect repair suggestions, assisting companies in achieving quality grading, process parameter adjustment, and production process control, thereby improving the overall product qualification rate.
[0051] Please see Figure 2 In a machine vision-based quality inspection method for watch production, the process of acquiring multispectral images, eliminating surface reflections using polarization filters, and enhancing defect features using multispectral fusion technology to obtain an initial feature image includes the following steps: Step 201: Using a multispectral image sensor and an adjustable angle light source array, acquire multi-angle, multi-band images of the watch sample. The multispectral image sensor includes at least ultraviolet, visible, and near-infrared bands to obtain multispectral images. Step 202: Based on the polarization state decomposition of the Stokes vector, calculate the optimal polarization angle of the multispectral image, fuse the polarization images, and obtain the first multispectral image; Step 203: The images of light sources from different angles in the first multispectral image are fused using the weighted least squares algorithm, and the weight coefficients are adaptively adjusted using the maximum entropy criterion to obtain the second multispectral image; Step 204: Using the improved NSCT non-subsampled contour wave transform, adaptive weighted averaging is used in the low-frequency subband and Laplace energy and criterion is used in the high-frequency subband to perform illumination equalization based on Retinex theory on the second multispectral image to obtain the initial feature image.
[0052] The above describes embodiments of the watch manufacturing quality inspection method based on machine vision of the present invention. Please refer to [link / reference]. Figure 3 A machine vision-based quality inspection system for watch production includes the following modules: The multispectral image acquisition module is used to acquire multispectral images, eliminate surface reflections through a polarization filter, enhance defect features using multispectral fusion technology, and obtain an initial feature image. The network model building module is used to improve the YOLOv5s convolutional neural network model by fusing dual-channel data of visible light and infrared images in the input layer and adding SPP-F spatial pyramid pooling layers to the network structure. The watch defect detection module is used to input the initial feature image into the improved YOLOv5s convolutional neural network model and output the part location area; the edge localization algorithm based on Zernike moments performs sub-pixel edge analysis on the part location area to obtain the watch defect detection result; The clock trajectory analysis module is used to collect the movement trajectory of the clock hands through sensors, and analyze the movement trajectory of the clock hands by combining optical flow method and Kalman filter to obtain the trajectory analysis results; The inspection report generation module is used to generate inspection reports based on the trajectory analysis results and watch defect inspection results, mark the defect locations, and recommend polishing process parameters.
[0053] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A machine vision-based method for quality inspection in watch manufacturing, characterized in that, The watch manufacturing quality inspection method includes the following steps: Multispectral images are acquired, surface reflections are eliminated using polarization filters, and defect features are enhanced using multispectral fusion technology to obtain an initial feature image. Based on the YOLOv5s convolutional neural network model, dual-channel data of visible light and infrared images are fused in the input layer, and an SPP-F spatial pyramid pooling layer is added to the network structure to obtain an improved YOLOv5s convolutional neural network model. The initial feature image is input into the improved YOLOv5s convolutional neural network model, and the part location region is output; the sub-pixel edge analysis of the part location region is performed based on the Zernike moment edge localization algorithm to obtain the watch defect detection result; The movement trajectory of the clock hands is collected by sensors, and the trajectory is analyzed by combining optical flow method and Kalman filter to obtain trajectory analysis results; Based on the trajectory analysis results and watch defect detection results, a detection report is generated, the defect location is marked, and polishing process parameters are recommended. When the defect detection confidence is ≥90% and the spatial overlap between the trajectory anomaly and the defect location is ≥80%, it is determined to be a deterministic defect; otherwise, it is marked as pending review. A mapping table is established based on historical process data, and the polishing effect is predicted through a random forest model. The parameters of the rule base are dynamically adjusted within a range of 10%.
2. The watch manufacturing quality inspection method based on machine vision as described in claim 1, characterized in that, The process involves acquiring multispectral images, eliminating surface reflections using a polarization filter, and enhancing defect features using multispectral fusion technology to obtain an initial feature image, including: Using a multispectral image sensor and an adjustable angle light source array, multi-angle, multi-band images of watch samples are acquired. The multispectral image sensor includes at least ultraviolet, visible, and near-infrared bands to obtain multispectral images. Based on the polarization state decomposition of the Stokes vector, the optimal polarization angle of the multispectral image is calculated, and the polarization images are fused to obtain the first multispectral image; The second multispectral image is obtained by fusing images of light sources from different angles in the first multispectral image using a weighted least squares algorithm and then adaptively adjusting the weight coefficients using the maximum entropy criterion. By utilizing the improved NSCT non-subsampled contour wave transform, adaptive weighted averaging is applied to the low-frequency subband, and Laplace energy and criterion are applied to the high-frequency subband, to perform illumination equalization based on Retinex theory on the second multispectral image, thus obtaining the initial feature image.
3. The watch manufacturing quality inspection method based on machine vision as described in claim 1, characterized in that, The YOLOv5s convolutional neural network model, by fusing dual-channel data from visible light and infrared images at the input layer and adding an SPP-F spatial pyramid pooling layer to the network structure, yields an improved YOLOv5s convolutional neural network model, including: Spatial discrepancies between the two types of images are corrected by coordinate mapping, and features at the same physical location are aligned at the pixel level, keeping the discrepancy within 1 pixel. A channel attention mechanism is introduced to dynamically assign weights to the feature maps of the visible light channel and the infrared channel; The fused feature maps are then integrated using a 3×3 convolutional layer to compress dual-channel information into a single-channel feature map.
4. The watch manufacturing quality inspection method based on machine vision as described in claim 1, characterized in that, The YOLOv5s convolutional neural network model, by fusing dual-channel data from visible light and infrared images at the input layer and adding an SPP-F spatial pyramid pooling layer to the network structure, yields an improved YOLOv5s convolutional neural network model, which also includes: Four pooling kernels of different sizes are used to correspond to the large-scale contour features and minute defect details of watch parts, respectively; By halving the number of multi-scale feature channels after pooling through convolution, the SPP-F layer is used to capture large-scale contour features of the case edge, medium-scale features of the pointer assembly, and small-scale defects such as tiny scratches.
5. The watch manufacturing quality inspection method based on machine vision as described in claim 1, characterized in that, The initial feature image is input into the improved YOLOv5s convolutional neural network model, which outputs the part location region. Sub-pixel edge analysis is performed on the part location region using a Zernike moment-based edge localization algorithm to obtain the watch defect detection result, including: Apply Gaussian filtering to the part positioning area; The edge features of low-contrast areas between the dial print and the metal substrate are enhanced by local histogram equalization. Based on the principle of gradient direction consistency, false edges caused by surface reflection and stains are eliminated, and the true edge contours that are continuous and consistent in direction are retained to obtain the watch defect detection results.
6. The watch manufacturing quality inspection method based on machine vision as described in claim 1, characterized in that, The process involves acquiring the movement trajectory of the clock hands using sensors, and then analyzing the trajectory using optical flow and Kalman filters to obtain trajectory analysis results, including: The tip and central bushing of the metal pointer are selected as dual tracking points, and the midpoint of the skeleton line is extracted by contour analysis of the hollow pointer; An adaptive threshold segmentation algorithm was used to separate the pointer from the background, and the Lucas-Kanade optical flow algorithm was used to calculate the trajectory analysis results for consecutive frames of images.
7. A watch manufacturing quality inspection system based on machine vision, characterized in that, The watch manufacturing quality inspection method includes the following modules: The multispectral image acquisition module is used to acquire multispectral images, eliminate surface reflections through a polarization filter, enhance defect features using multispectral fusion technology, and obtain an initial feature image. The network model building module is used to improve the YOLOv5s convolutional neural network model by fusing dual-channel data of visible light and infrared images in the input layer and adding SPP-F spatial pyramid pooling layers to the network structure. The watch defect detection module is used to input the initial feature image into the improved YOLOv5s convolutional neural network model and output the part location area; and to perform sub-pixel edge analysis on the part location area based on the Zernike moment edge localization algorithm to obtain the watch defect detection result. The clock trajectory analysis module is used to collect the movement trajectory of the clock hands through sensors, and analyze the movement trajectory of the clock hands by combining optical flow method and Kalman filter to obtain the trajectory analysis results; The inspection report generation module is used to generate an inspection report based on the trajectory analysis results and the watch defect inspection results, mark the defect location and recommend polishing process parameters, including determining a deterministic defect when the defect detection confidence is ≥90% and the spatial overlap between the trajectory anomaly and the defect location is ≥80%, otherwise it is marked as pending review; a mapping table is established based on historical process data, the polishing effect is predicted through a random forest model, and the rule base parameters are dynamically adjusted within a range of 10%.
8. The watch manufacturing quality inspection system based on machine vision as described in claim 7, characterized in that, The clock trajectory analysis module includes the following sub-modules: The analysis submodule is used to select the tip and central shaft sleeve of the metal pointer as dual tracking points, and extract the midpoint of the skeleton line through contour analysis of the hollow pointer; The calculation submodule is used to separate the pointer from the background using an adaptive threshold segmentation algorithm and to calculate the trajectory analysis results by using the pyramid Lucas-Kanade optical flow algorithm on consecutive frames of images.
Citation Information
Patent Citations
Visual technology-based clock spare and accessory part quality detection method
CN117132506A
Watch case vacuum coating defect detection method and system based on image processing
CN118628500A