Multi-channel image synthesis method and device, computer device and medium

By acquiring illumination from multiple regions of the workpiece under test and applying weighted bias processing, the problem of image blurring caused by uneven illumination was solved, achieving high-precision image synthesis and improved detection accuracy.

CN116124789BActive Publication Date: 2026-05-15GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD
Filing Date
2023-01-09
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

During device testing, uneven lighting can cause blurry and ghosting issues in photos, affecting the recognition of image details and reducing testing accuracy and efficiency.

Method used

By collecting illumination data from different areas of the workpiece under test, multiple workpiece images are generated. Weighted bias processing and cross-union ratio calculation are then performed to generate a composite target image, ensuring the uniformity and accuracy of image brightness.

Benefits of technology

It improves the uniformity and accuracy of image synthesis, enhances the imaging uniformity of defect features, and improves the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116124789B_ABST
    Figure CN116124789B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of multi-channel image synthesis method, device, computer equipment and medium, belong to image synthesis technical field.The method comprises: at least one part of the region of the workpiece to be measured is illuminated each time and the image acquisition of workpiece to be measured is carried out, obtains multiple workpiece images;Multiple workpiece images are subjected to weighted bias processing, obtain multiple bias images and synthesis graph;The intersection-over-union ratio calculation is carried out to synthesis graph and overall image, and the intersection-over-union ratio value is obtained;According to the intersection-over-union ratio value, synthesis graph and the intersection-over-union ratio condition of preposition determines target synthesis graph.The embodiment of the application can solve the problem of uneven imaging, realize defect feature imaging uniformity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image synthesis technology, and in particular to a multi-channel image synthesis method, apparatus, computer equipment, and medium. Background Technology

[0002] During the visual inspection of components, photographic capture is often required. Users analyze these photographs to determine if the components have defects or damage. However, photograph quality is significantly affected by lighting conditions. Photos taken during the day may be clear, while those taken at night may be blurry. Furthermore, uneven lighting can occur across different parts of the component under inspection, leading to blurry or ghosting images in the captured photographs. This results in indistinct image details, making it difficult to distinguish defect features and reducing inspection accuracy and efficiency. Summary of the Invention

[0003] The main objective of this application is to provide a multi-channel image synthesis method, apparatus, computer equipment, and medium that can solve the problem of uneven imaging.

[0004] To achieve the above objectives, a first aspect of this application proposes a multi-channel image synthesis method, the method comprising:

[0005] Each time, at least a portion of the workpiece to be tested is illuminated and an image of the workpiece is acquired, resulting in multiple workpiece images. The workpiece images include an overall image acquired by illuminating the entire workpiece.

[0006] Weighted bias processing is performed on multiple workpiece images to obtain multiple biased images and a composite image;

[0007] The cross-union ratio (CUI) is calculated for both the composite image and the overall image to obtain the CUI value.

[0008] The target composite image is determined based on the cross-union ratio, the composite image, and the preset cross-union ratio conditions.

[0009] In some embodiments, the weighted bias processing of multiple workpiece images to obtain multiple bias images and a composite image includes:

[0010] A weight matrix is ​​generated based on multiple workpiece images, wherein the weight matrix includes multiple matrix elements, each of which corresponds to one of the workpiece images;

[0011] The workpiece image is weighted and biased using the matrix elements in the weight matrix to obtain multiple biased images;

[0012] Multiple bias channels are determined based on the bias image, and the bias image and the bias channels are combined to obtain a composite image.

[0013] In some embodiments, the matrix elements include weight values; the weighted bias processing of the workpiece image using the matrix elements in the weight matrix to obtain multiple biased images includes:

[0014] Obtain the grayscale value of each workpiece image;

[0015] For each workpiece image, the grayscale value of the image is weighted and biased based on a preset offset value and the weight value to obtain multiple biased images.

[0016] In some embodiments, the weighted bias processing of the image grayscale values ​​based on a preset offset value and the weight value to obtain multiple biased images includes:

[0017] Determine the image weight value and the image offset value corresponding to the workpiece image;

[0018] The image grayscale value is weighted and biased according to the image weight value and the image offset value to obtain the target grayscale value;

[0019] The brightness of the workpiece image is adjusted according to the target grayscale value to obtain the offset image.

[0020] In some embodiments, the step of image synthesis of the bias image and the bias channel to obtain a composite image includes:

[0021] Obtain the pixels of the bias image;

[0022] The bias images are sorted to obtain a bias sequence;

[0023] The pixel and the bias channel are added together according to the bias sequence to obtain the composite image.

[0024] In some embodiments, calculating the intersection-over-union (IoU) ratio of the synthesized image and the overall image to obtain the IoU value includes:

[0025] Feature labeling is performed on the overall image to obtain defect feature information;

[0026] The feature width, feature height, and center point coordinates are determined based on the defect feature information.

[0027] The composite image is subjected to grayscale binarization to obtain the first defect feature information of the composite image;

[0028] The first defect feature information is segmented by a preset spot tool to obtain the second defect feature information.

[0029] The width, height, and coordinates of the synthesized feature center point are determined based on the second defect feature information.

[0030] The intersection-union ratio (IUGR) is calculated for the feature width, feature height, center point coordinates, composite feature width, composite feature height, and composite center point coordinates to obtain the IUGR value.

[0031] In some embodiments, determining the target composite image based on the intersection-union ratio, the composite image, and a preset intersection-union ratio condition includes:

[0032] The intersection-union ratio is compared with the preset intersection-union ratio condition;

[0033] If the cross-union ratio satisfies the cross-union ratio condition, the target composite graph is determined based on the composite graph;

[0034] If the crossover-union ratio does not meet the crossover-union ratio condition, the weighted bias processing is continued on multiple workpiece images to obtain an iterative crossover-union ratio until the iterative crossover-union ratio meets the crossover-union ratio condition.

[0035] A second aspect of this application provides a multi-channel image synthesis apparatus, the apparatus comprising:

[0036] The image acquisition module is used to illuminate at least a portion of the workpiece to be tested each time and acquire images of the workpiece to be tested, thereby obtaining multiple workpiece images, wherein the workpiece images include an overall image obtained by illuminating the entire workpiece to be tested.

[0037] The weighted bias module is used to perform weighted bias processing on multiple workpiece images to obtain multiple biased images and a composite image;

[0038] The intersection-over-union (IoU) ratio calculation module is used to calculate the IoU ratio of the composite image and the overall image to obtain the IoU ratio value.

[0039] The target determination module is used to determine the target composite image based on the intersection-union ratio, the composite image, and preset intersection-union ratio conditions.

[0040] A third aspect of this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is used to perform a multi-channel image synthesis method as described in any one of the embodiments of the first aspect of this application.

[0041] A fourth aspect of this application provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the computer is used to perform the multi-channel image synthesis method as described in any one of the embodiments of the first aspect of this application.

[0042] The multi-channel image synthesis method, apparatus, computer equipment, and medium proposed in this application firstly illuminate at least a portion of the workpiece under test and acquire images of the workpiece under test each time, thereby obtaining multiple workpiece images under different illumination conditions. The workpiece images include an overall image acquired by illuminating the entire workpiece under test. Then, the multiple workpiece images are weighted and biased to obtain multiple bias images, thereby improving the uniformity of image brightness. A composite image is then obtained based on the bias images to avoid data overflow. Finally, the cross-union ratio (CUI) is calculated on the composite image and the overall image to obtain the CUI value, thereby improving the image synthesis accuracy. The target composite image is then determined based on the CUI value, the composite image, and preset CUI conditions. This can solve the problem of uneven imaging, achieve uniform imaging of defect features, and improve the detection accuracy and efficiency of the workpiece under test. Attached Figure Description

