Adjustment method, system, device and storage medium for lens shading compensation

By calculating and adjusting the suppression coefficient of the lens shadow compensation LSC compensation table, the problem of insufficient suppression of the LSC compensation table in the dark environment is solved, reducing the noise around the image and improving the image quality in the dark environment.

CN115942123BActive Publication Date: 2025-08-08SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211679587.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-08-08
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

When the ambient brightness information is inaccurate and fluctuates greatly, the existing lens shadow compensation method leads to weak suppression of the LSC compensation gauge in dark environments, and the noise around the image is high, affecting the image quality.

Method used

By calculating the first suppression coefficient of the statistical value image of the original image under the preset ambient brightness information, a second suppression coefficient corresponding to the current ambient brightness information is obtained, and the smallest suppression coefficient of the two is used as the target suppression coefficient, the original lens shadow compensation LSC compensation table is adjusted.

Benefits of technology

Further suppression of noise around the image in dark environments is achieved, image quality is improved, and the problem of insufficient suppression of LSC compensation tables caused by inaccurate environmental brightness information is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115942123B_ABST
    Figure CN115942123B_ABST
Patent Text Reader

Abstract

The present invention discloses a lens shading compensation adjustment method, system, device, and storage medium. The method comprises: calculating a first suppression coefficient of a statistical value image of an original image obtained under preset ambient brightness information; obtaining a second suppression coefficient corresponding to the current ambient brightness information; using the minimum suppression coefficient between the first suppression coefficient and the second suppression coefficient as a target suppression coefficient; and adjusting the original lens shading compensation LSC compensation table according to the target suppression coefficient. The present invention further suppresses the LSC compensation gain of darker areas in the original image based on the statistical value image by using the minimum suppression coefficient between the calculated first suppression coefficient of the statistical value image and the obtained second suppression coefficient corresponding to the current ambient brightness information as the target suppression coefficient, and adjusting the original lens shading compensation LSC compensation table according to the target suppression coefficient. This prevents the amplification of the noise surrounding the image in dark environments from occurring, thereby improving the image quality in dark environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an adjustment method, system, device and storage medium for lens shading compensation. Background Art

[0002] In dark environments, if the compensation gain is large during lens shading correction, the image noise around the edges will be amplified, thus affecting image quality. Lens shading correction is typically performed by adaptively adjusting the compensation gain value during image lens shading correction based on ambient brightness information. When ambient brightness information is relatively accurate and stable, this method can effectively avoid the problem of amplifying the image noise around the edges in dark environments. However, when ambient brightness information is inaccurate and fluctuates greatly, the method of adjusting the compensation gain based on ambient brightness information may result in the LSC (lens shading compensation) compensation table being weakly suppressed or not suppressed at all in dark environments, resulting in still large noise around the edges of the image. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to overcome the defects of the existing method of adjusting the compensation gain in the prior art, which leads to weak or no suppression of the LSC compensation table in a dark environment and large noise around the image, thereby affecting the image quality when the ambient brightness information is inaccurate or fluctuates greatly. A method, system, device and storage medium for adjusting lens shading compensation are provided.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] A first aspect of the present invention provides a method for adjusting lens shading compensation, the method comprising:

[0006] Obtaining a statistical value image of the original image under preset ambient brightness information, an original lens shading compensation (LSC) compensation table, and current ambient brightness information, wherein the statistical value image is an image obtained by downsampling the original image;

[0007] Calculating a first suppression coefficient of the statistical value image;

[0008] Acquire a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information;

[0009] comparing the first compression coefficient and the second compression coefficient to take the smallest compression coefficient between the first compression coefficient and the second compression coefficient as a target compression coefficient;

[0010] The original lens shading compensation LSC compensation table is adjusted according to the target suppression coefficient.

[0011] Preferably, the step of acquiring a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information includes:

[0012] Obtain the corresponding relationship between ambient brightness information and suppression coefficient;

[0013] A second suppression coefficient corresponding to the current ambient brightness information is obtained according to the corresponding relationship.

[0014] Preferably, the step of calculating the first suppression coefficient of the statistical value image includes:

[0015] A first suppression coefficient is calculated for different pixel positions of the statistical value image, wherein the smaller the statistical value of a certain pixel position in the statistical value image is, the smaller the first suppression coefficient is.

