Image preprocessing method and system for laser light imaging

By acquiring multiple frames of images under consistent laser illumination conditions, generating a reference background image, and performing PCA dimensionality reduction and Fourier transform filtering, the problem of poor image quality in laser illumination imaging is solved, and image contrast and defect saliency are improved.

CN121095105BActive Publication Date: 2026-04-10QINGSOFT MICROVISION (HANGZHOU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGSOFT MICROVISION (HANGZHOU) TECH CO LTD
Filing Date
2025-11-13
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Laser illumination imaging technology suffers from poor image quality, including uneven bright spots, light-dark gradients, and background noise that affect image consistency and cause defects to be confused with material textures.

Method used

Multiple frames of images were acquired under consistent laser lighting and shooting conditions to generate a reference background image. A mask was constructed using PCA dimensionality reduction and two-dimensional Fourier transform. Combined with guided image fusion and filtering techniques, light spots and background noise were suppressed, and image contrast and defect saliency were improved.

Benefits of technology

It effectively suppresses light spots and background noise, improves image contrast and defect saliency, and enhances the accuracy and reliability of image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095105B_ABST
    Figure CN121095105B_ABST
Patent Text Reader

Abstract

The application discloses an image preprocessing method and system for laser light imaging, and relates to the technical field of image processing. The method comprises the following steps: under consistent laser light and shooting conditions, collecting multiple images of a target area; generating a reference background image according to the multiple images by using a preset algorithm; determining a corresponding difference image according to the reference background image, generating a guide image based on image gradient amplitudes, fusing the guide image into the difference image after normalization to obtain a target difference image; performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum image; constructing a two-dimensional mask and performing inverse Fourier transform on the frequency spectrum image after the two-dimensional mask is applied to the frequency spectrum image to obtain a target image. The application solves the problem of poor image quality in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an image preprocessing method and system for laser light imaging. BACKGROUND

[0002] In automated visual inspection, laser light imaging technology is widely used in profile recognition and defect detection of metal, plastic, ceramic and other material surfaces. Laser light source can form a high-contrast reflection image on the target surface due to its high directionality and strong focusing characteristics.

[0003] However, such imaging systems also face the following technical problems:

[0004] Laser light forms strong and uneven bright spots (Hot Spot) on diffuse reflection surfaces, affecting image consistency. Due to the limitation of device light distribution angle, the image has obvious light and dark gradient, and some materials have inherent texture or background noise, which is easy to be confused with defects, ultimately leading to the problem of poor image quality of laser light imaging. SUMMARY

[0005] Therefore, the purpose of the present application is to provide an image preprocessing method and system for laser light imaging, aiming to solve the problem of poor image quality of laser light imaging in the prior art.

[0006] In one aspect, the present application provides an image preprocessing method for laser light imaging, which comprises:

[0007] Under consistent laser light and shooting conditions, multiple images of the target area are collected, and a reference background image is generated from the multiple images using a preset algorithm;

[0008] A corresponding difference image is determined according to the reference background image, and a guide image is generated based on the image gradient amplitude, and the guide image is normalized and fused into the difference image to obtain a target difference image;

[0009] A two-dimensional Fourier transform is performed on the target difference image to obtain a frequency spectrum, a two-dimensional mask is constructed, and the two-dimensional mask is applied to the frequency spectrum to obtain a target image by inverse Fourier transform;

[0010] Wherein, a data matrix is constructed according to the multiple images, PCA dimensionality reduction is performed on the data matrix, the first preset number of principal components are retained to represent the stable background response, the reconstructed object is obtained by reconstruction through the principal components, and the reference background image is obtained by restoring the reconstructed object to an image.

[0011] Further, the above-mentioned image preprocessing method for laser light imaging, wherein the expression of the reconstructed object obtained by reconstruction through the principal components is:

[0012] ;

[0013] wherein, P is a two-dimensional principal component matrix composed of the first preset number of principal components, is a transpose matrix of P , is a data matrix.

[0014] Further, the image preprocessing method for laser light imaging, wherein the step of determining a corresponding difference image according to a reference background image, generating a guide image based on image gradient amplitudes, and fusing the guide image into the difference image after normalization to obtain a target difference image comprises:

[0015] ;

[0016] ;

[0017] ;

[0018] wherein, is an original image, is a reference background image, is a difference image, is a gradient of the original image in the horizontal direction, is a gradient of the original image in the vertical direction, is a structure enhancement coefficient, is a guide image.

[0019] Further, the image preprocessing method for laser light imaging, wherein the step of performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum image comprises:

[0020] ;

[0021] wherein, is a target difference image, is a two-dimensional Fourier transform operator, the central region of the frequency spectrum image is a low-frequency component, and the peripheral region of the frequency spectrum image is a high-frequency component.

[0022] Further, the image preprocessing method for laser light imaging, wherein the expression for constructing a two-dimensional mask and applying the two-dimensional mask to the frequency spectrum image to perform inverse Fourier transform to obtain a target image is:

[0023] ;

[0024] ;

[0025] ;

[0026] ;

[0027] wherein, is a frequency spectrum, is a two-dimensional mask, is a target image, is an inverse Fourier transform, is a center frequency of an elliptical band-pass filter, are long and short axis radii of the elliptical band-pass filter, respectively, is a coordinate of a current pixel point in the image, are used for controlling the thickness of the elliptical shell, respectively.

[0028] Further, the image preprocessing method for laser light imaging, wherein the method further comprises:

[0029] When constructing the two-dimensional mask, a deep neural network is used to train a historical sample set containing laser light imaging defects to obtain a model for adaptively adjusting the parameters of the elliptical band-pass filter;

[0030] The model optimizes the center frequency, long and short axis radii of the elliptical band-pass filter and the parameters for controlling the thickness of the elliptical shell in real time according to the frequency domain features of the current target difference image, so that the frequency domain selection characteristics of the two-dimensional mask are matched with the frequency distribution and morphological features of the defects to be detected.

[0031] Further, the image preprocessing method for laser light imaging, wherein the step of constructing a two-dimensional mask and applying the two-dimensional mask to the frequency spectrum and then performing an inverse Fourier transform to obtain a target image further comprises:

[0032] Statistical histogram distribution of historical images is determined to determine the gray scale stretching range, and the target image is stretched according to the determined gray scale stretching range.

[0033] Another object of the present application is to provide an image preprocessing system for laser light imaging, the system comprising:

[0034] The acquisition module is used to acquire multiple images of a target region under consistent laser light and shooting conditions, and to generate a reference background image according to the multiple images using a preset algorithm;

[0035] The fusion module is used to determine a corresponding difference image according to the reference background image, and to generate a guide image based on image gradient amplitude, and to fuse the guide image into the difference image after normalization to obtain a target difference image;

[0036] The processing module is configured to perform two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, construct a two-dimensional mask, apply the two-dimensional mask to the frequency spectrum, and perform inverse Fourier transform to obtain the target image.

[0037] The method comprises the following steps: constructing a data matrix according to the plurality of images, performing PCA dimension reduction on the data matrix, retaining a preset number of principal components representing a stable background response, reconstructing a reconstructed object through the principal components, and restoring the reconstructed object into an image to obtain the reference background image.

[0038] Another object of the present application is to provide a computer program product, which comprises a computer program stored on a computer readable storage medium, the program being executable by a processor to implement the steps of the method described above.

[0039] Another object of the present application is to provide an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable by the processor to implement the steps of the method described above.

[0040] The present application comprises the following steps: collecting a plurality of images of a target region under consistent laser lighting and shooting conditions, generating a reference background image according to the plurality of images using a preset algorithm, determining a corresponding difference image according to the reference background image, generating a guide image based on the image gradient amplitude, fusing the guide image into the difference image after normalization to obtain a target difference image, performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, constructing a two-dimensional mask, applying the two-dimensional mask to the frequency spectrum, and performing inverse Fourier transform to obtain the target image. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 The flow chart of the image preprocessing method for laser lighting imaging in the first embodiment of the present application;

[0042] Figure 2 The structural block diagram of the image preprocessing system for laser lighting imaging in the third embodiment of the present application.

[0043] The following specific embodiments will further illustrate the present application in conjunction with the above drawings. DETAILED DESCRIPTION

[0044] For the purpose of promoting an understanding of the principles of the application, reference will now be made to the embodiments illustrated in the drawings. There is shown in the drawings several embodiments of the application. However, it should be understood that the application can be practiced in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It is therefore an object of the present application to provide a method and system for image pre-processing.

[0045] It is to be understood that where the term "fixedly attached" is used herein, it can be directly attached, or intervening elements can also be present. Where the term "connected" is used herein, it can be directly connected, or intervening elements can be present. The terms "vertical", "horizontal", "left", "right", and similar terms as used herein are for purposes of illustration and description only and are not intended to limit the application.

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this description, the terms "therefore", "because", and the like are used merely to provide emphasis and are not intended to leave a supporting residual genetic material in the application.

[0047] Embodiment One

[0048] Referring to Figure 1 , an image pre-processing method for laser light imaging in the first embodiment of the present application is shown, which includes steps S10-S12.

[0049] Step S10, under consistent laser light and image shooting conditions, multiple images of the target area are collected, and a reference background image is generated according to the multiple images using a preset algorithm.

[0050] Among them, all the key conditions of controlling laser light and image shooting are to ensure that the power, wavelength, irradiation angle and light intensity stability of the laser are completely consistent, at the same time, the shooting parameters, shooting position of the camera and the distance and angle of the target area are also fixed, so as to eliminate the interference of external variables such as light fluctuation and equipment parameter change on image quality, and provide a unified benchmark for subsequent image processing;

[0051] Then, for the specific target area that needs to establish a background reference, multiple images are continuously collected through the above stable light control and shooting system, and the multiple images can cover more scene information of the target area under stable conditions, thereby laying a data foundation for subsequent extraction of stable background;

[0052] Finally, the preset algorithm designed and verified in advance is used to automatically process the collected multiple frames of images. The algorithm automatically identifies and eliminates temporary change interference components existing in the multiple frames of images, only retains image information that is stably present in all frames and can truly reflect the basic environmental conditions of the target region, and finally generates a reference background image with stable quality and reliable information. The image can be used as a benchmark background for subsequent image analysis tasks such as target detection, defect identification, and dynamic change analysis, thereby improving the accuracy and reliability of subsequent analysis.

[0053] Specifically, a data matrix is constructed according to multiple frames of images, PCA dimension reduction is performed on the data matrix, the first preset number of principal components are retained to represent stable background responses, a reconstruction object is obtained by reconstruction through the principal components, and the reconstruction object is restored to an image to obtain a reference background image.

[0054] The expression of the reconstruction object obtained by reconstruction through the principal components is:

[0055] ;

[0056] wherein, P is a two-dimensional principal component matrix composed of the first preset number of principal components, is a transpose matrix of P , and is the data matrix.

[0057] First, a data matrix is constructed. The multiple frames of images collected under consistent laser lighting and shooting conditions (assuming that N frames are collected, and each frame of image has a resolution of WxH and a total number of pixels M=WxH) need to be format-converted. The two-dimensional pixel array of each frame of image is flattened into a one-dimensional pixel vector in rows or columns, and then the N one-dimensional pixel vectors corresponding to the N frames of images are stacked in columns (or in rows) to form a data matrix X with a dimension of MxN. The matrix essentially converts the spatial pixel information of multiple frames of images into a matrix form convenient for mathematical operations, thereby laying a data foundation for subsequent dimension reduction processing.

[0058] Next, PCA dimension reduction operation is performed. The core of PCA (principal component analysis) is to extract the most representative stable features in the data and filter random interference. Specifically, the data matrix X is first subjected to centering preprocessing to obtain a centered matrix, and then the covariance matrix of the centered matrix is calculated. Subsequently, the eigenvalues and eigenvectors of the covariance matrix are solved. At this time, the eigenvectors corresponding to the first preset number K of eigenvalues are selected, which are the “principal components”. The principal components are arranged in columns to form a two-dimensional principal component matrix P. Through PCA dimension reduction, low-variance interference information caused by noise, temporary occlusion, etc. in the multiple frames of images is eliminated, and only high-variance principal components carrying stable background responses are retained.

[0059] After the reconstruction step, the influence of centralization on pixel brightness is eliminated, and the reconstructed object containing stable background information is finally obtained. Finally, image restoration is performed to obtain N frames of reconstructed images containing only stable background. Since these reconstructed images are all generated based on core principal components, the information is highly consistent, and they can usually be mean fused (further reduce residual small noise) to obtain a reference background image without interference and stable information.

[0060] Step S11, determine the corresponding difference image according to the reference background image, and generate a guide image based on the image gradient amplitude. After normalization, the guide image is fused into the difference image to obtain the target difference image.

[0061] Examples:

[0062] ;

[0063] ;

[0064] ;

[0065] Wherein, is the original image, is the reference background image, is the difference image, is the gradient of the original image in the horizontal direction, is the gradient of the original image in the vertical direction, is the structure enhancement coefficient, is the guide image.

[0066] Wherein, based on the original image and the reference background image, the difference image is obtained by pixel-by-pixel gray value subtraction operation, but the difference image at this time may contain noise or edge blur and other problems;

[0067] Then generate the guide image. The function of the guide image is to mark the structural features (such as edges and contours) that need to be enhanced in the image. First, calculate the horizontal and vertical gradients of the original image, then calculate the gradient amplitude based on the two gradients, and then combine the structure enhancement coefficient to obtain the guide image.

[0068] Finally, the guide image is normalized and fused. The guide image is first normalized to obtain a normalized guide image, and then the normalized guide image is fused with the difference image to generate a target difference image. The fusion logic is based on the principle of "structure enhancement and noise suppression". In the area with a high value of the normalized guide image (i.e., the edge / contour area), more original details of the difference image are retained to enhance the clarity of the target structure. In the area with a low value (i.e., the flat area), the noise interference is suppressed by reducing the weight. The final target difference image retains the core difference between the target and the background captured by the difference operation, and enhances the recognition of the key structure features while weakening the noise in the flat area.

[0069] In step S12, a two-dimensional Fourier transform is performed on the target difference image to obtain a frequency spectrum, a two-dimensional mask is constructed, and the two-dimensional mask is applied to the frequency spectrum to perform an inverse Fourier transform to obtain the target image.

[0070] First, a frequency spectrum is obtained by performing a two-dimensional Fourier transform on the target difference image obtained in the previous step. The central area of the frequency spectrum corresponds to low frequency (high energy and high brightness), and the edge area corresponds to high frequency (low energy and low brightness).

[0071] Then, a two-dimensional mask is constructed, and then the two-dimensional mask is applied to the frequency spectrum to realize frequency domain filtering. Finally, a two-dimensional inverse Fourier transform is performed on the processed frequency spectrum to remap the filtered frequency components in the frequency domain back to the spatial domain. The spatial domain image obtained finally is the target image.

[0072] In summary, the image preprocessing method for laser light imaging in the above embodiments of the present application acquires multiple images of a target area under consistent laser lighting and shooting conditions, generates a reference background image according to the multiple images using a preset algorithm, determines a corresponding difference image according to the reference background image, generates a guide image based on image gradient amplitudes, fuses the guide image into the difference image after normalization to obtain a target difference image, performs a two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, constructs a two-dimensional mask, and applies the two-dimensional mask to the frequency spectrum to perform an inverse Fourier transform to obtain a target image. In the method, a data matrix is constructed according to the multiple images, PCA dimensionality reduction is performed on the data matrix, the first preset number of principal components are retained to represent stable background responses, a reconstructed object is obtained by reconstruction through the principal components, and the reconstructed object is restored to an image to obtain a reference background image. Through the constructed reference background image, asymmetric frequency domain filtering and guide enhancement, the spot and background noise are effectively suppressed, and the image contrast and defect conspicuity are improved. The problem of poor image quality in laser light imaging in the prior art is solved.

[0073] Embodiment Two

[0074] The embodiment also proposes an image preprocessing method for laser light imaging. The image preprocessing method for laser light imaging in the embodiment is different from the image preprocessing method for laser light imaging in Embodiment One in that:

[0075] The step of performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum includes:

[0076]

[0077] wherein, is the target difference image, is a two-dimensional Fourier transform operator, the central region of the frequency spectrum is a low-frequency component, and the peripheral region of the frequency spectrum is a high-frequency component.

[0078] Further, a two-dimensional mask is constructed and applied to the frequency spectrum, and the expression of the target image obtained by inverse Fourier transform is:

[0079]

[0080]

[0081]

[0082]

[0083] wherein, is the frequency spectrum, is the two-dimensional mask, is the target image, is inverse Fourier transform, is the center frequency of the elliptical band-pass filter, are the long and short axis radii of the elliptical band-pass filter, respectively, is the coordinate of the current pixel point in the image, are used to control the thickness of the elliptical shell, respectively.

[0084] By way of example, the elliptical shell is composed of two layers of "outer ellipse" and "inner ellipse", and Δ is used to represent the difference between the key parameters of the two layers of ellipses, such as the long axis or the short axis of the ellipse.

[0085] wherein, the two-dimensional mask is designed by the elliptical band-pass filter, the frequency spectrum is filtered in the frequency domain, the specific frequency components corresponding to the target features are retained, the high and low frequency interference is removed, and then the high-quality spatial domain target image is restored by inverse Fourier transform;

[0086] ​​​​​Based on the parameters of the elliptical band-pass filter, a "frequency attribution judgment" is performed on each frequency domain pixel point in the frequency spectrum (the dimension is consistent with the target difference image, and is set as MxN). The "elliptical distance" of the pixel to the center frequency is calculated. When the pixel point is in the annular shell formed by the inner ellipse and the outer ellipse, the shell is the band-pass frequency range, and the pixel value of the two-dimensional mask is set to 1 (indicating that the frequency component is allowed to pass); if the pixel point is not in the shell, the pixel value of the two-dimensional mask is set to 0 (indicating that the frequency component is suppressed), and finally a binary two-dimensional mask matrix completely matched with the size of the frequency spectrum is formed. The elliptical shell structure of the mask can accurately match the non-circular distribution of the target feature in the frequency domain, and is more consistent with the actual scene than the circular mask.

[0087] Then the two-dimensional mask is applied to the frequency spectrum: the filtering is realized by the pixel-by-pixel multiplication operation in the frequency domain, and only the specific frequency band information key to target identification is left. Finally, the inverse Fourier transform is performed to obtain the target image.

[0088] In addition, in some optional embodiments of the present application, the method further comprises:

[0089] When constructing the two-dimensional mask, a deep neural network is used to train a historical sample set containing laser light imaging defects, to obtain a model for adaptively adjusting the parameters of the elliptical band-pass filter;

[0090] The model optimizes the center frequency, the major and minor axis radii of the elliptical band-pass filter and the parameters for controlling the thickness of the elliptical shell in real time according to the frequency domain characteristics of the current target difference image, so that the frequency domain selection characteristics of the two-dimensional mask are matched with the frequency distribution and morphological characteristics of the defect to be detected.

[0091] Among them, a large number of historical sample data are collected to provide sufficient and high-quality data basis for model training. Then, the training process of the deep neural network is needed, and the appropriate network structure (such as a convolutional neural network CNN, which is good at extracting local features and spatial correlation of frequency domain images; or a network combined with an attention mechanism, which can focus on the key frequency domain area corresponding to the defect; if the global frequency distribution needs to be processed, a Transformer structure can also be used) is selected according to the task requirements. The input of the network is set to the frequency domain features of the target difference image in the historical samples (such as the amplitude distribution heat map of the frequency spectrum, the peak intensity of the defect frequency domain area, the variance and skewness of the frequency distribution, the ellipticity of the frequency domain shape, etc. Quantitative features), and the output is set to the corresponding optimal elliptical bandpass filter parameters. During the training process, a targeted loss function is used, and the weights and biases of the network are continuously adjusted through the back propagation algorithm, so that the model gradually learns the mapping rule of “frequency domain features-optimal parameters”, until the parameter prediction error of the model on the validation set is lower than the preset threshold, and the model has stable parameter prediction ability. Finally, real-time parameter optimization and mask construction are performed. When processing a new laser light imaging task, the image sequence collected at present is preprocessed to obtain a target difference image, and the frequency domain features of the target difference image are extracted. These real-time frequency domain features are input into the trained model, and the model will output the optimized elliptical bandpass filter parameters for the current scene based on the learned mapping rule (without manual intervention, adaptive adjustment is realized), and finally a two-dimensional mask is constructed using these optimized parameters, so that the frequency domain selection characteristics of the mask are highly matched with the actual frequency distribution and morphological features of the defect to be detected. In the subsequent frequency domain filtering, the key frequency components corresponding to the defect can be maximally retained, and irrelevant low-frequency background redundancy and high-frequency random noise can be completely filtered out, thereby providing guarantee for the inverse Fourier transform to generate target images with high signal-to-noise ratio and high detail clarity, and finally improving the accuracy, robustness and scene adaptability of laser light imaging defect detection.

[0092] To sum up, the image preprocessing method for laser light imaging in the above-mentioned embodiments of the present application, by collecting multiple images of the target area under consistent laser light and shooting conditions, generating a reference background image according to the multiple images using a preset algorithm; determining the corresponding difference image according to the reference background image, and generating a guide image based on the image gradient amplitude, fusing the guide image into the difference image after normalization to obtain a target difference image; performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, constructing a two-dimensional mask and performing inverse Fourier transform on the frequency spectrum after the two-dimensional mask is applied to obtain a target image; wherein, a data matrix is constructed according to the multiple images, PCA dimension reduction is performed on the data matrix, the first preset number of principal components are retained to represent the stable background response, the reconstructed object is obtained through the principal components, and the reference background image is obtained by restoring the reconstructed object to an image. Through the constructed reference background image, asymmetric frequency domain filtering and guide enhancement, the spot and background noise are effectively suppressed, and the image contrast and defect saliency are improved. The problem of poor image quality in the prior art laser light imaging is solved.

[0093] Embodiment three

[0094] Please refer to Figure 2 , which is an image preprocessing system for laser light imaging proposed in the third embodiment of the present application, the system comprises:

[0095] The acquisition module 100 is used for collecting multiple images of the target area under consistent laser light and shooting conditions, and generating a reference background image according to the multiple images using a preset algorithm;

[0096] The fusion module 200 is used for determining the corresponding difference image according to the reference background image, and generating a guide image based on the image gradient amplitude, fusing the guide image into the difference image after normalization to obtain a target difference image;

[0097] The processing module 300 is used for performing two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, constructing a two-dimensional mask and performing inverse Fourier transform on the frequency spectrum after the two-dimensional mask is applied to obtain a target image;

[0098] Wherein, a data matrix is constructed according to the multiple images, PCA dimension reduction is performed on the data matrix, the first preset number of principal components are retained to represent the stable background response, the reconstructed object is obtained through the principal components, and the reference background image is obtained by restoring the reconstructed object to an image.

[0099] The functions or operation steps realized when the above-mentioned modules are executed are generally the same as those of the above-mentioned method embodiments, and will not be described here.

[0100] Embodiment four

[0101] Another aspect of the present application provides a readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the method according to any one of Embodiment One to Embodiment Two.

[0102] Embodiment Five

[0103] Another aspect of the present application provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements the steps of the method according to any one of Embodiment One to Embodiment Two when executing the program.

[0104] The technical features of each of the above embodiments can be combined in any manner. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not contradict each other, they shall be considered within the scope of the present application.

[0105] Those skilled in the art can understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing the logic function, which can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus or device, such as a computer-based system, a system including a processor or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or in conjunction with these instructions execution systems, apparatus or devices. For the purpose of the present application, the "computer-readable storage medium" can be any device that can contain, store, communicate, propagate or transport the program for use by or in connection with the instruction execution system, apparatus or device, or in conjunction with these instruction execution systems, apparatus or devices.

[0106] More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electrical devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable storage medium can even be paper or another suitable medium upon which the program is printed, because the program can be electronically captured, for example, by optically scanning the paper or other suitable medium, then electronically converted into a form that is suitable for use in a computer storage medium.

[0107] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques can be used to implement the hardware used to implement the described functions: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having logic gates for implementing the logic functions on data signals, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0108] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples.

