Flat field calibration method, device and system for a camera
By taking photos in dark and bright field environments, dark field and flat field calibration pictures are generated, flat field coefficients are calculated and pixel value mapping is performed, the camera detector response inhomogeneity problem is solved, and the camera correction effect is improved.
Patent Information
- Application Number
- CN202111014527.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-08-31
AI Technical Summary
In the prior art, the non-uniformity of the detector response of the camera causes uneven grayscale values of each pixel point in the image, affecting the correction effect.
By taking photos in dark and bright field environments, dark field and flat field calibration pictures are generated, flat field coefficients are calculated, and the original image is corrected through pixel value mapping and correction strategies to generate a corrected image.
It solves the problem of non-uniformity in response during camera correction process to ensure that the LED display displays better correction effect.
Smart Images

Figure CN113870355B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of LED display calibration, and particularly to a flat-field calibration method, device and system for a camera. Background Art
[0002] Under ideal circumstances, when the irradiance received by each pixel of the camera is equal, that is, the entire target surface of the detector is evenly irradiated, the gray values of all pixel points in the image should be equal. In fact, for any CCD and CMOS cameras, the gray values generated by each pixel for the same irradiance are not the same, which is called the response non-uniformity of the detector. The reasons for the response non-uniformity include: (1) the structural materials and manufacturing processes of the CCD or CMOS chips of the camera itself have local differences; (2) the spectral response functions of each pixel are different; (3) the differences in readout noise and dark current noise, etc.
[0003] Therefore, before using an industrial camera to calibrate a screen, the prior art performs flat-field calibration for a specific camera and lens combination to solve the above non-uniformity problem. Summary of the Invention
[0004] Aiming at the technical problems in the prior art, the present invention provides a flat-field calibration method, device and system for a camera.
[0005] The present invention includes a flat-field calibration method for a camera, comprising:
[0006] Obtaining N dark-field photos taken by the camera in a dark-field environment;
[0007] Generating a dark-field calibration picture according to a preset dark-field calibration picture generation strategy and the dark-field photos;
[0008] Obtaining M bright-field photos taken by the camera in a bright-field environment;
[0009] Generating a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos;
[0010] Mapping to obtain a flat-field calibration picture through a preset pixel value mapping strategy and the flat-field coefficient;
[0011] Correcting the original image through the dark-field calibration picture, the flat-field calibration picture and a preset image correction strategy to obtain a corrected image.
[0012] Further, generating a dark-field calibration picture according to a preset dark-field calibration picture generation strategy and the dark-field photos includes:
[0013] Calculating the sum of the first pixel values of the pixel points at the same position in the N dark-field photos; each dark-field photo contains n pixel points;
[0014] Calculate the first pixel average value of each of the n pixel points based on the sum of the first pixel values and the number N of dark field photos;
[0015] Generate a dark field calibration picture with n pixel points based on the first pixel average value.
[0016] Furthermore, generate a flat field coefficient according to a preset flat field coefficient calculation strategy and bright field photos, including:
[0017] Calculate the sum of the second pixel values of the pixel points at the same position in M bright field photos; each bright field photo contains n pixel points;
[0018] Calculate the second pixel average value of each of the n pixel points based on the sum of the second pixel values and the number M of bright field photos;
[0019] Sum up the pixel values of all the pixel points in the bright field photos to obtain the sum of the third pixel values;
[0020] Calculate the third pixel average value based on the sum of the third pixel values, the number M of bright field photos, and the number n of pixel points contained in each bright field photo;
[0021] Calculate the flat field coefficient of the n pixel points, where the flat field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value.
[0022] Furthermore, map to obtain a flat field calibration picture through a preset pixel value mapping strategy and flat field coefficient, including:
[0023] Determine the mapping denominator according to the maximum value in the flat field coefficient; the mapping denominator is an integer closest to the maximum value of the flat field coefficient and not less than the maximum value of the flat field coefficient;
[0024] Obtain the pixel value of each pixel point through flat field calibration picture pixel value = pixel coefficient * flat field coefficient / mapping denominator, and generate a flat field calibration picture based on this; the pixel coefficient is the maximum value of the preset pixel value range of the flat field calibration picture.
[0025] Furthermore, correct the original image through the dark field calibration picture, the flat field calibration picture, and a preset image correction strategy to obtain a corrected image, including:
[0026] Calculate the average pixel value of the flat field calibration picture;
[0027] Calculate the pixel point correction value for each pixel point in the original image, where pixel point correction value = (pixel value of the original image - pixel value of the dark field calibration picture) / (pixel value of the flat field calibration picture / average pixel value);
[0028] Generate a corrected image based on the pixel correction value.
[0029] Furthermore, it further includes:
[0030] Generate M bright-field compensated photos according to a preset pixel value compensation strategy, flat-field coefficient, and M bright-field photos.
[0031] Furthermore, generating M bright-field compensated photos according to a preset pixel value compensation strategy, flat-field coefficient, and M bright-field photos includes:
[0032] Calculate the pixel compensation value corresponding to each pixel point of each bright-field photo according to the pixel compensation value = bright-field photo pixel value / flat-field coefficient;
[0033] Generate M bright-field compensated photos based on the pixel compensation value.
[0034] Furthermore, it further includes:
[0035] Generate a compensated flat-field coefficient according to a preset flat-field coefficient calculation strategy and bright-field compensated photos;
[0036] And, map to obtain a compensated flat-field calibration image through a preset pixel value mapping strategy and the compensated flat-field coefficient.
[0037] The present invention also provides a flat-field calibration device for a camera. The flat-field calibration device includes a photo acquisition module, a dark-field calibration image generation module, a flat-field coefficient generation module, a flat-field calibration image generation module, and a correction module, where:
[0038] The photo acquisition module is connected to the dark-field calibration image generation module and the flat-field coefficient generation module; the photo acquisition module is used to acquire N dark-field photos taken by the camera in a dark-field environment; and is used to acquire M bright-field photos taken by the camera in a bright-field environment;
[0039] The dark-field calibration image generation module is connected to the photo acquisition module and the correction module. The dark-field calibration image generation module is used to generate a dark-field calibration image according to a preset dark-field calibration image generation strategy and dark-field photos;
[0040] The flat-field coefficient generation module is connected to the photo acquisition module and the flat-field calibration image generation module. The flat-field coefficient generation module is used to generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and bright-field photos;
[0041] The flat-field calibration image generation module is connected to the flat-field coefficient generation module and the correction module. The flat-field calibration image generation module is used to map to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient;
[0042] A calibration module, connected to the dark-field calibration image generation module and the flat-field calibration image generation module, is used to calibrate the original image through the dark-field calibration image, the flat-field calibration image, and a preset image calibration strategy to obtain a calibrated image.
[0043] The present invention also provides a flat-field calibration system, which includes the above-mentioned flat-field calibration device, as well as a camera, an LED display screen, and a bright-field light source, where:
[0044] The bright-field light source is used to provide a bright-field environment for the LED display screen;
[0045] The camera is communicatively connected to the flat-field calibration device. The camera is used to take pictures of the LED display screen showing the original image in a dark-field environment and a bright-field environment, respectively obtaining N dark-field photos and M bright-field photos;
[0046] The flat-field calibration device is communicatively connected to the LED display screen and the camera. The flat-field calibration device is used to obtain N dark-field photos and M bright-field photos, and generate a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos; and generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos; and map to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient; and calibrate the original image through the dark-field calibration image, the flat-field calibration image, and a preset image calibration strategy to obtain a calibrated image;
[0047] The LED display screen is communicatively connected to the flat-field calibration device. The LED display screen is used to display the original image and the calibrated image.
[0048] The flat-field calibration method, device, and system of the camera of the present invention obtain dark-field photos and bright-field photos, and perform corresponding processing on the dark-field photos and bright-field photos to obtain a dark-field calibration image and a flat-field calibration image, and then calibrate the original image displayed on the LED display screen through the dark-field calibration image and the flat-field calibration image, solving the problem of the influence of the non-uniformity of the detector response on the calibration effect of the camera, thereby ensuring the calibration effect during the calibration process of the camera, and presenting a better display effect when the LED display screen displays the calibrated image. Description of the Drawings
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0050] Figure 1Flow chart (I) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0051] Figure 2 Flow chart (II) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0052] Figure 3 Flow chart (III) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0053] Figure 4 Flow chart (IV) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0054] Figure 5 Flow chart (V) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0055] Figure 6 Flow chart (VI) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0056] Figure 7 Flow chart (VII) of the flat field calibration method for a camera according to an embodiment of the present invention;
[0057] Figure 8 Structural composition diagram of a flat field calibration device for a camera according to an embodiment of the present invention;
[0058] Figure 9 Structural composition diagram of a flat field calibration system according to an embodiment of the present invention. Detailed implementation manners
[0059] 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 present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0060] The present invention provides a flat field calibration method for a camera, as Figure 1 shown, including the following steps:
[0061] Step S10: Obtain N dark field photos taken by the camera in a dark field environment.
[0062] The dark field environment refers to an environment without external light sources. Usually, it can be realized in an opaque sealed box. Place the LED display screen in the sealed box and display the original image. The camera collects pictures of the LED display screen showing the original image in the dark field environment inside the sealed box, which are dark field photos. In this embodiment, the specific shape and size of the sealed box are not limited, as long as the requirements for the dark field environment of the present invention are met. In the steps of the present invention, the process of the camera collecting dark field photos can be: fixing the exposure duration and closing the camera shutter, and continuously shooting the LED display screen in the dark field environment to obtain N dark field photos. After obtaining these N dark field photos in this step, step S20 is executed.
[0063] Step S20: Generate a dark field calibration picture according to the preset dark field calibration picture generation strategy and the dark field photos.
[0064] The dark field calibration picture is used for subsequent correction of the original image. Specifically, as Figure 2 shown, step S20 includes:
[0065] Step S201: Calculate the sum of the first pixel values of the pixel points at the same position in the N dark field photos.
[0066] It is assumed that each dark field photo contains n pixel points, and there are N dark field photos in total. Therefore, the sum of the first pixel values of each pixel point at the same position is obtained by adding N pixel values. A total of n sums of the first pixel values are obtained through this step.
[0067] Step S202: Calculate the first pixel average value of each of the n pixel points through the sum of the first pixel values and the number N of the dark field photos.
[0068] Among the 1 to n pixel points, the first pixel average value of any one pixel point is equal to the value obtained by dividing the sum of the first pixel values corresponding to the pixel point by N.
[0069] For example, to calculate the first pixel average value of the 100th pixel point of the dark field photo, first add the pixel values of the 100th pixel point of each dark field photo (a total of N photos) to obtain the sum of the first pixel values of the 100th pixel point, and then divide by N. The obtained value is the first pixel average value of the 100th pixel point, and it is also the pixel value of the 100th pixel point of the dark field calibration picture generated in step S203.
[0070] Step S203: Generate a dark field calibration picture with n pixel points through the first pixel average value.
[0071] Generate a dark field calibration picture with the first pixel average value of the pixel points. The dark field calibration picture also has n pixel points. At the same time, save the dark field calibration picture as a dark field calibration file.
[0072] The processing process of steps S201 - S203 of the present invention is essentially to obtain the average image of N dark - field photos, and use this as the offset compensation for pixel values in subsequent calibration steps.
[0073] Step S30: Obtain M bright - field photos taken by the camera in a bright - field environment.
[0074] The bright - field environment is formed by the light emission of a light source placed in the dark - field environment to form a relatively uniform - brightness sealed environment. Herein, this light source is called a uniform light source, and the existing uniform light source can be realized by an integrating sphere. The light source brightness in this embodiment is adjustable, and those skilled in the art can adjust the brightness corresponding to the specific measurement requirements. The present invention embodiment does not limit the specific product type of the light source, and those skilled in the art can select it by themselves.
[0075] The camera takes pictures of the LED display screen showing the original image in the bright - field environment to obtain M bright - field photos. The present invention embodiment does not limit the value of M. The larger the value of M, the better the calibration effect finally achieved by the present invention. The same applies to the number N of dark - field photos.
[0076] After obtaining these M bright - field photos in this step, step S40 is executed.
[0077] Step S40: Generate a flat - field coefficient according to a preset flat - field coefficient calculation strategy and the bright - field photos.
[0078] Specifically, as Figure 3 shown, step S40 includes:
[0079] Step S401: Calculate the sum of the second pixel values of the pixel points at the same position in M bright - field photos.
[0080] The number of pixel points in the bright - field photos is the same as that in the dark - field photos. So each bright - field photo also contains n pixel points. This step calculates the sum of the second pixel values of the pixel points at the same position in the bright - field photos, and a total of n sums of the second pixel values are obtained. And each sum of the second pixel values is obtained by adding M pixel values.
[0081] Step S402: Calculate the average second pixel value of each of the n pixel points through the sum of the second pixel values and the number M of bright - field photos.
[0082] Calculate the corresponding average second pixel value for each of the pixel points from 1 to n. The average second pixel value of any pixel point is equal to the sum of the second pixel values of the corresponding pixel point divided by M.
[0083] Step S403: Sum up the pixel values of all pixel points in the bright - field photos to obtain the sum of the third pixel values.
[0084] The sum of the third pixel values is obtained by adding M * n pixel values.
[0085] Step S404: Calculate the third pixel average value according to the sum of the third pixel values, the number M of bright-field photos, and the number n of pixel points included in each bright-field photo.
[0086] The third pixel average value is obtained by dividing the sum of the third pixel values by (M * n).
[0087] Step S405: Calculate the flat-field coefficients of n pixel points, where the flat-field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value.
[0088] The flat-field coefficients corresponding to n pixel points are calculated with flat-field coefficient = second pixel average value / third pixel average value. The flat-field coefficients obtained in this step altogether include n coefficients, corresponding one by one to n pixel points.
[0089] After generating the flat-field coefficients, execute step S50.
[0090] Step S50: Map to obtain a flat-field calibration picture through a preset pixel value mapping strategy and the flat-field coefficients.
[0091] An image with pixel values is mapped according to the flat-field coefficients, and this image is the flat-field calibration picture.
[0092] Specifically, as Figure 4 shown, step S50 specifically includes:
[0093] Step S501: Determine the mapping denominator according to the maximum value in the flat-field coefficients.
[0094] The mapping denominator in the embodiment of the present invention is an integer closest to the maximum value of the flat-field coefficients, and the mapping denominator is not less than the maximum value of the flat-field coefficients.
[0095] The value of the flat-field coefficient is between 0 and x, where x is a positive integer. For example, if the value of x is 3, then the maximum value of the flat-field coefficient is a value less than or equal to 3. Through the practice of this embodiment, it is found that the value of the flat-field coefficient is generally less than 3 and much less than the pixel coefficient mentioned in the next step.
[0096] Step S502: Obtain the pixel value of each pixel point through flat-field calibration picture pixel value = pixel coefficient * flat-field coefficient / mapping denominator, and generate a flat-field calibration picture therewith; the pixel coefficient is the maximum value of the pixel value range of the preset flat-field calibration picture.
[0097] The pixel coefficient is set by those skilled in the art. The pixel coefficient is a name defined in this embodiment and is related to the number of bits of the image. For example, for a 16-bit image with a grayscale value ranging from 0 to 65535, 65536 (a total of 65536 gray levels) is defined as the pixel coefficient in this embodiment. Thus, according to the formula that the pixel value of the flat-field calibration picture = pixel coefficient * flat-field coefficient / mapping denominator, the corresponding pixel values of the n pixel points of the flat-field calibration picture are calculated, and the numerical range of the pixel values of the flat-field calibration picture is 0 to 65535.
[0098] After obtaining the flat-field calibration picture through the above steps, perform the calibration operation in step S60.
[0099] Step S60: Calibrate the original image through the dark-field calibration picture, the flat-field calibration picture, and a preset image calibration strategy to obtain a calibrated image.
[0100] Specifically, as Figure 5 shown, this step S60 specifically includes:
[0101] Step S601: Calculate the average pixel value of the flat-field calibration picture.
[0102] The flat-field calibration picture generated through the above steps has n pixel points, and each pixel point has a corresponding pixel value. Sum up the pixel values of the n pixel points in the flat-field calibration picture, and then calculate the average pixel value.
[0103] Step S602: Calculate the pixel point calibration value for each pixel point in the original image. The pixel point calibration value = (the pixel value of the original image - the pixel value of the dark-field calibration picture) / (the pixel value of the flat-field calibration picture / the average pixel value).
[0104] Taking each pixel point of the original image as a unit, calculate the corresponding pixel point calibration value in sequence.
[0105] Step S603: Generate a calibrated image according to the pixel point calibration value.
[0106] The original image in this embodiment is the image originally displayed on the LED display screen, and the calibrated image obtained in this step is the image that the LED display screen is to display after calibration.
[0107] Specifically, as Figure 6 shown, the flat-field calibration method of another embodiment of the present invention includes:
[0108] Step S10: Obtain N dark-field photos taken by the camera in a dark-field environment.
[0109] Step S20: Generate a dark-field calibration picture according to a preset dark-field calibration picture generation strategy and the dark-field photos.
[0110] Step S30: Obtain M bright-field photos taken by the camera in a bright-field environment.
[0111] Step S40: Generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos.
[0112] The implementation of the above steps S10 to S40 can refer to the description of the previous embodiments.
[0113] Step S70: Generate M bright-field compensated photos according to a preset pixel value compensation strategy, the flat-field coefficient, and the M bright-field photos.
[0114] To reduce the calibration error, compensate the pixel values of the bright-field photos. As Figure 7 shown, step S70 specifically includes:
[0115] Step S701: Calculate the pixel compensation value corresponding to each pixel point of each bright-field photo according to pixel compensation value = bright-field photo pixel value / flat-field coefficient.
[0116] Through the calculation in step S701, each pixel point of each bright-field photo corresponds to a pixel compensation value.
[0117] Step S702: Generate M bright-field compensated photos according to the pixel compensation values.
[0118] Use the pixel compensation values calculated in the previous step as the pixel values of the bright-field compensated photos.
[0119] As Figure 6 shown, the flat-field calibration method of the embodiment of the present invention further includes:
[0120] Step S80: Generate a compensated flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field compensated photos.
[0121] The process of calculating the compensated flat-field coefficient is the same as that of the flat-field coefficient in step S40 of the above embodiment, except that the bright-field photos are replaced with the bright-field compensated photos, so the calculation process will not be elaborated here.
[0122] Step S90: Map to obtain a compensated flat-field calibration image through a preset pixel value mapping strategy and the compensated flat-field coefficient.
[0123] This step is the same as the pixel value mapping strategy content in step S50 of the above embodiment. The process of mapping to obtain the compensated flat-field calibration image can directly refer to the mapping process of steps S501 to S502 for the flat-field calibration image, and will not be elaborated here.
[0124] After obtaining the dark-field calibration image and the compensated flat-field calibration image through the above steps in this embodiment, execute step S100:
[0125] Step S100: Correct the original image by a dark-field calibrated picture, a compensated flat-field calibrated picture, and a preset image correction strategy to obtain a corrected image.
[0126] The present invention also includes an embodiment, as Figure 8 shown, which is a flat-field calibration device for a camera. The flat-field calibration device 10 includes a photo acquisition module 101, a dark-field calibration picture generation module 102, a flat-field coefficient generation module 103, a flat-field calibration picture generation module 104, and a correction module 105, where:
[0127] The photo acquisition module 101 is connected to the dark-field calibration picture generation module 102 and the flat-field coefficient generation module 103; the photo acquisition module 101 is configured to acquire N dark-field photos taken by the camera in a dark-field environment; and to acquire M bright-field photos taken by the camera in a bright-field environment;
[0128] The dark-field calibration picture generation module 102 is connected to the photo acquisition module 101 and the correction module 105. The dark-field calibration picture generation module 102 is configured to generate a dark-field calibration picture according to a preset dark-field calibration picture generation strategy and the dark-field photos;
[0129] The flat-field coefficient generation module 103 is connected to the photo acquisition module 101 and the flat-field calibration picture generation module 104. The flat-field coefficient generation module 103 is configured to generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos;
[0130] The flat-field calibration picture generation module 104 is connected to the flat-field coefficient generation module 103 and the correction module 105. The flat-field calibration picture generation module 104 is configured to map and obtain a flat-field calibration picture through a preset pixel value mapping strategy and the flat-field coefficient;
[0131] The correction module 105 is connected to the dark-field calibration picture generation module 102 and the flat-field calibration picture generation module 104. The correction module 105 is configured to correct the original image by the dark-field calibration picture, the flat-field calibration picture, and a preset image correction strategy to obtain a corrected image.
[0132] For how each module in the flat-field calibration device 10 of the embodiment of the present invention implements the corresponding functions, reference may be specifically made to the description of the flat-field calibration method in the foregoing embodiment, and details are not described herein again. Specifically, in combination with Figures 1 to 7 , the flat-field calibration device 10 of this embodiment implements the corresponding functions through the following steps:
[0133] Step S10: Acquire N dark-field photos taken by the camera in a dark-field environment.
[0134] Step S20: Generate a dark field calibration image according to a preset dark field calibration image generation strategy and dark field photos. Specifically, step S20 includes:
[0135] Step S201: Calculate the sum of the first pixel values of the pixel points at the same position in N dark field photos.
[0136] Step S202: Calculate the first pixel average value of each of the n pixel points through the sum of the first pixel values and the number N of dark field photos.
[0137] Step S203: Generate a dark field calibration image with n pixel points through the first pixel average value.
[0138] Step S30: Obtain M bright field photos taken by the camera in a bright field environment.
[0139] Step S40: Generate a flat field coefficient according to a preset flat field coefficient calculation strategy and bright field photos. Specifically, step S40 includes:
[0140] Step S401: Calculate the sum of the second pixel values of the pixel points at the same position in M bright field photos.
[0141] Step S402: Calculate the second pixel average value of each of the n pixel points through the sum of the second pixel values and the number M of bright field photos.
[0142] Step S403: Sum up the pixel values of the pixel points of all bright field photos to obtain the sum of the third pixel values.
[0143] Step S404: Calculate the third pixel average value according to the sum of the third pixel values, the number M of bright field photos, and the number n of pixel points included in each bright field photo.
[0144] Step S405: Calculate the flat field coefficient of n pixel points, where the flat field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value.
[0145] Step S50: Map to obtain a flat field calibration image through a preset pixel value mapping strategy and flat field coefficient. Specifically, step S50 includes:
[0146] Step S501: Determine the mapping denominator according to the maximum value in the flat field coefficient.
[0147] Step S502: Obtain the pixel value of each pixel point through flat field calibration image pixel value = pixel coefficient * flat field coefficient / mapping denominator, and generate a flat field calibration image accordingly; the pixel coefficient is the maximum value of the pixel value range of the preset flat field calibration image.
[0148] Step S60: Correct the original image by means of a dark-field calibration image, a flat-field calibration image, and a preset image correction strategy to obtain a corrected image. Specifically, Step S60 includes:
[0149] Step S601: Calculate the average pixel value of the flat-field calibration image.
[0150] Step S602: Calculate a pixel correction value for each pixel point in the original image. The pixel correction value = (the pixel value of the original image - the pixel value of the dark-field calibration image) / (the pixel value of the flat-field calibration image / the average pixel value).
[0151] Step S603: Generate a corrected image according to the pixel correction value.
[0152] The embodiment of the present invention further includes a flat-field calibration system. As Figure 9 shown, the flat-field calibration system includes the flat-field calibration device 10 of the above embodiment, as well as a camera 20, an LED display screen 30, and a bright-field light source 40, where:
[0153] The bright-field light source 40 is used to provide a bright-field environment for the LED display screen 30. The bright-field light source 40 in this embodiment can be controlled independently, or electrically connected to the flat-field calibration device 10. When collecting bright-field photos, the flat-field calibration device 10 sends control information to the bright-field light source 40 to turn it on and form a bright-field environment.
[0154] The camera 20 is communicatively connected to the flat-field calibration device 10. The camera 20 is used to take pictures of the LED display screen 30 displaying the original image in a dark-field environment and a bright-field environment, respectively obtaining N dark-field photos and M bright-field photos;
[0155] The flat-field calibration device 10 is communicatively connected to the LED display screen 30 and the camera 20. The flat-field calibration device 10 is used to obtain N dark-field photos and M bright-field photos, and generate a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos; and generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos; and map to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient; and correct the original image by means of the dark-field calibration image, the flat-field calibration image, and a preset image correction strategy to obtain a corrected image;
[0156] The LED display screen 30 is communicatively connected to the flat-field calibration device 10. The LED display screen 30 is used to display the original image and the corrected image.
[0157] The flat-field calibration method, device and flat-field calibration system of the camera according to the embodiments of the present invention obtain a dark-field photo and a bright-field photo, perform corresponding processing on the dark-field photo and the bright-field photo to obtain a dark-field calibration picture and a flat-field calibration picture, and then correct the original image displayed on the LED display screen through the dark-field calibration picture and the flat-field calibration picture, solving the problem that the current non-uniformity of the detector response affects the calibration effect of the camera, thereby ensuring the calibration effect during the calibration process of the camera, and presenting a better display effect when the LED display screen displays the calibrated image.
[0158] The above further describes the present invention with the aid of specific embodiments. However, it should be understood that the specific description here should not be construed as a limitation on the essence and scope of the present invention. Various modifications made by those of ordinary skill in the art to the above embodiments after reading this specification all fall within the scope protected by the present invention.
Claims
1. A flat-field calibration method for a camera, characterized in that, Including: Obtaining N dark-field photos taken by a camera in a dark-field environment; Generating a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos; Obtaining M bright-field photos taken by the camera in a bright-field environment; Generating a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos; Mapping to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient; Correcting the original image through the dark-field calibration image, the flat-field calibration image, and a preset image correction strategy to obtain a corrected image; Generating a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos, including: calculating the sum of the second pixel values of the pixel points at the same position in the M bright-field photos; each of the bright-field photos includes n pixel points; calculating the second pixel average value of each of the n pixel points through the sum of the second pixel values and the number M of the bright-field photos; summing up the pixel values of all the pixel points of the bright-field photos to obtain a third pixel value sum; calculating a third pixel average value according to the third pixel value sum, the number M of the bright-field photos, and the number n of pixel points included in each bright-field photo; calculating the flat-field coefficient of the n pixel points, where the flat-field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value.
2. The flat-field calibration method of the camera according to claim 1, characterized in that Generating a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos, including: Calculating the sum of the first pixel values of the pixel points at the same position in the N dark-field photos; each of the dark-field photos includes n pixel points; Calculating the first pixel average value of each of the n pixel points through the sum of the first pixel values and the number N of the dark-field photos; Generating a dark-field calibration image with n pixel points through the first pixel average value.
3. The flat field calibration method of the camera according to claim 1, characterized in that, Mapping to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient, including: Determining a mapping denominator according to the maximum value in the flat-field coefficient; the mapping denominator is an integer closest to the maximum value of the flat-field coefficient, and the mapping denominator is not less than the maximum value of the flat-field coefficient; Obtaining the pixel value of each pixel point through flat-field calibration image pixel value = pixel coefficient * flat-field coefficient / mapping denominator, and generating the flat-field calibration image accordingly; the pixel coefficient is the maximum value of the preset pixel value range of the flat-field calibration image.
4. The flat field calibration method of the camera according to claim 1, characterized in that, Correcting the original image through the dark-field calibration image, the flat-field calibration image, and a preset image correction strategy to obtain a corrected image, including: Calculating the average pixel value of the flat-field calibration image; Calculating a pixel point correction value for each pixel point in the original image, where the pixel point correction value = (pixel value of the original image - pixel value of the dark-field calibration image) / (pixel value of the flat-field calibration image / average pixel value); Generating the corrected image according to the pixel point correction value.
5. The flat-field calibration method of the camera according to claim 1, characterized in that Also including: Generating M bright-field compensation photos according to a preset pixel value compensation strategy, the flat-field coefficient, and the M bright-field photos.
6. The flat field calibration method for a camera according to claim 5, characterized in that, Generate M bright-field compensated photos according to a preset pixel value compensation strategy, the flat-field coefficient, and the M bright-field photos, including: Calculate the pixel compensation value corresponding to each pixel point of each of the bright-field photos according to pixel compensation value = bright-field photo pixel value / flat-field coefficient; Generate the M bright-field compensated photos according to the pixel compensation value.
7. The flat field calibration method of the camera according to claim 5, characterized in that It further includes: Generate a compensated flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field compensated photos; And map to obtain a compensated flat-field calibration image through a preset pixel value mapping strategy and the compensated flat-field coefficient.
8. A flat-field calibration device for a camera, characterized in that, The flat-field calibration device includes a photo acquisition module, a dark-field calibration image generation module, a flat-field coefficient generation module, a flat-field calibration image generation module, and a correction module, where: The photo acquisition module is connected to the dark-field calibration image generation module and the flat-field coefficient generation module; the photo acquisition module is used to acquire N dark-field photos taken by the camera in a dark-field environment; and is used to acquire M bright-field photos taken by the camera in a bright-field environment; The dark-field calibration image generation module is connected to the photo acquisition module and the correction module, and the dark-field calibration image generation module is used to generate a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos; The flat-field coefficient generation module is connected to the photo acquisition module and the flat-field calibration image generation module, and the flat-field coefficient generation module is used to generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos; The flat-field calibration image generation module is connected to the flat-field coefficient generation module and the correction module, and the flat-field calibration image generation module is used to map to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient; The correction module is connected to the dark-field calibration image generation module and the flat-field calibration image generation module, and the correction module is used to correct the original image through the dark-field calibration image, the flat-field calibration image, and a preset image correction strategy to obtain a corrected image; Generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos, including: calculating the sum of the second pixel values of the pixel points at the same position in the M bright-field photos; each of the bright-field photos contains n pixel points; calculating the second pixel average value of each of the n pixel points through the sum of the second pixel values and the number M of the bright-field photos; summing up the pixel values of all the pixel points of the bright-field photos to obtain a sum of the third pixel values; calculating the third pixel average value according to the sum of the third pixel values, the number M of the bright-field photos, and the number n of pixel points contained in each of the bright-field photos; calculating the flat-field coefficient of the n pixel points, where the flat-field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value.
9. A flat-field calibration system, characterized in that, The flat-field calibration system includes the flat-field calibration device according to claim 8, as well as a camera, an LED display screen, and a bright-field light source, where: The bright-field light source is used to provide a bright-field environment for the LED display screen; The camera is communicatively connected to the flat-field calibration device. The camera is used to take pictures of the LED display screen showing the original image in a dark-field environment and a bright-field environment, respectively obtaining N dark-field photos and M bright-field photos. The flat-field calibration device is communicatively connected to the LED display screen and the camera. The flat-field calibration device is used to obtain N dark-field photos and M bright-field photos, and generate a dark-field calibration image according to a preset dark-field calibration image generation strategy and the dark-field photos; and generate a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos; and map to obtain a flat-field calibration image through a preset pixel value mapping strategy and the flat-field coefficient; and correct the original image through the dark-field calibration image, the flat-field calibration image, and a preset image correction strategy to obtain a corrected image. Generating a flat-field coefficient according to a preset flat-field coefficient calculation strategy and the bright-field photos includes: calculating the sum of the second pixel values of the pixel points at the same position in the M bright-field photos; each of the bright-field photos includes n pixel points; calculating the second pixel average value of each of the n pixel points through the sum of the second pixel values and the number M of the bright-field photos; summing up the pixel values of the pixel points of all the bright-field photos to obtain a sum of third pixel values; calculating a third pixel average value according to the sum of the third pixel values, the number M of the bright-field photos, and the number n of pixel points included in each bright-field photo; calculating the flat-field coefficients of the n pixel points, wherein the flat-field coefficient of the i-th pixel point is equal to the quotient of the second pixel average value of the i-th pixel point and the third pixel average value. The LED display screen is communicatively connected to the flat-field calibration device. The LED display screen is used to display the original image and the corrected image.
Citation Information
Patent Citations
Method and terminal of correcting camera exposure response
CN108510462A