[0016] Preferably, the step of adjusting the original lens shading compensation LSC compensation table according to the target suppression coefficient includes:

[0017] Adjusting the G channel compensation gain of the original lens shading compensation (LSC) compensation table according to the target suppression coefficient to obtain an adjusted G channel compensation gain;

[0018] Obtaining a first ratio of an R channel compensation gain to a G channel compensation gain in the original lens shading compensation (LSC) compensation table and a second ratio of a B channel compensation gain to a G channel compensation gain in the original lens shading compensation (LSC) compensation table;

[0019] An adjusted R channel compensation gain and an adjusted B channel compensation gain are respectively calculated according to the first ratio, the second ratio, and the adjusted G channel compensation gain.

[0020] Preferably, the adjusted G channel compensation gain is obtained according to at least one of the target suppression coefficient, the G channel compensation gain before adjustment, and the one-fold compensation gain.

[0021] Preferably, the adjustment method further includes:

[0022] The original image is processed according to the adjusted original lens shading compensation LSC compensation table to obtain a processed image.

[0023] Preferably, the step of processing the original image according to the adjusted original lens shading compensation (LSC) compensation table to obtain a processed image comprises:

[0024] Performing black level correction processing on the original image to obtain a black level corrected image;

[0025] Performing lens shading compensation adjustment processing on the image after black level correction to obtain an adjusted image;

[0026] performing white balance processing on the adjusted image to obtain a white balanced image;

[0027] Performing a demosaicing process on the image after the white balance processing to obtain a demosaiced image.

[0028] A second aspect of the present invention provides a lens shading compensation adjustment system, the adjustment system comprising a first acquisition module, a calculation module, a second acquisition module, a comparison module, and an adjustment module;

[0029] The first acquisition module is used to obtain a statistical value image of the original image under preset ambient brightness information, an original lens shading compensation (LSC) compensation table, and current ambient brightness information, wherein the statistical value image is an image obtained by downsampling the original image;

[0030] The calculation module is used to calculate the first suppression coefficient of the statistical value image;

[0031] The second acquisition module is configured to acquire a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information;

[0032] The comparison module is used to compare the first compression coefficient and the second compression coefficient, so as to use the smallest compression coefficient between the first compression coefficient and the second compression coefficient as the target compression coefficient;

[0033] The adjustment module is used to adjust the original lens shading compensation LSC compensation table according to the target suppression coefficient.

[0034] Preferably, the second acquisition module includes a first acquisition unit and a second acquisition unit;

[0035] The first acquisition unit is used to acquire the corresponding relationship between the ambient brightness information and the suppression coefficient;

[0036] The second acquisition unit is used to acquire a second suppression coefficient corresponding to the current environment brightness information according to the corresponding relationship.

[0037] Preferably, the calculation module is used to calculate the first suppression coefficients of different pixel positions in the statistical value image, wherein the smaller the statistical value of a certain pixel position in the statistical value image is, the smaller the first suppression coefficient is.

[0038] Preferably, the adjustment module includes a first adjustment unit, a third acquisition unit and a calculation unit;

[0039] The first adjustment unit is used to adjust the G channel compensation gain of the original lens shading compensation (LSC) compensation table according to the target suppression coefficient to obtain an adjusted G channel compensation gain;

[0040] The third acquisition unit is used to acquire a first ratio of the R channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table and a second ratio of the B channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table;

[0041] The calculation unit is configured to respectively calculate an adjusted R channel compensation gain and an adjusted B channel compensation gain according to the first ratio, the second ratio, and the adjusted G channel compensation gain.

[0042] Preferably, the first adjustment unit is used to obtain the adjusted G channel compensation gain based on at least one of the target suppression coefficient, the G channel compensation gain before adjustment, and the one-fold compensation gain. Preferably, the adjustment system further includes a processing module;

[0043] The processing module is used to process the original image according to the adjusted original lens shading compensation LSC compensation table to obtain a processed image.

[0044] Preferably, the processing module includes a first processing unit, a second adjustment unit, a second processing unit and a third processing unit;

[0045] The first processing unit is used to perform black level correction processing on the original image to obtain a black level corrected image;

[0046] The second adjustment unit is used to perform lens shading compensation adjustment processing on the image after black level correction to obtain an adjusted image;