[0109] The above-described embodiments only express several implementation manners of the application, which are described in a more specific and detailed manner, but cannot be understood as a limitation on the patent scope of the application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the application, which are all within the protection scope of the application. Therefore, the patent protection scope of the application should be subject to the appended claims.

Claims

1. An image preprocessing method for laser light-out imaging, characterized by, The method comprises: Under consistent laser lighting and shooting conditions, a plurality of images of a target region are collected, and a reference background image is generated from the plurality of images according to a preset algorithm; A corresponding difference image is determined according to the reference background image, and a guide image is generated based on the image gradient amplitude, the guide image is normalized and fused into the difference image to obtain a target difference image; A two-dimensional Fourier transform is performed on the target difference image to obtain a frequency spectrum, a two-dimensional mask is constructed, and the two-dimensional mask is applied to the frequency spectrum to perform an inverse Fourier transform to obtain a target image; Wherein, a data matrix is constructed according to the plurality of images, PCA dimension reduction is performed on the data matrix, the first preset number of principal components are retained to represent the stable background response, a reconstruction object is obtained by reconstruction through the principal components, and the reconstruction object is restored to an image to obtain the reference background image. The step of determining the corresponding difference image according to the reference background image, generating the guide image based on the image gradient amplitude, and fusing the guide image into the difference image after normalization to obtain the target difference image comprises: ; ; ; wherein, is the original image, is the reference background image, is the difference image, is the gradient of the original image in the horizontal direction, is the gradient of the original image in the vertical direction, is the structure enhancement coefficient, is the guide image.

