Image illumination transfer method, device and equipment in the field of SMT quality inspection and medium
By acquiring image information of components under different lighting conditions, adjusting parameter values, and utilizing image classification models and optimization algorithms, the problems of misjudgment and missed detection caused by lighting changes in SMT quality inspection were solved, achieving higher image accuracy and automated processing.
Patent Information
- Application Number
- CN202311458813.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-11-03
AI Technical Summary
Existing technologies have failed to effectively address the issues of misjudgment and missed detection caused by changes in image information of components under different lighting conditions in SMT quality inspection. Furthermore, the generated images have low accuracy and require manual intervention to adjust parameters.
By acquiring image information of components under different lighting conditions, adjusting parameter values, generating third image information, and using image classification models and optimization algorithms to automatically find the optimal parameter values, a fourth image information that is closest to the real image is generated.
It improves the accuracy and stability of quality inspection, reduces manual intervention, generates images that are closer to the real images of components, and adapts to different lighting conditions.
Smart Images

Figure CN117474813B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of SMT quality inspection, and more specifically to an image illumination transfer method, apparatus, device, and medium in the field of SMT quality inspection. Background Technology
[0002] In the field of SMT quality inspection, due to changes in lighting conditions, the image information of components will change under different lighting conditions. This may lead to misjudgment and missed detection in the quality inspection process. Moreover, in real industrial production, when the lighting conditions when photographing components change, the previously collected component images will be difficult to use for subsequent model training and updates.
[0003] Currently, existing methods to address the aforementioned issues involve using deep learning to extract content features of specific components captured under different lighting conditions and lighting style features under arbitrary lighting conditions to synthesize images of those components. However, this method only considers the content features and lighting style features of specific components, ignoring the changes in the components themselves under different lighting conditions. This results in the generated images potentially differing from the actual appearance of the components, leading to low accuracy in the synthesized images. Furthermore, when calculating the differences between the actual and generated images of the components, the influence of different components cannot be ignored, and it cannot automatically search for optimal parameter values among multiple samples, requiring manual intervention and adjustment, which increases the complexity and subjectivity of the operation.
[0004] Therefore, there is an urgent need for a new image illumination transfer method that can effectively solve the above problems. Summary of the Invention
[0005] The purpose of this invention is to provide a master control structure and control device for an interventional surgical robot, which aims to solve the technical problem that existing technologies, by extracting the content of content images and the style of target images, result in significant loss of content details and require manual verification of the generated images.
[0006] To achieve the above objectives, the present invention employs the following technical solution:
[0007] An image illumination transfer method in the field of SMT quality inspection includes:
[0008] Acquire first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination;
[0009] Adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information;
[0010] The third image information is input into the image classification model to obtain the cross-entropy value of the third image information;
[0011] Repeat the above steps to obtain multiple parameter values of the component, and obtain the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on the optimization algorithm;
[0012] Based on the optimal parameter values, a fourth image information that most closely resembles the real image of the component is generated.
[0013] Furthermore, before the step of adjusting the parameter values corresponding to the first image information and the second image information, the method further includes:
[0014] Import the first image information and the second image information into the image processing tool;
[0015] Based on the image processing tool's call library, the first image information and the second image are split into multiple color channels respectively;
[0016] Obtain the distribution information of multiple color channels of the first image information and the second image information.
[0017] Further, the step of adjusting the parameter values corresponding to the first image information and the second image information to obtain the third image information includes:
[0018] Based on the distribution information, parameter values for the first image information and the second image information are obtained, wherein the parameter values include color mixing weight and Gamma value;
[0019] Generate a six-dimensional random value, and adjust the parameter values of the color channels corresponding to the first image information and the second image information based on the six-dimensional random value;
[0020] The adjusted parameter values of the multiple color channels are combined to obtain the third image information.
[0021] Furthermore, before the step of inputting the third image information into the image classification model, the method further includes:
[0022] Acquire fifth image information, wherein the fifth image information includes image information of the component under both the first illumination and the second illumination;
[0023] The image classification model is obtained by training the first, second, and fifth image information of multiple components using a neural network.
[0024] Further, the step of obtaining multiple parameter values of the component and acquiring the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on an optimization algorithm includes:
[0025] Record multiple parameter values of the component in each loop;
[0026] According to the optimization algorithm, find the parameter value that minimizes the cross-entropy value among the multiple parameter values;
[0027] The parameter value is set to the optimal parameter value.
[0028] Further, the step of generating fourth image information that most closely approximates the actual image of the component based on the optimal parameter values includes:
[0029] The optimal parameter values are input into the color channels corresponding to the first and second image information to obtain the initial image;
[0030] The initial image is preprocessed to obtain the fourth image information.
[0031] Further, the step of inputting the third image information into the image classification model to obtain the cross-entropy value of the third image information includes:
[0032] The third image information is input into the image classification model to obtain the classification result of the third image information;
[0033] Define the true label of the third image information;
[0034] The cross-entropy value is obtained by calculating the similarity between the classification result and the true label based on the cross-entropy function.
[0035] This invention also proposes an image illumination transfer device in the field of SMT quality inspection, the device comprising:
[0036] The acquisition module is used to acquire first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination;
[0037] The adjustment module is used to adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information;
[0038] The input module is used to input the third image information into the image classification model to obtain the cross-entropy value of the third image information;
[0039] An optimization module is used to iterate through the above steps to obtain multiple parameter values of the component, and to obtain the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on an optimization algorithm.
[0040] The generation module is used to generate fourth image information that most closely resembles the real image of the component based on the optimal parameter values.
[0041] The present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the image illumination migration method in the field of SMT quality inspection as described above.
[0042] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image illumination migration steps in the field of SMT quality inspection as described above.
[0043] The beneficial effects of this invention are as follows: This invention obtains cross-entropy values by iteratively adjusting parameter values and inputting newly generated images of components under different lighting conditions into an image classification model. The optimal parameter values, which minimize the cross-entropy value, are then obtained through this iterative adjustment and optimization algorithm. This allows the invention to better adapt to changes in component image features under different lighting conditions, improving the accuracy and stability of quality inspection. Simultaneously, it enhances the effect of image illumination migration, making the generated fourth image information more closely resemble the actual image of the component. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the steps of an image illumination transfer method in the field of SMT quality inspection according to an embodiment of the present invention;
[0045] Figure 2 This is a schematic block diagram of an image illumination transfer device in the field of SMT quality inspection according to an embodiment of the present invention;
[0046] Figure 3 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0047] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0049] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0050] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, a direct connection, or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0051] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0052] Reference Figure 1 This invention provides an image illumination transfer method in the field of SMT quality inspection, the method comprising steps S1-S5:
[0053] S1: Acquire first image information and second image information, wherein the first image information includes image information of the component under the first illumination, and the second image information includes image information of the component under the second illumination;
[0054] In step S1, the first illumination is preferably white light, and the second illumination is preferably RGB (red, green, blue) three-color ring illumination. Photos taken under white light make the comparison of component quality inspection and the silkscreen printing on components more obvious, facilitating the extraction of silkscreen text, component outlines, or pad edges. Images taken under RGB three-color ring illumination are used to identify solder-related defects. This can be achieved by using a camera or other image acquisition equipment to photograph components under different illumination conditions and obtain corresponding image data. By acquiring image information of components under different illumination conditions, more comprehensive and diverse data can be obtained, providing a solid foundation for subsequent image illumination transfer.
[0055] S2: Adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information;
[0056] In step S2, based on the correspondence between the first and second image information, the corresponding parameter values are adjusted to generate the third image information. Specifically, the parameter values may include color channel weights and Gamma values. Based on the first and second image information, their color channels, such as red, green, and blue channels, are extracted. Then, the weights of the corresponding color channels in the first and second image information are adjusted to blend the two images. A larger weight indicates a higher proportion of that color channel in the final image, and a smaller weight indicates a lower proportion. By adjusting the weights, the color distribution and brightness of the image can be controlled. After blending the color channels, the Gamma value is further adjusted to affect the contrast and brightness of the image. By adjusting the Gamma value, the brightness and darkness of the image can be increased or decreased, making the image more consistent with the appearance under actual lighting conditions. Adjusting the parameter values allows for flexible control of the image's illumination migration effect. By adjusting the weights and Gamma values, third image information under various parameters can be obtained.
[0057] S3: Input the third image information into the image classification model to obtain the cross-entropy value of the third image information;
[0058] In step S3, the third image information is input into the trained image classification model, and the output result is calculated through the forward propagation algorithm. The model's prediction result is compared with the true label of the third image information, and the cross-entropy value is calculated as an evaluation index. The cross-entropy value reflects the model's prediction accuracy for the third image information and can objectively evaluate the image classification model's prediction accuracy and performance for the third image information. The cross-entropy value can be used as an optimization target. By adjusting the model parameters and structure, the model's performance can be optimized, and the classification accuracy for the third image information can be improved.
[0059] S4: Repeat the above steps to obtain multiple parameter values of the component, and obtain the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on the optimization algorithm;
[0060] In step S4, by continuously repeating steps S1-S3, multiple parameter values can be obtained. Optimization algorithms (such as random search, simulated annealing, evolutionary algorithms, etc.) are used to find the optimal parameter values. The goal of the optimization algorithm is to minimize the cross-entropy value so that the synthesized image is as close as possible to the actual sample image under RGB lighting and white light illumination, obtaining universal parameter values applicable to various situations and samples. This can improve the generalization ability of the algorithm. Moreover, the optimization algorithm can automatically search for the optimal parameter values without manual intervention. Compared with manually adjusting parameters, the optimization algorithm can find the best parameter values more quickly and efficiently, making the image more consistent with the actual sample.
[0061] S5: Based on the optimal parameter values, generate fourth image information that is closest to the real image of the component.
[0062] In step S5, the optimal parameter value with the smallest cross-entropy value in all loops is recorded, and a synthetic image that is closest to the real component image is generated by using the optimal parameter value.
[0063] In steps S1-S5, existing methods address the issue that changes in lighting conditions can alter the image information of components under different illuminations, posing challenges to quality inspection. The method of this application, by acquiring image information of components under first and second illuminations and adjusting corresponding parameter values, generates a fourth image that most closely resembles the actual image of the component under RGBW illumination (red, green, blue, and white light sources). This fourth image information can be used as a reference during component quality inspection, accurately determining component quality and preventing misjudgments and missed detections. By iteratively adjusting parameter values and using an optimization algorithm to obtain the optimal parameter value that minimizes cross-entropy, more accurate image illumination migration results can be obtained, better maintaining the integrity and accuracy of image information. Furthermore, the method adapts to different lighting conditions, generates multiple parameter values, and selects the optimal value, improving the algorithm's stability and adaptability.
[0064] This invention enables the automatic and intelligent generation of images that are closest to real-world component images using machine learning models, without requiring manual adjustment, based on component images under both RGB and white light illumination. This effectively solves the problem of component image illumination migration and can be applied to the processing workflow after industrial data acquisition. In the data preprocessing stage, it migrates component images acquired under non-target illumination conditions to target illumination conditions to ensure their usability in the training of deep learning models.
[0065] In one embodiment, before the step of adjusting the parameter values corresponding to the first image information and the second image information, the method further includes:
[0066] Import the first image information and the second image information into the image processing tool;
[0067] Based on the image processing tool's call library, the first image information and the second image are split into multiple color channels respectively;
[0068] Obtain the distribution information of multiple color channels of the first image information and the second image information.
[0069] In this embodiment, the first and second image information are imported into an image processing tool. Based on the tool's library, the first and second image information are split into multiple color channels. Preferably, the `cv2.split()` function from Python's OpenCV library can be used for this splitting, for example, splitting into three RGB channels: R for red, G for green, and B for blue. The RGB channels represent the distribution of red, green, and blue colors at different intensities in the image. By separating the first and second image information into three independent color channels (red, green, and blue), parameter values are adjusted, such as brightness and contrast. Alternatively, optimization algorithms can be used to automatically adjust parameter values to achieve the best results. By splitting the first and second image information into multiple color channels, their color distribution information can be better understood, allowing for more precise adjustment of parameter values.
[0070] In one embodiment, the step of adjusting the parameter values corresponding to the first image information and the second image information to obtain the third image information includes:
[0071] Based on the distribution information, parameter values for the first image information and the second image information are obtained, wherein the parameter values include color mixing weight and Gamma value;
[0072] Generate a six-dimensional random value, and adjust the parameter values of the color channels corresponding to the first image information and the second image information based on the six-dimensional random value;
[0073] The adjusted parameter values of the multiple color channels are combined to obtain the third image information.
[0074] In this embodiment, based on the aforementioned distribution information, the color mixing weights and Gamma values of the first and second images are obtained. Then, a six-dimensional random vector is generated, with each dimension having a value between 0 and 1. The six-dimensional random vector can be generated using a pseudo-random number generator. Based on the values of the six-dimensional random vector, the color mixing weights and Gamma values of the corresponding color channels of the first and second images are adjusted. According to a pre-set adjustment range, the random values between 0 and 1 can be mapped to actual values within the adjustment range. Finally, the adjusted parameter values are used to color mix the first and second images and apply Gamma correction to obtain the generated third image.
[0075] Furthermore, generally speaking, the larger the Gamma value, the greater the color contrast, and the smaller the Gamma value, the smaller the color contrast. Color mixing weights control the color mixing ratio between the two images, while the Gamma value adjusts image brightness and contrast. A six-dimensional random value is generated, and the parameter values of the color channels corresponding to the first and second image information are adjusted based on this value. For example, the red channel of the first image information is adjusted to correspond to the red channel of the second image information. The color channels of the first and second image information are then mixed, preferably using a linear weighting method, mixing the different color channels of the two images according to their weight ratios to obtain a new synthetic image information, i.e., the third image information. By adjusting the color mixing weights and Gamma value, the generated new image information sample can be made closer to the real image. By generating six-dimensional random values and adjusting the parameter values of the color channels based on these values, the generated new image information can be made more realistic and natural.
[0076] In one embodiment, before the step of inputting the third image information into the image classification model, the method further includes:
[0077] Acquire fifth image information, wherein the fifth image information includes image information of the component under both the first illumination and the second illumination;
[0078] The image classification model is obtained by training the first, second, and fifth image information of multiple components using a neural network.
[0079] In this embodiment, before image classification, it is necessary to acquire fifth image information, namely, image information of components simultaneously captured under first and second illumination, i.e., RGBW illumination, which is a light source containing four basic colors: red, green, blue, and white. A neural network is used to train the first, second, and fifth image information of multiple components to obtain an image classification model. Specifically, by pre-collecting images of various components captured under RGB, white, and RGBW illumination, a neural network-based image classification model capable of classifying images captured under these three illumination conditions is trained, and the structure and parameters of the neural network are reasonably designed and adjusted. By using a neural network to train the first, second, and fifth image information of multiple components, the resulting image classification model can automatically learn image features, thereby improving the accuracy and stability of image classification. Furthermore, because it is trained using a neural network, the resulting image classification model can adapt to different component types and illumination conditions, exhibiting strong versatility and adaptability.
[0080] In one embodiment, the step of obtaining multiple parameter values of the component and acquiring the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on an optimization algorithm includes:
[0081] Record multiple parameter values of the component in each loop;
[0082] According to the optimization algorithm, find the parameter value that minimizes the cross-entropy value among the multiple parameter values;
[0083] The parameter value is set to the optimal parameter value.
[0084] In this embodiment, in each loop, images of a certain number of component samples under RGB and white light illumination are synthesized, resulting in multiple corresponding parameter values. In multiple loops, different parameter values (combining weights and Gamma) are tried to generate the synthesized image, and the corresponding cross-entropy is calculated. In each loop, the parameter values corresponding to the components under different illuminations are recorded. The goal of the optimization algorithm is to find a parameter value among multiple component parameter values that minimizes the cross-entropy. Specific optimization algorithms may include gradient descent, genetic algorithms, simulated annealing, etc. When the optimization algorithm finds a parameter value that minimizes the cross-entropy, this parameter value is set as the optimal parameter value. By finding the optimal parameter value that minimizes the cross-entropy, the optimal solution can be automatically searched among multiple parameter values without manually adjusting each parameter value, saving time and effort, and avoiding the subjectivity and limitations that may arise from manually selecting parameter values.
[0085] In one embodiment, the step of generating fourth image information that most closely approximates the actual image of the component based on the optimal parameter values includes:
[0086] The optimal parameter values are input into the color channels corresponding to the first and second image information to obtain the initial image;
[0087] The initial image is preprocessed to obtain the fourth image information.
[0088] In this embodiment, the optimal parameter values are input into the color channels corresponding to the first and second image information to obtain an initial image. Specifically, the previously optimized optimal mixing weights and Gamma values are input into the respective color channels corresponding to the first and second image information. Then, the newly generated color channels are directly synthesized into an initial image. The generated initial image is then preprocessed to obtain the final fourth image information. The preprocessing process may include image denoising, brightness and contrast adjustment, etc., to ensure that the generated image is as close as possible to the actual component image. By inputting the optimal parameter values into the color channels corresponding to the first and second image information, an initial image can be obtained. This initial image has high similarity and closeness, and can better represent the real characteristics of the component, further improving the accuracy of the generated fourth image information. Furthermore, the entire process can be automated, improving processing efficiency and convenience.
[0089] In one embodiment, the step of inputting the third image information into an image classification model to obtain the cross-entropy value of the third image information includes:
[0090] The third image information is input into the image classification model to obtain the classification result of the third image information;
[0091] Define the true label of the third image information;
[0092] The cross-entropy value is obtained by calculating the similarity between the classification result and the true label based on the cross-entropy function.
[0093] In this embodiment, the third image information is used as input, and after forward propagation calculation by the image classification model, the classification result of the image is obtained. When performing image classification tasks, each image has a ground truth label to represent the true category to which the image belongs. This ground truth label can be labeled according to the image's attributes and category information during the dataset preparation stage. Then, the similarity between the classification result and the ground truth label is calculated based on the cross-entropy function to obtain the cross-entropy value. The cross-entropy function is often used to measure the difference or similarity between the classification model output and the ground truth label. By inputting the classification result and the ground truth label into the cross-entropy function, the similarity between them can be calculated, and the cross-entropy value can be obtained as an evaluation index. The smaller the cross-entropy value, the more similar the classification result is to the ground truth label.
[0094] Reference Figure 2 This application provides an image illumination transfer device in the field of SMT quality inspection, the device comprising:
[0095] The acquisition module 100 is used to acquire first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination;
[0096] Adjustment module 200 is used to adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information;
[0097] The input module 300 is used to input the third image information into the image classification model to obtain the cross-entropy value of the third image information;
[0098] The optimization module 400 is used to repeat the above steps to obtain multiple parameter values of the component, and to obtain the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on the optimization algorithm.
[0099] The generation module 500 is used to generate fourth image information that is closest to the real image of the component based on the optimal parameter values.
[0100] In this embodiment, without human intervention, a machine learning model automatically and intelligently generates images that are closest to real-world component images from component images under RGB and white light illumination. This effectively solves the problem of component image illumination migration and can be applied to the processing flow after industrial data acquisition. In the data preprocessing stage, component images acquired under non-target lighting conditions are migrated to target lighting conditions to ensure that they can be used in the training of deep learning models.
[0101] Furthermore, the image illumination transfer device in the field of SMT quality inspection also includes:
[0102] The import module is used to import the first image information and the second image information into the image processing tool.
[0103] The splitting module is used to split the first image information and the second image into multiple color channels based on the calling library of the image processing tool;
[0104] The second acquisition module is used to obtain the distribution information of multiple color channels of the first image information and the second image information.
[0105] Furthermore, the adjustment module 200 includes:
[0106] The first acquisition unit acquires parameter values of the first image information and the second image information based on the distribution information, wherein the parameter values include color mixing weight and Gamma value;
[0107] The first generation unit is used to generate a six-dimensional random value and adjust the parameter values of the color channels corresponding to the first image information and the second image information based on the six-dimensional random value.
[0108] The adjustment unit is used to synthesize the adjusted parameter values of multiple color channels to obtain the third image information.
[0109] Furthermore, the image illumination transfer device in the field of SMT quality inspection also includes:
[0110] The third acquisition module is used to acquire the fifth image information, wherein the fifth image information includes the image information of the component under both the first illumination and the second illumination;
[0111] The fourth acquisition module is used to train the first image information, second image information and fifth image information of multiple components based on a neural network to obtain the image classification model.
[0112] Furthermore, the optimization module 400 includes:
[0113] A recording unit is used to record multiple parameter values of the component in each cycle;
[0114] The search unit searches for the parameter value that minimizes the cross-entropy value among multiple parameter values according to the optimization algorithm.
[0115] A setting unit is used to set the value of the parameter to the optimal parameter value.
[0116] Furthermore, the generation module 500 includes:
[0117] The first input unit is used to input the optimal parameter value into the color channel corresponding to the first image information and the second image information to obtain the initial image;
[0118] The processing unit is used to preprocess the initial image to obtain the fourth image information.
[0119] Furthermore, the input module 300 includes:
[0120] The second input unit is used to input the third image information into the image classification model to obtain the classification result of the third image information;
[0121] Definition unit, used to define the real label of the third image information;
[0122] The calculation unit is used to calculate the similarity between the classification result and the true label based on the cross-entropy function, and obtain the cross-entropy value.
[0123] Reference Figure 3 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, this computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores programs such as image illumination transfer methods in the field of SMT quality inspection. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an image illumination transfer method in the field of SMT quality inspection.
[0124] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements an image illumination migration method in the field of SMT quality inspection. The method includes: acquiring first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination; adjusting the parameter values corresponding to the first image information and the second image information to obtain third image information; inputting the third image information into an image classification model to obtain the cross-entropy value of the third image information; repeating the above steps to obtain multiple parameter values of the component, and obtaining the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on an optimization algorithm; and generating fourth image information that is closest to the real image of the component based on the optimal parameter value.
[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0126] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An image illumination transfer method in the field of SMT quality inspection, characterized in that, include: Acquire first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination; Adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information, wherein the parameter values include color mixing weight and Gamma value; The third image information is input into an image classification model to obtain the cross-entropy value of the third image information; wherein, the image classification model is used to classify the illumination conditions of the input image, and the image classification model is obtained by: acquiring fifth image information, wherein the fifth image information includes image information of the component under both the first illumination and the second illumination; training the first image information, second image information and fifth image information of multiple components based on a neural network to obtain the image classification model; The steps of "acquiring first image information and second image information", "adjusting the parameter values corresponding to the first image information and the second image information to obtain third image information" and "inputting the third image information into the image classification model to obtain the cross-entropy value" are executed in a loop to obtain multiple parameter values of the component, and the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values is obtained based on the optimization algorithm. Based on the optimal parameter values, a fourth image information is generated that most closely resembles the real image of the component.
2. The image illumination transfer method in the field of SMT quality inspection according to claim 1, characterized in that, Before the step of adjusting the parameter values corresponding to the first image information and the second image information, the method further includes: Import the first image information and the second image information into the image processing tool; Based on the image processing tool's call library, the first image information and the second image are split into multiple color channels respectively; Obtain the distribution information of multiple color channels of the first image information and the second image information.
3. The image illumination transfer method in the field of SMT quality inspection according to claim 2, characterized in that, The step of adjusting the parameter values corresponding to the first image information and the second image information to obtain the third image information includes: Based on the distribution information, obtain the parameter values of the first image information and the second image information; Generate a six-dimensional random value, and adjust the parameter values of the color channels corresponding to the first image information and the second image information based on the six-dimensional random value; The adjusted parameter values of the multiple color channels are combined to obtain the third image information.
4. The image illumination transfer method in the field of SMT quality inspection according to claim 1, characterized in that, The step of obtaining multiple parameter values of the component and acquiring the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on an optimization algorithm includes: Record multiple parameter values of the component in each loop; According to the optimization algorithm, find the parameter value that minimizes the cross-entropy value among the multiple parameter values; The parameter value is set to the optimal parameter value.
5. The image illumination transfer method in the field of SMT quality inspection according to claim 2, characterized in that, The step of generating fourth image information that most closely resembles the real image of the component based on the optimal parameter values includes: The optimal parameter values are input into the color channels corresponding to the first and second image information to obtain the initial image; The initial image is preprocessed to obtain the fourth image information.
6. The image illumination transfer method in the field of SMT quality inspection according to claim 1, characterized in that, The step of inputting the third image information into the image classification model to obtain the cross-entropy value of the third image information includes: The third image information is input into the image classification model to obtain the classification result of the third image information; Define the true label of the third image information; The cross-entropy value is obtained by calculating the similarity between the classification result and the true label based on the cross-entropy function.
7. An image illumination transfer device for SMT quality inspection, characterized in that, The device includes: The acquisition module is used to acquire first image information and second image information, wherein the first image information includes image information of the component under a first illumination, and the second image information includes image information of the component under a second illumination; An adjustment module is used to adjust the parameter values corresponding to the first image information and the second image information to obtain the third image information, wherein the parameter values include color mixing weight and Gamma value; An input module is used to input the third image information into an image classification model to obtain the cross-entropy value of the third image information; wherein, the image classification model is used to classify the illumination conditions of the input image, and the image classification model is obtained by: acquiring fifth image information, wherein the fifth image information includes image information of the component under both the first illumination and the second illumination; training the first image information, second image information and fifth image information of multiple components based on a neural network to obtain the image classification model; The optimization module is used to repeatedly execute the steps of "acquiring first image information and second image information", "adjusting the parameter values corresponding to the first image information and the second image information to obtain third image information", and "inputting the third image information into the image classification model to obtain the cross-entropy value", to obtain multiple parameter values of the component, and to obtain the optimal parameter value that minimizes the cross-entropy value among the multiple parameter values based on the optimization algorithm; The generation module is used to generate fourth image information that most closely resembles the real image of the component based on the optimal parameter values.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the image illumination migration method in the field of SMT quality inspection as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image illumination migration steps in the field of SMT quality inspection as described in any one of claims 1 to 6.
Citation Information
Patent Citations
De-illumination method and device, electronic equipment and storage medium
CN113781352A
Living body detection method and device, electronic equipment and storage medium
CN114333078A
