Vignetting correction method and device, electronic equipment and storage medium

By acquiring the viscera correction matrix corresponding to the image to be corrected and determining the shooting conditions, the image is viscera corrected, and the problems of image brightness uniformity and poor visual effects after correction in the prior art are solved, thereby achieving better correction effects.

CN119722534APending Publication Date: 2025-03-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311236946.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, when the viscera correction is corrected, the corrected image brightness uniformity and visual effect are poor.

Method used

Viscera correction is performed on the image by acquiring the image to be corrected and determining the viscera correction matrix corresponding to its shooting conditions. The method includes acquiring the image to be corrected, determining a viscera correction matrix, and correcting the image based on the matrix.

Benefits of technology

Effective vibrating correction of images under different shooting conditions is achieved, and the brightness uniformity and visual effect of the corrected image are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722534A_ABST
    Figure CN119722534A_ABST
Patent Text Reader

Abstract

The invention relates to a vignetting correction method and device, electronic equipment and a storage medium. The vignetting correction method comprises the steps of obtaining a to-be-corrected image; determining a vignetting correction matrix corresponding to the shooting condition of the to-be-corrected image; and performing vignetting correction on the to-be-corrected image based on the vignetting correction matrix to obtain a corrected image. By acquiring the to-be-corrected image and determining the vignetting correction matrix corresponding to the shooting condition of the to-be-corrected image, vignetting correction can be performed on the to-be-corrected image according to the vignetting correction matrix to obtain the corrected image. The vignetting correction matrix corresponds to the shooting condition of the to-be-corrected image, the vignetting correction effect of the to-be-corrected image under different shooting conditions is ensured, and the brightness uniformity and visual effect of the corrected image are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to a vignetting correction method, device, electronic device and storage medium. Background Art

[0002] In recent years, with the rapid development of image acquisition and image display technology, people have higher and higher requirements for image quality. The image processing process before image formation is particularly critical. Various types of light attenuation during image acquisition will lead to the appearance of vignetting. It is necessary to process the image through vignetting correction to ensure the image quality.

[0003] However, when the vignetting correction method of the related art is used to process an image, the brightness uniformity and visual effect of the corrected image are poor. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a vignetting correction method, device, electronic device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a vignetting correction method is provided, the vignetting correction method comprising:

[0006] Acquire an image to be corrected;

[0007] Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected;

[0008] Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.

[0009] In some embodiments of the present disclosure, determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected includes:

[0010] The vignetting correction matrix is ​​determined based on the shooting conditions and preset configuration information, wherein the preset configuration information is used to characterize the corresponding relationship between different shooting conditions and the vignetting correction matrix.

[0011] In some embodiments of the present disclosure, performing vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image includes:

[0012] For each pixel unit in the image to be corrected, the following processing is performed to obtain the corrected image:

[0013] Get the initial pixel value of the pixel unit;

[0014] Determine the product of the initial pixel value of the pixel unit and the corresponding coefficient in the vignetting correction matrix as the corrected pixel value corresponding to the pixel unit;

[0015] The corrected pixel value is determined as the pixel value of the pixel unit.

[0016] In some embodiments of the present disclosure, the shooting conditions include the aperture size of the camera.

[0017] In some embodiments of the present disclosure, the process of generating a vignetting correction matrix includes:

[0018] Acquire a first image under preset shooting conditions;

[0019] Performing image filtering processing on the first image to obtain a second image;

[0020] Based on the second image, a vignetting correction matrix corresponding to the preset shooting condition is determined, and the vignetting correction matrix is ​​used for vignetting correction of the image captured under the corresponding preset shooting condition.

[0021] In some embodiments of the present disclosure, acquiring the first image under preset shooting conditions includes:

[0022] Acquire a plurality of third images captured under the preset shooting conditions;

[0023] averaging the plurality of third images to obtain a fourth image;

[0024] The fourth image is used as the first image, or the fourth image is converted into a grayscale image as the first image.

[0025] In some embodiments of the present disclosure, the acquiring of a plurality of third images under the preset shooting condition includes:

[0026] A plurality of images obtained by shooting the same display screen of the mobile terminal with a camera are determined as the plurality of third images.

[0027] In some embodiments of the present disclosure, the first image is a grayscale image, and performing image filtering on the first image to obtain the second image includes:

[0028] For each pixel unit in the first image, the following processing is performed to obtain the second image:

[0029] Taking the pixel unit as the center, determining the filtering area corresponding to the pixel unit; taking the median of the grayscale values ​​of each pixel unit in the filtering area to obtain a replacement grayscale value corresponding to the pixel unit;

[0030] The replacement grayscale value is determined as the grayscale value of the pixel unit.

[0031] In some embodiments of the present disclosure, determining the vignetting correction matrix corresponding to the preset shooting condition based on the second image includes:

[0032] Determine an average grayscale value based on the grayscale value of each pixel unit in the second image;

[0033] The vignetting correction matrix is ​​determined based on the second image and the average grayscale value.

[0034] In some embodiments of the present disclosure, determining the vignetting correction matrix based on the second image and the average grayscale value includes:

[0035] Determine a division coefficient matrix based on the pixel value and the average gray value of each pixel unit in the second image, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one;

[0036] The reciprocal of each of the coefficients is taken to obtain the vignetting correction matrix.

[0037] In some embodiments of the present disclosure, the first image is a color image, and performing image filtering on the first image to obtain the second image includes:

[0038] For each pixel unit in the first image, the following processing is performed to obtain the second image:

[0039] Taking the pixel unit as the center, determining the filtering area corresponding to the pixel unit;

[0040] Taking the median of the channel value of the preset primary color channel of each pixel unit in the filtering area to obtain a replacement channel value corresponding to the pixel unit;

[0041] The replacement channel value is determined as the channel value of the preset primary color channel of the pixel unit.

[0042] In some embodiments of the present disclosure, determining the vignetting correction matrix corresponding to the preset shooting condition based on the second image includes:

[0043] Determining an average channel value based on the channel value of the preset primary color channel of each pixel unit in the second image;

[0044] The vignetting correction matrix is ​​determined based on the second image and the average channel value.