[0047] The second processing unit is used to perform white balance processing on the adjusted image to obtain a white balanced image;

[0048] The third processing unit is used to perform demosaicing on the image after white balance processing to obtain a demosaiced image.

[0049] A third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein when the processor executes the computer program, the method for adjusting lens shading compensation as described in the first aspect is implemented.

[0050] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for adjusting lens shading compensation as described in the first aspect is implemented.

[0051] On the basis of conforming to the common sense in this field, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present invention.

[0052] The positive progress effect of the present invention is:

[0053] The present invention calculates a first suppression coefficient of a statistical value image of an original image under preset ambient brightness information, obtains a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information; takes the minimum suppression coefficient between the first suppression coefficient and the second suppression coefficient as the target suppression coefficient, and adjusts the original lens shading compensation LSC compensation table according to the target suppression coefficient, thereby further suppressing the LSC compensation gain of darker areas in the original image based on the statistical value image, improving the problem of weak or no suppression of the LSC compensation table due to inaccurate ambient brightness information, avoiding the amplification of noise around the image in a dark environment, and improving the image quality in a dark environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is a flow chart of a method for adjusting lens shading compensation according to embodiment 1 of the present invention.

[0055] Figure 2 Graph showing the corresponding relationship between the statistical values and the suppression coefficients of Examples 1 and 2 of the present invention.

[0056] Figure 3 Schematic diagram of the modules of the lens shading compensation adjustment system according to embodiment 2 of the present invention.

[0057] Figure 4 This is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention. DETAILED DESCRIPTION

[0058] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0059] The execution entity of the lens shading compensation adjustment method provided in this embodiment may be a separate chip, a chip module or a UE, or a chip or a chip module integrated into a UE.

[0060] The lens shading compensation adjustment system described in the embodiments may be a separate chip, chip module, or UE, or a chip or chip module integrated into a UE. The various modules / units included in the lens shading compensation adjustment system may be software modules / units, hardware modules / units, or partially software modules / units and partially hardware modules / units.

[0061] For example, for each device or product applied to or integrated into a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated into a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. / Unit can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the UE, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the UE, and the remaining modules / units can be implemented in the form of hardware such as circuits.

[0062] Example 1

[0063] This embodiment provides a lens shading compensation adjustment method, such as Figure 1 As shown, the adjustment method includes:

[0064] Step 101: Obtain a statistical value image of an original image under preset ambient brightness information, an original lens shading compensation (LSC) compensation table, and current ambient brightness information, where the statistical value image is an image obtained by downsampling the original image.

[0065] In this embodiment, the original image is captured by the lens of the camera device. It should be noted that the camera device includes but is not limited to mobile phones, camcorders, digital cameras, industrial cameras, web cameras, tablet computer cameras, game console cameras, video-capable smart watches, security cameras, camera modules, and other equipment products that use cameras for shooting and previewing, or other forms of camera devices.

[0066] In this embodiment, the preset environment brightness information may be lower than the normal environment brightness information. For example, the preset environment brightness information may be dark environment brightness information. For example, the LSCM and the initial LSC compensation table under the dark environment are obtained, that is, the statistical value image of the original image under the dark environment and the original lens shading compensation LSC compensation table are obtained. It should be noted that the LSCM is the statistical value image of the acquired original image after downsampling.

[0067] In addition, the current ambient brightness information may be an automatic exposure gain (AEgain for short), or other information representing the ambient brightness, such as an average ambient brightness (Brightness Value for short, BV for short).

[0068] Step 102: Calculate a first suppression coefficient of the statistical value image;

[0069] Step 103: Obtain a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information;

[0070] In this embodiment, the second suppression coefficient of the LSC compensation table under the current ambient brightness information is obtained according to the current ambient brightness information;

[0071] It should be noted that the suppression coefficient of each compensation gain in the LSC compensation table under the current ambient brightness information is the second suppression coefficient.

[0072] Step 104: Compare the first compression coefficient and the second compression coefficient, and use the smallest compression coefficient between the first compression coefficient and the second compression coefficient as the target compression coefficient;

[0073] In this embodiment, at each pixel position of the statistical value image, the first suppression coefficient W1(i,j) is compared with the second suppression coefficient W2(i,j), and the minimum value is taken as the final suppression coefficient of the statistical value image at that pixel position (that is, the minimum value is taken as the target suppression coefficient of the statistical value image at that pixel position) to prevent the LSC compensation table from having insufficient suppression force or not being suppressed, thereby improving the degree of suppression.

