An image dodging method, device, equipment and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 深圳市壹倍科技有限公司
- Filing Date
- 2025-04-17
- Publication Date
- 2026-06-26
Smart Images

Figure CN120339088B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image homogenization method, apparatus, device, and medium. Background Technology
[0002] With the continuous development of automated production lines and high-precision measurement technologies, optical measurement systems have been widely applied in various fields such as electronics manufacturing, semiconductor industry, automotive industry, and precision instrument manufacturing. Especially in the manufacturing process of MicroLED displays, optical inspection plays a crucial role in evaluating product quality and performance, achieving large field-of-view inspection through moving microscopes and stitching. However, as product accuracy requirements increase, the non-uniformity of illumination distribution has become a significant factor affecting measurement results.
[0003] Traditional optical measurement methods typically rely on fixed light source distributions, making it difficult to adapt to the needs of different product shapes and surface characteristics. Even by adjusting the light source angle or intensity, uneven illumination or shadow areas still interfere with the measurement results, thus affecting the accuracy and reliability of image measurements. Therefore, how to achieve uniform illumination and eliminate shadow interference to improve image measurement accuracy is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] Therefore, in order to address the above-mentioned technical problems, this invention provides an image uniform illumination method, apparatus, device, and medium that can achieve uniform illumination and eliminate shadow interference, thereby improving the measurement accuracy of images.
[0005] A first aspect of this application provides an image homogenization method, the image homogenization method comprising:
[0006] Acquire all microscopic images of the object under test;
[0007] Shadow correction processing is performed on all the microscopic images to obtain all target microscopic images;
[0008] All the target microscopic images are stitched together to obtain a target fused image of a preset target size;
[0009] The target fused image is subjected to curve fitting processing to obtain a target uniform light image;
[0010] Based on the target uniform light image, the image detection result of the object to be tested is determined.
[0011] A second aspect of this application provides an image homogenizing device, the image homogenizing device comprising:
[0012] The acquisition module is used to acquire all microscopic images of the object under test;
[0013] The processing module is used to perform shadow correction processing on all the microscopic images to obtain all target microscopic images; to perform stitching processing on all the target microscopic images to obtain a target fused image of a preset target size; and to perform curve fitting processing on the target fused image to obtain a target uniform light image.
[0014] The detection module is used to determine the image detection result of the object to be tested based on the target uniformly illuminated image.
[0015] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the image homogenization method as described in the first aspect.
[0016] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the image homogenization method as described in the first aspect.
[0017] In summary, this invention provides an image homogenization method, apparatus, device, and medium. It acquires all microscopic images of the object under test, performs shadow correction processing on all microscopic images to obtain all target microscopic images, stitches all target microscopic images to obtain a target fused image of a preset target size, performs curve fitting processing on the target fused image to obtain a target homogenized image, and determines the image detection result of the object under test based on the target homogenized image. As can be seen, this application performs shadow correction, stitching, and curve fitting processing on all acquired microscopic images to obtain a target homogenized image, and then determines the image detection result of the object under test based on the target homogenized image. This solves the imaging problem caused by uneven illumination in the prior art, ensuring uniform illumination and eliminating shadow interference in the final image, effectively improving the measurement accuracy of the image. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic flowchart of an image homogenization method provided in an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram of a target homogenized image in an image homogenization method provided in an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram of the structure of an image homogenizing device provided in an embodiment of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0024] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0025] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," or "in response to determination." Similarly, the phrase "if determined" or "if matched to [described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once matched to [described condition or event]," or "in response to matched to [described condition or event]."
[0027] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0029] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0030] This invention relates to optical measurement and image processing technologies, particularly a method for uniform illumination in microscopic image stitching to improve the accuracy of product measurement. Specifically, this invention is applicable to optical inspection systems in automated production lines, especially in fields requiring high-precision measurement and surface quality inspection, necessitating large-scale microscopic inspection and image stitching, such as electronics manufacturing, the semiconductor industry, the automotive industry, and precision instrument manufacturing. This method effectively eliminates the interference of uneven illumination on measurement results and is widely used in dimensional inspection, surface defect detection, and illumination optimization in other optical measurement systems. Especially in the field of optical inspection for MicroOLED (micro-light-emitting diode) displays, this invention optimizes illumination distribution through shading correction and curve fitting uniform illumination techniques, improving the measurement accuracy and reliability of photoluminescence (PL) signals. It is widely applied in surface defect detection, optical characteristic evaluation, and resolution testing during MicroOLED manufacturing processes.
[0031] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0032] See Figure 1 This is a schematic flowchart of an image homogenization method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, this image homogenization method can be implemented through the following steps.
[0033] S101: Acquire all microscopic images of the object under test.
[0034] In step S101, the object to be tested can be any product that requires surface defect detection. The specific type of the object to be tested is not limited in this embodiment. For example, the object to be tested can be a curved surface product or a flat surface product. All microscopic images are images of the object to be tested acquired by the visual inspection device. Based on the characteristics and requirements of the object to be tested, a suitable microscopic imaging technique is selected, such as an optical microscope, scanning electron microscope (SEM), or transmission electron microscope (TEM). By determining the microscope's magnification, resolution, illumination conditions, and other parameters, high-quality microscopic images are obtained. The object to be tested is placed under the microscope, and the focal length and illumination conditions are adjusted to acquire all microscopic images of the object to be tested.
[0035] In this embodiment of the application, by acquiring all microscopic images of the object under test, a more comprehensive understanding of the image information of all microscopic images can be obtained, so that rapid image processing can be performed on all microscopic images in the future, thereby further improving the accuracy of the image measurement results.
[0036] S102: Perform shadow correction processing on all the microscopic images to obtain all target microscopic images.
[0037] In step S102, the target microscopic image is the image after the influence of shadow areas has been eliminated. The microscopic image is read using an image processing library (such as OpenCV, PIL, or scikit-image) and necessary preprocessing is performed, such as grayscale conversion and denoising. The shadow areas in the microscopic image are analyzed, typically involving analysis of image brightness and contrast, as well as possible edge detection. Thresholding segmentation, morphological operations, or machine learning algorithms can be used to identify shadow areas; this application does not impose any limitations on these methods. Once the shadow areas are identified, various methods such as global correction or local correction can be used for shadow correction processing, thereby obtaining all target microscopic images.
[0038] In one embodiment of the invention, shadow correction processing is performed on all microscopic images to obtain all target microscopic images, including:
[0039] Each of the microscopic images is sequentially subjected to a first shadow correction process to obtain all first shadow corrected images;
[0040] The second shadow correction process is performed sequentially on each of the first shadow correction images to obtain all second shadow correction images, wherein all second shadow correction images are all target microscopic images.
[0041] Specifically, all microscopic images are read using image processing libraries (such as OpenCV, PIL, scikit-image, etc.) and stored in a list. Two empty lists are initialized: one to store the first shading-corrected image and the other to store the second shading-corrected image (i.e., the target microscopic image). The list storing microscopic images is traversed, and the first shading correction processing is applied to each microscopic image. This can include global or local brightness / contrast adjustment, histogram equalization, Retinex algorithm, etc., which means that a normalized defocused image can be captured by using a white paper or diffuser as a background. The formula for the first shadow correction, used as a correction parameter, is:
[0042]
[0043] in, Represented as a normalized defocused image, Represented as a microscopic image, This is represented as the first shading-corrected image. This process is repeated until all first shading-corrected images are obtained and added to a list of first shading-corrected images. Then, the list of stored first shading-corrected images is traversed, and a second shading correction process is applied to each image. This can be a different correction method than the first stage, or a further optimization based on the results of the first stage. The re-corrected image is then added to the list of second shading-corrected images. These images constitute the target microscopic image. Through these two stages of shading correction processing, the problems of shadows and uneven illumination in the image can be more effectively resolved, gradually improving image quality and thus enhancing the accuracy of subsequent image analysis.
[0044] In one embodiment of the invention, each first shadow-corrected image undergoes a second shadow-correction process, including:
[0045] N real-time image regions are sequentially divided from the center to the edge of the first shadow-corrected image, with no overlap between adjacent real-time image regions, where N is a positive integer greater than or equal to 2;
[0046] Calculate the average light intensity of all pixels in each of the real-time image regions;
[0047] The average light intensity of all pixels in each real-time image region is interpolated to obtain a light intensity non-uniformity image.
[0048] The light intensity non-uniformity image is normalized to obtain a normalized light intensity non-uniformity image.
[0049] Based on the normalized light intensity non-uniformity image, the first shadow correction image is subjected to second shadow correction processing.
[0050] Specifically, N is a positive integer greater than or equal to 2. The N real-time image regions can be divided sequentially from the center to the edge of the first shadow-corrected image, or sequentially from the edge to the center of the first shadow-corrected image, and then numbered sequentially from 1 to N. The division order and numbering of these real-time image regions must correspond one-to-one with the division order and numbering of the sample image regions, and the interval between two adjacent real-time image regions is the same as the interval between two adjacent sample image regions with the same number. By determining the center point of the first shadow-corrected image, the boundary from the center to the edge of each region is calculated based on the image's width and height, and the required number of N regions. This can be achieved by dividing the image into concentric rings (for circular images) or rectangular strips (for rectangular images), ensuring no overlap between adjacent regions. For each real-time image region, all its pixels are traversed, and the average light intensity is calculated using the following formula:
[0051]
[0052] Where A represents a local window region, It is expressed as the average value of light intensity.
[0053] Furthermore, by using interpolation algorithms (such as linear interpolation, bilinear interpolation, or more advanced interpolation methods) to calculate the light intensity values of pixels not directly contained in the real-time image region, a light intensity non-uniformity image is generated. In this image, the value of each pixel represents the degree of light intensity non-uniformity at that location. The light intensity non-uniformity image is then normalized by scaling the pixel values to a specific range (e.g., 0 to 1), which helps with numerical stability and comparison in subsequent processing. This results in a normalized light intensity non-uniformity image, which is calculated using the following formula:
[0054]
[0055] in, This is represented as a normalized image of light intensity non-uniformity. Based on this normalized image, a second shadow correction process is applied to the first shadow correction image to adjust the light intensity of each pixel. This can be achieved by directly modifying pixel values or using more complex image processing algorithms (such as adaptive histogram equalization, Retinex algorithm, etc.). The formula for this second shadow correction is:
[0056]
[0057] in, This is represented as a normalized image of light intensity non-uniformity. This is represented as the first shadow-corrected image. This is represented as the second shadow-corrected image, and so on, until all second shadow-corrected images are obtained. By dividing multiple real-time image regions and calculating the average light intensity, the unevenness of illumination in the image can be captured more accurately. Reducing or eliminating the unevenness of illumination in the image can significantly improve the image quality, making the details in the image clearer and providing a better foundation for subsequent image analysis or image detection.
[0058] It should be noted that the real-time image region can be rectangular, triangular, or trapezoidal, and this application does not limit it. Specifically, the shape of the real-time image region needs to match the shape of the sample image region.
[0059] In this embodiment, by performing shadow correction processing on all microscopic images to obtain all target microscopic images, the shadow areas in the images can be significantly reduced, the image clarity and contrast can be improved, thereby eliminating the brightness differences caused by shadows in the images, making the image data more accurate and reliable, which helps subsequent image stitching, fusion and other operations, and improves the accuracy and efficiency of image processing.
[0060] S103: Perform stitching processing on all the target microscopic images to obtain a target fusion image of a preset target size.
[0061] In step S103, all target microscopic images are preprocessed, including denoising, contrast enhancement, and resizing, to ensure consistent image quality. Image registration algorithms (such as feature-based registration, frequency-domain-based registration, etc.) are used to determine the relative positional relationships between the images. This typically involves steps such as feature extraction, feature matching, and transform estimation. Based on the registration results, the images are then stitched together. This may require processing overlapping areas between images to ensure visual consistency after stitching. Common stitching methods include linear stitching, weighted average stitching, and multi-band fusion, which are not limited in this application. If the size of the stitched image does not conform to the preset target size, image scaling algorithms (such as bilinear interpolation, bicubic interpolation, etc.) can be used to adjust the image size to generate a target fused image with higher quality, more detail, or better visual effects at the preset target size.
[0062] In one embodiment of the invention, all the target microscopic images are stitched together to obtain a target fused image of a preset target size, including:
[0063] Each of the microscopic images is preprocessed to obtain all preprocessed microscopic images of a preset target size;
[0064] Preprocess multiple regions of the preset splicing template to obtain multiple template images of a preset target size;
[0065] Based on the multiple template images, generate multiple transition region masks of a preset target size;
[0066] Based on the multiple transition region masks, all the target microscopic images are stitched together to obtain a target fused image of a preset target size.
[0067] Specifically, all microscopic images are preprocessed, which typically includes operations such as noise reduction, contrast enhancement, and brightness adjustment to improve image quality. The preprocessed microscopic images are then adjusted to a preset target size, which can be achieved through image scaling algorithms. A preset stitching template is selected from a variety of pre-provided stitching templates. The preset stitching template includes multiple sub-regions, and the region template image corresponding to each sub-region is used to limit the initial stitching position and initial stitching shape of the preprocessed image in that region. By translating the region template, the preprocessed region template is adjusted to the preset target size to ensure consistency with the size of the microscopic image, thereby obtaining the template image corresponding to the region template. The template image is used to limit the target stitching position and target stitching shape of the preprocessed image in that region. Then, based on multiple template images, transition region masks corresponding to the templates are generated. Specifically, the transition mask value for each pixel is calculated based on its pixel coordinates in each template image. These masks are used to smoothly transition overlapping areas of adjacent images during the stitching process. The masks can be created based on the relative positions and shapes between templates to ensure correct application during stitching. Using the generated transition region masks, all target microscopic images are stitched together. During stitching, the overlapping areas of adjacent images are adjusted according to the masks to achieve a smooth transition. Weighted averaging, multi-band fusion, and other methods can be used to further smooth the stitched image; this application does not limit the specific methods used. After stitching, all microscopic images are merged into a target fused image of a preset target size. By preprocessing the microscopic images and template images, diverse image stitching methods can be achieved, significantly improving image quality, reducing stitching gaps and artifacts, thereby improving the accuracy and efficiency of image stitching.
[0068] In this embodiment, by stitching together all the target microscopic images, a target fusion image of a preset target size is obtained, which can significantly expand the field of view, thereby enabling the observation of more detailed information and avoiding the problem of insufficient resolution of a single image, making it more suitable for subsequent image analysis, detection or visualization tasks.
[0069] S104: Perform curve fitting processing on the target fused image to obtain a target uniform light image.
[0070] In step S104, the target microscopic image is the image after addressing the effects of uneven illumination. After obtaining the target fused image, it can be seen that the seams are black, and the entire image has "grid" black stripes. Curve fitting processing is needed to obtain a uniformly illuminated target image. For example... Figure 2 As shown, after obtaining the stitched target fused image, by selecting an appropriate curve fitting method (such as polynomial fitting, nonlinear least squares fitting, etc.), the brightness distribution of the image in the X and Y directions is fitted respectively. During the fitting process, it is necessary to determine the type and order of the fitted curve, as well as the initial parameters of the fitting, etc., to obtain the horizontal brightness distribution curve and the vertical brightness distribution curve. The brightness of the image is adjusted using the fitted curve, and then the horizontal brightness distribution curve and the vertical brightness distribution curve are subjected to X and Y direction homogenization processing respectively to obtain the horizontal homogenized image and the vertical homogenized image, thereby achieving the homogenization effect. It can be seen that this application maps the brightness distribution of the image onto the fitted curve and performs homogenization to obtain the homogenized image.
[0071] In one embodiment of the invention, curve fitting processing is performed on the target fused image to obtain a target uniformly illuminated image, including:
[0072] Curve fitting is performed on the horizontal and vertical pixels of the target fused image respectively to generate horizontal brightness distribution curves and vertical brightness distribution curves;
[0073] Based on the horizontal and vertical brightness distribution curves, the pixels in the horizontal and vertical directions of the target fused image are subjected to image homogenization processing to generate horizontal homogenized images and vertical homogenized images.
[0074] The horizontal homogenization image and the vertical homogenization image are fused to generate the target homogenization image.
[0075] In one embodiment of the invention, the lateral luminance distribution curve and the longitudinal luminance distribution curve are calculated using the following formula:
[0076]
[0077]
[0078] in, Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, Represented as the height of the target fused image, Represented as the width of the target fused image. This is represented as the target fused image.
[0079] Specifically, curve fitting is performed on the pixel values of each row of the target fused image to generate a horizontal brightness distribution curve. A similar curve fitting is performed on the pixel values of each column of the target fused image to generate a vertical brightness distribution curve. This typically involves selecting appropriate fitting functions (such as polynomials, exponential functions, etc.) and fitting methods (such as least squares) to minimize the fitting error. Therefore, the horizontal and vertical brightness distribution curves are calculated using the following formulas:
[0080]
[0081]
[0082] in, Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, Represented as the height of the target fused image, Represented as the width of the target fused image. This is represented as the target fused image. Then, based on the generated horizontal brightness distribution curve, the pixel values of each row of the target fused image are adjusted to eliminate brightness non-uniformity. Based on the vertical brightness distribution curve, the pixel values of each column of the target fused image are adjusted to achieve vertical uniform illumination. This can be achieved by mapping each pixel value to the corresponding brightness value on the fitted curve. The horizontal and vertical uniform illumination images are calculated using the following formulas:
[0083]
[0084]
[0085] in, Represented as a horizontally uniform light image, Represented as the vertically uniform light image, and represented as the height of the target fused image. Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, This is represented as the target fused image. If simultaneous horizontal and vertical image homogenization is required, the horizontal homogenization image and the vertical homogenization image can be fused to generate the target homogenization image, which is calculated using the following formula:
[0086]
[0087] in, The image is represented as the target uniformly illuminated image, and the image is represented as the height of the target fused image. Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, This is represented as the target fused image. By performing curve fitting and homogenization processing on the horizontal and vertical pixels respectively, image distortion caused by uneven illumination can be removed, brightness inhomogeneity in the image can be reduced, and the overall image quality and image processing accuracy can be improved.
[0088] In this embodiment, by performing curve fitting on the target fused image, the brightness distribution of the image can be precisely adjusted, thereby obtaining a uniformly illuminated image of the target and achieving a good uniform illumination effect. This helps to improve the visual effect of the image and the subsequent image detection performance.
[0089] S105: Based on the target uniform light image, determine the image detection result of the object to be tested.
[0090] In step S105, after determining the target uniformly illuminated image, an appropriate image detection algorithm is selected based on the characteristics of the object to be tested and the detection requirements. Common algorithms include template matching-based methods, feature-based methods (such as SIFT, SURF, etc.), and deep learning-based methods (such as convolutional neural networks CNN) to detect the target uniformly illuminated image and identify information such as the position, shape, and size of the object to be tested. For example, defect statistics are performed on the target uniformly illuminated image. If the number of pixels in the defect area is less than a preset threshold for the number of defect pixels, the image detection result of the object to be tested is determined to be qualified; otherwise, it is deemed unqualified.
[0091] In this embodiment, the image detection result of the object under test is determined based on the uniformly illuminated image of the target, which can eliminate the interference caused by uneven illumination, solve the imaging problem caused by uneven illumination in the prior art, and effectively improve the accuracy and efficiency of image detection.
[0092] In summary, this invention provides an image homogenization method, apparatus, device, and medium. It acquires all microscopic images of the object under test, performs shadow correction processing on all microscopic images to obtain all target microscopic images, stitches all target microscopic images to obtain a target fused image of a preset target size, performs curve fitting processing on the target fused image to obtain a target homogenized image, and determines the image detection result of the object under test based on the target homogenized image. As can be seen, this application performs shadow correction, stitching, and curve fitting processing on all acquired microscopic images to obtain a target homogenized image, and then determines the image detection result of the object under test based on the target homogenized image. This solves the imaging problem caused by uneven illumination in the prior art, ensuring uniform illumination and eliminating shadow interference in the final image, effectively improving the measurement accuracy of the image.
[0093] Please see Figure 3 , Figure 3This is a schematic diagram of the image homogenizing device provided in an embodiment of the present invention. This image homogenizing device corresponds one-to-one with the image homogenizing method in the above embodiments. Please refer to [link / reference] for details. Figure 1 as well as Figure 1 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown. See also... Figure 3 The image homogenizing device 30 includes: an acquisition module 31, a processing module 32, and a detection module 33.
[0094] Acquisition module 31 is used to acquire all microscopic images of the object under test;
[0095] Processing module 32 is used to perform shadow correction processing on all the microscopic images to obtain all target microscopic images; to perform stitching processing on all the target microscopic images to obtain a target fused image of a preset target size; and to perform curve fitting processing on the target fused image to obtain a target uniform light image.
[0096] The detection module 33 is used to determine the image detection result of the object to be tested based on the target uniform light image.
[0097] Optionally, the processing module 32 described above is specifically used for:
[0098] Each of the microscopic images is sequentially subjected to a first shadow correction process to obtain all first shadow corrected images;
[0099] The second shadow correction process is performed sequentially on each of the first shadow correction images to obtain all second shadow correction images, wherein all second shadow correction images are all target microscopic images.
[0100] Optionally, the processing module 32 is further configured to:
[0101] N real-time image regions are sequentially divided from the center to the edge of the first shadow-corrected image, with no overlap between adjacent real-time image regions, where N is a positive integer greater than or equal to 2;
[0102] Calculate the average light intensity of all pixels in each of the real-time image regions;
[0103] The average light intensity of all pixels in each real-time image region is interpolated to obtain a light intensity non-uniformity image.
[0104] The light intensity non-uniformity image is normalized to obtain a normalized light intensity non-uniformity image.
[0105] Based on the normalized light intensity non-uniformity image, the first shadow correction image is subjected to second shadow correction processing.
[0106] Optionally, the processing module 32 is further configured to:
[0107] Each of the microscopic images is preprocessed to obtain all preprocessed microscopic images of a preset target size;
[0108] Preprocess multiple regions of the preset splicing template to obtain multiple template images of a preset target size;
[0109] Based on the multiple template images, generate multiple transition region masks of a preset target size;
[0110] Based on the multiple transition region masks, all the target microscopic images are stitched together to obtain a target fused image of a preset target size.
[0111] Optionally, the processing module 32 is further configured to:
[0112] Curve fitting is performed on the horizontal and vertical pixels of the target fused image respectively to generate horizontal brightness distribution curves and vertical brightness distribution curves;
[0113] Based on the horizontal and vertical brightness distribution curves, the pixels in the horizontal and vertical directions of the target fused image are subjected to image homogenization processing to generate horizontal homogenized images and vertical homogenized images.
[0114] The horizontal homogenization image and the vertical homogenization image are fused to generate the target homogenization image.
[0115] Optionally, the processing module 32 is further configured to:
[0116] The horizontal luminance distribution curve and the vertical luminance distribution curve are calculated using the following formula:
[0117]
[0118]
[0119] in, Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, Represented as the height of the target fused image, Represented as the width of the target fused image. This is represented as the target fused image.
[0120] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0121] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. For example... Figure 4 As shown, the electronic device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the diagram), a memory, and a computer program stored in the memory and capable of running on at least one processor, which, when executing the computer program, implements the steps in any of the above-described image homogenization method embodiments.
[0122] This electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 This is merely an example of an electronic device and does not constitute a limitation on electronic devices. Electronic devices may include more or fewer components than shown, or combinations of certain components, or different components, such as network interfaces, displays, and input systems.
[0123] In one embodiment, a computer-readable storage medium is provided that, when the instructions in the computer-readable storage medium are executed by a processor in an electronic device, enables the electronic device to perform the steps of any embodiment of the image homogenization method disclosed in this invention, which will not be repeated here. The computer-readable storage medium may be non-volatile or volatile.
[0124] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0125] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of an electronic device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of an electronic device, or in other embodiments, it can be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the electronic device. Memory is used to store the operating system, cooperative applications, bootloader, data, and other programs, such as program code of computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0126] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. This 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 described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can 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 data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0127] Those familiar with the technical field will understand that, for ease of description and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. 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.
[0128] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An image homogenization method, characterized in that, include: Acquire all microscopic images of the object under test; Shadow correction processing is performed on all the microscopic images to obtain all target microscopic images; All the target microscopic images are stitched together to obtain a target fused image of a preset target size; The brightness distribution of the target fused image is subjected to curve fitting processing to obtain a target uniform light image; Based on the target uniform light image, determine the image detection result of the object to be tested; Among them, shadow correction processing is performed on all the microscopic images to obtain all target microscopic images, including: Each of the microscopic images is sequentially subjected to a first shadow correction process to obtain all first shadow corrected images; The second shadow correction process is performed sequentially on each of the first shadow correction images to obtain all second shadow correction images, wherein all second shadow correction images are all target microscopic images; Each first shadow-corrected image undergoes a second shadow correction process, including: N real-time image regions are sequentially divided from the center to the edge of the first shadow-corrected image, with no overlap between adjacent real-time image regions, where N is a positive integer greater than or equal to 2; Calculate the average light intensity of all pixels in each of the real-time image regions; The average light intensity of all pixels in each real-time image region is interpolated to obtain a light intensity non-uniformity image. The light intensity non-uniformity image is normalized to obtain a normalized light intensity non-uniformity image. Based on the normalized light intensity non-uniformity image, the first shadow correction image is subjected to second shadow correction processing.
2. The image homogenization method as described in claim 1, characterized in that, The step of stitching together all the target microscopic images to obtain a target fused image of a preset target size includes: Each of the microscopic images is preprocessed to obtain all preprocessed microscopic images of a preset target size; Preprocess multiple regions of the preset splicing template to obtain multiple template images of a preset target size; Based on the multiple template images, generate multiple transition region masks of a preset target size; Based on the multiple transition region masks, all the target microscopic images are stitched together to obtain a target fused image of a preset target size.
3. The image homogenization method as described in claim 1, characterized in that, The step of performing curve fitting processing on the brightness distribution of the target fused image to obtain a target uniformly illuminated image includes: Curve fitting is performed on the horizontal and vertical pixels of the target fused image respectively to generate horizontal brightness distribution curves and vertical brightness distribution curves; Based on the horizontal and vertical brightness distribution curves, the pixels in the horizontal and vertical directions of the target fused image are subjected to image homogenization processing to generate horizontal homogenized images and vertical homogenized images. The horizontal homogenization image and the vertical homogenization image are fused to generate the target homogenization image.
4. The image homogenization method as described in claim 3, characterized in that, The horizontal luminance distribution curve and the vertical luminance distribution curve are calculated using the following formula: in, Represented as a horizontal brightness distribution curve, Represented as a longitudinal brightness distribution curve, Represented as the height of the target fused image, Represented as the width of the target fused image. This is represented as the target fused image.
5. An image homogenizing device, characterized in that, include: The acquisition module is used to acquire all microscopic images of the object under test; The processing module is used to perform shadow correction processing on all the microscopic images to obtain all target microscopic images; All the target microscopic images are stitched together to obtain a target fused image of a preset target size; The brightness distribution of the target fused image is subjected to curve fitting processing to obtain a target uniform light image; The detection module is used to determine the image detection result of the object under test based on the target uniformly illuminated image; Among them, shadow correction processing is performed on all the microscopic images to obtain all target microscopic images, including: Each of the microscopic images is sequentially subjected to a first shadow correction process to obtain all first shadow corrected images; The second shadow correction process is performed sequentially on each of the first shadow correction images to obtain all second shadow correction images, wherein all second shadow correction images are all target microscopic images; Each first shadow-corrected image undergoes a second shadow correction process, including: N real-time image regions are sequentially divided from the center to the edge of the first shadow-corrected image, with no overlap between adjacent real-time image regions, where N is a positive integer greater than or equal to 2; Calculate the average light intensity of all pixels in each of the real-time image regions; The average light intensity of all pixels in each real-time image region is interpolated to obtain a light intensity non-uniformity image. The light intensity non-uniformity image is normalized to obtain a normalized light intensity non-uniformity image. Based on the normalized light intensity non-uniformity image, the first shadow correction image is subjected to second shadow correction processing.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the image homogenization method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image homogenization method as described in any one of claims 1 to 4.