[0045] In some embodiments of the present disclosure, determining the vignetting correction matrix based on the second image and the average channel value includes:

[0046] Determine a division coefficient matrix based on the pixel value and the average channel value of each pixel unit in the second image, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one;

[0047] The reciprocal of each of the coefficients is taken to obtain the vignetting correction matrix.

[0048] In some embodiments of the present disclosure, a process for generating preset configuration information for determining the vignetting correction matrix includes:

[0049] Determining the vignetting correction matrix under different preset shooting conditions;

[0050] The preset configuration information is determined based on the vignetting correction matrix under different preset shooting conditions, and the preset configuration information is used to characterize the corresponding relationship between the shooting conditions and the vignetting correction matrix.

[0051] According to a second aspect of an embodiment of the present disclosure, a vignetting correction device is provided, the vignetting correction device comprising:

[0052] An acquisition module, wherein the acquisition module is used to acquire an image to be corrected;

[0053] A determination module, the determination module is used to determine a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected;

[0054] A correction module is used to perform vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image.

[0055] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:

[0056] processor;

[0057] a memory for storing processor-executable instructions;

[0058] Wherein, the processor is configured to:

[0059] Acquire an image to be corrected;

[0060] Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected;

[0061] Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.

[0062] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform a vignetting correction method. The vignetting correction method includes:

[0063] Acquire an image to be corrected;

[0064] Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected;

[0065] Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.

[0066] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by acquiring the image to be corrected and determining the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, the vignetting correction can be performed on the image to be corrected according to the vignetting correction matrix to obtain a corrected image. The vignetting correction matrix corresponds to the shooting conditions of the image to be corrected, thereby ensuring the vignetting correction effect of the image to be corrected under different shooting conditions, and improving the brightness uniformity and visual effect of the corrected image.

[0067] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0069] Figure 1 It is a schematic diagram of dark corners.

[0070] Figure 2 The figure is a flow chart of a vignetting correction method according to an exemplary embodiment.

[0071] Figure 3 The flowchart is a process of performing a process on each pixel unit in an image to be corrected to obtain a corrected image according to an exemplary embodiment.

[0072] Figure 4 is a flowchart showing a process of generating a vignetting correction matrix according to an exemplary embodiment.

[0073] Figure 5 The flowchart of acquiring a first image under preset shooting conditions is shown according to an exemplary embodiment.

[0074] Figure 6 The flowchart is a process of performing a processing process on each pixel unit in a first image to obtain a second image according to an exemplary embodiment.

[0075] Figure 7 The present invention is a flowchart showing a method of determining a vignetting correction matrix corresponding to a preset shooting condition based on a second image according to an exemplary embodiment.

[0076] Figure 8 The present invention is a flowchart of determining a vignetting correction matrix based on a second image and an average grayscale value according to an exemplary embodiment.

[0077] Fig. 9 is a flowchart of a processing procedure of executing a processing procedure on each pixel unit in a first image to obtain a second image according to another exemplary embodiment.

[0078] Fig.10 The present invention is a flowchart showing a method of determining a vignetting correction matrix corresponding to a preset shooting condition based on a second image according to another exemplary embodiment.

[0079] Fig.11 The flowchart of determining a vignetting correction matrix based on a second image and an average grayscale value according to another exemplary embodiment is shown.

[0080] Fig.12 is a flow chart of a vignetting correction method according to another exemplary embodiment.

[0081] Fig.13 is a block diagram of a vignetting correction device according to an exemplary embodiment.

[0082] Fig.14 is a block diagram of an electronic device according to an exemplary embodiment.

[0083] In the figure:

[0084] 10-acquisition module; 20-determination module; 30-correction module; 101-processing component; 102-memory; 103-power component; 104-multimedia component; 105-audio component; 106-input / output interface; 107-sensor component; 108-communication component; 109-processor. DETAILED DESCRIPTION

[0085] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0086] In recent years, with the rapid development of image acquisition and image display technology, people have higher and higher requirements for image quality, making the image processing process for imaging defects before imaging more critical. Light attenuation caused by various factors such as lens components blocking the light path, off-axis incident light being blocked, and image sensor sensitivity will cause the following: Figure 1The appearance of the vignetting shown in the figure makes the four corners of the image darker, affecting the image quality and the detection accuracy of the optical detection. Therefore, vignetting correction becomes a necessary image processing process to ensure the image quality.

[0087] However, the vignetting correction method of the related art used to correct the image to be corrected cannot be applied to the images to be corrected under different shooting conditions at the same time and has obvious limitations, resulting in poor correction effect, which leads to poor brightness uniformity and visual effect of the corrected image. Based on this, the exemplary embodiment of the present disclosure provides a vignetting correction method, which can perform vignetting correction on the image to be corrected according to the vignetting correction matrix by acquiring the image to be corrected and determining the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, and obtain a corrected image. The vignetting correction matrix corresponds to the shooting conditions of the image to be corrected, which ensures the vignetting correction effect on the images to be corrected under different shooting conditions and improves the brightness uniformity and visual effect of the corrected image. In an exemplary embodiment, reference Figure 2 As shown, a vignetting correction method is provided, and the vignetting correction method includes:

[0088] S400: Acquire an image to be corrected.

[0089] In step S400, exemplarily, the image to be corrected can be obtained by acquiring the image actually taken by the camera, and the image to be corrected is taken under certain shooting conditions. The shooting conditions may include, for example, the aperture value of the camera, the brightness of the object, the distance between the camera and the object, etc.

[0090] S500: Determine a vignetting correction matrix corresponding to shooting conditions of the image to be corrected.

[0091] In step S500, since the vignetting produced under the same shooting conditions is roughly the same, it is necessary to determine a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected. The vignetting correction matrix may, for example, have multiple correction coefficients, and the pixel units of the image to be corrected correspond one-to-one to the correction coefficients in the vignetting correction matrix.

[0092] S600: Perform vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image.

[0093] In step S600, according to the determined vignetting correction matrix, the acquired image to be corrected is subjected to vignetting correction to obtain a corrected image. The vignetting correction matrix based on which the vignetting correction is performed corresponds to the shooting conditions of the image to be corrected, so that the vignetting correction matrix can be applied to the image to be corrected, thereby ensuring the vignetting correction effect.