[0074] Step 105: Adjust the original lens shading compensation LSC compensation table according to the target suppression coefficient.

[0075] In this embodiment, lens shading includes Luma Shading and Color Shading. Luma Shading is manifested as a brighter image center and darker surroundings; Color shading is manifested as inconsistent colors between the image center and surroundings.

[0076] This embodiment, based on suppressing the LSC compensation gain according to the current ambient brightness information, further suppresses areas in the image where the LSC compensation gain suppression is weak. Specifically, the suppression coefficient of the LSC compensation table in a dark environment is calculated based on the statistical value image obtained by downsampling the original image and the current ambient brightness information. The LSC compensation gain in the dark environment is adaptively adjusted, thereby reducing the noise around the image and improving the image quality. In addition, the suppression coefficient of the LSC compensation table in the darker areas of the image is calculated based on the statistical value image, thereby reducing the coupling degree of different modules in the system.

[0077] As an optional implementation, step 103 includes:

[0078] Step 1031: Obtain the corresponding relationship between the ambient brightness information and the suppression coefficient;

[0079] In this embodiment, different ambient brightness information corresponds to different suppression coefficients; the suppression coefficient of the LSC compensation table is preset according to the ambient brightness information. Specifically, the suppression coefficients under different ambient brightness information gears are set respectively, and the suppression coefficients corresponding to the ambient brightness information between the gears are obtained by linear interpolation.

[0080] Step 1032: Obtain a second suppression coefficient corresponding to the current environment brightness information according to the corresponding relationship.

[0081] In this embodiment, the second suppression coefficient that matches the current ambient brightness information is searched from the corresponding relationship between the ambient brightness information and the suppression coefficient.

[0082] As an optional implementation, step 102 includes:

[0083] Step 1021: Calculate first suppression coefficients for different pixel positions in the statistical value image, wherein the smaller the statistical value of a certain pixel position in the statistical value image is, the smaller the first suppression coefficient is.

[0084] In this embodiment, the first suppression coefficient W1(i,j) is calculated for different pixel positions of the statistical value image. The smaller the statistical value of a pixel position in the statistical value image, the smaller the suppression coefficient; conversely, the larger the statistical value, the larger the suppression coefficient.

[0085] In the specific implementation process, the suppression coefficients corresponding to different statistical values can be set respectively, and the suppression coefficients corresponding to other statistical values are obtained by linear interpolation, such as Figure 2 As shown, under different ambient brightness information, the suppression coefficient curves based on the statistical value settings can be set to multiple as needed. For example, the suppression coefficient corresponding to the statistical value P1 is the first suppression coefficient W1; the suppression coefficient corresponding to the statistical value P2 is the first suppression coefficient W2;

[0086] This embodiment adjusts the suppression degree of the LSC compensation table according to actual needs, balances the overall effect of the image in a dark environment, and improves the flexibility of the LSC compensation table's suppression strength by setting the correspondence between different ambient brightness information and the suppression coefficient of the LSC compensation table, as well as the suppression coefficient corresponding to different statistical values.

[0087] As an optional implementation, step 105 includes:

[0088] Step 1051: adjusting the G channel compensation gain of the original lens shading compensation (LSC) table according to the target suppression coefficient to obtain an adjusted G channel compensation gain;

[0089] As an optional implementation manner, the adjusted G channel compensation gain is obtained according to at least one of the target suppression coefficient, the G channel compensation gain before adjustment, and the one-fold compensation gain; specifically, the expression for obtaining the adjusted G channel compensation gain is:

[0090] gain_g_new(i,j)=gain_base+(gain_g_orig(i,j)-gain_base)*W_table(i,j)

