Image flat field correction method and device and computer readable storage medium

By calculating the non-uniform value of the image and generating a correction coefficient diagram, the complex problem of traditional image flat-field correction methods is solved, and the image brightness uniformity and non-uniformity correction effect is improved.

CN119515754AActive Publication Date: 2025-02-25SHENZHEN SEICHITECH TECHN CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510066292.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-02-25
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

The traditional image flat field correction method is complex, and requires shooting multiple sets of flat field calibration images and calculating grid coefficients, which is difficult to automate and simplify.

Method used

By acquiring the calibration image and the target image, calculating their respective non-uniform values, and generating a target correction coefficient diagram based on the difference values, the image flat field correction is achieved.

Benefits of technology

It reduces the difficulty of parameter debugging, improves debugging efficiency and accuracy, realizes uniformity of image brightness distribution, and significantly improves the inhomogeneity correction effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515754A_ABST
    Figure CN119515754A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image flat field correction method and device and a computer readable storage medium, which are used for reducing the parameter debugging difficulty. The method comprises the steps of obtaining a calibration image and a target image; calculating a first non-uniform value of the calibration image according to the first ROI of the calibration image; calculating a second non-uniform value of the target image according to the second ROI of the target image; calculating a difference value according to the first non-uniform value and the second non-uniform value, wherein the difference value is a ratio of the second non-uniform value to the first non-uniform value; generating a target correction coefficient graph according to the difference value; and performing flat-field correction on the target image according to the target correction coefficient graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to an image flat field correction method, device, and computer-readable storage medium. Background Art

[0002] Lens shading is a common phenomenon in the field of photography and optics, which refers to the situation where the brightness or saturation of the edge of an image is lower than that of the center, and the output value of each pixel in the image deviates from the expected value. This phenomenon is usually caused by the limitations of the camera's aperture and lens, and is considered an undesirable effect. It is necessary to study the precise calibration and correction methods for flat field generation to generate high-quality images.

[0003] The traditional flat field correction method requires taking multiple sets of flat field calibration images and calculating the grid coefficients for each set of images, and finally generating a coefficient map equal to the current image size through interpolation calculation. This method needs to consider multiple shooting factors (exposure time, shooting temperature, etc.), and the calibration process is complicated. Summary of the invention

[0004] The embodiments of the present application provide an image flat-field correction method, device, and computer-readable storage medium, which can reduce the difficulty of parameter debugging.

[0005] A first aspect of an embodiment of the present application provides an image flat field correction method, comprising: Acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; Calculating a first non-uniform value of the calibration image according to a first ROI of the calibration image, wherein the first ROI includes a first central ROI and a first edge ROI, wherein the first central ROI is located at the center of the calibration image, and the first edge ROI is located at four corners of the calibration image, and the first central ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a non-uniform degree between each of the first edge ROIs and the first central ROI; Calculating a second non-uniform value of the target image according to a second ROI of the target image, wherein the second ROI includes a second central ROI and a second edge ROI, wherein the second central ROI is located at the center of the target image, and the second edge ROI is located at four corners of the target image, and the second central ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates a non-uniform degree between each of the second edge ROIs and the second central ROI; Calculate a difference value according to the first non-uniform value and the second non-uniform value, wherein the difference value is a ratio of the second non-uniform value to the first non-uniform value; generating a target correction coefficient map according to the difference value; A flat-field correction is performed on the target image according to the target correction coefficient map.

[0006] Optionally, calculating a first non-uniform value of the calibration image according to a first ROI of the calibration image includes: Calculate the grayscale mean of the first center ROI and the first edge ROI respectively; Taking the ratio of the grayscale mean of the first edge ROI to the grayscale mean of the first center ROI as a first non-uniform value; Calculating a second non-uniform value of the target image according to a second ROI of the target image comprises: Calculate the grayscale mean of the second center ROI and the second edge ROI respectively; The ratio of the grayscale mean value of the second edge ROI to the grayscale mean value of the second center ROI is used as the second non-uniform value.

[0007] Optionally, generating a target correction coefficient map according to the difference value includes: Calculating a correction ratio of each pixel in the calibration image, wherein the correction ratio is a ratio of a grayscale value to a grayscale mean value of the first central ROI; Combining the correction ratios of all pixels in the calibration image into a calibration correction coefficient map; A target correction coefficient map is generated according to the difference value and the calibration correction coefficient map.