[0094] In this embodiment, by acquiring the image to be corrected and determining the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, the vignetting correction can be performed on the image to be corrected according to the vignetting correction matrix to obtain a corrected image. The vignetting correction matrix corresponds to the shooting conditions of the image to be corrected, which ensures the vignetting correction effect of the image to be corrected under different shooting conditions and improves the brightness uniformity and visual effect of the corrected image.

[0095] In some embodiments, determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected includes: determining the vignetting correction matrix based on the shooting conditions and preset configuration information, wherein the preset configuration information is used to characterize the correspondence between different shooting conditions and the vignetting correction matrix.

[0096] Exemplarily, before determining the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, the vignetting correction matrix corresponding to the shooting conditions can be generated by changing different shooting conditions, and preset configuration information can be constructed according to the different shooting conditions and the corresponding vignetting correction matrix. The preset configuration information can characterize the correspondence between different shooting conditions and the vignetting correction matrix, and the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected can be determined according to the preset configuration information.

[0097] In this embodiment, based on the shooting conditions of the image to be corrected and the preset configuration information, the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected can be determined, so that the vignetting correction matrix based on which the subsequent vignetting correction is based corresponds to the shooting conditions of the image to be corrected, thereby ensuring the vignetting correction effect and accuracy of the image to be corrected under different shooting conditions, and improving the brightness uniformity and visual effect of the corrected image.

[0098] In some embodiments, reference Figure 3 As shown, based on the vignetting correction matrix, the image to be corrected is subjected to vignetting correction to obtain a corrected image, including: for each pixel unit in the image to be corrected, the following processing is performed to obtain a corrected image:

[0099] S610: Obtain an initial pixel value of the pixel unit.

[0100] In step S610, the initial pixel value of the pixel unit is obtained. The smaller the initial pixel value, the darker the brightness of the pixel unit. For an image to be corrected with dark corners, the initial pixel values ​​of the pixel units in the four corners are smaller.

[0101] S620: Determine the product of the initial pixel value of the pixel unit and the corresponding coefficient in the vignetting correction matrix as the corrected pixel value corresponding to the pixel unit.

[0102] In step S620, each pixel unit in the image to be corrected corresponds to the correction coefficient in the vignetting correction matrix one by one, the initial pixel value of the pixel unit is multiplied by the corresponding coefficient in the vignetting correction matrix, and the obtained product is used as the correction pixel value corresponding to the pixel unit.

[0103] S630: Determine the corrected pixel value as the pixel value of the pixel unit.

[0104] In step S630, the corrected pixel value is determined as the pixel value of the pixel unit, that is, the initial pixel value of the pixel unit is replaced by the corrected pixel value corresponding to the pixel unit.

[0105] For example, the initial pixel values ​​of each pixel unit in the image to be corrected are, for example, r1, r2, ..., r m*n , the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected is, for example, Then, the initial pixel value of the pixel unit is multiplied by the corresponding coefficient in the dark corner correction matrix to obtain multiple corrected pixel values ​​r1*q / p1, r2*q / p2, ..., r m*n *q / p m*n , and the corrected pixel value is used as the pixel value of the corresponding pixel unit.

[0106] After executing the processing from step S610 to step S630 for each pixel unit in the image to be corrected, a corrected image is obtained, and the pixel value of each pixel unit in the corrected image is a corrected pixel value. For a pixel unit with a smaller initial pixel value, the corresponding correction coefficient in the final vignetting correction matrix is ​​larger, so that the corrected pixel value obtained after multiplication is larger, and the brightness of the originally dark pixel unit can be increased.

[0107] In this embodiment, the above-mentioned processing is performed on each pixel unit in the image to be corrected, and the corrected pixel value is obtained by calculating each pixel unit in the image to be corrected through the vignetting correction matrix. The corrected image is obtained by replacing the initial pixel value with the corrected pixel value, thereby achieving vignetting correction of the image to be corrected, and improving the brightness uniformity and visual effect of the image to be corrected.

[0108] In some embodiments, the shooting conditions include the aperture size of the camera.

[0109] The shooting conditions may include, for example, the aperture size of the camera, which affects the amount of light entering the camera, thereby affecting the vignetting of the captured image. The shooting conditions may also include, for example, the brightness of the object being shot and the distance between the camera and the object being shot. For example, different preset shooting conditions correspond to different preset aperture values ​​of the same camera. When determining the vignetting correction matrix under different preset shooting conditions, the preset aperture value of the camera may be changed, and other shooting conditions may be controlled to remain unchanged, so as to respectively determine different vignetting correction matrices corresponding to different aperture sizes of the camera.

[0110] In this embodiment, the shooting conditions include the aperture size of the camera. The vignetting correction matrix corresponding to different aperture sizes of the camera can be determined by changing the preset aperture value of the camera, thereby realizing the determination of the vignetting correction matrix under different preset shooting conditions. Furthermore, vignetting correction can be performed on the image to be corrected that is shot by the camera under shooting conditions with different aperture sizes, thereby improving the applicability of the vignetting correction method.

[0111] In order to determine the vignetting correction matrix corresponding to the shooting condition of the image to be corrected, it is necessary to generate the vignetting correction matrix under different shooting conditions. In an exemplary embodiment, reference is made to Figure 4 As shown, the generation process of the vignetting correction matrix includes:

[0112] S100: Acquire a first image under preset shooting conditions.

[0113] In step S100, illustratively, for example, the first image may be obtained by obtaining an image actually captured by the camera, or the first image may be an image obtained after the actual captured image is processed. The first image may be, for example, a grayscale image or a color image including three primary color channels. The preset shooting conditions may include, for example, the aperture value of the camera, the brightness of the captured object, the distance between the camera and the captured object, etc. The vignetting generated under the same preset shooting conditions is substantially the same, so that the vignetting correction matrix finally obtained can perform vignetting correction on the captured image under the preset shooting conditions.

[0114] S200: Perform image filtering processing on the first image to obtain a second image.