[0091] Among them, gain_g_new(i,j) represents the adjusted G channel compensation gain, gain_base represents the one-fold compensation gain, (gain_g_orig(i,j) represents the G channel compensation gain before adjustment, W_table(i,j) represents the target suppression coefficient, and (i,j) represents the pixel position of the statistical value image.

[0092] Step 1052: Obtain a first ratio of the R channel compensation gain to the G channel compensation gain in the original lens shading compensation LSC compensation table and a second ratio of the B channel compensation gain to the G channel compensation gain in the original lens shading compensation LSC compensation table;

[0093] Step 1053: Calculate the adjusted R channel compensation gain and the adjusted B channel compensation gain according to the first ratio, the second ratio, and the adjusted G channel compensation gain.

[0094] In this embodiment, based on the ratio R / G of the R channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table, the ratio B / G of the B channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table, and the adjusted G channel compensation gain, the adjusted R channel compensation gain gain_r_new and B channel compensation gain gain_b_new are calculated respectively.

[0095] As an optional implementation manner, the adjustment method further includes:

[0096] Step 106: Process the original image according to the adjusted original lens shading compensation (LSC) table to obtain a processed image.

[0097] As an optional implementation, step 106 includes:

[0098] Step 1061: Perform black level correction on the original image to obtain a black level corrected image;

[0099] Step 1062: performing lens shading compensation adjustment processing on the image after black level correction to obtain an adjusted image;

[0100] Step 1063: performing white balance processing on the adjusted image to obtain a white balanced image;

[0101] Step 1064: perform demosaicing on the image after white balance processing to obtain a demosaiced image.

[0102] In a specific implementation process, the original image is captured by the lens of the camera device, and the original image is output through the image sensor in the camera device. Then, the output original image is subjected to black level correction processing, lens shading compensation adjustment processing, white balance processing, and demosaicing processing, and the processed image is output through a display device or a memory;

[0103] It should be noted that display devices include but are not limited to LCD (liquid crystal display), LED (a type of flat panel display) screens, etc., and memories include but are not limited to flash memory, RAM (random access memory), ROM (read-only memory), EEPROM (electrically erasable programmable read-only memory), etc.

[0104] This embodiment calculates a first suppression coefficient of a statistical value image of the original image under preset ambient brightness information, and obtains a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information; the minimum suppression coefficient between the first suppression coefficient and the second suppression coefficient is used as the target suppression coefficient, and the original lens shading compensation LSC compensation table is adjusted according to the target suppression coefficient, thereby achieving further suppression of the LSC compensation gain of the darker areas in the original image based on the statistical value image, improving the problem of weak or no suppression of the LSC compensation table due to inaccurate ambient brightness information, avoiding the amplification of noise around the image in a dark environment, and improving the image quality in a dark environment.

[0105] Example 2

[0106] This embodiment provides a lens shading compensation adjustment system, such as Figure 3As shown, the adjustment system includes a first acquisition module 21, a calculation module 22, a second acquisition module 23, a comparison module 24 and an adjustment module 25;

[0107] The first acquisition module 21 is used to obtain a statistical value image of the original image under preset ambient brightness information, an original lens shading compensation LSC compensation table, and current ambient brightness information. The statistical value image is an image obtained by downsampling the original image;

[0108] In this embodiment, the original image is captured by the lens of the camera device. It should be noted that the camera device includes but is not limited to mobile phones, camcorders, digital cameras, industrial cameras, web cameras, tablet computer cameras, game console cameras, video-capable smart watches, security cameras, camera modules, and other equipment products that use cameras for shooting and previewing, or other forms of camera devices.

[0109] In this embodiment, the preset environment brightness information may be lower than the normal environment brightness information. For example, the preset environment brightness information may be dark environment brightness information. For example, the LSCM and the initial LSC compensation table under the dark environment are obtained, that is, the statistical value image of the original image under the dark environment and the original lens shading compensation LSC compensation table are obtained. It should be noted that the LSCM is the statistical value image of the acquired original image after downsampling.

[0110] In addition, the current ambient brightness information may be an automatic exposure gain (AEgain for short), or other information representing the ambient brightness, such as an average ambient brightness (Brightness Value for short, BV for short).

[0111] The calculation module 22 is used to calculate a first suppression coefficient of the statistical value image;

[0112] The second acquisition module 23 is used to acquire a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information;

[0113] In this embodiment, the second suppression coefficient of the LSC compensation table under the current ambient brightness information is obtained according to the current ambient brightness information;

[0114] It should be noted that the suppression coefficient of each compensation gain in the LSC compensation table under the current ambient brightness information is the second suppression coefficient.

[0115] The comparison module 24 is used to compare the first compression coefficient and the second compression coefficient, and use the smallest compression coefficient between the first compression coefficient and the second compression coefficient as the target compression coefficient;

[0116] In this embodiment, at each pixel position of the statistical value image, the first suppression coefficient W1(i,j) is compared with the second suppression coefficient W2(i,j), and the minimum value is taken as the final suppression coefficient of the statistical value image at that pixel position (that is, the minimum value is taken as the target suppression coefficient of the statistical value image at that pixel position) to prevent the LSC compensation table from having insufficient suppression force or not being suppressed, thereby improving the degree of suppression.

[0117] The adjustment module 25 is used to adjust the original lens shading compensation LSC compensation table according to the target suppression coefficient.

[0118] In this embodiment, the lens shadow includes Luma Shading and Color Shading; Luma Shading is characterized by a brighter center and darker surroundings in the image; color shading is characterized by inconsistent colors between the center and surrounding areas of the image.

[0119] This embodiment, based on suppressing the LSC compensation gain according to the current ambient brightness information, further suppresses areas in the image where the LSC compensation gain suppression is weak. Specifically, the suppression coefficient of the LSC compensation table in a dark environment is calculated based on the statistical value image obtained by downsampling the original image and the current ambient brightness information. The LSC compensation gain in the dark environment is adaptively adjusted, thereby reducing the noise around the image and improving the image quality. In addition, the suppression coefficient of the LSC compensation table in the darker areas of the image is calculated based on the statistical value image, thereby reducing the coupling degree of different modules in the system.

[0120] As an optional implementation, Figure 3 As shown, the second acquisition module 23 includes a first acquisition unit 231 and a second acquisition unit 232;

[0121] The first acquisition unit 231 is used to obtain the corresponding relationship between the ambient brightness information and the suppression coefficient;

[0122] In this embodiment, different ambient brightness information corresponds to different suppression coefficients; the suppression coefficient of the LSC compensation table is preset according to the ambient brightness information. Specifically, the suppression coefficients under different ambient brightness information gears are set respectively, and the suppression coefficients corresponding to the ambient brightness information between the gears are obtained by linear interpolation.

[0123] The second acquiring unit 232 is configured to acquire a second suppression coefficient corresponding to the current environment brightness information according to the corresponding relationship.

[0124] In this embodiment, the second suppression coefficient that matches the current ambient brightness information is searched from the corresponding relationship between the ambient brightness information and the suppression coefficient.

[0125] As an optional implementation, the calculation module 22 is configured to calculate first suppression coefficients for different pixel positions in the statistical image, wherein the smaller the statistical value of a pixel position in the statistical image, the smaller the first suppression coefficient.

[0126] In this embodiment, the first suppression coefficient W1(i,j) is calculated for different pixel positions of the statistical value image. The smaller the statistical value of a pixel position in the statistical value image, the smaller the suppression coefficient; conversely, the larger the statistical value, the larger the suppression coefficient.

[0127] In the specific implementation process, the suppression coefficients corresponding to different statistical values can be set respectively, and the suppression coefficients corresponding to other statistical values are obtained by linear interpolation, such as Figure 2 As shown, under different ambient brightness information, the suppression coefficient curves based on the statistical value settings can be set to multiple as needed. For example, the suppression coefficient corresponding to the statistical value P1 is the first suppression coefficient W1; the suppression coefficient corresponding to the statistical value P2 is the first suppression coefficient W2;

[0128] This embodiment adjusts the suppression degree of the LSC compensation table according to actual needs, balances the overall effect of the image in a dark environment, and improves the flexibility of the LSC compensation table's suppression strength by setting the correspondence between different ambient brightness information and the suppression coefficient of the LSC compensation table, as well as the suppression coefficient corresponding to different statistical values.

[0129] As an optional implementation, Figure 3 As shown, the adjustment module 25 includes a first adjustment unit 251, a third acquisition unit 252 and a calculation unit 253;

[0130] The first adjustment unit 251 is used to adjust the G channel compensation gain of the original lens shading compensation LSC compensation table according to the target suppression coefficient to obtain an adjusted G channel compensation gain;

[0131] As an optional implementation manner, the first adjustment unit 251 is configured to obtain an adjusted G channel compensation gain based on at least one of the target suppression coefficient, the G channel compensation gain before adjustment, and the one-fold compensation gain; specifically, the expression for obtaining the adjusted G channel compensation gain is:

[0132] gain_g_new(i,j)=gain_base+(gain_g_orig(i,j)-gain_base)*W_table(i,j)

[0133] Among them, gain_g_new(i,j) represents the adjusted G channel compensation gain, gain_base represents the one-fold compensation gain, (gain_g_orig(i,j) represents the G channel compensation gain before adjustment, W_table(i,j) represents the target suppression coefficient, and (i,j) represents the pixel position of the statistical value image.

[0134] The third acquiring unit 252 is configured to acquire a first ratio of the R channel compensation gain to the G channel compensation gain in the original lens shading compensation LSC compensation table and a second ratio of the B channel compensation gain to the G channel compensation gain in the original lens shading compensation LSC compensation table;

[0135] The calculation unit 253 is configured to calculate an adjusted R channel compensation gain and an adjusted B channel compensation gain according to the first ratio, the second ratio, and the adjusted G channel compensation gain.

[0136] In this embodiment, based on the ratio R / G of the R channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table, the ratio B / G of the B channel compensation gain to the G channel compensation gain of the original lens shading compensation LSC compensation table, and the adjusted G channel compensation gain, the adjusted R channel compensation gain gain_r_new and B channel compensation gain gain_b_new are calculated respectively.

[0137] As an optional implementation, Figure 3 As shown, the adjustment system further includes a processing module 26;

[0138] The processing module 26 is used to process the original image according to the adjusted original lens shading compensation LSC compensation table to obtain a processed image.

[0139] As an optional implementation, Figure 3 As shown, the processing module 26 includes a first processing unit 261, a second adjustment unit 262, a second processing unit 263 and a third processing unit 264;

[0140] The first processing unit 261 is used to perform black level correction processing on the original image to obtain a black level corrected image;

[0141] The second adjustment unit 262 is used to perform lens shading compensation adjustment processing on the image after black level correction to obtain an adjusted image;

[0142] The second processing unit 263 is used to perform white balance processing on the adjusted image to obtain a white balanced image;

[0143] The third processing unit 264 is configured to perform a demosaicing process on the image after the white balance process to obtain a demosaiced image.

[0144] In a specific implementation process, the original image is captured by the lens of the camera device, and the original image is output through the image sensor in the camera device. Then, the output original image is subjected to black level correction processing, lens shading compensation adjustment processing, white balance processing, and demosaicing processing, and the processed image is output through a display device or a memory;

[0145] It should be noted that the display device includes but is not limited to LCD, LED screen, etc., and the memory includes but is not limited to flash memory, RAM, ROM, EEPROM, etc.

[0146] This embodiment calculates a first suppression coefficient of a statistical value image of the original image under preset ambient brightness information, and obtains a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information; the minimum suppression coefficient between the first suppression coefficient and the second suppression coefficient is used as the target suppression coefficient, and the original lens shading compensation LSC compensation table is adjusted according to the target suppression coefficient, thereby achieving further suppression of the LSC compensation gain of the darker areas in the original image based on the statistical value image, improving the problem of weak or no suppression of the LSC compensation table due to inaccurate ambient brightness information, avoiding the amplification of noise around the image in a dark environment, and improving the image quality in a dark environment.

[0147] Example 3

[0148] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Example 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and configured to run on the processor. When the processor executes the program, the lens shading compensation adjustment method of Example 1 is implemented. Figure 4 The electronic device 30 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.

[0149] like Figure 4 As shown, the electronic device 30 may be a general-purpose computing device, such as a server device. Components of the electronic device 30 may include, but are not limited to, the at least one processor 31, the at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0150] The bus 33 includes a data bus, an address bus, and a control bus.

[0151] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .

[0152] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0153] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32 , such as the lens shading compensation adjustment method of the first embodiment of the present invention.

