Image dodging method, device, equipment and medium
By performing shadow correction, stitching and curve fitting on the microscopic images, uniform images are generated, which solves the problems of light inhomogeneity and shadow interference, and improves the accuracy of image measurement and detection accuracy.
Patent Information
- Application Number
- CN202510486204.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-04-17
AI Technical Summary
In the existing optical measurement methods, the interference of light inhomogeneity and shadowed areas on the measurement results affects the accuracy and reliability of image measurement.
By acquiring the microscopic image of the object to be tested, shadow correction processing, stitching processing and curve fitting processing are performed to generate a target uniform image to eliminate light inhomogeneity and shadow interference.
Improves the accuracy of image measurement and detection accuracy, eliminating the effects of light inhomogeneity and shadow interference.
Smart Images

Figure CN120339088A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image homogenization method, device, equipment and medium. Background Art
[0002] With the continuous development of automated production lines and high-precision measurement technology, optical measurement systems have been widely used in many fields such as electronic manufacturing, semiconductor industry, automotive industry and precision instrument manufacturing. Especially in the manufacturing process of MicroLED displays, optical inspection plays a key role in evaluating the quality and performance of products. It achieves large field of view inspection by moving microscopes for inspection and splicing. However, with the improvement of product precision requirements, the unevenness of light distribution has become an important factor affecting the measurement results.
[0003] Traditional optical measurement methods usually rely on fixed light source distribution, which is difficult to adapt to the needs of different product forms and surface characteristics. Even by adjusting the light source angle or intensity, there is still interference from uneven lighting or shadow areas on the measurement results, thus affecting the accuracy and reliability of image measurement. Therefore, how to achieve uniform lighting, eliminate shadow interference, and thus improve image measurement accuracy is a technical problem that needs to be solved urgently. Summary of the invention
[0004] Based on this, it is necessary to address the above technical problems. The embodiments of the present invention provide an image uniformity method, device, equipment and medium, which can achieve uniform illumination and eliminate shadow interference, thereby improving the measurement accuracy of the image.
[0005] A first aspect of an embodiment of the present application provides an image light homogenization method, the image light homogenization method comprising: Acquire all microscopic images of the object to be tested; Performing shadow correction processing on all the microscopic images to obtain all target microscopic images; Performing stitching processing on all the target microscopic images to obtain a target fused image of a preset target size; Performing curve fitting processing on the target fusion image to obtain a target homogenization image; Based on the target uniform light image, an image detection result of the object to be detected is determined.
[0006] A second aspect of an embodiment of the present application provides an image light homogenization device, the image light homogenization device comprising: An acquisition module, used for acquiring all microscopic images of the object to be tested; A processing module for performing shadow correction processing on all the microscopic images to obtain all target microscopic images; performing stitching processing on all the target microscopic images to obtain a target fusion image of a preset target size; performing curve fitting processing on the target fusion image to obtain a target uniform illumination image; A detection module for determining an image detection result of the object to be measured based on the target uniform illumination image.
[0007] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the image uniform illumination method described in the first aspect is implemented.
[0008] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image uniform illumination method described in the first aspect is implemented.
[0009] In summary, the present invention provides an image uniform illumination method, apparatus, device, and medium. All microscopic images of the object to be measured are obtained, shadow correction processing is performed on all the microscopic images to obtain all target microscopic images, stitching processing is performed on all the target microscopic images to obtain a target fusion image of a preset target size, curve fitting processing is performed on the target fusion image to obtain a target uniform illumination image, and an image detection result of the object to be measured is determined based on the target uniform illumination image. It can be seen that the present application performs shadow correction processing, stitching processing, and curve fitting processing on all the acquired microscopic images to obtain a target uniform illumination image, and then determines the image detection result of the object to be measured according to the target uniform illumination image, thereby solving the imaging problem caused by uneven illumination in the prior art, making the finally obtained image have uniform illumination and eliminating shadow interference, and effectively improving the measurement accuracy of the image. Description of the Drawings
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.
[0011] Figure 1 is a flowchart of an image uniform illumination method provided by an embodiment of the present invention; Figure 2 is a schematic diagram of a target uniform illumination image in an image uniform illumination method provided by an embodiment of the present invention; Figure 3It is a schematic structural diagram of an image equalization device provided by an embodiment of the present invention; Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0012] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0013] It should be understood that when used in the specification and appended claims of the present invention, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0014] It should also be understood that the term "and / or" used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0015] As used in the specification and appended claims of the present invention, the term "if" can be interpreted as "when", "once" or "in response to determining" according to the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is compared" can be interpreted as meaning "once it is determined" or "in response to determining" or "once [the described condition or event] is compared" or "in response to comparing [the described condition or event]" according to the context.
[0016] In addition, in the description of the specification and appended claims of the present invention, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0017] References to "one embodiment" or "some embodiments" etc. described in the specification of the present invention mean that specific features, structures, or characteristics described in connection with that embodiment are included in one or more embodiments of the present invention. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.
[0018] It should be understood that the magnitudes of the sequence numbers of the steps in the following embodiments do not mean the order of execution is prior or subsequent. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0019] The present invention relates to optical measurement and image processing technologies, especially a method for uniform illumination of stitched microscope images applied to improve the measurement accuracy of products. Specifically, the present invention is applicable to optical detection systems in automated production lines, especially in fields that require high-precision measurement and surface quality detection, where large-scale microscopic detection and image stitching are needed, such as electronic manufacturing, semiconductor industry, automotive industry, precision instrument manufacturing, etc. This method can effectively eliminate the interference of uneven illumination on the measurement results and is widely used in illumination optimization in dimensional inspection, surface defect detection, and other optical measurement systems. Especially in the field of optical detection of MicrOLED (micro light-emitting diode) displays, the present invention optimizes the illumination distribution through shadow correction and curve fitting uniform illumination technology, improves the measurement accuracy and reliability of photoluminescence (PL) signals, and is widely used in surface defect detection, optical property evaluation, and resolution testing during the manufacturing process of MicrOLED.
[0020] In order to illustrate the technical solution of the present invention, the following specific embodiments are used for illustration.
[0021] See Figure 1 , which is a schematic flowchart of an image uniform illumination method provided by an embodiment of the present invention. As Figure 1 shown, the image uniform illumination method can be implemented through the following steps.
[0022] S101: Obtain all microscopic images of the object to be measured.
[0023] In step S101, the object to be measured can be any product that needs to be subjected to surface defect detection. The specific type of the object to be measured is not limited in this embodiment. For example, the object to be measured can be a curved surface product or a flat surface product. All microscopic images are images of the object to be measured collected by a vision detection device. According to the characteristics and requirements of the object to be measured, a suitable microscopic imaging technique is selected, such as an optical microscope, a scanning electron microscope (SEM), a transmission electron microscope (TEM), etc. By determining parameters such as the magnification, resolution, and illumination conditions of the microscope, high-quality microscopic images are ensured. By placing the object to be measured under the microscope and adjusting the focal length and illumination conditions, all microscopic images of the object to be measured are collected.
[0024] In the embodiment of the present application, by obtaining all microscopic images of the object to be measured, the image information of all microscopic images can be more comprehensively understood, so that subsequent rapid image processing can be performed on all microscopic images, thereby further improving the accuracy of the image measurement result.
[0025] S102: Perform shadow correction processing on all the microscopic images to obtain all target microscopic images.
[0026] In step S102, the target microscopic image is an image after eliminating the influence of the shadow area. 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, denoising, etc. The shadow area in the microscopic image is analyzed, which usually involves the analysis of the image brightness and contrast, and possible edge detection. Threshold segmentation, morphological operations, or machine learning algorithms can be used to identify the shadow area. The present application does not make any limitations in this regard. Once the shadow area is identified, various methods such as global correction or local correction can be used to perform shadow correction processing, thereby obtaining all target microscopic images.
[0027] In an embodiment of the invention, performing shadow correction processing on all the microscopic images to obtain all target microscopic images includes: Performing first shadow correction processing on each of all the microscopic images in sequence to obtain all first shadow correction images; Performing second shadow correction processing on each of all the first shadow correction images in sequence to obtain all second shadow correction images, where all the second shadow correction images are all target microscopic images.
[0028] Specifically, use an image processing library (such as OpenCV, PIL, scikit-image, etc.) to read all microscopic images and store them in a list. Initialize two empty lists, one for storing the first shadow-corrected images and the other for storing the second shadow-corrected images (i.e., the target microscopic images). Traverse the list storing the microscopic images and apply the first shadow correction process to each microscopic image. This can include global or local brightness / contrast adjustment, histogram equalization, Retinex algorithm, etc. That is, a normalized defocused image can be taken with a white paper or a diffuse reflection plate as the background. As the correction parameter, the formula for this first shadow correction is: Where, is expressed as the normalized defocused image, is expressed as the microscopic image, is expressed as the first shadow-corrected image, and so on until all the first shadow-corrected images are obtained and added to the list of the first shadow-corrected images. Traverse the list storing the first shadow-corrected images and apply the second shadow correction process to each first shadow-corrected image. This can be a correction method different from the first stage or a further optimization based on the results of the first stage. Then, add the images after the second correction to the list of the second shadow-corrected images. These images are the target microscopic images. Through the above two-stage shadow correction process, the problems of shadows and uneven illumination in the images can be solved more effectively, gradually improving the image quality and thus enhancing the accuracy of subsequent image analysis.
[0029] In an embodiment of the invention, the second shadow correction process for each first shadow-corrected image includes: Successively divide N real-time image regions between the center and the edge of the first shadow-corrected image, with no overlapping parts between adjacent two real-time image regions, where N is a positive integer greater than or equal to 2; Calculate the average light intensity of all pixel points in each of the real-time image regions; Perform interpolation processing on the average light intensity of all pixel points in each of the real-time image regions to obtain an image of light intensity non-uniformity; Perform normalization processing on the image of light intensity non-uniformity to obtain a normalized image of light intensity non-uniformity; According to the normalized image of light intensity non-uniformity, perform the second shadow correction process on the first shadow-corrected image.
[0030] Specifically, N is a positive integer greater than or equal to 2. The N real-time image regions can be sequentially divided from the center to the edge of the first shadow-corrected image, or sequentially divided from the edge to the center of the first shadow-corrected image, and then numbered 1 - N in sequence. Moreover, the division order and numbering of the real-time image regions must correspond one-to-one with the division order and numbering of the sample image regions. Furthermore, the interval between two adjacent real-time image regions is the same as the interval between two adjacent sample image regions with the same numbering. By determining the center point of the first shadow-corrected image, based on the width and height of the image, as well as the required number of N regions, the boundary from the center to the edge of each region is calculated. 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 pixel points are traversed, and the average value of the light intensity is calculated. This average value is calculated through the following formula: where A represents the local window region, represents the average value of the light intensity.
[0031] Furthermore, by using an interpolation algorithm (such as linear interpolation, bilinear interpolation, or more advanced interpolation methods) to calculate the light intensity values of the pixel points not directly included in the real-time image regions in the image, this will generate an image of light intensity non-uniformity. Among them, the value of each pixel point represents the degree of light intensity non-uniformity at that position. The image of light intensity non-uniformity is normalized, and the pixel values are scaled to a specific range (such as 0 to 1), which helps with numerical stability and comparison in subsequent processing, obtaining the normalized image of light intensity non-uniformity. The normalized image of light intensity non-uniformity is calculated through the following formula: where, represents the normalized image of light intensity non-uniformity. Then, based on the normalized image of light intensity non-uniformity, the first shadow-corrected image is subjected to a second shadow correction process to adjust the light intensity of each pixel point in the first shadow-corrected image. This can be achieved by directly modifying the 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: where, represents the normalized image of light intensity non-uniformity, represents the first shadow-corrected image, It is represented as the second shadow-corrected image, and so on until all the second shadow-corrected images are obtained. By dividing multiple real-time image regions and calculating the average light intensity, the light unevenness in the image can be captured more precisely, reducing or eliminating the light unevenness in the image, which can significantly improve the quality of the image, making the details in the image clearer and providing a better basis for subsequent image analysis or image detection.
[0032] It should be noted that the real-time image region can be rectangular, triangular or trapezoidal, and this application does not make any limitation here. Specifically, the shape of the real-time image region needs to match the shape of the sample image region.
[0033] In this embodiment, by performing shadow correction processing on all microscopic images to obtain all target microscopic images, the shadow regions in the images can be significantly reduced, the clarity and contrast of the images can be improved, thereby eliminating the brightness differences caused by shadows in the images, making the image data more accurate and reliable, which is helpful for subsequent operations such as image stitching and fusion, and improving the accuracy and efficiency of image processing.
[0034] S103: Perform stitching processing on all the target microscopic images to obtain a target fusion image with a preset target size.
[0035] In step S103, preprocess all the target microscopic images, including denoising, enhancing contrast, adjusting size, etc., to ensure the consistency of image quality. Use image registration algorithms (such as feature-based registration, frequency-domain-based registration, etc.) to determine the relative position relationships between the images, which usually involves steps such as feature extraction, feature matching, and transformation estimation. Then, according to the registration results, stitch the images together, which may require processing the overlapping regions between the images to ensure that the stitched image is visually consistent. Commonly used stitching methods include linear stitching, weighted average stitching, multi-band fusion, etc., and this application does not make any limitation here. If the size of the stitched image does not meet 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 fusion image with a preset target size that has higher quality, more details or better visual effects.
[0036] In an embodiment of the invention, performing stitching processing on all the target microscopic images to obtain a target fusion image with a preset target size includes: Preprocess all the microscopic images respectively to obtain all the preprocessed microscopic images with a preset target size; Preprocess multiple region templates in a preset stitching template to obtain multiple template images with a preset target size; Generate multiple transition region masks with a preset target size according to the multiple template images; Perform stitching processing on all the target microscopic images according to the multiple transition region masks to obtain a target fusion image of a preset target size.
[0037] Specifically, preprocess all microscopic images, which usually includes operations such as denoising, enhancing contrast, and adjusting brightness to improve the image quality. Adjust the preprocessed microscopic images to a preset target size, which can be achieved through an image scaling algorithm. Select a preset stitching template from a variety of pre-provided stitching templates. The preset stitching template includes multiple sub-regions, and the regional 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 performing a translation process on the regional template, adjust the preprocessed regional template to the preset target size to ensure consistency with the microscopic image size, and then obtain the template image corresponding to the regional template. The template image is used to limit the target stitching position and target stitching shape of the preprocessed image in that region. Furthermore, generate transition region masks corresponding to the templates based on multiple template images, that is, calculate the transition mask values of each pixel point according to the pixel coordinates of each pixel point in each template image, and generate the transition region mask corresponding to the template image according to the transition mask values of each pixel point. These masks are used to smoothly transition the overlapping regions of adjacent images during the stitching process. The masks can be created based on the relative positions and shapes between the templates to ensure correct application during stitching. By using the generated transition region masks, perform stitching processing on all target microscopic images. During the stitching process, adjust the overlapping regions of adjacent images according to the masks to achieve a smooth transition. Methods such as weighted average and multi-band fusion can be used to further smooth the stitched image. The present application does not make any limitations in this regard. After the stitching processing, merge all microscopic images into a target fusion image of a preset target size. By preprocessing the microscopic images and template images, diverse image stitching can be achieved, significantly improving the image quality, reducing stitching gaps and artifacts, and thus improving the accuracy and efficiency of image stitching.
[0038] In this embodiment, by performing stitching processing on all target microscopic images to obtain a target fusion image of a preset target size, the field of view range can be significantly expanded, so that more detailed information can be observed, avoiding the problem of insufficient resolution of a single image and making it more suitable for subsequent image analysis, detection, or visualization tasks.
[0039] S104: Perform curve fitting processing on the target fusion image to obtain a target uniform illumination image.
[0040] In step S104, the target microscopic image is the image after solving the influence of uneven illumination. After obtaining the target fusion image, it can be seen that the stitching seams are black and there are "grid" black stripes in the whole image. It is necessary to perform curve fitting processing on the target fusion image to obtain a target uniform illumination image. For exampleFigure 2 As shown, after obtaining the spliced target fusion image, by selecting a suitable curve fitting method (such as polynomial fitting, non-linear least squares fitting, etc.), the brightness distributions of the image in the X direction and the Y direction are respectively fitted. During the fitting process, it is necessary to determine the type and order of the fitting 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 curves, and then the horizontal brightness distribution curve and the vertical brightness distribution curve are respectively subjected to equalization processing in the X direction and the Y direction to obtain the horizontal equalized image and the vertical equalized image, thereby achieving the equalization effect. It can be seen that in this application, the brightness distribution of the image is mapped onto the fitting curve and equalized to obtain the equalized image.
[0041] In an embodiment of the invention, performing curve fitting processing on the target fusion image to obtain a target equalized image includes: Performing curve fitting on the pixels in the horizontal and vertical directions of the target fusion image respectively to generate a horizontal brightness distribution curve and a vertical brightness distribution curve; According to the horizontal brightness distribution curve and the vertical brightness distribution curve, performing image equalization processing on the pixels in the horizontal and vertical directions of the target fusion image respectively to generate a horizontal equalized image and a vertical equalized image; Fusing the horizontal equalized image and the vertical equalized image to generate a target equalized image.
[0042] In an embodiment of the invention, the horizontal brightness distribution curve and the vertical brightness distribution curve are calculated by the following formula: Wherein, is expressed as the horizontal brightness distribution curve, is expressed as the vertical brightness distribution curve, is expressed as the height of the target fusion image, is expressed as the width of the target fusion image, is expressed as the target fusion image.
[0043] Specifically, curve fitting is performed on the pixel values of each row of the target fusion image to generate a horizontal brightness distribution curve, and similar curve fitting is performed on the pixel values of each column of the target fusion image to generate a vertical brightness distribution curve. This usually involves selecting a suitable fitting function (such as polynomial, exponential function, etc.) and fitting method (such as least squares method) to minimize the fitting error. It can be seen that the horizontal brightness distribution curve and the vertical brightness distribution curve are calculated by the following formula: Among them, is represented as a horizontal brightness distribution curve, is represented as a vertical brightness distribution curve, is represented as the height of the target fusion image, is represented as the width of the target fusion image, is represented as the target fusion image. Furthermore, according to the generated horizontal brightness distribution curve, the pixel values of each row of the target fusion image are adjusted to eliminate brightness non-uniformity. According to the vertical brightness distribution curve, the pixel values of each column of the target fusion image are adjusted to achieve vertical uniform illumination. This can be achieved by mapping each pixel value to the corresponding brightness value on the fitting curve. The horizontally uniformly illuminated image and the vertically uniformly illuminated image are calculated through the following formula: Among them, is represented as the horizontally uniformly illuminated image, is represented as the vertically uniformly illuminated image, and is represented as the height of the target fusion image, is represented as the horizontal brightness distribution curve, is represented as the vertical brightness distribution curve, is represented as the target fusion image. If it is necessary to perform image uniform illumination processing on both the horizontal and vertical directions simultaneously, the horizontally uniformly illuminated image and the vertically uniformly illuminated image can be fused to generate the target uniformly illuminated image. The target uniformly illuminated image is calculated through the following formula: Among them, is represented as the target uniformly illuminated image, and is represented as the height of the target fusion image, is represented as the horizontal brightness distribution curve, is represented as the vertical brightness distribution curve, is represented as the target fusion image. By respectively performing curve fitting and uniform illumination processing on the horizontal and vertical pixels, the image distortion caused by uneven illumination can be removed, the brightness non-uniformity in the image can be reduced, and the overall quality of the image and the accuracy of image processing can be improved.
[0044] In this embodiment, by performing curve fitting processing on the target fusion image, the brightness distribution of the image can be precisely adjusted, thereby obtaining the target uniformly illuminated image and achieving a good uniform illumination effect. This helps to improve the visual effect of the image and the subsequent image detection performance.
[0045] S105: Based on the target uniformly illuminated image, determine the image detection result of the object to be detected.
[0046] In step S105, after determining the target uniform illumination image, according to the characteristics of the object to be measured and the detection requirements, a suitable image detection algorithm is selected. Common algorithms include template matching-based methods, feature-based methods (such as SIFT, SURF, etc.), and deep learning-based methods (such as convolutional neural network CNN). The target uniform illumination image is detected to identify information such as the position, shape, and size of the object to be measured. For example, defect statistics are performed on the target uniform illumination image. If the number of pixel points in the defect area is less than the preset defect pixel number threshold, the image detection result of the object to be measured is determined to be qualified; otherwise, it is unqualified.
[0047] In this embodiment, based on the target uniform illumination image, the image detection result of the object to be measured is determined, 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.
[0048] In summary, the present invention provides an image uniform illumination method, device, equipment, and medium. All microscopic images of the object to be measured are obtained, all microscopic images are subjected to shadow correction processing to obtain all target microscopic images, all target microscopic images are subjected to stitching processing to obtain a target fusion image of a preset target size, the target fusion image is subjected to curve fitting processing to obtain a target uniform illumination image, and based on the target uniform illumination image, the image detection result of the object to be measured is determined. It can be seen that this application performs shadow correction processing, stitching processing, and curve fitting processing on all the obtained microscopic images to obtain a target uniform illumination image, and then determines the image detection result of the object to be measured according to the target uniform illumination image, thereby solving the imaging problem caused by uneven illumination in the prior art, making the finally obtained image have uniform illumination and eliminating shadow interference, and effectively improving the measurement accuracy of the image.
[0049] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of the image uniform illumination device provided by an embodiment of the present invention. This image uniform illumination device corresponds one-to-one with the image uniform illumination method in the above embodiment. Specifically, please refer to Figure 1 and Figure 1 the relevant descriptions in the corresponding embodiments. For the sake of convenience of description, only the parts related to this embodiment are shown. See Figure 3 , the image uniform illumination device 30 includes: an acquisition module 31, a processing module 32, and a detection module 33.
[0050] The acquisition module 31 is used to acquire all microscopic images of the object to be measured; The processing module 32 is configured to perform shadow correction processing on all the microscopic images to obtain all target microscopic images; perform stitching processing on all the target microscopic images to obtain a target fusion image of a preset target size; perform curve fitting processing on the target fusion image to obtain a target uniform illumination image; The detection module 33 is configured to determine an image detection result of the object to be detected based on the target uniform illumination image.
[0051] Optionally, the above-mentioned processing module 32 is specifically configured to: Perform first shadow correction processing on each of all the microscopic images in sequence to obtain all first shadow correction images; Perform second shadow correction processing on each of all the first shadow correction images in sequence to obtain all second shadow correction images, where all the second shadow correction images are all target microscopic images.
[0052] Optionally, the above-mentioned processing module 32 is further configured to: Divide N real-time image regions in sequence between the center and the edge of the first shadow correction image, and there is no overlapping part between adjacent two real-time image regions, where N is a positive integer greater than or equal to 2; Calculate the average light intensity of all pixel points in each of the real-time image regions; Perform interpolation processing on the average light intensity of all pixel points in each of the real-time image regions to obtain a light intensity non-uniformity image; Perform normalization processing on the light intensity non-uniformity image to obtain a normalized light intensity non-uniformity image; Perform second shadow correction processing on the first shadow correction image according to the normalized light intensity non-uniformity image.
[0053] Optionally, the above-mentioned processing module 32 is further configured to: Perform preprocessing on all the microscopic images respectively to obtain all preprocessed microscopic images of a preset target size; Perform preprocessing on multiple region templates in a preset stitching template to obtain multiple template images of a preset target size; Generate multiple transition region masks of a preset target size according to the multiple template images; Perform stitching processing on all the target microscopic images according to the multiple transition region masks to obtain a target fusion image of a preset target size.
[0054] Optionally, the above-mentioned processing module 32 is further configured to: Perform curve fitting on the pixels of the target fusion image horizontally and vertically respectively to generate a horizontal brightness distribution curve and a vertical brightness distribution curve; According to the horizontal brightness distribution curve and the vertical brightness distribution curve, perform image equalization processing on the pixels in the horizontal and vertical directions of the target fusion image respectively to generate a horizontally equalized image and a vertically equalized image; Fuse the horizontally equalized image and the vertically equalized image to generate a target equalized image.
[0055] Optionally, the above processing module 32 is further configured to: The horizontal brightness distribution curve and the vertical brightness distribution curve are calculated by the following formula: Wherein, is expressed as the horizontal brightness distribution curve, is expressed as the vertical brightness distribution curve, is expressed as the height of the target fusion image, is expressed as the width of the target fusion image, is expressed as the target fusion image.
[0056] It should be noted that for the information interaction, execution process, etc. between the above units, since they are based on the same concept as the method embodiment of the present invention, their specific functions and the technical effects brought about can be specifically referred to in the method embodiment part, and will not be elaborated here.
[0057] Figure 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 4 shown, the electronic device of this embodiment includes: at least one processor ( Figure 4 only one is shown in), a memory, and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, the steps in any of the above image equalization method embodiments are implemented.
[0058] The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that Figure 4 is only an example of an electronic device and does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include a network interface, a display screen, and an input system, etc.
[0059] In one embodiment, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor in the electronic device, the electronic device can execute the steps in any of the embodiments of an image equalization method disclosed in the present invention, which will not be repeated here. The computer-readable storage medium may be non-volatile or volatile.
[0060] The so-called processor may be a CPU, and the processor may 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0061] The memory includes a readable storage medium, internal memory, etc. Among them, the internal memory may be the memory of the electronic device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be the hard disk of the electronic device, and in some other embodiments, it may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory may also include both the internal storage unit and the external storage device of the electronic device. The memory is used to store the operating system, cooperative applications, a boot loader, data, and other programs, such as the program code of a computer program. The memory may also be used to temporarily store the data that has been output or will be output.
[0062] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. This computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0063] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present invention. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0064] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions 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 uniform illumination method, characterized in that, Including: Obtain all microscopic images of the object to be measured; Perform shadow correction processing on all the microscopic images to obtain all target microscopic images; Perform stitching processing on all the target microscopic images to obtain a target fusion image with a preset target size; Perform curve fitting processing on the target fusion image to obtain a target uniform illumination image; Based on the target uniform illumination image, determine the image detection result of the object to be measured.
2. The image equalization method according to claim 1, characterized in that The performing shadow correction processing on all the microscopic images to obtain all target microscopic images includes: Successively perform first shadow correction processing on each of the microscopic images in all the microscopic images to obtain all first shadow correction images; Successively perform second shadow correction processing on each of the first shadow correction images in all the first shadow correction images to obtain all second shadow correction images, where all the second shadow correction images are all target microscopic images.
3. The image uniform illumination method according to claim 2, wherein The performing second shadow correction processing on each of the first shadow correction images includes: Successively divide N real-time image regions between the center and the edge of the first shadow correction image, and there is no overlapping part between adjacent two real-time image regions, where N is a positive integer greater than or equal to 2; Calculate the average light intensity of all pixel points in each of the real-time image regions; Perform interpolation processing on the average light intensity of all pixel points in each of the real-time image regions to obtain a light intensity non-uniformity image; Perform normalization processing on the light intensity non-uniformity image to obtain a normalized light intensity non-uniformity image; According to the normalized light intensity non-uniformity image, perform second shadow correction processing on the first shadow correction image.
4. The image uniform illumination method according to claim 1, characterized in that, The performing stitching processing on all the target microscopic images to obtain a target fusion image with a preset target size includes: Perform preprocessing on all the microscopic images respectively to obtain all preprocessed microscopic images with a preset target size; Perform preprocessing on multiple region templates in a preset stitching template to obtain multiple template images with a preset target size; Generate multiple transition region masks with a preset target size according to the multiple template images; According to the multiple transition region masks, perform stitching processing on all the target microscopic images to obtain a target fusion image with a preset target size.
5. The image uniform illumination method according to claim 1, wherein The performing curve fitting processing on the target fusion image to obtain a target uniform illumination image includes: Perform curve fitting on the pixels in the horizontal and vertical directions of the target fusion image respectively to generate a horizontal brightness distribution curve and a vertical brightness distribution curve; According to the horizontal brightness distribution curve and the vertical brightness distribution curve, perform image uniform illumination processing on the pixels in the horizontal and vertical directions of the target fusion image respectively to generate a horizontal uniform illumination image and a vertical uniform illumination image; Fuse the horizontal uniform illumination image and the vertical uniform illumination image to generate a target uniform illumination image.
6. The image uniform illumination method according to claim 5, wherein The horizontal brightness distribution curve and the vertical brightness distribution curve are calculated by the following formula: Among them, is represented as a horizontal brightness distribution curve, is represented as a vertical brightness distribution curve, represents the height of the target fusion image, represents the width of the target fusion image, represents the target fusion image.
7. An image uniform illumination device, characterized in that, Including: An acquisition module, configured to obtain all microscopic images of the object to be measured; A processing module, configured to perform shadow correction processing on all the microscopic images to obtain all target microscopic images; Perform stitching processing on all the target microscopic images to obtain a target fusion image of a preset target size; Perform curve fitting processing on the target fusion image to obtain a target uniform illumination image; A detection module, configured to determine an image detection result of the object to be detected based on the target uniform illumination image.
8. The image light homogenizing device according to claim 1, characterized in that The processing module is further configured to: Perform first shadow correction processing on each of the microscopic images in all the microscopic images in sequence to obtain all first shadow correction images; Perform second shadow correction processing on each of the first shadow correction images in all the first shadow correction images in sequence to obtain all second shadow correction images, where all the second shadow correction images are all the target microscopic images.
9. 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 uniform illumination method according to any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the image uniform illumination method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Defect detection method, device and equipment and storage medium
CN109671075A
Image depth measurement method based on shadow cue and parallax method
CN113706466A
Image processing method and device and storage medium
CN114972047A
Control method of display device, display device, equipment and computer storage medium
CN115989476A
Image splicing method
CN116596761A
Cited By
Image splicing fusion method and device, electronic equipment and medium
CN121458550A