Image signal preprocessing analysis method
Through Gaussian hybrid modeling and image preprocessing methods, the problems of low efficiency and poor accuracy in workpiece surface defect detection are solved, efficient and accurate image signal preprocessing is achieved, and the effectiveness of detection and image clarity are improved.
Patent Information
- Application Number
- CN202311829190.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
In the detection of surface defects of workpieces, the prior art has problems such as low detection efficiency, poor reliability, easy to miss and missed detection, poor contrast and defect resolution capabilities in laser scanning detection, and poor system stability and maintainability.
Gaussian hybrid modeling method is used to detect moving targets, combined with image preprocessing operations such as grayscale, super-resolution reconstruction and adaptive thresholding methods, to eliminate image noise and improve image clarity and accuracy.
The target recognition performance has been improved, the effectiveness and accuracy of detection have been significantly improved, high-quality image output is ensured, and the basis for subsequent feature information extraction is provided.
Smart Images

Figure CN120235804A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of lasers, and in particular, to a method for preprocessing and analyzing image signals. Background Art
[0002] The detection of defects on the surface of workpieces, as a key link in the product production process, plays an important role in ensuring the performance and quality of the delivered products. Especially in the fields of precision manufacturing and processing, the appearance of defects on the surface of industrial products will directly affect the stability and safety of subsequent deep processing. In the past, due to limitations in terms of funds, technology, etc., most small and medium-sized enterprises mostly adopted methods such as manual visual inspection and laser scanning detection. Among them, manual visual inspection is that inspectors conduct quality inspection and defect judgment through naked eyes, mainly relying on the experience of inspectors, lacking quantitative detection standards, with poor reliability, low detection efficiency, high labor intensity, and prone to missed inspections and misjudgments. Laser scanning detection is a detection technology developed with the maturity and improvement of laser technology. It has high sensitivity and can meet the real-time requirements for the detection of product surface quality, but it has insufficient ability to distinguish defects with poor contrast, and the identification accuracy of the system is not high. At the same time, due to the rather complex structure of its optical system, the detection signal is easily interfered by the external environment, and the stability and maintainability of the system are poor. Summary of the Invention
[0003] In order to solve the above technical problems, the present invention provides a method for preprocessing and analyzing image signals for detecting defects on the surface of workpiece products, thereby improving product quality and conducting quality control.
[0004] The technical solution adopted by the present invention is as follows:
[0005] Detect moving targets in a complex environment through the Gaussian mixture modeling method, and then through a variety of image preprocessing operations, eliminate irrelevant information or noise in the image, make the image clearer and more real, ensure the output of high-quality images, and provide necessary conditions for the extraction of the next feature information. The steps include:
[0006] S1. Determine the actual initial parameters of the Gaussian mixture model, update the corresponding parameters of the Gaussian mixture model, and finally perform normalization processing on the actual weights of each Gaussian function;
[0007] S2. Perform grayscale processing on the image, make the three components of each pixel point in the pixel point matrix equal, thereby ignoring color information and obtaining gradient features;
[0008] S3. Through the analysis of digital image signals, in the form of software algorithms, reconstruct one or more frames of images into higher-resolution images or videos;
[0009] S4. Use the Adaptive Threshold method. According to the brightness distribution in different regions of the image, calculate the mean, median, and Gaussian weighted average (Gaussian filtering) of a certain region to determine the threshold of that region, and then determine the target position and region size.
[0010] The beneficial effects of the present invention are as follows:
[0011] 1. The performance of target recognition is improved, and the effectiveness and accuracy of detection are greatly enhanced.
[0012] 2. By applying corresponding image processing methods, irrelevant information or noise in the image is eliminated, making the image clearer and more real, ensuring the output of high-quality images, providing necessary conditions for the extraction of the next feature information, and realizing the effective detection of defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is the EDSR model structure in this method. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0014] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention fall within the scope of protection of the present invention.
[0015] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and should not be construed as indicating or implying relative importance.
[0016] Embodiment 1
[0017] The present invention discloses a preferred embodiment of an image signal preprocessing and analysis method, including the following steps:
[0018] S1. First, determine the actual initial parameters of the Gaussian mixture model. Read a video with a length of N frames, calculate the variance and average value of the color values of all pixel points in the video image, and initialize the Gaussian mixture model in the background model. Let the number of models be represented by M. The specific formulas for calculating the variance and average value of the pixel point color values are as follows:
[0019]
[0020] Wherein, μ0 represents the average value of the pixel color values; N represents the number of pixels; t represents the moment; I t represents the pixel color value; σ 2 represents the variance of the pixel color value.
[0021] Then update the corresponding parameters of the Gaussian mixture model. When the complex environment is constantly changing, the constructed background model must also update the parameters in a timely manner. Match the Gaussian distribution with each pixel, specifically as follows:
[0022] |X t -μ t | 2 <λ 2 ω k,t
[0023] Wherein, Xt represents the Gaussian dimension; μt represents the pixel value; λ represents the Gaussian threshold of the pixel; ω k,t represents the weight of the Gaussian distribution.
[0024] Finally, normalize the actual weights of each Gaussian function, and the specific application formula is as follows:
[0025]
[0026] Wherein, ωk,t' represents the weight of the Gaussian distribution after being updated again.
[0027] S2. Perform grayscale processing on the image. A pixel is the smallest image unit in an image. The color of each pixel in an image is determined by three color components: red (R), green (G), and blue (B), and each component can take 255 values. Grayscale processing of the image is to make the three components of each pixel in the pixel matrix equal, thereby ignoring the color information and obtaining gradient features. This processing method can also reduce the subsequent image processing calculation amount and improve the processing efficiency. The methods of grayscale value processing usually include the component method, the average value method, the maximum value method, and the weighted average method. In this project, the weighted average method is used to process the original image. The principle of this method is to assign different weights to each pixel according to the different sensitivities of the human eye to red, green, and blue light, so as to obtain the grayscale value of this point. The formula is
[0028] f Gray = 0.30R(x,y) + 0.59G(x,y) + 0.11B(x,y)
[0029] Where: R(x, y), G(x, y), and B(x, y) are the red (R), green (G), and blue (B) color components of the original color image, respectively. After the gray value transformation, the values of the three components are equal.
[0030] S3. Perform super-resolution reconstruction. Based on the deep learning super-resolution models EDSR (Enhanced Deep Residual Networks) and DBPN (Deep Back-Projection Networks), research is carried out to explore a better model structure. The structure of the EDSR model is as shown in the appendix Figure 1 As shown, it treats each feature channel equally, which affects the quality of the reconstructed image, thus helping to improve the accuracy of image reconstruction. However, EDSR uses the traditional deconvolution upsampling method, and the generated image is prone to artifacts, with the details not being processed properly. The larger the generated image, the more blurred it becomes, and the jaggedness is obvious.
[0031] DBPN's error feedback mechanism that iteratively calculates the projection errors of upsampling and downsampling guides the reconstruction process to obtain better results. However, the iterative calculation increases the computational cost, making the operation speed of the model slower than that of EDSR. According to the official test results of EDSR and DBPN on multiple datasets, when the magnification factor is 2 times, the PSNR (Peak Signal-to-Noise Ratio) index of the images generated by both EDSR and DBPN reaches 32.3, and the SSIM (Structural Similarity) index reaches 0.9.
[0032] S4. Use the Adaptive Threshold method. According to the brightness distribution in different regions of the image, calculate the mean, median, and Gaussian weighted average (Gaussian filtering) of a certain region to determine the threshold of that region, and then determine the target position and region size.
[0033] For the defective region image f(x, y), the segmentation threshold between the defective target and the normal background is denoted as T, the proportion of the number of pixels belonging to the defect in the entire image is denoted as w0, and its average gray value is μ0. The proportion of the number of pixels of the normal board background in the entire image is w1, and its average gray value is μ1. The total average gray value of the wood surface defect image is denoted as μ, and the between-class variance is denoted as g.
[0034] Assume that the size of the defective region image is M*N. The number of pixels with a gray value less than the threshold T in the image is denoted as N0, and the number of pixels with a gray value greater than the threshold T is denoted as N1. Then:
[0035]
[0036]
[0037] N0 + N1 = M * N
[0038] μ = w0 * μ0 + w1 * μ1
[0039] g = w0(μ0 - μ) 2 + w1(μ1 - μ) 2
[0040] From the above two equations, we can obtain:
[0041] g = w0w1(μ0 - μ1) 2
[0042] The threshold T that maximizes the between-class variance g is obtained by using the traversal method, which is what we want.
[0043] The above is a preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as within the protection scope of the present invention.
Claims
1. An image signal preprocessing and analysis method for detecting surface defects of workpiece products, thereby improving product quality and conducting quality control. It includes the following steps: S1. Determine the actual initial parameters of the Gaussian mixture model, update the corresponding parameters of the Gaussian mixture model, and finally perform normalization processing on the actual weights of each Gaussian function; S2. Perform grayscale processing on the image, making the three components of each pixel point in the pixel point matrix equal, thereby ignoring color information and obtaining gradient features; S3. Through the analysis of digital image signals, in the form of software algorithms, reconstruct one or more frames of images into higher-resolution images or videos; S4. Use the Adaptive Threshold method to calculate the mean, median, and Gaussian weighted average (Gaussian filtering) of a certain area according to the brightness distribution of different areas of the image to determine the threshold of the area, and then determine the target position and area size.
2. The image signal preprocessing analysis method according to claim 1, characterized in that In step S1, a controller is set to control the detection camera to move at a fixed speed on the detection path. During the movement, the detection camera takes target images at a fixed frequency. The movement speed is proportional to the shooting frequency, so that at least part of two adjacent images overlap.
3. A method for preprocessing and analyzing an image signal according to claim 1, characterized in that, In step S1, a controller is set to control the detection camera to move at a fixed speed on the detection path. During the movement, the detection camera takes target images at a fixed frequency. The movement speed is proportional to the shooting frequency, so that at least part of two adjacent images overlap.
4. A method for preprocessing and analyzing an image signal according to claim 1, characterized in that, In steps S3 and S4, during detection, first perform median filtering on the image, then sharpen the image, and then use the histogram threshold segmentation algorithm for processing to determine whether there are defects in the target.
5. The image signal preprocessing analysis method according to claim 4, characterized in that, After completing the detection of various parameters, summarize and group the various data, draw each group of data into a histogram, obtain the quality distribution status according to the distribution of statistical data, and analyze the quality fluctuation to judge and predict the product quality and unqualified rate.