[0043] Figure 1 This is a flowchart of a multi-channel image synthesis method provided in one embodiment of this application;

[0044] Figure 2 yes Figure 1 The detailed flowchart of step S102;

[0045] Figure 3 yes Figure 2 The detailed flowchart of step S202;

[0046] Figure 4 yes Figure 3 The detailed flowchart of step S302;

[0047] Figure 5 yes Figure 1 The detailed flowchart of step S203;

[0048] Figure 6 yes Figure 1 The detailed flowchart of step S103;

[0049] Figure 7 yes Figure 1 The detailed flowchart of step S104;

[0050] Figure 8 yes Figure 1Another specific flowchart of step S104;

[0051] Figure 9 This is a schematic diagram of the structure of the multi-channel image synthesis device provided in the embodiments of this application;

[0052] Figure 10 This is a schematic diagram of the hardware structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0055] 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 herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0056] The multi-channel image synthesis method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; the software can be an application implementing the above method, but is not limited to the above forms.

[0057] The embodiments of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0058] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a specific method of the multi-channel image synthesis method provided in this application embodiment. In some embodiments, the multi-channel image synthesis method includes, but is not limited to, steps S101 to S104.

[0059] Step S101: Illuminate at least a portion of the workpiece to be tested each time and acquire images of the workpiece to be tested to obtain multiple workpiece images.

[0060] It should be noted that the workpiece image includes the overall image obtained by illuminating the entire workpiece under test.

[0061] In some embodiments, a light source emitter is provided above the workpiece to be tested. The light source emitter is turned on or off by a light source controller. During each illumination of the workpiece to be tested, the rear area, left area, front area, right area, and overall illumination of the light source emitter are controlled sequentially so that at least a part of the workpiece to be tested is illuminated. Images of the workpiece to be tested in different illuminated areas are acquired to obtain multiple workpiece images, which are convenient for subsequent image synthesis.

[0062] Understandably, during the image acquisition process of the workpiece under test, the rear quarter light source emitter can be turned on first to trigger the camera to take a picture and obtain the first image. Then, the left quarter light source emitter, the front quarter light source emitter, the right quarter light source emitter, and the overall light source emitter can be turned on in sequence to obtain the second image, the third image, the fourth image, and the overall image. The first image, the second image, the third image, the fourth image, and the overall image can be integrated to obtain multiple workpiece images.

[0063] It is worth noting that the activation sequence of the light source emitter and the illumination area can be adjusted according to the user's needs in this embodiment, and this embodiment does not impose any specific restrictions.

[0064] Step S102: Perform weighted bias processing on multiple workpiece images to obtain multiple biased images and a composite image;

[0065] In some embodiments, each workpiece image is subjected to weighted bias processing to obtain multiple bias images, thereby making the image brightness of the bias images uniform and avoiding the situation of excessively bright or dark images. Then, a composite image is determined based on the bias images to facilitate subsequent comparison of the composite images.

[0066] Step S103: Calculate the intersection-union ratio (IUR) of the composite image and the overall image to obtain the IUR value;

[0067] In some embodiments, the cross-union ratio (CUI) is calculated for the synthesized image and the overall image to obtain the CUI value, thereby improving the image accuracy of the synthesized image and solving the problem of uneven imaging of defects.

[0068] Step S104: Determine the target composite image based on the cross-union ratio, the composite image, and the preset cross-union ratio conditions.

[0069] In some embodiments, the cross-union ratio (CUP) is compared with a preset CUP condition to determine whether the current composite image meets the CUP condition requirements, and the target composite image is determined based on the determination result, thereby achieving uniform imaging.

[0070] It should be noted that after obtaining the target composite image, the workpiece to be tested can be adjusted or modified according to the target composite image, thereby improving the detection efficiency of the workpiece to be tested.