[0115] In step S200, the image filtering process may include, for example, low-pass filtering, mean filtering or median filtering, etc., to achieve the change of the pixel unit in the image through the filter. Performing image filtering on the first image to smooth the first image obtained in step S100 can avoid the risk of generating impact noise on the obtained second image, eliminate the interference of impact noise, and facilitate the subsequent determination of the vignetting correction matrix according to the second image.

[0116] S300: Determine a vignetting correction matrix corresponding to a preset shooting condition based on the second image, where the vignetting correction matrix is ​​used for vignetting correction of an image captured under the corresponding preset shooting condition.

[0117] In step S300, the vignetting correction matrix corresponding to the preset shooting conditions can be determined based on the second image. By way of example, the vignetting correction matrix may be composed of a plurality of correction coefficients, each correction coefficient corresponding to each pixel unit of the captured image. The pixel values ​​of the corresponding pixel units in the captured image can be calculated using the correction coefficients in the vignetting correction matrix to achieve vignetting correction for the image captured under the preset shooting conditions.

[0118] In this embodiment, by performing image filtering processing on the first image under preset shooting conditions to obtain the second image, the impact noise can be reduced or removed, so that the vignetting correction matrix determined according to the second image eliminates the interference of the impact noise. The vignetting correction matrix can be used to perform vignetting correction on the image captured under preset shooting conditions, thereby ensuring the stability of the vignetting correction and improving the brightness uniformity and visual effect of the corrected captured image.

[0119] In some embodiments, reference Figure 5 As shown, obtaining a first image under preset shooting conditions includes:

[0120] S110: Acquire a plurality of third images captured under preset shooting conditions.

[0121] In step S110, a plurality of third images are first acquired. The third image may be, for example, an image actually captured by a camera. The plurality of third images are images captured of the same subject under the same preset shooting conditions. For example, images of the same subject continuously captured by the camera under the preset shooting conditions may be taken as the plurality of third images.

[0122] S120 , averaging the multiple third images to obtain a fourth image.

[0123] In step S120, since each third image has the same preset shooting conditions and shooting object, the plurality of third images can be superimposed and averaged to obtain a fourth image. For example, the pixel values ​​of corresponding pixel units in the plurality of third images can be averaged as the pixel value of each pixel unit of the fourth image.

[0124] S130: Use the fourth image as the first image, or convert the fourth image into a grayscale image as the first image.

[0125] In step S130, the fourth image may be, for example, a color image including three primary color channels. The fourth image may be directly used as the first image, or the fourth image may be converted into a grayscale image so that the converted image has only one grayscale channel, and the converted grayscale image may be used as the first image.

[0126] In this embodiment, by acquiring multiple third images captured under preset shooting conditions and averaging the multiple third images to obtain a fourth image, the fourth image or a grayscale image converted from the fourth image can be used as the first image, thereby achieving the acquisition of the first image, and the subsequent second image and vignetting correction matrix can be determined based on the first image. The fourth image is obtained by superimposing and averaging multiple third images, which also plays a certain degree of noise reduction role, further reduces or removes impact noise, and improves the brightness uniformity and visual effect of the corrected captured image.

[0127] In some embodiments, acquiring a plurality of third images under preset shooting conditions includes: determining a plurality of images obtained by shooting a same display screen of the mobile terminal with a camera as the plurality of third images.

[0128] The same display screen of the mobile terminal is used as the shooting object of the camera. The mobile terminal can be, for example, a mobile phone, a tablet computer, etc. The same display screen of the mobile terminal can be displayed by operating the mobile terminal. For example, the display screen can be set to white with a preset brightness. Under the preset shooting conditions, the same display screen of the mobile terminal is shot multiple times by the camera, and the multiple images shot are determined as multiple third images for acquisition.

[0129] In this embodiment, multiple images obtained by shooting the same display screen of the mobile terminal with a camera are determined as multiple third images, so that the acquisition of multiple third images is achieved, and the subsequent first image can be determined based on the multiple third images. By using the same display screen of the mobile terminal as the shooting object, the self-luminous property of the mobile terminal and the in-plane uniformity of the display screen are fully utilized, which is conducive to ensuring the distance between the shooting object and the camera and the stability of the brightness, and avoiding errors caused by setting up additional light sources.

[0130] In some embodiments, the first image is a grayscale image with only one grayscale channel, and the first image can be subjected to image filtering processing by, for example, low-pass filtering or mean filtering. In other embodiments, the first image is also a grayscale image with only one grayscale channel. Figure 6 As shown, performing image filtering processing on the first image to obtain the second image includes: for each pixel unit in the first image, performing the following processing process to obtain the second image:

[0131] S210 , taking the pixel unit as the center, determining a filtering area corresponding to the pixel unit.

[0132] In step S210, the filtering area is the window range for subsequent pixel units to perform filtering operations. Exemplarily, the filtering area can be, for example, a 3*3 window centered on the pixel unit, that is, the pixel unit is located at the center of the filtering area, and the filtering area includes 8 pixel units surrounding the pixel unit in addition to the pixel unit.

[0133] S220 , taking the median of the grayscale values ​​of each pixel unit in the filtering area to obtain a replacement grayscale value corresponding to the pixel unit.

[0134] In step S220, the grayscale values ​​of the pixel units including the pixel unit in the filtering area corresponding to the pixel unit are median, which is used as the replacement grayscale value corresponding to the pixel unit. Exemplarily, when the filtering area is a 3*3 window centered on the pixel unit, the grayscale values ​​of all 9 pixel units included in the filtering area are sorted from large to small, and the grayscale value ranked fifth is used as the replacement grayscale value of the pixel unit.

[0135] S230: Determine the replacement grayscale value as the grayscale value of the pixel unit.

[0136] In step S230, the replacement grayscale value is determined as the grayscale value of the pixel unit, that is, the initial grayscale value of the pixel unit is replaced by the replacement grayscale value corresponding to the pixel unit.

[0137] When the first image is a grayscale image, after executing the processing process from step S210 to step S230 on each pixel unit in the first image, a second image is obtained, and the grayscale values ​​of each pixel unit in the second image are all replacement grayscale values, thereby realizing image filtering processing of the first image.