2. The image pre-processing method for laser light-out imaging according to claim 1, wherein, The expression of the reconstruction object obtained by reconstruction through the principal components is: ; wherein P is a two-dimensional principal component matrix consisting of the first predetermined number of principal components, is P is a transpose matrix of is a data matrix.

3. The image pre-processing method for laser light-out imaging according to claim 1, wherein, The step of performing a two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum comprises: ; wherein is the target difference image, is a two-dimensional Fourier transform operator, the central region of the spectrum is the low-frequency component, and the peripheral region of the spectrum is the high-frequency component.

4. The image pre-processing method for laser light-out imaging according to claim 3, wherein, The expression of constructing a two-dimensional mask and applying the two-dimensional mask to the frequency spectrum to perform an inverse Fourier transform to obtain a target image is: ; ; ; ; wherein, is a frequency spectrum, is a two-dimensional mask, is a target image, is an inverse Fourier transform, is a center frequency of the elliptical band-pass filter, are long and short axis radii of the elliptical band-pass filter, respectively, is a coordinate of a current pixel in the image, are used to control the thickness of the elliptical shell, respectively.

5. The image pre-processing method for laser light-out imaging according to claim 4, wherein, The method further comprises: When constructing the two-dimensional mask, a deep neural network is used to train a historical sample set containing laser lighting imaging defects to obtain a model for adaptively adjusting the parameters of the elliptical band-pass filter; The model optimizes the center frequency, long and short axis radii of the elliptical band-pass filter and the parameter for controlling the thickness of the elliptical shell in real time according to the frequency domain characteristics of the current target difference image, so that the frequency domain selection characteristics of the two-dimensional mask match the frequency distribution and morphological characteristics of the defect to be detected.