[0008] Optionally, generating a target correction coefficient map according to the difference value and the calibration correction coefficient map includes: Generate a basic coefficient map according to the difference value, wherein pixel values ​​of a quarter of the area corresponding to the difference value in the basic coefficient map are all the difference value, and pixel values ​​of the remaining three quarters of the area in the basic coefficient map are all 1; A target correction coefficient map is calculated based on the basic coefficient map and the calibration correction coefficient map.

[0009] Optionally, performing flat field correction on the target image according to the target correction coefficient map includes: The target image is multiplied by the target correction coefficient map to obtain a corrected target image.

[0010] Optionally, before calculating the first non-uniform value of the calibration image according to the first ROI of the calibration image, the method further includes: The shape and size of the first central ROI are determined according to the resolution of the calibration image.

[0011] Optionally, before acquiring the calibration image and the target image, the method further includes: Determine the camera and shooting scene for taking the calibration image; Determining the saturation of the calibration image according to the camera and the shooting scene A second aspect of an embodiment of the present application provides an image flat field correction device, comprising: An acquisition unit, used to acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; a first calculation unit, configured to calculate a first non-uniform value of the calibration image according to a first ROI of the calibration image, wherein the first ROI includes a first central ROI and a first edge ROI, wherein the first central ROI is located at the center of the calibration image, and the first edge ROI is located at four corners of the calibration image, and the first central ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a degree of non-uniformity between each of the first edge ROIs and the first central ROI; a second calculation unit, configured to calculate a second non-uniform value of the target image according to a second ROI of the target image, wherein the second ROI includes a second center ROI and a second edge ROI, wherein the second center ROI is located at the center of the target image, and the second edge ROI is located at four corners of the target image, and the second center ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates a degree of non-uniformity between each of the second edge ROIs and the second center ROI; a third calculating unit, configured to calculate a difference value according to the first non-uniform value and the second non-uniform value, wherein the difference value is a ratio of the second non-uniform value to the first non-uniform value; A generating unit, configured to generate a target correction coefficient map according to the difference value; An execution unit is used to perform flat field correction on the target image according to the target correction coefficient map.

[0012] Optionally, the first computing unit is specifically configured to: Calculate the grayscale mean of the first center ROI and the first edge ROI respectively; Taking the ratio of the grayscale mean of the first edge ROI to the grayscale mean of the first center ROI as a first non-uniform value; The second computing unit is specifically used for: Calculate the grayscale mean of the second center ROI and the second edge ROI respectively; The ratio of the grayscale mean value of the second edge ROI to the grayscale mean value of the second center ROI is used as the second non-uniform value.

[0013] The generating unit comprises: A calculation module, used for calculating a correction ratio of each pixel in the calibration image, wherein the correction ratio is a ratio of a gray value to a gray mean value of the first central ROI; A merging module, used for merging the correction ratios of all pixels in the calibration image into a calibration correction coefficient map; A generating module is used to generate a target correction coefficient map according to the difference value and the calibration correction coefficient map.

[0014] Optionally, the generating module is specifically used for: Generate a basic coefficient map according to the difference value, wherein pixel values ​​of a quarter of the area corresponding to the difference value in the basic coefficient map are all the difference value, and pixel values ​​of the remaining three quarters of the area in the basic coefficient map are all 1; A target correction coefficient map is calculated based on the basic coefficient map and the calibration correction coefficient map.

[0015] Optionally, the execution unit is specifically used for: The target image is multiplied by the target correction coefficient map to obtain a corrected target image.

[0016] Optionally, the device further comprises: The first determining unit is used to determine the shape and size of the first central ROI according to the resolution of the calibration image.

[0017] Optionally, the device further includes a second determining unit, wherein the second unit is configured to: Determine the camera and shooting scene for taking the calibration image; The saturation of the calibration image is determined according to the camera and the shooting scene.

[0018] A third aspect of the embodiment of the present application provides an image flat field correction device, comprising: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method in the first aspect and any possible implementation manner of the first aspect.