[0071] In some embodiments, steps S101 to S104 involve first illuminating at least a portion of the workpiece under test and acquiring an image of the workpiece, thereby obtaining multiple workpiece images under different illumination conditions. The workpiece image includes an overall image acquired by illuminating the entire workpiece. Then, weighted bias processing is applied to the multiple workpiece images to obtain multiple bias images, thereby improving the uniformity of image brightness. A composite image is then obtained based on the bias images to avoid data overflow. Finally, the cross-union ratio (CUI) is calculated between the composite image and the overall image to obtain the CUI value, thereby improving image synthesis accuracy. The target composite image is then determined based on the CUI value, the composite image, and preset CUI conditions. This process can solve the problem of uneven imaging, achieve uniform imaging of defect features, and improve the detection accuracy and efficiency of the workpiece under test.

[0072] Please refer to Figure 2 , Figure 2This is a flowchart illustrating step S102 provided in an embodiment of this application. In some embodiments, step S102 includes, but is not limited to, steps S201 and S203.

[0073] Step S201: Generate a weight matrix based on multiple workpiece images;

[0074] It should be noted that the weight matrix includes multiple matrix elements, each of which corresponds to a workpiece image.

[0075] Step S202: The workpiece image is weighted and biased by the matrix elements in the weight matrix to obtain multiple biased images.

[0076] Step S203: Determine multiple bias channels based on the bias image, and perform image synthesis on the bias image and the bias channels to obtain a composite image.

[0077] In steps S201 to S203 of some embodiments, a weight matrix is ​​randomly generated based on multiple workpiece images, and the number of matrix elements in the weight matrix corresponds to the number of workpiece images. The sum of each matrix element is equal to 1. Then, each pixel in the corresponding workpiece image is weighted and biased through the matrix elements to obtain multiple bias images, thereby improving the uniformity of image brightness. The bias channel corresponding to each bias image is determined based on the bias images, and the bias images and bias channels are image synthesized to obtain a new and complete composite image, thereby realizing the image synthesis.

[0078] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating step S202 as provided in an embodiment of this application. In some embodiments, step S202 may include, but is not limited to, steps S301 and S302.

[0079] It should be noted that the matrix elements include weight values.

[0080] Step S301: Obtain the image grayscale value of each workpiece image;

[0081] Step S302: For each workpiece image, the grayscale value of the image is weighted and biased based on a preset offset value and weight value to obtain multiple biased images.

[0082] In steps S301 to S302 of some embodiments, during the weighted bias calculation process, it is necessary to first obtain the original image grayscale value of each workpiece image, and then perform weighted bias processing on the grayscale value of each workpiece image based on the preset offset value and weight value to obtain multiple biased images, thereby reducing the grayscale value of the brighter parts of the workpiece image and increasing the grayscale value of the darker parts, thus improving the overall image brightness uniformity.

[0083] Please refer to Figure 4 , Figure 4 This is a flowchart illustrating step S302 as provided in an embodiment of this application. In some embodiments, step S302 may include, but is not limited to, steps S401 and S403.

[0084] Step S401: Determine the image weight value and the image offset value corresponding to the workpiece image;

[0085] Step S402: Weight the image grayscale value according to the image weight value and the image offset value to obtain the target grayscale value;

[0086] Step S403: Adjust the brightness of the workpiece image according to the target grayscale value to obtain an offset image.

[0087] In steps S401 to S403 of some embodiments, an image weight value corresponding to the workpiece image is determined in the matrix elements, and an image offset value corresponding to the workpiece image is determined in the preset offset value. Then, the image grayscale value is weighted and offset according to the image weight value and the image offset value to obtain the target grayscale value. Finally, the brightness of the workpiece image is adjusted according to the target grayscale value, so that the grayscale value of the brighter parts of the workpiece image is reduced and the grayscale value of the darker parts is increased. This process is repeated for each workpiece image, and weighted offset processing is performed to obtain multiple offset images with uniform brightness.

[0088] It should be noted that the specific weighted bias calculation process is shown in the following formula (1):

[0089] y = a1*x + b1 (1)