[0154] The electronic device 30 may also communicate with one or more external devices 34 (e.g., a keyboard, a pointing device, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model generating device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. Figure 4 As shown, the network adapter 36 communicates with the other modules of the model-generated device 30 via the bus 33. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the model-generated device 30, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.

[0155] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above may be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above may be further divided and embodied by multiple units / modules.

[0156] Example 4

[0157] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the lens shading compensation adjustment method provided in Embodiment 1 is implemented.

[0158] The readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0159] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the adjustment method for lens shading compensation described in Example 1.

[0160] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on the remote device.

[0161] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.

Claims

1. A method for adjusting lens shading compensation, characterized in that: The adjustment method includes: Obtaining a statistical value image of the original image under preset ambient brightness information, an original lens shading compensation (LSC) compensation table, and current ambient brightness information, wherein the statistical value image is an image obtained by downsampling the original image; Calculating a first suppression coefficient of the statistical value image; Acquire a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information; comparing the first compression coefficient and the second compression coefficient to take the smallest compression coefficient between the first compression coefficient and the second compression coefficient as a target compression coefficient; Adjust the original lens shading compensation LSC compensation table according to the target suppression coefficient; The step of acquiring a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information includes: Obtain the corresponding relationship between ambient brightness information and suppression coefficient; Acquire a second suppression coefficient corresponding to the current ambient brightness information according to the corresponding relationship; The step of calculating the first suppression coefficient of the statistical value image includes: A first suppression coefficient is calculated for different pixel positions of the statistical value image, wherein the smaller the statistical value of a certain pixel position in the statistical value image is, the smaller the first suppression coefficient is.