[0019] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the computer executes the method in the first aspect and any possible implementation of the first aspect.

[0020] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages: The embodiments of the present application provide quantified non-uniformity data and accurate correction coefficients, making the flat field correction process more automated and data-driven. It reduces manual intervention, simplifies the debugging process, reduces the difficulty that may be encountered when adjusting parameters, and improves debugging efficiency and accuracy. At the same time, it is also possible to generate an accurate correction coefficient map based on the difference value, making the flat field correction process more accurate and able to accurately eliminate non-uniformities in the image. By comparing the non-uniformity differences between the calibration image and the target image, and generating correction coefficients in a targeted manner, the final target image is more uniform in brightness distribution than the uncorrected image, thereby greatly improving the non-uniformity correction effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a flow chart of an embodiment of an image flat field correction method in an embodiment of the present application; Figure 2 In the embodiment of the present application, the target correction coefficient is generated according to the difference value. Figure 1 A schematic diagram of a flow chart of an embodiment; Figure 3 A schematic diagram of a flow chart of an embodiment of determining the shape and size of the first center ROI in an embodiment of the present application; Figure 4 A schematic diagram of a flow chart of an embodiment of determining the saturation of a calibration image in an embodiment of the present application; Figure 5 This is a schematic structural diagram of an embodiment of an image flat field correction device in an embodiment of the present application; Figure 6 Schematic diagram of the structure of an embodiment of an image flat field correction device in the embodiments of the present application. DETAILED DESCRIPTION

[0022] The embodiments of the present application provide an image flat-field correction method, an apparatus, and a computer-readable storage medium, which can reduce the difficulty of parameter debugging.

[0023] The method of the present application can be applied to a server, a terminal or other devices with logic processing capabilities, and the present application does not limit this. For the convenience of description, the following description is made by taking the execution subject as a server as an example.

[0024] The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0025] See also Figure 1 In the embodiment of the present application, an image flat field correction method includes: 101. Acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; The server first obtains the calibration image and the target image. The saturation of the calibration image should be within the preset saturation range to ensure that the image brightness is moderate. The target image is the image to be flat-field corrected, and the resolution of the target image is consistent with the calibration image. This ensures consistency in subsequent processing and avoids additional debugging complexity due to image resolution mismatch.

[0026] 102. Calculate a first non-uniform value of the calibration image according to a first ROI of the calibration image, where the first ROI includes a first center ROI and a first edge ROI, where the first center ROI is located at the center of the calibration image, and the first edge ROI is located at four corners of the calibration image, and the first center ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a non-uniform degree between each first edge ROI and the first center ROI; The server calculates the first non-uniformity value according to the first ROI of the calibration image. The first ROI includes a first center ROI and a first edge ROI. The first center ROI is located at the center of the image, and the first edge ROI is located at the four corners of the image, and the two are the same in size and shape. The calculated first non-uniformity value can quantify the non-uniformity of the image, reduce the subjective deviation that may occur during manual adjustment, and thus simplify the debugging work.

[0027] 103. Calculate a second non-uniform value of the target image according to a second ROI of the target image, where the second ROI includes a second central ROI and a second edge ROI, where the second central ROI is located at the center of the target image, and the second edge ROI is located at the four corners of the target image, and the second central ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates a non-uniform degree between each second edge ROI and the second central ROI; The server calculates a second non-uniformity value based on a second ROI of the target image. The second ROI also includes a second center ROI and a second edge ROI, which are the same size and shape as the first ROI. The second non-uniformity value quantifies the non-uniformity of the target image by comparing the difference between the center and edge ROIs, providing accurate data so that subsequent debugging can rely more on data rather than manual intervention.

[0028] 104. Calculate a difference value according to the first non-uniform value and the second non-uniform value, where the difference value is a ratio of the second non-uniform value to the first non-uniform value; The server calculates a difference value according to the first non-uniform value and the second non-uniform value, where the difference value is the ratio of the second non-uniform value to the first non-uniform value, and the ratio reflects the non-uniformity difference between the calibration image and the target image.

[0029] 105. Generate a target correction coefficient map according to the difference value; The server generates a target correction coefficient map based on the calculated difference values. The coefficient map provides a correction coefficient for each pixel of the target image to compensate for the non-uniformity in the image.