[0090] Where a1 represents the image weight value, b1 represents the image offset value, x represents the image gray value, and y is the target gray value after weighted bias.

[0091] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating step S203 as provided in an embodiment of this application. In some embodiments, step S203 may include, but is not limited to, steps S501 and S503.

[0092] Step S501: Obtain the pixels of the bias image;

[0093] Step S502: Sort the bias images to obtain the bias sequence;

[0094] Step S503: Add the pixels and the bias channel according to the bias sequence to obtain the composite image.

[0095] In steps S501 to S503 of some embodiments, during the image synthesis process, it is first necessary to obtain each pixel of the bias image, then sort the bias image to obtain the bias sequence, so as to avoid the image order disorder during the synthesis process, which would lead to the disorder of the synthesized image area. Finally, the pixel and the bias channel corresponding to each bias image are added according to the bias sequence to obtain the synthesized image.

[0096] It should be noted that the coefficients multiplied by each pixel in the bias image will not exceed 1, and the overall pixel grayscale value will not exceed 255, thereby avoiding data overflow.

[0097] Please refer to Figure 6 , Figure 6 This is a flowchart illustrating step S103 provided in an embodiment of this application. In some embodiments, step S103 includes, but is not limited to, steps S601 and S606.

[0098] Step S601: Perform feature marking on the overall image to obtain defect feature information;

[0099] In some embodiments, a prominent feature is defined in the overall image, and the overall image is marked with features to obtain defect feature information, which facilitates subsequent calculation of defect features.

[0100] Step S602: Determine the feature width, feature height, and center point coordinates based on the defect feature information;

[0101] In some embodiments, the feature width, feature height, and center point coordinates of the original defect feature are first determined based on the defect feature information of the overall image, and are denoted as w0, h0, and (x0, y0).

[0102] Step S603: Perform grayscale binarization on the composite image to obtain the first defect feature information of the composite image;

[0103] In some embodiments, the composite image obtained in step S503 is subjected to grayscale binarization to highlight the defect features in the composite image, thereby obtaining the first defect feature information and improving the efficiency of defect feature finding.

[0104] Step S604: The first defect feature information is segmented by a threshold based on a preset spot tool to obtain the second defect feature information;

[0105] In some embodiments, the first defect feature information is segmented by a preset blob tool to obtain the second defect feature information. In the process of threshold segmentation, the area of ​​the composite image needs to be combined for segmentation, and the segmented results are filtered to obtain the second defect feature information.

[0106] Step S605: Determine the width of the synthesized feature, the height of the synthesized feature, and the coordinates of the synthesized center point based on the second defect feature information;

[0107] In some embodiments, the composite feature width w1, composite feature height h1, and composite center point coordinates (x1, y1) are determined based on the second defect feature information. This facilitates subsequent crossover ratio (CRR) calculations.

[0108] Step S606: Calculate the intersection-union ratio (IUGR) of the feature width, feature height, center point coordinates, composite feature width, composite feature height, and composite center point coordinates to obtain the IUGR value.

[0109] In some embodiments, the intersection-union ratio of the second defect feature information and the defect feature information is calculated based on the width, height and coordinate points, thereby determining whether the synthesized image meets the standard and achieving uniform defect feature imaging.

[0110] Please refer to Figure 7 , Figure 7 This is a flowchart illustrating step S104 as provided in an embodiment of this application. In some embodiments, step S104 includes, but is not limited to, steps S701 and S702.

[0111] Step S701: Compare the crossover-union ratio with the preset crossover-union ratio conditions;

[0112] Step S702: If the crossover-union ratio satisfies the crossover-union ratio condition, determine the target composite map based on the composite map.

[0113] In steps S701 to S702 of some embodiments, the cross-union ratio is compared with the preset cross-union ratio conditions. If the cross-union ratio meets the cross-union ratio conditions, it indicates that the composite image has reached the specified specifications and can be directly used as the target composite image.