[0138] In this embodiment, by performing the above processing on each pixel unit in the first image, each pixel unit can determine the corresponding replacement grayscale value according to the corresponding filtering area, and obtain the second image by replacing the original initial grayscale value with the replacement grayscale value, thereby realizing filtering processing of the first image, reducing or removing impact noise, and eliminating the interference of impact noise according to the vignetting correction matrix determined by the second image, thereby improving the brightness uniformity and visual effect of the corrected captured image. This image filtering processing method does not rely on the linear relationship between pixel units, has a good filtering effect on impact noise, and can also retain the edge details of the image.

[0139] In some embodiments, after performing image filtering on the first image which is a grayscale image to obtain the second image, referring to Figure 7As shown, based on the second image, determining the vignetting correction matrix corresponding to the preset shooting condition includes:

[0140] S310: Determine an average grayscale value based on the grayscale value of each pixel unit in the second image.

[0141] S320: Determine a vignetting correction matrix based on the second image and the average grayscale value.

[0142] In step S310 to step S320, the grayscale values ​​of each pixel unit in the second image are first averaged to determine the average grayscale value, which can represent the average brightness of the second image. After determining the average grayscale value, for example, the pixel values ​​of each pixel unit in the second image can be calculated by the average grayscale value to obtain the correction coefficient corresponding to each pixel unit to determine the vignetting correction matrix.

[0143] In this embodiment, the average grayscale value is determined according to the grayscale value of each pixel unit in the second image, and the vignetting correction matrix is ​​determined according to the second image and the average grayscale value, so that the vignetting correction matrix is ​​determined, and the vignetting correction of the image captured under the preset shooting conditions can be performed through the vignetting correction matrix, thereby improving the brightness uniformity and visual effect of the corrected captured image. The vignetting correction matrix is ​​determined based on the second image after image filtering, eliminating the interference of impact noise points. The determination of the vignetting correction matrix is ​​based on the average grayscale value, so that the overall image after vignetting correction can be maintained within the normal brightness range under the preset shooting conditions.

[0144] In some embodiments, reference Figure 8 As shown, based on the second image and the average gray value, a vignetting correction matrix is ​​determined, including:

[0145] S321. Determine a division coefficient matrix based on the pixel value and average grayscale value of each pixel unit in the second image, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one.

[0146] In step S321, the pixel values ​​of each pixel unit in the second image are divided by the average grayscale value to obtain a plurality of coefficients corresponding to each pixel unit one by one, and the plurality of coefficients constitute a division coefficient matrix.

[0147] S322, taking the inverse of each coefficient to obtain a vignetting correction matrix.

[0148] In step S322, the inverse of each coefficient in the coefficient matrix is ​​taken to obtain a plurality of correction coefficients corresponding to each coefficient, ie, each pixel unit, and the plurality of correction coefficients constitute a vignetting correction matrix.

[0149] Exemplarily, the second image includes m*n pixel units, and the pixel values ​​of each pixel unit are p1, p2, ..., p m*n, the average gray value is q, then the pixel value of each pixel unit in the second image can be divided by the average gray value to obtain the division coefficient matrix Then take the inverse of each coefficient in the coefficient matrix to get the vignetting correction matrix It can be understood that for any pixel unit, the smaller the pixel value, the darker the brightness, and the larger the corresponding correction coefficient in the final vignetting correction matrix, so that the pixel value of the pixel unit after correction is larger, so that the brightness of the pixel unit is brighter.

[0150] In this embodiment, a division coefficient matrix is ​​determined based on the pixel value and average grayscale value of each pixel unit in the second image, and then the inverse of each coefficient in the division coefficient matrix is ​​taken to obtain a vignetting correction matrix. This enables the correction coefficients in the vignetting correction matrix to balance the brightness of each pixel unit under preset shooting conditions to achieve vignetting correction, thereby improving the brightness uniformity and visual effect of the corrected captured image.

[0151] In some embodiments, the first image is a color image. It should be noted that the first image being a color image means that the first image includes three primary color channels, namely RBG (Red Blue Green) channels, and does not represent the color of the photographed object. When the photographed object is the display screen of a mobile terminal, the display screen of the mobile terminal may be white. Fig. 9 As shown, performing image filtering processing on the first image to obtain a second image includes:

[0152] For each pixel unit in the first image, the following processing is performed to obtain the second image:

[0153] S240 , taking the pixel unit as the center, determining a filtering area corresponding to the pixel unit.

[0154] In step S240, the filtering area is the window range for subsequent pixel units to perform filtering operations. Exemplarily, the filtering area can be, for example, a 3*3 window centered on the pixel unit, that is, the pixel unit is located at the center of the filtering area, and the filtering area includes 8 pixel units surrounding the pixel unit in addition to the pixel unit.

[0155] S250 , taking the median of the channel values ​​of the preset primary color channels of each pixel unit in the filtering area to obtain a replacement channel value corresponding to the pixel unit.

[0156] In step S250, the channel values ​​of the preset primary color channels of the pixel units in the filtering area corresponding to the pixel unit are taken as the median value as the replacement channel value corresponding to the pixel unit, and the preset primary color channel can be, for example, any one of the red primary color channel, the blue primary color channel or the green primary color channel. Exemplarily, when the filtering area is a 3*3 window centered on the pixel unit, the channel values ​​of the red primary color channels of all 9 pixel units included in the filtering area are sorted from large to small, and the channel value ranked 5th is used as the replacement channel value of the pixel unit.

[0157] S260: Determine the replacement channel value as the channel value of the preset primary color channel of the pixel unit.

[0158] In step S260, the replacement channel value is determined as the channel value of the preset primary color channel of the pixel unit, that is, the initial channel value of the preset primary color channel of the pixel unit is replaced by the replacement channel value corresponding to the pixel unit.

[0159] When the first image is a color image, after executing the processing process from step S240 to step S260 on each pixel unit in the first image, a second image is obtained, and the channel values ​​of the preset primary color channels of each pixel unit in the second image are all replacement channel values, thereby realizing image filtering processing of the first image.