[0030] 106. Perform flat field correction on the target image according to the target correction coefficient map.

[0031] The server performs flat field correction on the target image according to the target correction coefficient map. Flat field correction eliminates non-uniformity in the target image by applying these correction coefficients, thereby improving the image quality.

[0032] In this embodiment, the server provides quantitative non-uniformity data and accurate correction coefficients, making the flat field correction process more automated and data-driven. It reduces manual intervention, simplifies the debugging process, reduces the difficulty that may be encountered when adjusting parameters, and improves debugging efficiency and accuracy. At the same time, it is also possible to generate an accurate correction coefficient map based on the difference value, making the flat field correction process more accurate and able to accurately eliminate non-uniformity in the image. By comparing the non-uniformity difference between the calibration image and the target image, and generating correction coefficients in a targeted manner, the target image finally obtained is more uniform in brightness distribution than the uncorrected image, thereby greatly improving the non-uniformity correction effect.

[0033] Further, in some embodiments of the present application, step 102 in the above embodiment of calculating the first non-uniform value of the calibration image according to the first ROI of the calibration image may include the following steps: 1021. Calculate the grayscale mean of the first center ROI and the first edge ROI respectively; The server calculates the grayscale mean of the first center ROI and the first edge ROI in the calibration image, quantifies the brightness information of different areas of the image, and provides data support for subsequent non-uniformity analysis.

[0034] 1022. Taking the ratio of the grayscale mean value of the first edge ROI to the grayscale mean value of the first center ROI as the first non-uniform value; By calculating the grayscale mean ratio of the two, the first non-uniformity value of the calibration image is obtained. This ratio directly reflects the non-uniformity of the image, helps quantify the brightness changes in the image, and facilitates subsequent processing and adjustment.

[0035] In the above embodiment, step 103 calculates the second non-uniform value of the target image according to the second ROI of the target image, which may include the following steps: 1031. Calculate the grayscale mean of the second center ROI and the second edge ROI respectively; The server calculates the grayscale mean of the second center ROI and the second edge ROI in the target image, further quantifies the brightness of different areas of the target image, and ensures that subsequent steps can be processed based on accurate data.

[0036] 1032. Take the ratio of the grayscale mean value of the second edge ROI to the grayscale mean value of the second center ROI as the second non-uniform value.

[0037] By calculating the grayscale mean ratio of the two, the second non-uniformity value of the target image is obtained. This ratio can effectively quantify the non-uniformity of the target image and ensure the targeted processing.

[0038] See also Figure 2 In some embodiments of the present application, step 105 in the above embodiment generates a target correction coefficient map according to the difference value, which may include the following steps: 201. Calculate a correction ratio of each pixel in the calibration image, where the correction ratio is a ratio of the gray value to the gray mean of the first center ROI; The server first calculates the correction ratio of each pixel in the calibration image, which is the ratio of the gray value of the pixel to the gray mean of the first central ROI. This ratio reflects the brightness difference of each pixel relative to the brightness of the central area of ​​the calibration image, and is used to quantify the non-uniformity of the image.

[0039] 202. Combining the correction ratios of all pixels in the calibration image into a calibration correction coefficient map; The server combines the calculated correction ratios of each pixel in the calibration image to generate a calibration correction coefficient map. This coefficient map reflects the relative brightness difference between each pixel and the central area of ​​the calibration image, providing basic data for subsequent correction.

[0040] 203. Generate a basic coefficient map according to the difference value, wherein pixel values ​​of a quarter of the area corresponding to the difference value in the basic coefficient map are all the difference value, and pixel values ​​of the remaining three quarters of the area in the basic coefficient map are all 1; The server generates a basic coefficient map based on the difference value. The pixel values ​​of one quarter of the area in the basic coefficient map are set to the difference value, indicating the correction requirement of the image area; while the pixel values ​​of the remaining three quarters of the area are set to 1, indicating that no adjustment is required or it remains the same. This design provides a preliminary coefficient map for the flat field correction of the target image.

[0041] 204. Calculate a target correction coefficient diagram based on the basic coefficient diagram and the calibration correction coefficient diagram.