[0114] It should be noted that the intersection-union ratio conditions can be set by the user according to their needs, and this embodiment does not impose specific restrictions.

[0115] Please refer to Figure 8 , Figure 8 This is a flowchart illustrating step S104 according to another embodiment of this application. In some embodiments, step S104 includes, but is not limited to, step S703.

[0116] Step S703: If the crossover-union ratio does not meet the crossover-union ratio condition, continue to perform weighted bias processing on multiple workpiece images to obtain an iterative crossover-union ratio until the iterative crossover-union ratio meets the crossover-union ratio condition.

[0117] In some embodiments, during the comparison of the cross-union ratio with the preset cross-union ratio conditions, if the cross-union ratio does not meet the cross-union ratio conditions, it indicates that the composite image at this time does not meet the specified specifications. In this case, it is necessary to repeat steps S102-S103, that is, to continue to perform weighted bias processing on multiple workpiece images and continuously iterate and optimize the weights until the iterative cross-union ratio meets the cross-union ratio conditions. The iterative composite image corresponding to the iterative cross-union ratio is then used as the target composite image.

[0118] Please see Figure 9 This application also provides a multi-channel image synthesis apparatus that can implement the above-described multi-channel image synthesis method. The apparatus includes:

[0119] The image acquisition module 801 is used to illuminate at least a portion of the workpiece to be tested each time and to acquire images of the workpiece to be tested, thereby obtaining multiple workpiece images. The workpiece images include an overall image of the workpiece to be tested that is illuminated and acquired.

[0120] The weighted bias module 802 is used to perform weighted bias processing on multiple workpiece images to obtain multiple biased images and a composite image.

[0121] The intersection-over-union (IoU) calculation module 803 is used to calculate the IoU of the composite image and the overall image to obtain the IoU value.

[0122] The target determination module 804 is used to determine the target composite image based on the cross-union ratio, the composite image, and preset cross-union ratio conditions.

[0123] The multi-channel image synthesis apparatus of this application embodiment is used to execute the multi-channel image synthesis method in the above embodiments. Its specific processing procedure is the same as that of the multi-channel image synthesis method in the above embodiments, and will not be described in detail here.

[0124] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, which, when executed by the processor, is used by the processor to perform the multi-channel image synthesis method described above in this application.

[0125] Reference Figure 10 , Figure 10 This is a schematic diagram of the hardware structure of the computer device provided in the embodiments of this application.

[0126] The following is combined with Figure 10 The hardware structure of the computer device is described in detail. The computer device includes: a processor 910, a memory 920, an input / output interface 930, a communication interface 940, and a bus 950.

[0127] The processor 910 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application.

[0128] The memory 920 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 920 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and called and executed by the processor 910 using the multi-channel image synthesis method of the embodiments of this application.

[0129] The input / output interface 930 is used to implement information input and output;

[0130] The communication interface 940 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and the bus 950 is used to transmit information between the various components of the device (such as processor 910, memory 920, input / output interface 930 and communication interface 940).

[0131] The processor 910, memory 920, input / output interface 930 and communication interface 940 are connected to each other within the device via bus 950.

[0132] This application also provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the computer is used to perform the multi-channel image synthesis method as described in the above embodiments of this application.

