Watch case surface detection system and method based on machine vision
By combining technical means of scale space feature extraction, local gradient feature extraction, image dimension mapping and variance feature extraction, the problem of low detection accuracy and insufficient comprehensiveness in the existing technology is solved, and fast and accurate detection of the surface of the watch case is achieved.
Patent Information
- Application Number
- CN202410375062.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-03-29
AI Technical Summary
The existing watch case surface inspection system based on machine vision has low detection accuracy and slow speed. It cannot simultaneously detect dents, deformations, cracks, scratches, defects and oxidation on the watch case surface, resulting in incomplete detection.
Scale space feature extraction algorithm is used to detect dents and deformations, local gradient feature extraction algorithm model is used to detect cracks and scratches, image dimension mapping analysis mechanism and variance feature extraction model are used to detect defects and oxidation, and images are collected through CMOS cameras, LED lighting, and image processing modules Works in parallel with multiple detection modules to achieve comprehensive detection.
It improves the accuracy and efficiency of watch case surface detection, achieves comprehensive detection of watch case surfaces, and can quickly and accurately detect dents, deformations, cracks, scratches, defects and oxidation.
Smart Images

Figure CN118032789B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of watch case surface detection, and more specifically to a watch case surface detection system and method based on machine vision. Background Art
[0002] A watch case surface detection system and method based on machine vision, which can automatically detect and locate defects and oxidation problems by processing and analyzing the watch case surface image. The watch case surface detection system and method based on machine vision realizes automatic processing, analysis and recognition of the watch case surface image by using a variety of technical means, such as linear discriminant analysis operator, k-nearest neighbor algorithm classifier, local binary pattern, etc. Compared with the traditional manual detection method, the system has the following advantages: High degree of automation: The system can automatically process and analyze a large number of watch case surface images, and can complete the detection task in a short time. Low cost: Compared with the manual detection method, the system can reduce labor cost and time cost, and can greatly improve product quality and user satisfaction. Broad application prospects: The system is not only applicable to the watch field, but also has broad application prospects in other fields, such as automobile manufacturing, electronic product production, etc.
[0003] In the prior art, there are many drawbacks in the watch case surface detection system and method based on machine vision. On the one hand, the traditional watch case surface detection has low accuracy and slow detection speed, which makes it impossible to accurately realize the watch case surface detection. On the other hand, it is impossible to simultaneously detect dents, deformations, cracks, scratches, defects and oxidation on the watch case surface, resulting in incomplete watch case surface detection. Therefore, the present invention proposes a watch case surface detection system and method based on machine vision, which aims to improve the accuracy and efficiency of watch case surface detection and realize comprehensive watch case surface detection. Summary of the invention
[0004] In view of the deficiencies of the above-mentioned technologies, the present invention discloses a watch case surface detection system and method based on machine vision. The concave deformation detection module adopts a scale space feature extraction algorithm to perform scale space feature description on the watch case surface image, and extracts concave features and deformation features. The local gradient feature extraction algorithm model analyzes the crack and scratch features in the watch case surface image through a local gradient calculation module, a feature descriptor construction module, a feature matching and screening module, and a detection and recognition module, so as to realize crack detection and scratch detection on the watch case surface. The image dimension mapping analysis mechanism performs dimensional space mapping on the watch case surface image through a t-distributed random neighborhood embedding algorithm. The variance feature extraction model extracts defects and oxidation features from the dimensional space of the watch case surface image through a feature extractor module, a feature selector module, and a defect oxidation recognition module, so as to realize defect detection and oxidation detection on the watch case surface, solve the problem that the detection speed is slow and the watch case surface detection cannot be accurately realized, and solve the problem that the watch case surface detection is not comprehensive enough.
[0005] The present invention adopts the following technical solutions:
[0006] A watch case surface detection system based on machine vision, comprising:
[0007] An image acquisition module is used to acquire an image of the surface of the watch casing. The image acquisition module uses a CMOS camera to acquire an image of the surface of the watch casing. The CMOS camera is equipped with a software interface and a development tool kit for parameter setting, calibration and debugging operations;
[0008] A light source illumination module is used to fully illuminate the surface of the watch case and provide bright light while collecting images of the watch case surface. The light source illumination module uses LED lighting to provide uniform illumination.
[0009] An image processing module is used to process the collected watch case surface image. The image processing module filters the watch case surface image by mean filtering to achieve denoising of the watch case surface image. The image processing module then fuses the frequency channels of the watch case surface image by frequency channel fusion to improve the resolution of the watch case surface image by 99%;
[0010] A concave deformation detection module is used to detect concave and deformation on the surface of a watch casing. The concave deformation detection module uses a scale space feature extraction algorithm to perform scale space feature description on the surface image of the watch casing to extract concave features and deformation features. The scale space feature extraction algorithm realizes concave detection and deformation detection on the surface of the watch casing according to the concave features and deformation features.
[0011] A crack and scratch detection module, used for detecting cracks and scratches on the surface of a watch casing. The crack and scratch detection module adopts a local gradient feature extraction algorithm model to analyze crack and scratch features in a watch casing surface image to realize crack detection and scratch detection on the watch casing surface. The local gradient feature extraction algorithm model includes a local gradient calculation module, a feature descriptor construction module, a feature matching and screening module, and a detection and identification module. The output end of the local gradient calculation module is connected to the input end of the feature descriptor construction module calculation module, the output end of the feature descriptor construction module is connected to the input end of the feature matching and screening module, and the output end of the feature matching and screening module is connected to the input end of the detection and identification module.
[0012] A defect oxidation detection module is used to detect defects and oxidation on the surface of the watch casing. The defect oxidation detection module uses an image dimension mapping analysis mechanism to perform dimensional space mapping on the watch casing surface image. The defect oxidation detection module then uses a variance feature extraction model to extract defect and oxidation features from the dimensional space of the watch casing surface image to achieve defect detection and oxidation detection on the watch casing surface.
[0013] The output end of the light source illumination module is connected to the input end of the image acquisition module, the output end of the image acquisition module is connected to the input end of the image processing module, the output end of the image processing module is connected to the input end of the dent deformation detection module, the input end of the crack and scratch detection module and the input end of the defect oxidation detection module, and the dent deformation detection module, the crack and scratch detection module and the defect oxidation detection module are connected in parallel.
[0014] As a further technical solution of the present invention, the working method of the scale space feature extraction algorithm is:
[0015] S1. A scale space model is constructed by using a Gaussian difference pyramid. The Gaussian difference pyramid compresses and blurs the watch case surface image through downsampling compression operation and Gaussian kernel blur processing to obtain at least 6 scale space images. The Gaussian kernel blur processing obtains a scale value specific to the scale space image through a Gaussian blur function. The scale value calculation formula of the scale space image is:
[0016]
[0017] In formula (1), S is the scale value of the scale space image, y is the scale factor of the scale space image, q is the area of the target area covered by the Gaussian convolution kernel of the Gaussian blur function, and z is the number of Gaussian convolution kernels of the Gaussian blur function;
[0018] S2, and then use the scale-invariant feature transformation network to detect extreme points of the scale space image to obtain key points. The scale-invariant feature transformation network solves the precise position and scale of the key points through the Taylor expansion function to obtain the horizontal scale and vertical scale of the key points. The horizontal scale calculation formula of the key points is:
[0019]
[0020] In formula (2), V is the horizontal scale of the key point, n is the area of the scale space image, k is the main direction of the scale factor of the scale space image, x is the number of expansions of the Taylor expansion function, and a is the third-order derivative of the Taylor expansion function;
[0021] The vertical scale calculation formula of the key point is:
[0022]
[0023] In formula (3), C is the vertical scale of the key point, s is the extreme value of the scale factor of the scale space image, f is the fifth-order derivative of the Taylor expansion function, and b is the layer number of the extreme point in the Gaussian difference pyramid;
[0024] S3. Finally, a feature matching mechanism is used to establish a neighborhood area of 16x16 with the key point as the center. The feature matching mechanism calculates the gradient amplitude and direction of each pixel in the neighborhood area through a Gaussian weighted function to obtain a 128-dimensional feature vector. The feature matching mechanism performs a threshold analysis based on the feature vector to determine the concave point or deformation point. The gradient amplitude calculation formula for each pixel in the neighborhood area is:
[0025]
[0026] In formula (4), A is the gradient amplitude of each pixel in the neighborhood area, m is the pixel value in the neighborhood area, u is the area value of the neighborhood area, l is the variance of the Gaussian weighting function, and θ is the weight value corresponding to the Gaussian weighting function;
[0027] The gradient direction calculation formula for each pixel in the neighborhood area is:
[0028]
[0029] In formula (5), H is the gradient direction of each pixel in the neighborhood, σ is the standard deviation of the Gaussian weighted function, ω is the direction allocation factor of the feature matching mechanism, j is the number of Gaussian weighted samplings of the feature matching mechanism, and i is the difference between the local minimum and maximum values in the scale space image.
[0030] As a further technical solution of the present invention, the local gradient calculation module uses an edge detection analysis operator to calculate the local gradient information in the watch case surface image. The edge detection analysis operator applies a 3x3 template to each pixel in the watch case surface image through a pixel convolution network. The pixel convolution network performs a convolution operation according to the gradient amplitude and direction of the pixel point, multiplies the template with the grayscale value of the current pixel point, and adds all the results to obtain a new pixel value, which represents the local gradient eigenvalue at the current position; the feature descriptor construction module uses matrix determinant extreme value detection to local The key points of the gradient information are detected to determine the sampling area of each key point. The feature descriptor construction module then uses a local large block description operator to convert the sampling area of the key point into a statistical feature descriptor. The local large block description operator divides the gradient direction of each sampling area into 8 intervals through sampling area division. The local large block description operator then accumulates the gradient values in each interval to obtain a gradient histogram through a directional gradient histogram construction mechanism. The local large block description operator finally connects the gradient histograms in series through an LBP inter-code concatenation protocol to form a global feature vector as the statistical feature descriptor of the key point.
[0031] As a further technical solution of the present invention, the feature matching and screening module adopts an approximate nearest neighbor search operator to match the extracted feature descriptors, the approximate nearest neighbor search operator adopts a binary tree structure to build an index structure to find feature points that match the feature descriptors, the nodes of the binary tree structure represent sample points, the binary tree structure recursively divides the feature space to recursively match subsets in each sample point, the feature matching and screening module then adopts a Harris corner detection mechanism to screen the extracted feature descriptors, the Harris corner detection mechanism extracts feature points with rotation invariance and scale invariance through scale space extreme value detection, the scale space extreme value detection smoothes the feature descriptors through a Gaussian filtering mechanism to simulate the feature descriptors. For feature points at different scales, the Harris corner point detection mechanism is used to screen matching feature descriptors according to feature points; the detection and identification module uses noise space clustering to aggregate the matched and screened feature descriptors, and the noise space clustering distributes the feature descriptors to the nearest cluster by iteratively updating the cluster center points until convergence; the detection and identification module then uses a decision tree machine learning mechanism to identify the aggregated feature descriptors, and the decision tree machine learning mechanism constructs a decision tree classifier through queue iterative model training to determine whether the detected feature descriptor is a crack or a scratch, and the decision tree classifier generates a feature vector with a fixed length and directional property of the feature descriptor through a local feature description protocol, and the decision tree classifier performs classification and prediction according to the feature vector to realize the detection of cracks or scratches.
[0032] As a further technical solution of the present invention, the image dimension mapping analysis mechanism adopts a t-distributed random neighbor embedding algorithm to perform nonlinear dimensionality reduction to obtain the dimensional space of the watch case surface image, the t-distributed random neighbor embedding algorithm measures the similarity of pixels in the watch case surface image through the Euclidean distance, the t-distributed random neighbor embedding algorithm optimizes the target mapping function through a gradient descent optimization iteration mechanism, the gradient descent optimization iteration mechanism performs function optimization according to the similarity of pixels in the watch case surface image to obtain the target mapping function, the t-distributed random neighbor embedding algorithm maps the dimensional space of the watch case surface image according to the optimized target mapping function to minimize the original distance, the target mapping function obtains the dimensional space of the watch case surface image through the similarity matrix, and retains the relative distance relationship between pixels.
[0033] As a further technical solution of the present invention, the variance feature extraction model includes a feature extractor module, a feature selector module and a defect oxidation identification module, the output end of the feature extractor module is connected to the input end of the feature selector module, the output end of the feature selector module is connected to the input end of the defect oxidation identification module, the feature extractor module uses a GPQ semi-supervised convolutional neural network to extract key feature indicators of defects and oxidation from the watch case surface image, the key feature indicators at least include brightness, contrast, color distribution, texture, slope and normal, the GPQ semi-supervised convolutional neural network constructs a gray level co-occurrence matrix through a cosine similarity classifier, the cosine similarity classifier analyzes and extracts brightness and contrast information in the watch case surface image according to the gray level co-occurrence matrix, the GPQ semi-supervised convolutional neural network then performs subspace minimum maximum entropy loss logic analysis through a Gabor filtering mechanism to obtain color distribution and texture information in the watch case surface image, the GPQ semi-supervised convolutional neural network finally normalizes the feature vector through a wavelet transform fractal structure, and the GPQ semi-supervised convolutional neural network determines the slope and normal information according to the normalized feature vector.
[0034] As a further technical solution of the present invention, the feature selector module uses a linear discriminant analysis operator to reduce noise and screen key feature indicators. The linear discriminant analysis operator uses Bayesian theory to construct an intra-class divergence matrix mechanism to calculate the sum of squared distances between all sample points of the key feature indicators in each category and the category mean, and the sum of squared distances is added to obtain the intra-class divergence moment. The Bayesian theory constructs an intra-class divergence matrix mechanism to determine the maximum inter-class divergence matrix and the minimum intra-class divergence matrix according to the projection vector. The linear discriminant analysis operator maps and reduces noise on the key feature indicators according to the maximum inter-class divergence matrix and the minimum intra-class divergence matrix. The linear discriminant analysis operator uses a feature variable screening mechanism to screen the denoised key feature indicators. The feature variable screening mechanism calculates The characteristic vector of multivariate variance analysis is minimized to obtain the identification characteristic vector, and the characteristic variable screening mechanism screens and optimizes the key characteristic indicators according to the identification characteristic vector; the defect oxidation identification module adopts the k-nearest neighbor algorithm classifier to realize the defect detection and oxidation detection of the watch case surface image, and the defect oxidation identification module trains the key characteristic indicators through the local binary pattern to realize the optimization of the k-nearest neighbor algorithm classifier, and the local binary pattern adjusts the k value of the k-nearest neighbor algorithm classifier according to the binary code to optimize the performance of the k-nearest neighbor algorithm classifier, and the k-nearest neighbor algorithm classifier finds the key characteristic indicator closest to the defect oxygen through the Euclidean distance and cosine similarity measurement mechanism, and the k-nearest neighbor algorithm classifier detects the defects and oxidation parts of the watch case surface image according to the labels of the key characteristic indicators.
[0035] As a further technical solution of the present invention, a watch case surface detection method based on machine vision is applied to the watch case surface detection system based on machine vision, and the method comprises the following steps:
[0036] Step 1: Use LED lighting to fully illuminate the surface of the watch case to provide uniform lighting for the image acquisition module, and the image acquisition module acquires the image of the watch case surface through a CMOS camera equipped with a software interface and a development tool kit;
[0037] Step 2, the image processing module performs image preprocessing on the collected watch case surface image through mean filtering and frequency channel fusion to achieve denoising and enhancement operations on the watch case surface image;
[0038] Step 3, the scale space feature extraction algorithm uses a Gaussian difference pyramid to construct a scale space model, performs scale space analysis on the watch case surface image, and then uses a scale invariant feature transformation network to analyze the scale features. Finally, the scale space feature extraction algorithm uses a feature matching mechanism to perform a value threshold analysis to determine a depression point or a deformation point, thereby realizing depression detection and deformation detection on the watch case surface;
[0039] Step 4: The local gradient feature extraction algorithm model analyzes the crack and scratch features in the watch case surface image through the local gradient calculation module, the feature descriptor construction module, the feature matching and screening module, and the detection and recognition module to achieve crack detection and scratch detection on the watch case surface;
[0040] Step 5. The image dimension mapping analysis mechanism maps the watch case surface image to a dimensional space through a t-distributed random neighborhood embedding algorithm. The variance feature extraction model extracts defects and oxidation features from the dimensional space of the watch case surface image through a feature extractor module, a feature selector module, and a defect oxidation recognition module, thereby realizing defect detection and oxidation detection on the watch case surface.
[0041] The present invention has the following positive and beneficial effects compared with the prior art:
[0042] The invention discloses a watch shell surface detection system and method based on machine vision. The concave deformation detection module adopts a scale space feature extraction algorithm to perform scale space feature description on the watch shell surface image, and extracts concave features and deformation features. The local gradient feature extraction algorithm model analyzes crack and scratch features in the watch shell surface image through a local gradient calculation module, a feature descriptor construction module, a feature matching and screening module, and a detection and recognition module to realize crack detection and scratch detection on the watch shell surface. The image dimension mapping analysis mechanism performs dimensional space mapping on the watch shell surface image through a t-distributed random neighborhood embedding algorithm. The variance feature extraction model extracts defects and oxidation features from the dimensional space of the watch shell surface image through a feature extractor module, a feature selector module, and a defect oxidation recognition module to realize defect detection and oxidation detection on the watch shell surface, improve the watch shell surface detection speed, accurately realize watch shell surface detection, and realize comprehensive watch shell surface detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0044] Figure 1 The overall architecture principle diagram of a watch casing surface detection system based on machine vision of the present invention;
[0045] Figure 2 A flow chart of a watch casing surface detection method based on machine vision of the present invention;
[0046] Figure 3 This is a schematic diagram of the local gradient feature extraction algorithm model structure adopted by the present invention;
[0047] Figure 4 This is a flow chart of the scale space feature extraction algorithm method adopted by the present invention;
[0048] Figure 5 This is a schematic diagram of the variance feature extraction model structure used in the present invention. DETAILED DESCRIPTION
[0049] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0050] like Figure 1-Figure 5 As shown, a watch case surface detection system based on machine vision comprises:
[0051] An image acquisition module is used to acquire an image of the surface of the watch casing. The image acquisition module uses a CMOS camera to acquire an image of the surface of the watch casing. The CMOS camera is equipped with a software interface and a development tool kit for parameter setting, calibration and debugging operations;
[0052] A light source illumination module is used to fully illuminate the surface of the watch case and provide bright light while collecting images of the watch case surface. The light source illumination module uses LED lighting to provide uniform illumination.
[0053] An image processing module is used to process the collected watch case surface image. The image processing module filters the watch case surface image by mean filtering to achieve denoising of the watch case surface image. The image processing module then fuses the frequency channels of the watch case surface image by frequency channel fusion to improve the resolution of the watch case surface image by 99%;
[0054] A concave deformation detection module is used to detect concave and deformation on the surface of a watch casing. The concave deformation detection module uses a scale space feature extraction algorithm to perform scale space feature description on the surface image of the watch casing to extract concave features and deformation features. The scale space feature extraction algorithm realizes concave detection and deformation detection on the surface of the watch casing according to the concave features and deformation features.
[0055] A crack and scratch detection module, used for detecting cracks and scratches on the surface of a watch casing. The crack and scratch detection module adopts a local gradient feature extraction algorithm model to analyze crack and scratch features in a watch casing surface image to realize crack detection and scratch detection on the watch casing surface. The local gradient feature extraction algorithm model includes a local gradient calculation module, a feature descriptor construction module, a feature matching and screening module, and a detection and identification module. The output end of the local gradient calculation module is connected to the input end of the feature descriptor construction module calculation module, the output end of the feature descriptor construction module is connected to the input end of the feature matching and screening module, and the output end of the feature matching and screening module is connected to the input end of the detection and identification module.
[0056] A defect oxidation detection module is used to detect defects and oxidation on the surface of the watch casing. The defect oxidation detection module uses an image dimension mapping analysis mechanism to perform dimensional space mapping on the watch casing surface image. The defect oxidation detection module then uses a variance feature extraction model to extract defect and oxidation features from the dimensional space of the watch casing surface image to achieve defect detection and oxidation detection on the watch casing surface.
[0057] The output end of the light source illumination module is connected to the input end of the image acquisition module, the output end of the image acquisition module is connected to the input end of the image processing module, the output end of the image processing module is connected to the input end of the dent deformation detection module, the input end of the crack and scratch detection module and the input end of the defect oxidation detection module, and the dent deformation detection module, the crack and scratch detection module and the defect oxidation detection module are connected in parallel.
[0058] In a specific embodiment, during the implementation of the present invention, first, the light source illumination module provides a light source so that the watch shell to be inspected can be properly illuminated at different angles and produce a clear image, and the image acquisition module acquires the image of the watch shell to be inspected. Using a camera or other equipment for acquisition, a high-resolution, high-definition image can be obtained. Image processing module: This module is used to process the acquired image, such as denoising and enhancement operations, so that the subsequent defect detection algorithm can accurately analyze and identify defects. After that, the depression deformation detection module detects whether there are defects such as depressions or deformations on the watch shell. The crack and scratch detection module detects whether there are defects such as cracks or scratches on the watch shell. Defect oxidation detection module: This module is used to detect whether there are stains, oxidation and other defects on the watch shell. In summary, the watch shell surface detection system based on machine vision includes an image acquisition module, a light source illumination module, an image processing module, a depression deformation detection module, a crack and scratch detection module and a defect oxidation detection module. These modules work together to effectively realize the automatic detection of defects in the watch shell.
[0059] In a further embodiment, the scale space feature extraction algorithm works as follows:
[0060] S1. A scale space model is constructed by using a Gaussian difference pyramid. The Gaussian difference pyramid compresses and blurs the watch case surface image through downsampling compression operation and Gaussian kernel blur processing to obtain at least 6 scale space images. The Gaussian kernel blur processing obtains a scale value specific to the scale space image through a Gaussian blur function. The scale value calculation formula of the scale space image is:
[0061]
[0062] In formula (1), S is the scale value of the scale space image, y is the scale factor of the scale space image, q is the area of the target area covered by the Gaussian convolution kernel of the Gaussian blur function, and z is the number of Gaussian convolution kernels of the Gaussian blur function;
[0063] S2, and then use the scale-invariant feature transformation network to detect extreme points of the scale space image to obtain key points. The scale-invariant feature transformation network solves the precise position and scale of the key points through the Taylor expansion function to obtain the horizontal scale and vertical scale of the key points. The horizontal scale calculation formula of the key points is:
[0064]
[0065] In formula (2), V is the horizontal scale of the key point, n is the area of the scale space image, k is the main direction of the scale factor of the scale space image, x is the number of expansions of the Taylor expansion function, and a is the third-order derivative of the Taylor expansion function;
[0066] The vertical scale calculation formula of the key point is:
[0067]
[0068] In formula (3), C is the vertical scale of the key point, s is the extreme value of the scale factor of the scale space image, f is the fifth-order derivative of the Taylor expansion function, and b is the layer number of the extreme point in the Gaussian difference pyramid;
[0069] S3. Finally, a feature matching mechanism is used to establish a neighborhood area of 16x16 with the key point as the center. The feature matching mechanism calculates the gradient amplitude and direction of each pixel in the neighborhood area through a Gaussian weighted function to obtain a 128-dimensional feature vector. The feature matching mechanism performs a threshold analysis based on the feature vector to determine the concave point or deformation point. The gradient amplitude calculation formula for each pixel in the neighborhood area is:
[0070]
[0071] In formula (4), A is the gradient amplitude of each pixel in the neighborhood area, m is the pixel value in the neighborhood area, u is the area value of the neighborhood area, l is the variance of the Gaussian weighting function, and θ is the weight value corresponding to the Gaussian weighting function;
[0072] The gradient direction calculation formula for each pixel in the neighborhood area is:
[0073]
[0074] In formula (5), H is the gradient direction of each pixel in the neighborhood, σ is the standard deviation of the Gaussian weighted function, ω is the direction allocation factor of the feature matching mechanism, j is the number of Gaussian weighted samplings of the feature matching mechanism, and i is the difference between the local minimum and maximum values in the scale space image.
[0075] In a specific embodiment, an application platform of a scale space feature extraction algorithm can be constructed. During the operation of the platform, a hardware platform can be built, for example, by constructing the following components for processing: a sensor, an image acquisition card, a computer host, a graphics processor, a display, and a controller. The following is a more detailed description of the implementation method:
[0076] Sensor: used to collect image data, CMOS or CCD image sensor can be selected.
[0077] Image acquisition card: used to convert image data collected by the sensor into digital signals for image processing.
[0078] Computer host: used to process and calculate image data, and needs to have sufficient computing power and storage capacity.
[0079] Graphics Processing Unit (GPU): used to accelerate image processing and calculation, and can popularize graphics processing unit technologies such as CUDA.
[0080] Display: Used to display processing results and image quality, it needs to have high resolution and high color depth.
[0081] Controller: used to adjust and control the working status and parameters of the hardware platform, and can use a microcontroller or a single-chip microcomputer, etc.
[0082] When building a hardware platform, it is necessary to select and configure it according to specific application scenarios and requirements to ensure that the platform is stable and efficient enough to meet actual image processing and computing needs. At the same time, factors such as hardware cost and maintenance management need to be considered to achieve sustainable development and application promotion of the platform.
[0083] The scale space feature extraction algorithm is a feature extraction method used in image processing. Its main purpose is to achieve object recognition, matching and other tasks in the field of computer vision. The algorithm uses a feature matching mechanism to establish a 16x16 neighborhood area with the key point as the center. In the neighborhood area, the gradient amplitude and direction of each pixel are calculated by the Gaussian weighted function to obtain a 128-dimensional feature vector. This feature vector contains the information of all pixels in the neighborhood area and can describe the texture, shape and other features of the area. In the feature matching process, the value threshold analysis is used to determine the depression point or deformation point. Specifically, when matching key points, indicators such as Euclidean distance or Hamming distance are usually used to measure the similarity between two feature vectors. If the similarity exceeds a pre-set threshold, the two key points are considered to be matched successfully. In short, the scale space feature extraction algorithm is a method for image processing and pattern recognition based on local image feature descriptors. It calculates the Gaussian weighted function in the neighborhood around the key point, generates a 128-dimensional feature vector based on the calculation result, and then determines the depression point or deformation point through the value threshold analysis. The statistical table of the gradient amplitude calculation results of each pixel in the neighborhood area is shown in Table 1:
[0084]
[0085] As shown in Table 1, four test groups are set, and two methods are used to calculate the gradient amplitude of each pixel in the neighborhood area. Method 1 is edge detection based on second-order derivative calculation, and the gradient amplitude of each pixel is calculated by performing Laplace operation on the grayscale value of the pixel in the neighborhood area. Method 2 is a scale space feature extraction algorithm that uses a feature matching mechanism to calculate the gradient amplitude of each pixel in the neighborhood area. The error of Method 1 is greater than the error of Method 2. It can be seen that the scale space feature extraction algorithm of the present invention uses a feature matching mechanism to calculate the gradient amplitude of each pixel in the neighborhood area, which has outstanding technical effects.
[0086] In a further embodiment, the local gradient calculation module uses an edge detection analysis operator to calculate the local gradient information in the watch case surface image, and the edge detection analysis operator applies a 3x3 template to each pixel in the watch case surface image through a pixel convolution network. The pixel convolution network performs a convolution operation according to the gradient amplitude and direction of the pixel point, multiplies the template with the grayscale value of the current pixel point, and adds all the results to obtain a new pixel value, which represents the local gradient eigenvalue at the current position; the feature descriptor construction module uses matrix determinant extreme value detection to detect the local gradient The key points of the information are detected to determine the sampling area of each key point. The feature descriptor construction module then uses a local large block description operator to convert the sampling area of the key point into a statistical feature descriptor. The local large block description operator divides the gradient direction of each sampling area into 8 intervals through sampling area division. The local large block description operator then accumulates the gradient values in each interval to obtain a gradient histogram through a directional gradient histogram construction mechanism. The local large block description operator finally connects the gradient histograms in series through an LBP inter-code concatenation protocol to form a global feature vector as the statistical feature descriptor of the key point.
[0087] In a further embodiment, the feature matching and screening module uses an approximate nearest neighbor search operator to match the extracted feature descriptors, the approximate nearest neighbor search operator uses a binary tree structure to build an index structure to find feature points that match the feature descriptors, the nodes of the binary tree structure represent sample points, the binary tree structure recursively divides the feature space to recursively match subsets in each sample point, the feature matching and screening module then uses a Harris corner point detection mechanism to screen the extracted feature descriptors, the Harris corner point detection mechanism extracts feature points with rotation invariance and scale invariance through scale space extreme value detection, the scale space extreme value detection smoothes the feature descriptors through a Gaussian filtering mechanism, and simulates the feature descriptors in the absence of Feature points at the same scale, the Harris corner point detection mechanism is used to screen the matching feature descriptors according to the feature points; the detection and identification module uses noise space clustering to aggregate the matched and screened feature descriptors, and the noise space clustering distributes the feature descriptors to the nearest cluster by iteratively updating the cluster center points until convergence, and the detection and identification module then uses a decision tree machine learning mechanism to identify the aggregated feature descriptors, and the decision tree machine learning mechanism constructs a decision tree classifier through queue iterative model training to determine whether the detected feature descriptor is a crack or a scratch, and the decision tree classifier generates a feature vector with a fixed length and directional property of the feature descriptor through a local feature description protocol, and the decision tree classifier performs classification and prediction according to the feature vector to realize the detection of cracks or scratches.
[0088] In a specific embodiment, the local gradient feature extraction algorithm model includes the following modules: The local gradient calculation module extracts image features by calculating the gradient information of each pixel in the image. In the watch case surface image, the local gradient information can help us better identify the outline and edge of the watch. The edge detection analysis operator applies a 3x3 template to each pixel in the image through a convolution operation to calculate the gradient information at the point. In this process, the operator determines whether there is an edge based on the difference between the grayscale value of the current pixel and the surrounding pixels, and calculates information such as the edge direction and intensity. Specifically, when using the edge detection analysis operator for local gradient calculation, we can use a template similar to a classic convolution kernel such as Sobel, Prewitt or Laplacian, and apply it to each pixel in the watch case surface image. For each pixel, we can calculate the grayscale value difference between its 8 neighboring pixels and the current pixel, and use these difference values to calculate the gradient direction and amplitude at the position. The feature descriptor construction module extracts unique and robust image features by counting and describing the gradient information of the area around the key point in the image. After detecting the key points of local gradient information using matrix determinant extreme value detection, we need to determine the sampling area of each key point. Here we can choose to sample with a fixed-size window or an adaptive-size circular area centered on the key point. For each sampling area, we can divide all the pixels contained in it into 8 directional intervals according to their gradient directions, and use the gradient values in these directional intervals to construct a directional gradient histogram. In this way, we can quickly and accurately calculate the gradient direction histogram in each sampling area, and concatenate them to form a global feature vector as the statistical feature descriptor of the key point. This method can not only effectively extract important features in the image, but also has high robustness and noise resistance, and is suitable for image processing tasks in various scenarios.
[0089] The feature matching and filtering module matches the extracted feature descriptors and filters out feature points with high confidence. The feature matching and filtering module matches the extracted feature descriptors based on the approximate nearest neighbor search operator. This method can build an index structure through a binary tree structure to quickly find the sample points that are most similar to the given feature descriptor. Specifically, we can take each feature descriptor as a node and recursively match the subsets in each sample point by recursively dividing the feature space. This method can not only improve the matching efficiency, but also effectively handle the matching problem under large-scale data sets. After completing the feature matching, we need to filter the matching results and select feature points with high confidence. To this end, we use the Harris corner detection mechanism for filtering. This method extracts feature points with rotation invariance and scale invariance through scale space extreme value detection, finding a balance between ensuring accuracy and speed. The detection and recognition module is an important part of image processing. Its main task is to classify and identify the aggregated feature descriptors, so as to detect defects such as cracks or scratches. In this module, we use noise space clustering to aggregate the matched and filtered feature descriptors. This method distributes feature descriptors to the nearest cluster by iteratively updating cluster centers and continuously adjusting cluster centers until convergence. This method can effectively reduce the impact of noise on image processing results and improve detection accuracy and reliability.
[0090] In a further embodiment, the image dimension mapping analysis mechanism uses a t-distributed random neighbor embedding algorithm to perform nonlinear dimensionality reduction to obtain the dimensional space of the watch case surface image, the t-distributed random neighbor embedding algorithm measures the similarity of pixels in the watch case surface image through Euclidean distance, the t-distributed random neighbor embedding algorithm optimizes the target mapping function through a gradient descent optimization iteration mechanism, the gradient descent optimization iteration mechanism performs function optimization according to the similarity of pixels in the watch case surface image to obtain the target mapping function, the t-distributed random neighbor embedding algorithm maps the dimensional space of the watch case surface image according to the optimized target mapping function to minimize the original distance, the target mapping function obtains the dimensional space of the watch case surface image through a similarity matrix, and retains the relative distance relationship between pixels.
[0091] In a specific embodiment, the image dimension mapping analysis mechanism is a method of mapping high-dimensional data to a low-dimensional space, which can help us better understand and analyze the watch case surface image. In this mechanism, we use the t-distributed random neighbor embedding algorithm to perform nonlinear dimensionality reduction on the watch case surface image to obtain its representation in a low-dimensional space. Specifically, in the t-distributed random neighbor embedding algorithm, we first use the Euclidean distance to measure the similarity of pixels in the watch case surface image and convert it into a similarity matrix. Then, we optimize the target mapping function through a gradient descent optimization iteration mechanism to minimize the original distance and reduce the impact of noise on the mapping result. Finally, we map the watch case surface image to a low-dimensional space according to the optimized target mapping function, and retain the relative distance relationship between pixels. In this way, we can obtain the representation of the watch case surface image in a low-dimensional space, and further visualize and analyze it. At the same time, since the t-distributed random neighbor embedding algorithm has good robustness and scalability, it can be applied to different types of data analysis and processing tasks.
[0092] In a further embodiment, the variance feature extraction model includes a feature extractor module, a feature selector module and a defect oxidation identification module, the output end of the feature extractor module is connected to the input end of the feature selector module, the output end of the feature selector module is connected to the input end of the defect oxidation identification module, the feature extractor module uses a GPQ semi-supervised convolutional neural network to extract key feature indicators of defects and oxidation from the watch case surface image, the key feature indicators at least include brightness, contrast, color distribution, texture, slope and normal, the GPQ semi-supervised convolutional neural network constructs a grayscale co-occurrence matrix through a cosine similarity classifier, the cosine similarity classifier analyzes and extracts brightness and contrast information in the watch case surface image according to the grayscale co-occurrence matrix, the GPQ semi-supervised convolutional neural network then performs subspace minimum maximum entropy loss logic analysis through a Gabor filtering mechanism to obtain color distribution and texture information in the watch case surface image, the GPQ semi-supervised convolutional neural network finally normalizes the feature vector through a wavelet transform fractal structure, and the GPQ semi-supervised convolutional neural network determines the slope and normal information based on the normalized feature vector.
[0093] In a further embodiment, the feature selector module uses a linear discriminant analysis operator to reduce noise and screen key feature indicators. The linear discriminant analysis operator uses Bayesian theory to construct an intra-class divergence matrix mechanism to calculate the sum of squared distances between all sample points of the key feature indicators in each category and the category mean, and the sum of squared distances is added to obtain the intra-class divergence moment. The Bayesian theory constructs an intra-class divergence matrix mechanism to determine the maximum inter-class divergence matrix and the minimum intra-class divergence matrix according to the projection vector. The linear discriminant analysis operator maps and reduces noise on the key feature indicators according to the maximum inter-class divergence matrix and the minimum intra-class divergence matrix. The linear discriminant analysis operator uses a feature variable screening mechanism to screen the denoised key feature indicators. The feature variable screening mechanism calculates the minimum The characteristic vector of multivariate variance analysis is used to obtain the identification characteristic vector, and the characteristic variable screening mechanism screens and optimizes the key characteristic indicators according to the identification characteristic vector; the defect oxidation recognition module adopts the k-nearest neighbor algorithm classifier to realize the defect detection and oxidation detection of the watch case surface image, and the defect oxidation recognition module trains the key characteristic indicators through the local binary pattern to realize the optimization of the k-nearest neighbor algorithm classifier, and the local binary pattern adjusts the k value of the k-nearest neighbor algorithm classifier according to the binary code to optimize the performance of the k-nearest neighbor algorithm classifier, and the k-nearest neighbor algorithm classifier finds the key characteristic indicator closest to the defect oxygen through the Euclidean distance and cosine similarity measurement mechanism, and the k-nearest neighbor algorithm classifier detects the defects and oxidation parts of the watch case surface image according to the labels of the key characteristic indicators.
[0094] In a specific embodiment, the variance feature extraction model is a model for image classification and defect oxidation identification. It includes three main modules: a feature extractor module, a feature selector module, and a defect oxidation identification module. The feature extractor module uses a GPQ semi-supervised convolutional neural network to extract key feature indicators of defects and oxidation from the watch case surface image, and these key feature indicators include brightness, contrast, color distribution, texture, slope, and normal. Specifically, the implementation process of this module is as follows: First, the GPQ semi-supervised convolutional neural network uses a cosine similarity classifier to construct a grayscale co-occurrence matrix by analyzing and extracting brightness and contrast information from the watch case surface image. The grayscale co-occurrence matrix is a statistical method that describes the distribution law of local grayscale levels of an image. It can reflect the spatial relationship between different colors and is widely used in texture analysis. Secondly, the GPQ semi-supervised convolutional neural network uses a Gabor filtering mechanism to perform subspace minimum maximum entropy loss logic analysis to obtain color distribution and texture information in the watch case surface image. The Gabor filter is a filter based on the frequency domain. It can effectively extract local spatial frequency and direction information, and has good performance in texture recognition, edge detection, etc. Finally, the GPQ semi-supervised convolutional neural network normalizes the feature vector through the wavelet transform fractal structure to determine the slope and normal information. Wavelet transform is a multi-scale analysis technique that can decompose the signal into sub-bands of different frequencies and has a wide range of applications in denoising and compression. In summary, the feature extractor module uses the GPQ semi-supervised convolutional neural network and combines methods such as cosine similarity classifier, Gabor filtering mechanism and wavelet transform to extract key characteristic indicators of defects and oxidation from the watch case surface image. These indicators can help us identify and locate problems on the watch case surface more accurately and provide valuable input for the subsequent defect oxidation identification module.
[0095] The feature selector module uses the linear discriminant analysis operator to reduce noise and screen the key feature indicators. Specifically, the implementation process of this module is as follows: First, the linear discriminant analysis operator uses the Bayesian theory to construct the intra-class scatter matrix mechanism to calculate the sum of squared distances between all sample points of the key feature indicators in each category and the category mean, and the sum of squared distances is added to obtain the intra-class scatter moment. Then, the operator determines the maximum inter-class scatter matrix and the minimum intra-class scatter matrix according to the projection vector, and maps and reduces noise on the key feature indicators. Secondly, the linear discriminant analysis operator uses the characteristic variable screening mechanism to screen and optimize the key feature indicators after denoising. This mechanism obtains the identification feature vector by calculating the eigenvector of the minimized multivariate variance analysis, and screens and optimizes the key feature indicators based on the identification feature vector. In summary, the feature selector module can effectively remove noise from the key feature indicators and select the most discriminative indicators from them. These selected indicators can provide more accurate and reliable feature inputs for the subsequent defective oxidation identification module.
[0096] The defect oxidation recognition module uses the k-nearest neighbor algorithm classifier to realize the defect detection and oxidation detection of the watch case surface image. Specifically, the implementation process of this module is as follows: First, the module trains the key feature indicators through local binary patterns to optimize the performance of the k-nearest neighbor algorithm classifier. The local binary pattern is a texture descriptor based on the gray-level co-occurrence matrix. It can reflect the similarities and differences between different regions in the image and has wide applications in image classification, target detection, etc. Secondly, the module adjusts the k value of the k-nearest neighbor algorithm classifier according to the binary code to optimize the classifier performance. The k-nearest neighbor algorithm is a non-parametric statistical method based on distance measurement. It can determine the category to which the sample to be classified belongs by calculating the distance between the sample to be classified and the known sample. Finally, the module uses the Euclidean distance and cosine similarity measurement mechanism to find the key feature indicator closest to the defect oxygen, and detects the defects and oxidation parts of the watch case surface image according to the labels of the key feature indicators. In summary, the defect oxidation recognition module realizes the defect detection and oxidation detection of the watch case surface image by adopting the k-nearest neighbor algorithm classifier and combining local binary pattern, binary coding and Euclidean distance methods. These technical means can help us more accurately identify and locate the problems on the watch case surface and improve product quality and user satisfaction.
[0097] In a further embodiment, a machine vision-based watch case surface detection method is applied to the machine vision-based watch case surface detection system, the method comprising the following steps:
[0098] Step 1: Use LED lighting to fully illuminate the surface of the watch case to provide uniform lighting for the image acquisition module, and the image acquisition module acquires the image of the watch case surface through a CMOS camera equipped with a software interface and a development tool kit;
[0099] Step 2, the image processing module performs image preprocessing on the collected watch case surface image through mean filtering and frequency channel fusion to achieve denoising and enhancement operations on the watch case surface image;
[0100] Step 3, the scale space feature extraction algorithm uses a Gaussian difference pyramid to construct a scale space model, performs scale space analysis on the watch case surface image, and then uses a scale invariant feature transformation network to analyze the scale features. Finally, the scale space feature extraction algorithm uses a feature matching mechanism to perform a value threshold analysis to determine a depression point or a deformation point, thereby realizing depression detection and deformation detection on the watch case surface;
[0101] Step 4: The local gradient feature extraction algorithm model analyzes the crack and scratch features in the watch case surface image through the local gradient calculation module, the feature descriptor construction module, the feature matching and screening module, and the detection and recognition module to achieve crack detection and scratch detection on the watch case surface;
[0102] Step 5. The image dimension mapping analysis mechanism maps the watch case surface image to a dimensional space through a t-distributed random neighborhood embedding algorithm. The variance feature extraction model extracts defects and oxidation features from the dimensional space of the watch case surface image through a feature extractor module, a feature selector module, and a defect oxidation recognition module, thereby realizing defect detection and oxidation detection on the watch case surface.
[0103] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that these specific embodiments are only illustrative, and those skilled in the art may make various omissions, substitutions and changes to the details of the above methods and systems without departing from the principles and essence of the present invention. For example, merging the above method steps so as to perform substantially the same functions in substantially the same manner to achieve substantially the same results is within the scope of the present invention. Therefore, the scope of the present invention is limited only by the appended claims.
Claims
1. A watch case surface detection system based on machine vision, characterized in that: Include: An image acquisition module is used to acquire an image of the surface of the watch casing. The image acquisition module uses a CMOS camera to acquire an image of the surface of the watch casing. The CMOS camera is equipped with a software interface and a development tool kit for parameter setting, calibration and debugging operations; A light source illumination module is used to fully illuminate the surface of the watch case and provide bright light while collecting images of the watch case surface. The light source illumination module uses LED lighting to provide uniform illumination. An image processing module is used to process the collected watch case surface image. The image processing module filters the watch case surface image by mean filtering to achieve denoising of the watch case surface image. The image processing module then fuses the frequency channels of the watch case surface image by frequency channel fusion to improve the resolution of the watch case surface image by 99%; A concave deformation detection module is used to detect concave and deformation on the surface of a watch casing. The concave deformation detection module uses a scale space feature extraction algorithm to perform scale space feature description on the surface image of the watch casing to extract concave features and deformation features. The scale space feature extraction algorithm realizes concave detection and deformation detection on the surface of the watch casing according to the concave features and deformation features. A crack and scratch detection module, used for detecting cracks and scratches on the surface of a watch casing. The crack and scratch detection module adopts a local gradient feature extraction algorithm model to analyze crack and scratch features in a watch casing surface image to realize crack detection and scratch detection on the watch casing surface. The local gradient feature extraction algorithm model includes a local gradient calculation module, a feature descriptor construction module, a feature matching and screening module, and a detection and identification module. The output end of the local gradient calculation module is connected to the input end of the feature descriptor construction module calculation module, the output end of the feature descriptor construction module is connected to the input end of the feature matching and screening module, and the output end of the feature matching and screening module is connected to the input end of the detection and identification module. A defect oxidation detection module is used to detect defects and oxidation on the surface of the watch casing. The defect oxidation detection module uses an image dimension mapping analysis mechanism to perform dimensional space mapping on the watch casing surface image. The defect oxidation detection module then uses a variance feature extraction model to extract defect and oxidation features from the dimensional space of the watch casing surface image to achieve defect detection and oxidation detection on the watch casing surface. The output end of the light source illumination module is connected to the input end of the image acquisition module, the output end of the image acquisition module is connected to the input end of the image processing module, the output end of the image processing module is connected to the input end of the dent deformation detection module, the input end of the crack and scratch detection module and the input end of the defect oxidation detection module, and the dent deformation detection module, the crack and scratch detection module and the defect oxidation detection module are connected in parallel; The working method of the scale space feature extraction algorithm is: S1. A scale space model is constructed by using a Gaussian difference pyramid. The Gaussian difference pyramid compresses and blurs the watch case surface image through downsampling compression operation and Gaussian kernel blur processing to obtain at least 6 scale space images. The Gaussian kernel blur processing obtains a scale value specific to the scale space image through a Gaussian blur function. The scale value calculation formula of the scale space image is: In formula (1), is the scale value of the scale space image, is the scale factor of the scale space image, The Gaussian convolution kernel of the Gaussian blur function covers the target area. is the number of Gaussian convolution kernels of the Gaussian blur function; S2, then use the scale-invariant feature transformation network to detect extreme points on the scale space image to obtain key points. The scale-invariant feature transformation network solves the precise position and scale of the key points through the Taylor expansion function to obtain the horizontal and vertical scales of the key points; S3. Finally, a feature matching mechanism is used to establish a neighborhood area of 16x16 with the key point as the center. The feature matching mechanism calculates the gradient amplitude and direction of each pixel in the neighborhood area through a Gaussian weighted function to obtain a 128-dimensional feature vector. The feature matching mechanism performs a threshold analysis based on the feature vector to determine the depression point or deformation point. The local gradient calculation module uses an edge detection analysis operator to calculate the local gradient information in the watch case surface image. The edge detection analysis operator applies a 3x3 template to each pixel in the watch case surface image through a pixel convolution network. The pixel convolution network performs a convolution operation based on the gradient amplitude and direction of the pixel point, multiplies the template with the grayscale value of the current pixel point, and adds all the results to obtain a new pixel value. The new pixel value represents the local gradient feature value at the current position. The feature descriptor construction module detects the key points of local gradient information by using matrix determinant extreme value detection to determine the sampling area of each key point. The feature descriptor construction module then uses a local large block description operator to convert the sampling area of the key point into a statistical feature descriptor. The local large block description operator divides the gradient direction of each sampling area into 8 intervals by sampling area division. The local large block description operator then accumulates the gradient values in each interval to obtain a gradient histogram through a directional gradient histogram construction mechanism. The local large block description operator finally connects the gradient histograms in series through an LBP inter-code series protocol to form a global feature vector as the statistical feature descriptor of the key point. The feature matching and screening module matches the extracted feature descriptors using an approximate nearest neighbor search operator. The approximate nearest neighbor search operator uses a binary tree structure to build an index structure to find feature points that match the feature descriptors. The nodes of the binary tree structure represent sample points. The binary tree structure recursively divides the feature space to recursively match subsets in each sample point. The feature matching and screening module then uses a Harris corner point detection mechanism to screen the extracted feature descriptors. The Harris corner point detection mechanism extracts feature points with rotation invariance and scale invariance through scale space extreme value detection. The scale space extreme value detection smoothes the feature descriptors through a Gaussian filtering mechanism to simulate the feature descriptors at different scales. Feature points, the Harris corner point detection mechanism is used to screen the matched feature descriptors according to the feature points; the detection and identification module uses noise space clustering to aggregate the matched and screened feature descriptors, and the noise space clustering distributes the feature descriptors to the nearest cluster by iteratively updating the cluster center points until convergence, and the detection and identification module then uses a decision tree machine learning mechanism to identify the aggregated feature descriptors, and the decision tree machine learning mechanism constructs a decision tree classifier through queue iterative model training to determine whether the detected feature descriptor is a crack or a scratch, and the decision tree classifier generates a feature vector with a fixed length and directional property of the feature descriptor through a local feature description protocol, and the decision tree classifier performs classification and prediction according to the feature vector to realize the detection of cracks or scratches; The image dimension mapping analysis mechanism adopts a t-distributed random neighbor embedding algorithm to perform nonlinear dimensionality reduction to obtain the dimensional space of the watch case surface image. The t-distributed random neighbor embedding algorithm measures the similarity of pixels in the watch case surface image by Euclidean distance. The t-distributed random neighbor embedding algorithm optimizes the target mapping function by a gradient descent optimization iteration mechanism. The gradient descent optimization iteration mechanism performs function optimization according to the similarity of pixels in the watch case surface image to obtain the target mapping function. The t-distributed random neighbor embedding algorithm maps the dimensional space of the watch case surface image according to the optimized target mapping function to minimize the original distance. The target mapping function obtains the dimensional space of the watch case surface image by a similarity matrix and retains the relative distance relationship between pixels. The variance feature extraction model includes a feature extractor module, a feature selector module and a defect oxidation identification module, the output end of the feature extractor module is connected to the input end of the feature selector module, the output end of the feature selector module is connected to the input end of the defect oxidation identification module, the feature extractor module uses a GPQ semi-supervised convolutional neural network to extract key feature indicators of defects and oxidation from the watch case surface image, the key feature indicators at least include brightness, contrast, color distribution, texture, slope and normal, the GPQ semi-supervised convolutional neural network constructs a gray level co-occurrence matrix through a cosine similarity classifier, the cosine similarity classifier analyzes and extracts brightness and contrast information in the watch case surface image according to the gray level co-occurrence matrix, the GPQ semi-supervised convolutional neural network then performs subspace minimum maximum entropy loss logic analysis through a Gabor filtering mechanism to obtain color distribution and texture information in the watch case surface image, the GPQ semi-supervised convolutional neural network finally normalizes the feature vector through a wavelet transform fractal structure, and the GPQ semi-supervised convolutional neural network determines the slope and normal information according to the normalized feature vector; The feature selector module uses a linear discriminant analysis operator to reduce noise and screen key feature indicators. The linear discriminant analysis operator uses Bayesian theory to construct an intra-class scatter matrix mechanism to calculate the sum of squared distances between all sample points of the key feature indicators in each category and the category mean, and the sum of squared distances is added to obtain the intra-class scatter moment. The Bayesian theory constructs an intra-class scatter matrix mechanism to determine the maximum inter-class scatter matrix and the minimum intra-class scatter matrix according to the projection vector. The linear discriminant analysis operator maps and reduces noise on the key feature indicators according to the maximum inter-class scatter matrix and the minimum intra-class scatter matrix. The linear discriminant analysis operator uses a feature variable screening mechanism to screen the denoised key feature indicators. The feature variable screening mechanism minimizes the multivariate variance by calculating The feature vector analyzed is used to obtain the identification feature vector, and the feature variable screening mechanism screens and optimizes the key feature indicators according to the identification feature vector; the defect oxidation recognition module adopts the k-nearest neighbor algorithm classifier to realize the defect detection and oxidation detection of the watch case surface image, and the defect oxidation recognition module trains the key feature indicators through the local binary pattern to realize the optimization of the k-nearest neighbor algorithm classifier, and the local binary pattern adjusts the k value of the k-nearest neighbor algorithm classifier according to the binary code to optimize the performance of the k-nearest neighbor algorithm classifier, and the k-nearest neighbor algorithm classifier finds the key feature indicator closest to the defect oxygen through the Euclidean distance and cosine similarity measurement mechanism, and the k-nearest neighbor algorithm classifier detects the defects and oxidation parts of the watch case surface image according to the labels of the key feature indicators.
2. A watch case surface detection method based on machine vision, characterized in that: Applied to the machine vision-based watch casing surface detection system as described in claim 1, the method comprises the following steps: Step 1: Use LED lighting to fully illuminate the surface of the watch case to provide uniform lighting for the image acquisition module, and the image acquisition module acquires the image of the watch case surface through a CMOS camera equipped with a software interface and a development tool kit; Step 2, the image processing module performs image preprocessing on the collected watch case surface image through mean filtering and frequency channel fusion to achieve denoising and enhancement operations on the watch case surface image; Step 3, the scale space feature extraction algorithm uses a Gaussian difference pyramid to construct a scale space model, performs scale space analysis on the watch case surface image, and then uses a scale invariant feature transformation network to analyze the scale features. Finally, the scale space feature extraction algorithm uses a feature matching mechanism to perform a value threshold analysis to determine a depression point or a deformation point, thereby realizing depression detection and deformation detection on the watch case surface; Step 4: The local gradient feature extraction algorithm model analyzes the crack and scratch features in the watch case surface image through the local gradient calculation module, the feature descriptor construction module, the feature matching and screening module, and the detection and recognition module to achieve crack detection and scratch detection on the watch case surface; Step 5. The image dimension mapping analysis mechanism maps the watch case surface image to a dimensional space through a t-distributed random neighborhood embedding algorithm. The variance feature extraction model extracts defects and oxidation features from the dimensional space of the watch case surface image through a feature extractor module, a feature selector module, and a defect oxidation recognition module, thereby realizing defect detection and oxidation detection on the watch case surface.