6. The image pre-processing method for laser light-out imaging according to claim 1, wherein, The step of constructing a two-dimensional mask and applying the two-dimensional mask to the frequency spectrum to perform an inverse Fourier transform to obtain a target image further comprises: The gray level histogram distribution of the historical image is counted, the gray level stretching range is determined, and the target image is stretched according to the determined gray level stretching range.

7. An image pre-processing system for laser light-out imaging, characterized by A system for implementing the image preprocessing method for laser lighting imaging according to any one of claims 1 to 6, the system comprising: An acquisition module for collecting a plurality of images of a target region under consistent laser lighting and shooting conditions, and generating a reference background image from the plurality of images according to a preset algorithm; A fusion module for determining a corresponding difference image according to the reference background image, generating a guide image based on the image gradient amplitude, and fusing the guide image into the difference image after normalization to obtain a target difference image; A processing module for performing a two-dimensional Fourier transform on the target difference image to obtain a frequency spectrum, constructing a two-dimensional mask, and applying the two-dimensional mask to the frequency spectrum to perform an inverse Fourier transform to obtain a target image; Wherein, a data matrix is constructed according to the plurality of images, PCA dimension reduction is performed on the data matrix, the first preset number of principal components are retained to represent the stable background response, a reconstruction object is obtained by reconstruction through the principal components, and the reconstruction object is restored to an image to obtain the reference background image.

8. A readable storage medium, having stored thereon a computer program, characterized in that, The program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 6.

9. An electronic device, comprising: A computer program product comprising a memory, a processor, and a computer program stored on the memory and running on the processor, the processor implementing the steps of the method according to any one of claims 1 to 6 when executing the program.

Citation Information

Patent Citations

  • Visual inspection method and system for beverage package defects

    CN120374520A

  • Dynamic image coding device, dynamic image coding method and dynamic image coding program

    JP2017034408A