[0133] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0134] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0135] It will be understood by those skilled in the art that Figures 1 to 8 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0137] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0138] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0139] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0143] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A multi-channel image synthesis method, characterized in that, The method includes: Step S1: Illuminate at least a portion of the workpiece to be tested each time and acquire images of the workpiece to be tested to obtain multiple workpiece images, wherein the workpiece images include an overall image acquired by illuminating the entire workpiece to be tested. Step S2: Perform weighted bias processing on multiple workpiece images to obtain multiple biased images and a composite image; Step S3: Calculate the intersection-union ratio (IUR) of the synthesized image and the overall image to obtain the IUR value; Step S4: Determine the target composite image based on the intersection-union ratio, the composite image, and the preset intersection-union ratio conditions; Step S2: Weighted bias processing is performed on multiple workpiece images to obtain multiple biased images and a composite image, including: Step S2.1: Generate a weight matrix based on the multiple workpiece images, wherein the weight matrix includes multiple matrix elements, and each matrix element corresponds to one of the workpiece images; Step S2.2: Perform weighted bias processing on the workpiece image using the matrix elements in the weight matrix to obtain multiple biased images; Step S2.3: Determine multiple bias channels based on the bias image, and perform image synthesis on the bias image and the bias channels to obtain a composite image; The matrix elements include weight values; step S2.2: weighting the workpiece image using the matrix elements in the weight matrix to obtain multiple biased images, including: Step S2.2.1: Obtain the image grayscale value of each workpiece image; Step S2.2.2: For each workpiece image, the grayscale value of the image is weighted and biased based on a preset offset value and the weight value to obtain multiple biased images; Step S2.2.2: The weighted bias processing of the image grayscale values ​​based on the preset offset value and the weight value to obtain multiple biased images includes: Step S2.2.2.1: Determine the image weight value and the image offset value corresponding to the workpiece image; Step S2.2.2.2: Weight the image grayscale value according to the image weight value and the image offset value to obtain the target grayscale value; Step S2.2.2.3: Adjust the brightness of the workpiece image according to the target grayscale value to obtain the offset image; Step S2.3: Image synthesis is performed on the bias image and the bias channel to obtain a composite image, including: Step S2.3.1: Obtain the pixels of the bias image; Step S2.3.2: Sort the bias images to obtain a bias sequence; Step S2.3.3: Add the pixel points and the bias channels according to the bias sequence to obtain the composite image.

2. The multi-channel image synthesis method according to claim 1, characterized in that, Step S3: Calculate the intersection-union ratio (IUR) of the synthesized image and the overall image to obtain the IUR value, including: Feature labeling is performed on the overall image to obtain defect feature information; The feature width, feature height, and center point coordinates are determined based on the defect feature information. The composite image is subjected to grayscale binarization to obtain the first defect feature information of the composite image; The first defect feature information is segmented by a preset spot tool to obtain the second defect feature information. The width, height, and coordinates of the synthesized feature center point are determined based on the second defect feature information. The intersection-union ratio (IUGR) is calculated for the feature width, feature height, center point coordinates, composite feature width, composite feature height, and composite center point coordinates to obtain the IUGR value.

3. The multi-channel image synthesis method according to claim 1, characterized in that, Step S4: Determining the target composite image based on the intersection-union ratio, the composite image, and the preset intersection-union ratio conditions, including: The intersection-union ratio is compared with the preset intersection-union ratio condition; If the cross-union ratio satisfies the cross-union ratio condition, the target composite graph is determined based on the composite graph; If the crossover-union ratio does not meet the crossover-union ratio condition, the weighted bias processing is continued on multiple workpiece images to obtain an iterative crossover-union ratio until the iterative crossover-union ratio meets the crossover-union ratio condition.

4. A multi-channel image synthesis apparatus, performing the multi-channel image synthesis method according to any one of claims 1-3, characterized in that, The device includes: The image acquisition module is used to illuminate at least a portion of the workpiece to be tested each time and acquire images of the workpiece to be tested, thereby obtaining multiple workpiece images, wherein the workpiece images include an overall image obtained by illuminating the entire workpiece to be tested. The weighted bias module is used to perform weighted bias processing on multiple workpiece images to obtain multiple biased images and a composite image; The intersection-over-union (IoU) ratio calculation module is used to calculate the IoU ratio of the composite image and the overall image to obtain the IoU ratio value. The target determination module is used to determine the target composite image based on the intersection-union ratio, the composite image, and preset intersection-union ratio conditions.

5. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is used to perform the multi-channel image synthesis method as described in any one of claims 1 to 3.

6. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by the computer, the computer is used to perform the multi-channel image synthesis method as described in any one of claims 1 to 3.