[0160] In this embodiment, by performing the above processing on each pixel unit in the first image, each pixel unit can determine the corresponding replacement channel value according to the corresponding filtering area, and obtain the second image by replacing the original initial channel value of the same preset base color channel with the replacement channel value, thereby realizing filtering processing of the first image, reducing or removing impact noise, and eliminating the interference of impact noise according to the vignetting correction matrix determined by the second image, thereby improving the brightness uniformity and visual effect of the corrected captured image. This image filtering processing method does not rely on the linear relationship between pixel units, has a good filtering effect on impact noise, and can also retain the edge details of the image.

[0161] In some embodiments, after performing image filtering on the first image which is a color image to obtain the second image, referring to Fig.10 As shown, based on the second image, determining the vignetting correction matrix corresponding to the preset shooting condition includes:

[0162] S330: Determine an average channel value based on the channel value of the preset primary color channel of each pixel unit in the second image.

[0163] S340: Determine a vignetting correction matrix based on the second image and the average channel value.

[0164] In step S330 to step S340, the channel values ​​of the preset primary color channels of each pixel unit in the second image are first averaged to determine the average channel value, which can represent the average color value of the second image in the preset primary color channel. After the average channel value is determined, for example, the pixel values ​​of each pixel unit in the second image can be calculated by the average channel value to obtain the correction coefficient corresponding to each pixel unit to determine the vignetting correction matrix.

[0165] In this embodiment, the average channel value is determined according to the channel value of the preset primary color channel of each pixel unit in the second image, and then the vignetting correction matrix is ​​determined according to the second image and the average channel value, so that the vignetting correction matrix can be determined, and the vignetting correction of the image captured under the preset shooting conditions can be performed through the vignetting correction matrix, thereby improving the brightness uniformity and visual effect of the corrected captured image. The vignetting correction matrix is ​​determined based on the second image after image filtering, eliminating the interference of impact noise points. The determination of the vignetting correction matrix is ​​based on the average channel value, so that the overall image after vignetting correction can maintain the normal color value range of the preset primary color channel under the preset shooting conditions.

[0166] In some embodiments, reference Fig.11 As shown, based on the second image and the average channel value, a vignetting correction matrix is ​​determined, including:

[0167] S341. Determine a division coefficient matrix based on the pixel value of each pixel unit in the second image and the average channel value, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one.

[0168] In step S341, the pixel value of each pixel unit in the second image is divided by the average channel value to obtain a plurality of coefficients corresponding to each pixel unit one by one, and the plurality of coefficients constitute a division coefficient matrix.

[0169] S342, taking the inverse of each coefficient to obtain a vignetting correction matrix.

[0170] In step S322, the inverse of each coefficient in the coefficient matrix is ​​taken to obtain a plurality of correction coefficients corresponding to each coefficient, ie, each pixel unit, and the plurality of correction coefficients constitute a vignetting correction matrix.

[0171] Exemplarily, the second image includes x*y pixel units, and the pixel values ​​of each pixel unit are j1, j2, ..., j x*y , the average channel value is k, then the pixel value of each pixel unit in the second image can be divided by the average channel value to obtain the division coefficient matrix Then take the inverse of each coefficient in the coefficient matrix to get the vignetting correction matrix It can be understood that for any pixel unit, the smaller the pixel value, the darker the brightness, and the larger the corresponding correction coefficient in the final vignetting correction matrix, so that the pixel value of the pixel unit after correction is larger, so that the brightness of the pixel unit is brighter.

[0172] In this embodiment, a division coefficient matrix is ​​determined based on the pixel value and the average channel value of each pixel unit in the second image, and then the inverse of each coefficient in the division coefficient matrix is ​​taken to obtain a vignetting correction matrix. This enables the correction coefficients in the vignetting correction matrix to balance the brightness of each pixel unit under preset shooting conditions to achieve vignetting correction, thereby improving the brightness uniformity and visual effect of the corrected captured image.

[0173] In an exemplary embodiment, reference Fig.12 As shown, a vignetting correction method is provided, and the vignetting correction method includes:

[0174] S1. Acquire a plurality of third images captured under preset shooting conditions;

[0175] S2, averaging the plurality of third images to obtain a fourth image;

[0176] S3, using the fourth image as the first image, or converting the fourth image into a grayscale image as the first image;

[0177] S4, when the first image is a grayscale image, for each pixel unit in the first image, taking the pixel unit as the center, determining a filtering area corresponding to the pixel unit;

[0178] S5, taking the median of the grayscale values ​​of each pixel unit in the filtering area to obtain a replacement grayscale value corresponding to the pixel unit;

[0179] S6, determining the replacement grayscale value as the grayscale value of the pixel unit to obtain a second image;

[0180] S7, determining an average grayscale value based on the grayscale value of each pixel unit in the second image;

[0181] S8, determining a division coefficient matrix based on the pixel value and the average grayscale value of each pixel unit in the second image;

[0182] S9, taking the inverse of each coefficient to obtain a vignetting correction matrix;

[0183] S10, when the first image is a color image, for each pixel unit in the first image, taking the pixel unit as the center, determining a filtering area corresponding to the pixel unit;

[0184] S11, taking the median of the channel value of the preset primary color channel of each pixel unit in the filtering area to obtain a replacement channel value corresponding to the pixel unit;

[0185] S12, determining the replacement channel value as the channel value of the preset primary color channel of the pixel unit to obtain a second image;

[0186] S13, determining an average channel value based on the channel value of the preset primary color channel of each pixel unit in the second image;

[0187] S14, determining a division coefficient matrix based on the pixel value and the average channel value of each pixel unit in the second image;

[0188] S15, taking the inverse of each coefficient to obtain a vignetting correction matrix;

[0189] S16, determining a vignetting correction matrix under different preset shooting conditions;

[0190] S17, determining configuration information based on the vignetting correction matrix under different preset shooting conditions;

[0191] S18, obtaining the image to be corrected;

[0192] S19, determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected based on the configuration information and the shooting conditions of the image to be corrected;

[0193] S20, for each pixel unit in the image to be corrected, obtaining an initial pixel value of the pixel unit;

[0194] S21, determining the product of the initial pixel value of the pixel unit and the corresponding coefficient in the vignetting correction matrix as the corrected pixel value corresponding to the pixel unit;