[0042] The server combines the basic coefficient map and the calibration correction coefficient map to calculate the target correction coefficient map. The target correction coefficient map is generated by combining the correction ratio in the calibration image with the basic coefficient map, and ultimately provides an accurate correction coefficient for each pixel. This coefficient map will be used in the subsequent flat field correction process to ensure that the non-uniformity of the target image is effectively corrected.

[0043] In this embodiment, the server can generate an accurate target correction coefficient map, and automatically generate correction coefficients based on the difference between the difference value and the grayscale value of the calibration image, thereby ensuring that the target image can be effectively flat-field corrected. This process reduces manual intervention, improves the efficiency and accuracy of correction, reduces the difficulty of parameter debugging in practical applications, and improves the automation of the system.

[0044] See also Figure 3 In some embodiments of the present application, before step 102 in the above embodiment calculates the first non-uniform value of the calibration image according to the first ROI of the calibration image, the image flat field correction method may further include the following steps: 301. Determine the shape and size of a first central ROI according to the resolution of the calibration image.

[0045] The server determines the shape and size of the first center ROI according to the resolution of the calibration image. When the resolution is high, the server may select a larger ROI to cover more pixels, and vice versa. This step ensures that the shape and size of the first center ROI are adapted to the image resolution, thereby providing a reasonable reference area for subsequent non-uniformity calculations and ensuring the accuracy and applicability of the calculation results.

[0046] See also Figure 4 In some embodiments of the present application, before obtaining the calibration image and the target image in step 101 in the above embodiment, the image flat field correction method may further include the following steps: 401. Determine a camera and a shooting scene for shooting a calibration image; Before acquiring the calibration image, the server first determines the camera type and shooting scene used to shoot the calibration image. The sensor characteristics of different cameras and the shooting environment (such as lighting conditions) will affect the overall quality of the image, especially in terms of image saturation and contrast. By understanding the characteristics of the camera and the shooting scene, the server can provide more accurate saturation settings and image adjustment strategies for subsequent steps.

[0047] 402. Determine the saturation of the calibration image according to the camera and the shooting scene.

[0048] The server sets the saturation of the calibration image according to the camera type and shooting scene determined in step 401. The dynamic range of the camera and the lighting conditions of the shooting scene will affect the brightness and color performance of the image, so it is necessary to select a suitable saturation range to ensure that the image is not overexposed or too dark. Setting a suitable saturation can ensure the brightness uniformity and detail clarity of the image, providing a good foundation for subsequent flat field correction.

[0049] In this embodiment, the server first ensures that the impact of the camera and the shooting scene on the calibration image is effectively controlled, especially in terms of image saturation. This can avoid image quality problems caused by improper camera settings or insufficient ambient light, ensure that the quality of the calibration image meets expectations, and provide a stable and reliable foundation for subsequent flat field correction. This significantly reduces the complexity caused by image quality problems during debugging and simplifies the difficulty of overall parameter debugging.

[0050] See also Figure 5 In the embodiment of the present application, an image flat field correction device comprises: An acquisition unit 501 is used to acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; A first calculation unit 502 is used to calculate a first non-uniform value of the calibration image according to a first ROI of the calibration image, wherein the first ROI includes a first center ROI and a first edge ROI, wherein the first center ROI is located at the center of the calibration image, and the first edge ROI is located at the four corners of the calibration image, and the first center ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a non-uniform degree between each first edge ROI and the first center ROI; A second calculation unit 503 is used to calculate a second non-uniform value of the target image according to a second ROI of the target image, where the second ROI includes a second center ROI and a second edge ROI, where the second center ROI is located at the center of the target image, and the second edge ROI is located at the four corners of the target image, and the second center ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates the degree of non-uniformity between each second edge ROI and the second center ROI; A third calculation unit 504 is used to calculate a difference value according to the first non-uniform value and the second non-uniform value, where the difference value is a ratio of the second non-uniform value to the first non-uniform value; A generating unit 505, configured to generate a target correction coefficient map according to the difference value; The execution unit 506 is configured to perform flat field correction on the target image according to the target correction coefficient map.

