Image flat field correction method and device, electronic equipment and medium
The image is corrected by calculating the gray mean value and the flat field coefficient of the image, and combined with the background image for correction, which solves the problem of insufficient stability and accuracy of the traditional image flat field method under uneven light source brightness, and achieves a more efficient image. Flat-field correction reduces camera workload and improves image quality.
Patent Information
- Application Number
- CN202410199477.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-22
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the traditional image flat-field method deals with uneven light source brightness, it causes uneven camera imaging, which affects the target detection rate and classification accuracy. Moreover, high-frequency flat-field correction increases the camera workload and affects the stability and accuracy of the image.
By determining the gray value of each pixel in the sampled image, calculating the average gray value of multiple columns and the average gray value of the image, the flat field coefficient is obtained, and the coefficient is used to correct the image to be corrected, combined with the background image for correction, to implement the software Simulated image flat field correction.
It reduces camera workload, improves the stability and accuracy of image flat-field operations, reduces image artifacts and noise, and improves image quality.
Smart Images

Figure CN118570109A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image flat field correction method, device, electronic equipment and medium. Background Art
[0002] At present, when shooting objects with linear array cameras and strip lights, the uneven brightness of the light source leads to uneven camera imaging, which in turn further affects the target detection rate and classification accuracy.
[0003] In the related technology, most cameras have an image flattening function that can make the image uniform. However, due to the variable optical reflective properties of the surface of the material to be photographed, the camera needs to perform flattening correction at irregular intervals and at high frequencies. The camera's high-frequency and irregular flattening correction will increase the camera's workload and easily cause the camera to work abnormally, which in turn affects the stability and accuracy of image capture.
[0004] Therefore, the traditional image flattening method has the problems of insufficient stability and accuracy. Summary of the invention
[0005] The present invention provides an image flat field correction method, device, electronic equipment and medium, which are used to solve the defects of insufficient stability and accuracy of traditional image flat field methods.
[0006] In a first aspect, the present invention provides an image flat field correction method, comprising: Determine the pixel gray value of each pixel in the sampled image; averaging the grayscale values of all pixels corresponding to each column in the sampled image to obtain a plurality of column grayscale means; Determine an image grayscale mean based on the plurality of column grayscale means; The pre-obtained image grayscale standard value is divided by the image grayscale mean value to obtain a flat field coefficient; The pixel grayscale value of each pixel in the image to be corrected is corrected by using the flat field coefficient to obtain a flat field correction result.
[0007] According to the image flat field correction method provided by the present invention, the sampled images are multiple, and the multiple sampled images are obtained by continuously shooting with an image acquisition device; The step of determining the image grayscale mean based on the plurality of column grayscale means comprises: averaging the plurality of column grayscale means corresponding to each of the sampled images to obtain a plurality of first grayscale means; The plurality of first grayscale means are averaged to obtain an image grayscale mean.
[0008] According to the image flat field correction method provided by the present invention, the pixel gray value of each pixel in the image to be corrected is corrected by the flat field coefficient to obtain the flat field correction result, which includes: Multiplying the pixel grayscale value of each pixel in the image to be corrected by the flat field coefficient to obtain a grayscale correction value of each pixel; Determine a corrected image based on the grayscale correction value of each pixel; The corrected image is used as a flat field correction result.
[0009] According to the image flat field correction method provided by the present invention, after obtaining the flat field correction result, the method further includes: Acquire multiple first background images corresponding to the image to be corrected; averaging the grayscale values of the pixels at corresponding positions in the plurality of first background images to obtain a second background image; Determine a third background image based on the first background image and the second background image; The flat field correction result is corrected based on the second background image and the third background image.
[0010] According to the image flat field correction method provided by the present invention, determining a third background image based on the first background image and the second background image includes: Based on the second background image, determining a grayscale deviation value of each pixel in each of the first background images; Determine the grayscale standard deviation of each pixel based on the grayscale deviation value of each pixel in each of the first background images; A third background image is determined based on the grayscale standard deviation of each pixel.
[0011] According to the image flat field correction method provided by the present invention, after obtaining the flat field correction result, the method further includes: Acquire multiple first background images corresponding to the image to be corrected; averaging the grayscale values of the pixels at corresponding positions in the plurality of first background images to obtain a second background image; Determine the maximum grayscale value of pixels in the second background image, and calculate the quotient of the maximum grayscale value of pixels and the grayscale value of each pixel in the second background image to obtain a proportional factor corresponding to each pixel; Based on the proportional factor corresponding to each pixel, the pixel grayscale value of each pixel in the flat field correction result is corrected.
[0012] According to the image flat field correction method provided by the present invention, the pixel gray value of each pixel in the flat field correction result is corrected based on the proportional factor corresponding to each pixel, including: The pixel grayscale value of each pixel in the flat field correction result is multiplied by the proportional factor corresponding to the pixel.
[0013] In a second aspect, the present invention further provides an image flat field correction device, comprising: A determination module, used to determine the pixel grayscale value of each pixel in the sampled image; A first calculation module is used to average the pixel grayscale values of all pixel points corresponding to each column in the sampled image to obtain a plurality of column grayscale means; A second calculation module, configured to determine an image grayscale mean based on the plurality of column grayscale means; A third calculation module is used to calculate the quotient of the pre-acquired image grayscale standard value and the image grayscale mean value to obtain a flat field coefficient; The correction module is used to correct the pixel gray value of each pixel in the image to be corrected by using the flat field coefficient to obtain a flat field correction result.
[0014] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image flat field correction method as described above is implemented.
[0015] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the image flat field correction method as described above is implemented.
[0016] The image flat field correction method, device, electronic device and medium provided by the present invention determine the pixel grayscale value of each pixel point in the sampled image, average the pixel grayscale values of all pixel points corresponding to each column in the sampled image, obtain multiple column grayscale means, determine the image grayscale mean based on the multiple column grayscale means, take the pre-acquired image grayscale standard value and the image grayscale mean as a quotient to obtain the flat field coefficient, and finally correct the pixel grayscale value of each pixel point in the image to be corrected by the flat field coefficient to obtain the flat field correction result. Since the image flat field correction is realized by software simulation, compared with the camera hardware flat field correction method, the workload of the camera is reduced, and the stability and accuracy of the image flat field operation are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flow chart of an image flat field correction method provided by an embodiment of the present invention; Figure 2 is an image to be corrected acquired under an embodiment; Figure 3 It is the flat field correction result after the flat field correction is performed on the image to be corrected; Figure 4 is a schematic structural diagram of an image flat field correction device provided by an embodiment of the present invention; Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0020] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0021] It should be understood that although the terms "first", "second", "third", etc. may be used to describe various information in the present invention, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0022] This embodiment relates to the field of image processing, and can be specifically applied to a scene in which image acquisition is achieved in a combination of a line array camera and a backlight. In practical applications, when shooting an object with a line array camera and a strip light, the uneven brightness of the light source causes uneven camera imaging, and the uneven image will affect the target detection rate and classification accuracy.
[0023] In the related technology, most cameras have an image flattening function. Flat field correction, also known as light field correction, grayscale correction or speckle correction, is an image processing technology used for image sensors or cameras. Flat field correction operation is mainly used to eliminate the problem of uneven image brightness and color caused by uneven sensor response, lighting differences or other factors. Flat field correction can improve image quality, make the brightness of different areas more uniform, and reduce artifacts, noise and other effects in the image.
[0024] However, due to the variable optical reflectivity of the surface of the material to be photographed, the camera needs to perform flattening at high frequency and irregularly. The high frequency and irregular flattening of the camera will increase the workload of the camera and easily cause the camera to work abnormally, thus affecting the stability and reliability of the entire image processing process.
[0025] Therefore, a more stable, accurate and reliable image flat field correction solution is urgently needed on industrial production lines.
[0026] Combine the following Figures 1 to 5 The detailed scheme of the image flat field correction method, device, electronic equipment and medium provided by the embodiments of the present invention is described.
[0027] See also Figure 1 The image flat field correction method provided by the embodiment of the present invention specifically includes: Step 110: Determine the grayscale value of each pixel in the sampled image.
[0028] In this embodiment, the width and height of the sampled image meet preset requirements. In actual applications, the width and height of the sampled image are consistent with the image to be corrected. The sampled image can be one or more images.
[0029] Step 120: averaging the grayscale values of all pixels corresponding to each column in the sampled image to obtain a plurality of column grayscale means.
[0030] It can be understood that for a sampled image with a width of W and a height of H, which corresponds to W columns of pixels, the average grayscale values of all pixels in each column are calculated to obtain W column grayscale means.
[0031] Step 130: Determine the image grayscale mean based on multiple column grayscale means.
[0032] In this embodiment, for a sampled image, after W column grayscale means are calculated, the pixel grayscale mean of the sampled image, that is, the image grayscale mean, can be determined based on all the column grayscale means.
[0033] Step 140: Taking the pre-obtained image grayscale standard value and the image grayscale mean value as the quotient to obtain a flat field coefficient.
[0034] It can be understood that the flat field coefficient can represent the correction coefficient for performing flat field correction on the image to be corrected. By solving the flat field coefficient, the flat field coefficient can be directly used to perform flat field correction on the image to be corrected.
[0035] Step 150: Correct the grayscale value of each pixel in the image to be corrected using the flat field coefficient to obtain a flat field correction result.
[0036] The solution provided in this embodiment solves the flat field coefficient and uses the flat field coefficient to perform flat field correction on the image to be corrected, thereby realizing flat field correction through a software simulation method. Compared with the camera hardware flat field correction method, the workload of the camera is reduced and the stability and accuracy of the image flat field operation are improved.
[0037] In one embodiment, there are multiple sample images, and the multiple sample images are obtained by continuously shooting with an image acquisition device. In this embodiment, the width and height of the multiple sample images are the same.
[0038] Based on multiple column grayscale means, determine the image grayscale mean, including: Averaging multiple column grayscale means corresponding to each sampled image to obtain multiple first grayscale means; The plurality of first grayscale means are averaged to obtain the image grayscale mean.
[0039] It can be understood that when multiple sampling images are collected continuously, the first grayscale mean corresponding to each sampling image can be determined by averaging the grayscale means of multiple columns of each sampling image. The first grayscale mean can represent the grayscale mean of each sampling image, and the image grayscale mean can be obtained by averaging all the first grayscale means.
[0040] In this embodiment, assuming that the image grayscale mean value is A and the image grayscale standard value is M, the calculation formula of the flat field coefficient B is: (1) Among them, B represents the flat field coefficient, A represents the image grayscale mean, and M represents the image grayscale standard value.
[0041] In one embodiment, the pixel grayscale value of each pixel in the image to be corrected is corrected by using the flat field coefficient to obtain a flat field correction result including: Multiply the grayscale value of each pixel in the image to be corrected by the flat field coefficient to obtain the grayscale correction value of each pixel; Determine a corrected image based on the grayscale correction value of each pixel; The corrected image is taken as the flat field correction result.
[0042] In this embodiment, the pixel grayscale value of each pixel in the image to be corrected can be corrected by the flat field coefficient, so as to obtain a corrected image, that is, a flat field correction result. Figure 2 and Figure 3 The image to be corrected and the image corrected by the image flat field correction method provided by the embodiment of the present invention are respectively shown. Figure 2 and Figure 3 After comparison, it can be found that after correction by the image flat field correction method provided in this embodiment, the image brightness in different areas is more uniform, the image has fewer artifacts and noise, and the image quality is higher.
[0043] In some embodiments, before performing flat field correction on the image to be corrected, the image to be corrected may be pre-processed, such as image enhancement processing, noise reduction processing, etc.
[0044] In some other embodiments, before outputting the flat field correction result, the flat field correction result may be post-processed, such as image contrast adjustment, image enhancement processing, etc.
[0045] In practical applications, in order to simplify the calculation process, the image to be corrected can be converted into a grayscale image before flat field correction, and after the flat field processing, the flat field processing result can be converted into a color image and output.
[0046] In one embodiment, after obtaining the flat field correction result, the method further includes: The first step is to obtain multiple first background images corresponding to the image to be corrected.
[0047] It is understandable that the first background image refers to a completely uniform image without a target object, which can accurately represent the background information of the image to be corrected. In this embodiment, the width and height of the first background image are consistent with the width and height of the image to be corrected.
[0048] In the second step, the grayscale values of the pixels at corresponding positions in the plurality of first background images are averaged to obtain a second background image.
[0049] In practical applications, multiple first background images may be superimposed together, and then the grayscale mean of each pixel may be calculated to obtain the second background image.
[0050] The third step is to determine a third background image based on the first background image and the second background image.
[0051] In this embodiment, the third background image may represent the grayscale difference between the first background image and the second background image.
[0052] The fourth step is to correct the flat field correction result based on the second background image and the third background image.
[0053] In this embodiment, the flat field correction result can be corrected after gray value transformation and solution using a plurality of first background images corresponding to the image to be corrected, thereby further improving the accuracy of the flat field correction.
[0054] In one embodiment, determining the third background image based on the first background image and the second background image includes: The first step is to determine the grayscale deviation value of each pixel in each first background image based on the second background image.
[0055] In this embodiment, the grayscale value of the second background image and each of the first background images may be subtracted pixel by pixel to calculate a plurality of grayscale deviation values corresponding to each pixel.
[0056] In the second step, based on the grayscale deviation value of each pixel in each first background image, the grayscale standard deviation of each pixel is determined.
[0057] In this embodiment, the standard deviation of the multiple grayscale deviation values corresponding to each pixel is calculated to obtain the grayscale standard deviation of each pixel.
[0058] The third step is to determine the third background image based on the grayscale standard deviation of each pixel.
[0059] In this embodiment, the grayscale value of each pixel in the third background image can represent the standard deviation of the corresponding pixel position.
[0060] In some embodiments, the flat field correction result is corrected based on the second background image and the third background image, including: Subtract the grayscale value of the flat field correction result from that of the second background image pixel by pixel to obtain a first intermediate result; The first intermediate result is divided by the grayscale value of each pixel of the third background image to obtain a correction result.
[0061] It can be understood that, through the correction process provided in this embodiment, the image brightness and color in the flat field correction result can be made more uniform, the influence of artifacts and noise in the image can be reduced, the image quality can be effectively improved, and the accuracy of the flat field correction result can be improved.
[0062] In one embodiment, after obtaining the flat field correction result, the method may further include: The first step is to obtain multiple first background images corresponding to the image to be corrected.
[0063] In the second step, the grayscale values of the pixels at corresponding positions in the plurality of first background images are averaged to obtain a second background image.
[0064] The third step is to determine the maximum grayscale value of the pixels in the second background image, and to calculate the quotient of the maximum grayscale value of the pixels and the grayscale value of each pixel in the second background image to obtain the proportional factor corresponding to each pixel.
[0065] The fourth step is to correct the pixel grayscale value of each pixel in the flat field correction result based on the proportional factor corresponding to each pixel.
[0066] The correction scheme provided in this embodiment can correct the flat field correction result more conveniently and efficiently through the proportional factor corresponding to each pixel point, thereby further improving the accuracy of the flat field correction result.
[0067] In one embodiment, based on the proportional factor corresponding to each pixel point, the pixel grayscale value of each pixel point in the flat field correction result is corrected, including: Multiply the pixel grayscale value of each pixel in the flat field correction result by the proportional factor corresponding to the pixel.
[0068] By multiplying the pixel grayscale value of each pixel in the flat field correction result by the proportional factor corresponding to the pixel, each pixel can be corrected respectively, thereby realizing the correction of the flat field correction result.
[0069] It can be understood that both of the above two correction schemes provided in this embodiment can achieve the effect of correcting the flat field correction result. In practical applications, the correction scheme can be reasonably selected according to the actual scene requirements. For example, for scenes with high correction accuracy requirements, the second background image and the third background image can be used to correct the flat field correction result. For scenes with high correction efficiency requirements, a proportional factor can be used to correct the flat field correction result. The specific correction scheme can be reasonably selected according to the actual scene requirements, and will not be described in detail here.
[0070] Based on the same general inventive concept, the present invention also protects an image flat field correction device. The image flat field correction device provided by the present invention is described below. The image flat field correction device described below and the image flat field correction method described above can be referenced to each other.
[0071] Figure 4 It is a structural schematic diagram of an image flat field correction device provided by an embodiment of the present invention.
[0072] See also Figure 4The image flat field correction device provided by the embodiment of the present invention specifically includes: A determination module 210 is used to determine the pixel gray value of each pixel in the sampled image; A first calculation module 220 is used to average the grayscale values of all pixels corresponding to each column in the sampled image to obtain a plurality of column grayscale means; A second calculation module 230, configured to determine an image grayscale mean based on a plurality of column grayscale means; The third calculation module 240 is used to calculate the quotient of the pre-obtained image grayscale standard value and the image grayscale mean value to obtain a flat field coefficient; The correction module 250 is used to correct the pixel grayscale value of each pixel in the image to be corrected by using the flat field coefficient to obtain a flat field correction result.
[0073] In one embodiment, there are multiple sampled images, and the multiple sampled images are obtained by continuously shooting with an image acquisition device.
[0074] The second calculation module 230 is specifically used for: averaging a plurality of column grayscale means corresponding to each sampled image to obtain a plurality of first grayscale means; averaging a plurality of first grayscale means to obtain an image grayscale mean.
[0075] In one embodiment, the correction module 250 is specifically used to: multiply the pixel grayscale value of each pixel in the image to be corrected by the flat field coefficient to obtain a grayscale correction value of each pixel; determine a corrected image based on the grayscale correction value of each pixel; and use the corrected image as a flat field correction result.
[0076] In one embodiment, the image flat field correction device provided by the embodiment of the present invention may further include: a correction module, used to obtain multiple first background images corresponding to the image to be corrected; average the grayscale values of pixel points at corresponding positions in the multiple first background images to obtain a second background image; determine a third background image based on the first background image and the second background image; and correct the flat field correction result based on the second background image and the third background image.
[0077] In one embodiment, the correction module determines the third background image based on the first background image and the second background image through the following process: Based on the second background image, determining the grayscale deviation value of each pixel in each first background image; Determine the grayscale standard deviation of each pixel based on the grayscale deviation value of each pixel in each first background image; A third background image is determined based on the grayscale standard deviation of each pixel.
[0078] In summary, the image flat field correction device provided in the embodiment of the present invention realizes image flat field correction by software simulation, which reduces the workload of the camera and improves the stability and accuracy of the image flat field operation compared to the camera hardware flat field correction method.
[0079] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0080] like Figure 5 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the image flat field correction method provided by the above embodiments, including: determining the pixel gray value of each pixel point in the sampled image; averaging the pixel gray values of all pixels points corresponding to each column in the sampled image to obtain a plurality of column gray mean values; determining the image gray mean value based on the plurality of column gray mean values; dividing the pre-obtained image gray standard value by the image gray mean value to obtain a flat field coefficient; and correcting the pixel gray value of each pixel point in the image to be corrected by the flat field coefficient to obtain a flat field correction result.
[0081] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. 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, etc. Various media that can store program codes.
[0082] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the image flat field correction method provided by the above-mentioned embodiments, including: determining the pixel grayscale value of each pixel point in the sampled image; averaging the pixel grayscale values of all pixel points corresponding to each column in the sampled image to obtain multiple column grayscale means; determining the image grayscale mean based on the multiple column grayscale means; taking the quotient of the pre-acquired image grayscale standard value and the image grayscale mean to obtain a flat field coefficient; correcting the pixel grayscale value of each pixel point in the image to be corrected by the flat field coefficient to obtain a flat field correction result.
[0083] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the image flat field correction method provided by the above embodiments is implemented, including: determining the pixel grayscale value of each pixel point in the sampled image; averaging the pixel grayscale values of all pixel points corresponding to each column in the sampled image to obtain multiple column grayscale means; determining the image grayscale mean based on the multiple column grayscale means; taking a quotient of a pre-acquired image grayscale standard value and the image grayscale mean to obtain a flat field coefficient; and correcting the pixel grayscale value of each pixel point in the image to be corrected by using the flat field coefficient to obtain a flat field correction result.
[0084] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0086] Finally, it should be noted that the above 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for image flat field correction, It is characterized in that include: Determine the pixel gray value of each pixel in the sampled image; averaging the grayscale values of all pixels corresponding to each column in the sampled image to obtain a plurality of column grayscale means; Determine an image grayscale mean based on the plurality of column grayscale means; The pre-obtained image grayscale standard value is divided by the image grayscale mean value to obtain a flat field coefficient; The pixel grayscale value of each pixel in the image to be corrected is corrected by using the flat field coefficient to obtain a flat field correction result.
2. The image flat field correction method according to claim 1, It is characterized in that The plurality of sample images are obtained by continuously photographing the plurality of sample images through an image acquisition device; The step of determining the image grayscale mean based on the plurality of column grayscale means comprises: averaging the plurality of column grayscale means corresponding to each of the sampled images to obtain a plurality of first grayscale means; The plurality of first grayscale means are averaged to obtain an image grayscale mean.
3. The image flat field correction method according to claim 1, It is characterized in that Correcting the pixel grayscale value of each pixel in the image to be corrected by using the flat field coefficient to obtain a flat field correction result includes: Multiplying the pixel grayscale value of each pixel in the image to be corrected by the flat field coefficient to obtain a grayscale correction value of each pixel; Determine a corrected image based on the grayscale correction value of each pixel; The corrected image is used as a flat field correction result.
4. The image flat field correction method according to claim 1, It is characterized in that After obtaining the flat field correction result, the method further includes: Acquire multiple first background images corresponding to the image to be corrected; averaging the grayscale values of the pixels at corresponding positions in the plurality of first background images to obtain a second background image; Determine a third background image based on the first background image and the second background image; The flat field correction result is corrected based on the second background image and the third background image.
5. The image flat field correction method according to claim 4, It is characterized in that The determining a third background image based on the first background image and the second background image includes: Based on the second background image, determining a grayscale deviation value of each pixel in each of the first background images; Determine the grayscale standard deviation of each pixel based on the grayscale deviation value of each pixel in each of the first background images; A third background image is determined based on the grayscale standard deviation of each pixel.
6. The image flat field correction method according to claim 1, It is characterized in that After obtaining the flat field correction result, the method further includes: Acquire multiple first background images corresponding to the image to be corrected; averaging the grayscale values of the pixels at corresponding positions in the plurality of first background images to obtain a second background image; Determine the maximum grayscale value of pixels in the second background image, and calculate the quotient of the maximum grayscale value of pixels and the grayscale value of each pixel in the second background image to obtain a proportional factor corresponding to each pixel; Based on the proportional factor corresponding to each pixel, the pixel grayscale value of each pixel in the flat field correction result is corrected.
7. The image flat field correction method according to claim 6, It is characterized in that The step of correcting the pixel grayscale value of each pixel in the flat field correction result based on the proportional factor corresponding to each pixel includes: The pixel grayscale value of each pixel in the flat field correction result is multiplied by the proportional factor corresponding to the pixel.
8. An image flat field correction device, It is characterized in that include: A determination module, used to determine the pixel grayscale value of each pixel in the sampled image; A first calculation module is used to average the pixel grayscale values of all pixel points corresponding to each column in the sampled image to obtain a plurality of column grayscale means; A second calculation module, configured to determine an image grayscale mean based on the plurality of column grayscale means; A third calculation module is used to calculate the quotient of the pre-acquired image grayscale standard value and the image grayscale mean value to obtain a flat field coefficient; The correction module is used to correct the pixel gray value of each pixel in the image to be corrected by using the flat field coefficient to obtain a flat field correction result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the image flat field correction method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the image flat field correction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Dynamic non-uniformity correction method for linear scanned image based on image sequence analysis
CN102938137A
Adaptive infrared non-uniformity calibration method based on motion state estimation
CN106017695A
Cited By
Image flat field correction method and device and computer readable storage medium
CN119515754A
Display screen flat field correction method, device and system and storage medium
CN119541377A
A method, device, system and storage medium for display screen flat field correction
CN119541377B
Light intensity correction method for interference image and electronic equipment
CN122016059A