2. The lens shading compensation adjustment method according to claim 1, wherein: The step of adjusting the original lens shading compensation LSC compensation table according to the target suppression coefficient comprises: Adjusting the G channel compensation gain of the original lens shading compensation (LSC) compensation table according to the target suppression coefficient to obtain an adjusted G channel compensation gain; Obtaining a first ratio of an R channel compensation gain to a G channel compensation gain in the original lens shading compensation (LSC) compensation table and a second ratio of a B channel compensation gain to a G channel compensation gain in the original lens shading compensation (LSC) compensation table; An adjusted R channel compensation gain and an adjusted B channel compensation gain are respectively calculated according to the first ratio, the second ratio, and the adjusted G channel compensation gain.

3. The lens shading compensation adjustment method according to claim 2, wherein: The adjusted G channel compensation gain is obtained according to at least one of the target suppression coefficient, the G channel compensation gain before adjustment, and the one-fold compensation gain.

4. The lens shading compensation adjustment method according to claim 1, wherein: The adjustment method further includes: The original image is processed according to the adjusted original lens shading compensation LSC compensation table to obtain a processed image.

5. The lens shading compensation adjustment method according to claim 4, wherein: The step of processing the original image according to the adjusted original lens shading compensation (LSC) compensation table to obtain a processed image comprises: Performing black level correction processing on the original image to obtain a black level corrected image; Performing lens shading compensation adjustment processing on the image after black level correction to obtain an adjusted image; performing white balance processing on the adjusted image to obtain a white balanced image; Performing a demosaicing process on the image after the white balance processing to obtain a demosaiced image.