[0195] S22: Determine the corrected pixel value as the pixel value of the pixel unit to obtain a corrected image.

[0196] In this embodiment, by acquiring the image to be corrected and determining the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, the vignetting correction can be performed on the image to be corrected according to the vignetting correction matrix to obtain a corrected image. The vignetting correction matrix corresponds to the shooting conditions of the image to be corrected, which ensures the vignetting correction effect of the image to be corrected under different shooting conditions and improves the brightness uniformity and visual effect of the corrected image. By performing image filtering processing on the first image under preset shooting conditions to obtain a second image, impact noise can be reduced or removed, so that the interference of impact noise is eliminated according to the vignetting correction matrix determined according to the second image.

[0197] In an exemplary embodiment, reference Fig.13As shown, a vignetting correction device is provided, which includes an acquisition module 10, a determination module 20 and a correction module 30. The acquisition module 10 is used to acquire an image to be corrected, the determination module 20 is used to determine a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected, and the correction module 30 is used to perform vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image.

[0198] In this embodiment, the image to be corrected is obtained by the acquisition module 10 and the vignetting correction matrix corresponding to the shooting conditions of the image to be corrected is determined by the determination module 20. The correction module 30 can perform vignetting correction on the image to be corrected according to the vignetting correction matrix to obtain a corrected image. The vignetting correction matrix corresponds to the shooting conditions of the image to be corrected, which ensures the vignetting correction effect of the image to be corrected under different shooting conditions and improves the brightness uniformity and visual effect of the corrected image.

[0199] In one embodiment, the determination module 20 is further used to determine a vignetting correction matrix based on the shooting conditions and preset configuration information, where the preset configuration information is used to characterize the correspondence between different shooting conditions and the vignetting correction matrix.

[0200] In one embodiment, the correction module 30 is also used to: for each pixel unit in the image to be corrected, perform the following processing to obtain a corrected image: obtain the initial pixel value of the pixel unit; determine the product of the initial pixel value of the pixel unit and the corresponding coefficient in the vignetting correction matrix as the corrected pixel value corresponding to the pixel unit; determine the corrected pixel value as the pixel value of the pixel unit.

[0201] In some embodiments, the vignetting correction device further includes a generating module, and the generating module is used for the vignetting correction matrix.

[0202] In one embodiment, the generation module is also used to: obtain a first image under preset shooting conditions; perform image filtering on the first image to obtain a second image; and based on the second image, determine a vignetting correction matrix corresponding to the preset shooting conditions, wherein the vignetting correction matrix is ​​used to correct the vignetting of the image captured under the corresponding preset shooting conditions.

[0203] In one embodiment, the generation module is also used to: obtain multiple third images taken under preset shooting conditions, average the multiple third images to obtain a fourth image, use the fourth image as the first image, or convert the fourth image into a grayscale image as the first image.

[0204] In one embodiment, the first image is a grayscale image, and the generation module is also used to: for each pixel unit in the first image, perform the following processing to obtain a second image: with the pixel unit as the center, determine the filtering area corresponding to the pixel unit, take the median of the grayscale values ​​of each pixel unit in the filtering area, obtain a replacement grayscale value corresponding to the pixel unit, and determine the replacement grayscale value as the grayscale value of the pixel unit.

[0205] In one embodiment, the first image is a grayscale image, and the generating module is further used to: determine an average grayscale value based on the grayscale value of each pixel unit in the second image, and determine a vignetting correction matrix based on the second image and the average grayscale value.

[0206] In one embodiment, the first image is a grayscale image, and the generation module is also used to: determine a division coefficient matrix based on the pixel value and average grayscale value of each pixel unit in the second image, each pixel unit corresponds one-to-one to the coefficient in the division coefficient matrix, and take the inverse of each coefficient to obtain a vignetting correction matrix.

[0207] In one embodiment, the first image is a color image, and the generation module is also used to: for each pixel unit in the first image, perform the following processing to obtain a second image: with the pixel unit as the center, determine the filtering area corresponding to the pixel unit, take the median of the channel values ​​of the preset primary color channels of each pixel unit in the filtering area, obtain the replacement channel value corresponding to the pixel unit, and determine the replacement channel value as the channel value of the preset primary color channel of the pixel unit.

[0208] In one embodiment, the first image is a color image, and the generation module is further used to: determine an average channel value based on the channel value of a preset primary color channel of each pixel unit in the second image, and determine a vignetting correction matrix based on the second image and the average channel value.

[0209] In one embodiment, the first image is a color image, and the generation module is also used to: determine a division coefficient matrix based on the pixel value and average channel value of each pixel unit in the second image, each pixel unit corresponds one-to-one to the coefficient in the division coefficient matrix, and take the inverse of each coefficient to obtain a vignetting correction matrix.

[0210] In one embodiment, the generation module is further used to: determine the vignetting correction matrix under different preset shooting conditions; based on the vignetting correction matrix under different preset shooting conditions, determine preset configuration information, the preset configuration information is used to characterize the correspondence between the shooting conditions and the vignetting correction matrix.

[0211] In an exemplary embodiment, an electronic device is provided, referring to Fig.14As shown, the electronic device may include one or more of the following components: a processing component 101 , a memory 102 , a power component 103 , a multimedia component 104 , an audio component 105 , an input / output (I / O) interface 106 , a sensor component 107 , and a communication component 108 .

[0212] The processing component 101 generally controls the overall operation of the electronic device, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 101 may include one or more processors 109 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 101 may include one or more modules to facilitate the interaction between the processing component 101 and other components. For example, the processing component 101 may include a multimedia module to facilitate the interaction between the multimedia component 104 and the processing component 101.

[0213] The memory 102 is configured to store various types of data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc. The memory 102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0214] The power component 103 provides power to various components of the electronic device. The power component 103 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0215] The multimedia component 104 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 104 includes a front camera and / or a rear camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0216] The audio component 105 is configured to output and / or input audio signals. For example, the audio component 105 includes a microphone (MIC), and when the electronic device is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 102 or sent via the communication component 108. In some embodiments, the audio component 105 also includes a speaker for outputting audio signals.