[0051] In this embodiment, the server provides quantitative non-uniformity data and accurate correction coefficients, making the flat field correction process more automated and data-driven. It reduces manual intervention, simplifies the debugging process, reduces the difficulty that may be encountered when adjusting parameters, and improves debugging efficiency and accuracy. At the same time, the server can also generate an accurate correction coefficient map based on the difference value, making the flat field correction process more accurate and able to accurately eliminate non-uniformity in the image. By comparing the non-uniformity difference between the calibration image and the target image, and generating correction coefficients in a targeted manner, the target image finally obtained is more uniform in brightness distribution than the uncorrected image, thereby greatly improving the non-uniformity correction effect.

[0052] Optionally, the first calculating unit 502 is specifically configured to: Calculate the grayscale mean of the first center ROI and the first edge ROI respectively; The ratio of the grayscale mean of the first edge ROI to the grayscale mean of the first center ROI is taken as the first non-uniform value; The second computing unit 503 is specifically used for: Calculate the grayscale mean of the second center ROI and the second edge ROI respectively; The ratio of the grayscale mean value of the second edge ROI to the grayscale mean value of the second center ROI is used as the second non-uniform value.

[0053] The generating unit 505 includes: A calculation module, used to calculate a correction ratio of each pixel in the calibration image, where the correction ratio is a ratio of the gray value to the gray mean of the first center ROI; A merging module, used for merging the correction ratios of all pixels in the calibration image into a calibration correction coefficient map; The generation module is used to generate a target correction coefficient map according to the difference value and the calibration correction coefficient map.

[0054] Optionally, the generation module is specifically used to: Generate a basic coefficient map according to the difference value, wherein the pixel values ​​of a quarter of the area corresponding to the difference value in the basic coefficient map are all the difference value, and the pixel values ​​of the remaining three quarters of the area in the basic coefficient map are all 1; The target correction coefficient map is calculated based on the basic coefficient map and the calibration correction coefficient map.

[0055] Optionally, the execution unit 506 is specifically configured to: Multiply the target image by the target correction coefficient map to obtain the corrected target image.

[0056] Optionally, the device further comprises: The first determining unit is used to determine the shape and size of the first central ROI according to the resolution of the calibration image.

[0057] Optionally, the device further includes a second determining unit, the second unit being configured to: Determine the camera and shooting scene for taking the calibration image; The saturation of the calibration image is determined based on the camera and the captured scene.

[0058] In this implementation, the functions of each unit and module are the same as those described above. Figure 1 The steps in the embodiment shown in Figure 4 correspond to those in the embodiment shown in Figure 4 and will not be repeated here.

[0059] See also Figure 6 Another embodiment of the image flat field correction device in the embodiment of the present application includes: Processor 601, memory 602, input and output unit 603 and bus 604; The processor 601 is connected to the memory 602, the input and output unit 603 and the bus 604; The memory 602 stores a program, and the processor 601 calls the program to execute Figures 1 to 4 Steps in the illustrated embodiment.

[0060] In this embodiment, the function of the processor 601 is the same as that of the aforementioned Figures 1 to 4 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0061] The embodiment of the present application also provides a computer-readable storage medium on which a program is stored. When the program is executed on a computer, the computer executes the aforementioned Figures 1 to 4 A method in any possible implementation.

[0062] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0063] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

[0065] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0066] 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. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. An image flat field correction method, characterized in that: include: Acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; Calculating a first non-uniform value of the calibration image according to a first ROI of the calibration image, wherein the first ROI includes a first central ROI and a first edge ROI, wherein the first central ROI is located at the center of the calibration image, and the first edge ROI is located at four corners of the calibration image, and the first central ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a non-uniform degree between each of the first edge ROIs and the first central ROI; Calculating a second non-uniform value of the target image according to a second ROI of the target image, wherein the second ROI includes a second central ROI and a second edge ROI, wherein the second central ROI is located at the center of the target image, and the second edge ROI is located at four corners of the target image, and the second central ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates a non-uniform degree between each of the second edge ROIs and the second central ROI; Calculate a difference value according to the first non-uniform value and the second non-uniform value, wherein the difference value is a ratio of the second non-uniform value to the first non-uniform value; generating a target correction coefficient map according to the difference value; A flat-field correction is performed on the target image according to the target correction coefficient map.