6. A lens shading compensation adjustment system, characterized in that: The adjustment system includes a first acquisition module, a calculation module, a second acquisition module, a comparison module and an adjustment module; The first acquisition module is used to obtain a statistical value image of the original image under preset ambient brightness information, an original lens shading compensation (LSC) compensation table, and current ambient brightness information, wherein the statistical value image is an image obtained by downsampling the original image; The calculation module is used to calculate the first suppression coefficient of the statistical value image; The second acquisition module is configured to acquire a second suppression coefficient corresponding to the current ambient brightness information according to the current ambient brightness information; The comparison module is used to compare the first compression coefficient and the second compression coefficient, so as to use the smallest compression coefficient between the first compression coefficient and the second compression coefficient as the target compression coefficient; The adjustment module is used to adjust the original lens shading compensation LSC compensation table according to the target suppression coefficient; The second acquisition module includes a first acquisition unit and a second acquisition unit; the first acquisition unit is used to obtain the corresponding relationship between the ambient brightness information and the suppression coefficient; the second acquisition unit is used to obtain the second suppression coefficient corresponding to the current ambient brightness information according to the corresponding relationship; The calculation module is used to calculate the first suppression coefficients of different pixel positions in the statistical value image, wherein the smaller the statistical value of a certain pixel position in the statistical value image is, the smaller the first suppression coefficient is.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and configured to run on the processor, wherein: When the processor executes the computer program, the method for adjusting lens shading compensation according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for adjusting lens shading compensation according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Camera lens shadow compensation method, device and equipment and camera shooting equipment

    CN113364935A

  • Systems and methods for lens shading correction

    US20130321678A1