[0217] I / O interface 106 provides an interface between processing component 101 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0218] The sensor assembly 107 includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor assembly 107 can detect the on / off state of the electronic device, the relative positioning of components, such as the display and keypad of the electronic device, and the sensor assembly 107 can also detect the position change of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device and the temperature change of the electronic device. The sensor assembly 107 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 107 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 107 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0219] The communication component 108 is configured to facilitate wired or wireless communication between the electronic device and other devices. The device can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 108 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 108 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0220] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned vignetting correction method applied to the electronic device.

[0221] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 102 including instructions, and the instructions can be executed by a processor 109 of an electronic device to complete the above-mentioned vignetting correction method applied to the electronic device. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical data storage device. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the vignetting correction method shown in the above embodiment.

[0222] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0223] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A vignetting correction method, characterized in that: The vignetting correction method comprises: Acquire an image to be corrected; Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected; Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.

2. The vignetting correction method according to claim 1, characterized in that: The step of determining a vignetting correction matrix corresponding to a shooting condition of the image to be corrected includes: The vignetting correction matrix is ​​determined based on the shooting conditions and preset configuration information, wherein the preset configuration information is used to characterize the corresponding relationship between different shooting conditions and the vignetting correction matrix.

3. The vignetting correction method according to claim 1, characterized in that: The step of performing vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image includes: For each pixel unit in the image to be corrected, the following processing is performed to obtain the corrected image: Get the initial pixel value of the pixel unit; Determine the product of the initial pixel value of the pixel unit and the corresponding coefficient in the vignetting correction matrix as the corrected pixel value corresponding to the pixel unit; The corrected pixel value is determined as the pixel value of the pixel unit.

4. The vignetting correction method according to any one of claims 1 to 3, characterized in that: The shooting conditions include the aperture size of the camera.

5. The vignetting correction method according to any one of claims 1 to 3, characterized in that: The generation process of the vignetting correction matrix includes: Acquire a first image under preset shooting conditions; Performing image filtering processing on the first image to obtain a second image; Based on the second image, a vignetting correction matrix corresponding to the preset shooting condition is determined, and the vignetting correction matrix is ​​used for vignetting correction of the image captured under the corresponding preset shooting condition.

6. The vignetting correction method according to claim 5, characterized in that: The obtaining of the first image under the preset shooting condition comprises: Acquire a plurality of third images captured under the preset shooting conditions; averaging the plurality of third images to obtain a fourth image; The fourth image is used as the first image, or the fourth image is converted into a grayscale image as the first image.

7. The vignetting correction method according to claim 6, characterized in that: The acquiring of a plurality of third images under the preset shooting condition comprises: A plurality of images obtained by shooting the same display screen of the mobile terminal with a camera are determined as the plurality of third images.

8. The vignetting correction method according to claim 5, characterized in that: The first image is a grayscale image, and performing image filtering on the first image to obtain a second image includes: For each pixel unit in the first image, the following processing is performed to obtain the second image: Taking the pixel unit as the center, determining the filtering area corresponding to the pixel unit; Taking the median of the grayscale values ​​of each pixel unit in the filtering area to obtain a replacement grayscale value corresponding to the pixel unit; The replacement grayscale value is determined as the grayscale value of the pixel unit.

9. The vignetting correction method according to claim 8, characterized in that: The step of determining, based on the second image, a vignetting correction matrix corresponding to the preset shooting condition includes: Determine an average grayscale value based on the grayscale value of each pixel unit in the second image; The vignetting correction matrix is ​​determined based on the second image and the average grayscale value.

10. The vignetting correction method according to claim 9, characterized in that: The step of determining the vignetting correction matrix based on the second image and the average grayscale value comprises: Determine a division coefficient matrix based on the pixel value and the average grayscale value of each pixel unit in the second image, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one; The reciprocal of each of the coefficients is taken to obtain the vignetting correction matrix.

11. The vignetting correction method according to claim 5, characterized in that: The first image is a color image, and performing image filtering on the first image to obtain a second image includes: For each pixel unit in the first image, the following processing is performed to obtain the second image: Taking the pixel unit as the center, determining the filtering area corresponding to the pixel unit; Taking the median of the channel value of the preset primary color channel of each pixel unit in the filtering area to obtain a replacement channel value corresponding to the pixel unit; The replacement channel value is determined as the channel value of the preset primary color channel of the pixel unit.

12. The vignetting correction method according to claim 11, characterized in that: The step of determining, based on the second image, a vignetting correction matrix corresponding to the preset shooting condition includes: Determining an average channel value based on the channel value of the preset primary color channel of each pixel unit in the second image; The vignetting correction matrix is ​​determined based on the second image and the average channel value.

13. The vignetting correction method according to claim 12, characterized in that: The step of determining the vignetting correction matrix based on the second image and the average channel value comprises: Determine a division coefficient matrix based on the pixel value and the average channel value of each pixel unit in the second image, wherein each pixel unit corresponds to a coefficient in the division coefficient matrix one by one; The reciprocal of each of the coefficients is taken to obtain the vignetting correction matrix.

14. The vignetting correction method according to claim 5, characterized in that: The process of generating the preset configuration information for determining the vignetting correction matrix includes: Determining the vignetting correction matrix under different preset shooting conditions; The preset configuration information is determined based on the vignetting correction matrix under different preset shooting conditions, and the preset configuration information is used to characterize the corresponding relationship between the shooting conditions and the vignetting correction matrix.

15. A vignetting correction device, characterized in that: The vignetting correction device comprises: An acquisition module, wherein the acquisition module is used to acquire an image to be corrected; A determination module, the determination module is used to determine a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected; A correction module is used to perform vignetting correction on the image to be corrected based on the vignetting correction matrix to obtain a corrected image.

16. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Acquire an image to be corrected; Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected; Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.

17. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform a vignetting correction method, the vignetting correction method comprising: Acquire an image to be corrected; Determining a vignetting correction matrix corresponding to the shooting conditions of the image to be corrected; Based on the vignetting correction matrix, vignetting correction is performed on the image to be corrected to obtain a corrected image.