2. The method according to claim 1, characterized in that Calculating a first non-uniform value of the calibration image according to a first ROI of the calibration image comprises: Calculate the grayscale mean of the first center ROI and the first edge ROI respectively; Taking the ratio of the grayscale mean of the first edge ROI to the grayscale mean of the first center ROI as a first non-uniform value; Calculating a second non-uniform value of the target image according to a second ROI of the target image comprises: Calculate the grayscale mean of the second center ROI and the second edge ROI respectively; The ratio of the grayscale mean value of the second edge ROI to the grayscale mean value of the second center ROI is used as the second non-uniform value.

3. The method according to claim 2, characterized in that: Generating a target correction coefficient map according to the difference value comprises: Calculating a correction ratio of each pixel in the calibration image, wherein the correction ratio is a ratio of a grayscale value to a grayscale mean value of the first central ROI; Combining the correction ratios of all pixels in the calibration image into a calibration correction coefficient map; A target correction coefficient map is generated according to the difference value and the calibration correction coefficient map.

4. The method according to claim 3, characterized in that: The generating a target correction coefficient map according to the difference value and the calibration correction coefficient map comprises: Generate a basic coefficient map according to the difference value, wherein pixel values ​​of a quarter of the area corresponding to the difference value in the basic coefficient map are all the difference value, and pixel values ​​of the remaining three quarters of the area in the basic coefficient map are all 1; A target correction coefficient map is calculated based on the basic coefficient map and the calibration correction coefficient map.

5. The method according to claim 1, characterized in that: The performing flat field correction on the target image according to the target correction coefficient map comprises: The target image is multiplied by the target correction coefficient map to obtain a corrected target image.

6. The method according to any one of claims 1 to 5, characterized in that: Before calculating the first non-uniform value of the calibration image according to the first ROI of the calibration image, the method further includes: The shape and size of the first central ROI are determined according to the resolution of the calibration image.

7. The method according to any one of claims 1 to 5, characterized in that Before acquiring the calibration image and the target image, the method further includes: Determine the camera and shooting scene for taking the calibration image; The saturation of the calibration image is determined according to the camera and the shooting scene.

8. An image flat field correction device, characterized in that: include: An acquisition unit, used to acquire a calibration image and a target image, wherein the saturation of the calibration image is within a preset saturation range, the target image is an image to be flat-field corrected, and the resolution of the target image is consistent with the resolution of the calibration image; a first calculation unit, configured to calculate a first non-uniform value of the calibration image according to a first ROI of the calibration image, wherein the first ROI includes a first central ROI and a first edge ROI, wherein the first central ROI is located at the center of the calibration image, and the first edge ROI is located at four corners of the calibration image, and the first central ROI and the first edge ROI have the same size and shape, and the first non-uniform value indicates a degree of non-uniformity between each of the first edge ROIs and the first central ROI; a second calculation unit, configured to calculate a second non-uniform value of the target image according to a second ROI of the target image, wherein the second ROI includes a second center ROI and a second edge ROI, wherein the second center ROI is located at the center of the target image, and the second edge ROI is located at four corners of the target image, and the second center ROI and the second edge ROI have the same size and shape, and the second non-uniform value indicates a degree of non-uniformity between each of the second edge ROIs and the second center ROI; a third calculating unit, configured to calculate a difference value according to the first non-uniform value and the second non-uniform value, wherein the difference value is a ratio of the second non-uniform value to the first non-uniform value; A generating unit, configured to generate a target correction coefficient map according to the difference value; An execution unit is used to perform flat field correction on the target image according to the target correction coefficient map.

9. An image flat field correction device, characterized in that: include: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method according to any one of claims 1 to 7. 10 . A computer-readable storage medium having a program stored thereon, wherein when the program is executed on a computer, the computer is caused to execute the method according to claim 1 .

Citation Information

Patent Citations

  • Shadow correction detection parameter determining and correction detecting method and device, storage medium and fisheye camera

    CN108234824A

  • Lens shadow correction method, system and electronic device

    CN109068025A

  • Light source design and production method and device of optical system and electronic equipment

    CN117647885A

  • Image flat field correction method and device, electronic equipment and medium

    CN118570109A

  • Method for correcting uniformity of display monitor and program therefor

    JP2004364021A