CN113284062A - Lens shadow correction method, device, medium and terminal - Google Patents

Lens shadow correction method, device, medium and terminal Download PDF

Info

Publication number
CN113284062A
CN113284062A CN202110547339.3A CN202110547339A CN113284062A CN 113284062 A CN113284062 A CN 113284062A CN 202110547339 A CN202110547339 A CN 202110547339A CN 113284062 A CN113284062 A CN 113284062A
Authority
CN
China
Prior art keywords
highlight
compensation coefficient
image
lens shading
pixel point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110547339.3A
Other languages
Chinese (zh)
Inventor
邵子奇
胡继瑶
许志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Semiconductor Nanjing Co Ltd
Original Assignee
Spreadtrum Semiconductor Nanjing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Semiconductor Nanjing Co Ltd filed Critical Spreadtrum Semiconductor Nanjing Co Ltd
Priority to CN202110547339.3A priority Critical patent/CN113284062A/en
Publication of CN113284062A publication Critical patent/CN113284062A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4023Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides a method, a device, a medium and a terminal for correcting lens shadows, wherein the method can be applied to a camera terminal and comprises the following steps: the method comprises the steps of obtaining an original image, determining a lens shading compensation coefficient table of the original image, interpolating the lens shading compensation coefficient table, calculating initial lens shading compensation coefficients of pixel points in the original image, determining the original image as a highlight image according to brightness information of the original image, adjusting the initial lens shading compensation coefficients of the pixel points in the highlight image according to the brightness information of the highlight image to obtain target lens shading compensation coefficients of the pixel points, and finally correcting the lens shading of the highlight image according to the target lens shading compensation coefficients of the pixel points. According to the invention, through confirming the highlight image and adaptively adjusting the highlight image, the loss of detail information after the highlight area is corrected is avoided, and the image quality after the lens shadow is corrected is improved.

Description

Lens shadow correction method, device, medium and terminal
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, a medium, and a terminal for correcting a lens shading.
Background
The optical characteristics of the lens are that the central light sensitivity of the lens is higher than the peripheral light sensitivity, and the light transmission quantity is gradually reduced from the center to the periphery of the lens, so that the phenomenon that the middle of an image is bright and the periphery of the image is dark occurs. Meanwhile, the captured image has a color cast phenomenon because the lenses have different refractive indexes for light rays with different wavelengths and different refraction angles for different positions.
The two phenomena are collectively called as lens shading, which reduces the quality of an image, and in order to improve the quality of the image, a Lens Shading Correction (LSC) technique is usually adopted to implement shading compensation. However, in some scenes where the original image contains a highlight region or a high dynamic region, when the original image is subjected to shading compensation to eliminate lens shading, the edge and detail information of the highlight region may be lost or an overexposed image may occur due to overcorrection, which results in poor image quality.
Disclosure of Invention
The invention aims to provide a method, a device, a medium and a terminal for correcting lens shadows, which avoid the loss of detail information after the correction of highlight areas and improve the quality of images.
In order to achieve the above object, in a first aspect, the present invention provides a method for correcting lens shading, applied to a camera terminal, the method including:
the method comprises the steps that a camera terminal obtains an original image, a lens shadow compensation coefficient table of the original image is determined, interpolation is carried out on the lens shadow compensation coefficient table, an initial lens shadow compensation coefficient of a pixel point in the original image is calculated, the original image is determined to be a highlight image according to brightness information of the original image, then the camera terminal adjusts the initial lens shadow compensation coefficient of the pixel point in the highlight image according to the brightness information of the highlight image to obtain a target lens shadow compensation coefficient of the pixel point, and finally the camera terminal corrects the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
The correction method of the lens shadow disclosed by the invention has the beneficial effects that: the method comprises the steps that after an original image is obtained by a camera terminal, a lens shadow compensation coefficient table of the original image is determined, interpolation is carried out on the table, an initial lens shadow compensation coefficient of a pixel point in the original image is calculated, whether the original image is a highlight image or not is determined according to brightness information of the original image, and after the original image is determined to be the highlight image, the initial lens shadow compensation coefficient of the pixel point in the highlight image is adjusted according to the brightness information of the highlight image, and a target lens shadow compensation coefficient of the pixel point is obtained. The lens shadow of the highlight image is corrected according to the target lens shadow compensation coefficient of the pixel point, so that the phenomenon that the edge and detail information of the highlight area are lost or overexposed due to overcorrection when the lens shadow is eliminated by performing shadow compensation on the highlight image is effectively reduced, and the quality of the image is greatly improved.
In one possible implementation, adjusting an initial lens shading compensation coefficient of a pixel point in a highlight image according to brightness information of the highlight image to obtain a target lens shading compensation coefficient of the pixel point includes: determining the adjustment weight of a pixel point in the highlight image according to the brightness information of the highlight image; and adjusting the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point to obtain the target lens shading compensation coefficient of the pixel point.
In one possible implementation, determining an adjustment weight of a pixel point in the highlight image according to the brightness information of the highlight image includes: determining the adjustment weight of pixel points of a highlight area and a non-highlight area in the highlight image according to the brightness information of the highlight image; and adjusting the weight of the pixel points in the highlight area to be smaller than that of the pixel points in the non-highlight area. The beneficial effects are that: the adjustment weight of the pixel points in the highlight area is smaller than that of the pixel points in the non-highlight area, so that the situation that the edge and the detail information of the highlight area are lost due to overcorrection is avoided in the lens shadow correction of the highlight image, and the image quality is improved.
In one possible implementation, adjusting an initial lens shading compensation coefficient of a pixel point according to an adjustment weight of the pixel point to obtain a target lens shading compensation coefficient of the pixel point includes: multiplying the adjustment weight of the pixel point in the highlight area by the initial lens shading compensation coefficient of the pixel point in the highlight area to obtain a target lens shading compensation coefficient of the pixel point in the highlight area; multiplying the adjustment weight of the pixel points in the non-highlight area by the initial lens shading compensation coefficient of the pixel points in the non-highlight area to obtain a target lens shading compensation coefficient of the pixel points in the non-highlight area; and the target lens shadow compensation coefficient of the pixel point of the non-highlight area is close to or equal to the initial lens shadow compensation coefficient of the pixel point of the non-highlight area.
In one possible implementation, determining a lens shading compensation coefficient table for an original image includes: and determining a lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters and the image statistic value information.
In one possible implementation, determining the original image as a highlight image according to the brightness information of the original image includes: calculating a brightness distribution statistic value of the original image; when the brightness distribution statistic value is lower than a preset threshold value, determining that the original image is a non-highlight image; and when the brightness distribution statistic value is larger than or equal to a preset threshold value, determining that the original image is a highlight image.
In one possible implementation, the preset threshold is determined according to the luminance distribution statistical characteristics of the sample highlight image set.
In a second aspect, an embodiment of the present invention provides a device for correcting lens shading, including:
an acquisition unit configured to acquire an original image;
a determining unit determining a lens shading compensation coefficient table of an original image; the image processing device is used for determining the original image as a highlight image according to the brightness information in the original image;
the calculation unit is used for interpolating the lens shadow compensation coefficient table of the highlight image and calculating the initial lens shadow compensation coefficient of a pixel point in the highlight image;
the adjusting unit is used for adjusting the initial lens shading compensation coefficient of the pixel point in the highlight image according to the brightness information of the highlight image to obtain the target lens shading compensation coefficient of the pixel point;
and the correction unit is used for correcting the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
The correction device for the lens shadow disclosed by the invention has the beneficial effects that: the method comprises the steps that after an original image is obtained by a camera terminal, a lens shadow compensation coefficient table of the original image is determined, interpolation is carried out on the table, an initial lens shadow compensation coefficient of a pixel point in the original image is calculated, whether the original image is a highlight image or not is determined according to brightness information of the original image, and after the original image is determined to be the highlight image, the initial lens shadow compensation coefficient of the pixel point in the highlight image is adjusted according to the brightness information of the highlight image, and a target lens shadow compensation coefficient of the pixel point is obtained. The lens shadow of the highlight image is corrected according to the target lens shadow compensation coefficient of the pixel point, so that the phenomenon that the edge and detail information of the highlight area are lost or overexposed due to overcorrection when the lens shadow is eliminated by performing shadow compensation on the highlight image is effectively reduced, and the quality of the image is greatly improved.
In a possible implementation, the determining unit is further configured to determine an adjustment weight of a pixel point in the highlight image according to the brightness information of the highlight image, and then the adjusting unit adjusts the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point to obtain a target lens shading compensation coefficient of the pixel point.
In a possible implementation, the determining unit is further configured to determine, according to luminance information of the highlight image, an adjustment weight of pixel points in a highlight region and a non-highlight region in the highlight image. And adjusting the weight of the pixel points in the highlight area to be smaller than that of the pixel points in the non-highlight area.
In one possible implementation, the calculating unit is configured to multiply the adjustment weight of the pixel point in the highlight region by the initial lens shading compensation coefficient of the pixel point in the highlight region to obtain a target lens shading compensation coefficient of the pixel point in the highlight region; multiplying the adjustment weight of the pixel points in the non-highlight area by the initial lens shading compensation coefficient of the pixel points in the non-highlight area to obtain a target lens shading compensation coefficient of the pixel points in the non-highlight area;
and the target lens shading compensation coefficient of the pixel point in the highlight area is smaller than the initial lens shading compensation coefficient of the pixel point in the highlight area.
In one possible implementation, the calculation unit is configured to determine a lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters, and the image statistic information.
In a possible implementation, when determining that the original image is a highlight image according to the brightness information of the original image, the computing unit is specifically configured to: the calculating unit calculates the brightness distribution statistic value of the original image;
when the luminance distribution statistic value is lower than a preset threshold value, the determining unit determines that the original image is a non-highlight image;
when the luminance distribution statistic is greater than or equal to a preset threshold, the determining unit determines that the original image is a highlight image.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and when the computer instructions are executed, the steps of the method are performed.
In a fourth aspect, a terminal provided in an embodiment of the present invention includes a memory and a processor, where the memory stores computer instructions capable of being executed on the processor, and the processor executes the computer instructions to perform the steps of the method.
In a fifth aspect, an embodiment of the present invention provides a chip system, which is coupled to a memory, and configured to read and execute program instructions stored in the memory to perform the steps of the foregoing method.
Drawings
FIG. 1A is a schematic diagram of a two-dimensional lens shading disclosed herein;
FIG. 1B is a schematic diagram of a three-dimensional lens shading compensation coefficient table according to the present disclosure;
FIG. 1C is a diagram illustrating detail loss after image correction of a highlight region by the lens shading correction technique disclosed in the present invention;
FIG. 2 is a flowchart illustrating a method for correcting lens shading according to an embodiment of the disclosure;
FIG. 3 is a flowchart of a lens shading correction algorithm process according to a disclosed embodiment of the present invention;
FIG. 4 is a flow chart of a method for adaptive adjustment of shading compensation gain according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of a device for correcting lens shading according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram of an apparatus according to an embodiment of the disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. As used herein, the word "comprising" and similar words are intended to mean that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items.
Under the influence of optical characteristics of a lens, when some camera terminals such as a mobile phone or a camera shoot images, brightness shading (luma shading) in which the brightness gradually becomes dark from the center of the images to the surrounding brightness or color shading (color shading) in which the color of the center of the images is inconsistent with the color of the surrounding brightness occurs in the shot images, so that the image quality is reduced.
In the prior art, in order to improve image quality, a Lens Shading Correction (LSC) technique is used to correct an image. The lens shading correction technology mostly adopts a grid method, and referring to fig. 1A and 1B, fig. 1A is a schematic diagram of two-dimensional lens shading, and fig. 1B is a schematic diagram of a three-dimensional lens shading compensation coefficient table. The grid method comprises a calibration stage and an operation stage. In the calibration stage, shooting is carried out to obtain an original image, and the shot original image is an image with a bright center and gradually darkened periphery. The original image is then input to a calculation module to obtain lens shading compensation coefficients. The output lens shading compensation coefficient is a size M × N lens shading compensation coefficient table. Where M × N is smaller than the size of the original image. In the operation stage, aiming at an original image shot by a terminal, the lens compensation coefficient table is mapped to the original image, and the lens shading compensation coefficient of each pixel point in the grid can be calculated according to the lens shading compensation coefficients of a plurality of vertexes of the grid. And aiming at each original pixel of the original image, amplifying the brightness value of the original pixel according to the calculated lens shadow compensation coefficient of the corresponding pixel point, and thus obtaining the processed image.
Referring to fig. 1C, fig. 1C is a schematic diagram illustrating details lost after a conventional lens shading correction technique is used to correct an image in a highlight area. The lines in the dashed box 100 in the original image in fig. 1C cause the lines to be lost after the lens shading correction. It can be seen that in some scenes with high brightness regions or scenes with high dynamics, the use of the lens shading correction technique may cause the high brightness regions in the image to lose edge and detail information due to over-correction.
In order to solve the above problem, an embodiment of the present invention provides a method for correcting lens shading, which can be applied to a camera terminal, and as shown in fig. 2, the method includes:
s201: the camera terminal acquires an original image.
The image data of the original image includes image size, luminance information, color information, and the like.
S202: the camera terminal determines a lens shading compensation coefficient table of an original image.
In this step, the camera terminal may determine a final lens shading compensation coefficient table of the original image according to the current environment, the debugging parameter, and the image statistic information. Specifically, an image processor of the camera terminal calculates an input image according to the current environment, the debugging parameters, and the image statistic information to obtain a lens shading compensation coefficient (lsc table).
S203: and the camera terminal performs interpolation on the lens shadow compensation coefficient table and calculates the initial lens shadow compensation coefficient of the pixel point in the original image.
In this step, because the color shadows appear differently under different light sources, the lsc tables under several common light sources are generally calibrated in advance, then a group of lsc tables is calculated according to the current environment information, and then the calculated lsc tables are interpolated to obtain the initial lens shadow compensation coefficient corresponding to each pixel point in the original image.
S204: and the camera terminal determines the original image as a highlight image according to the brightness information of the original image.
In this step, a possible implementation is that the image capturing terminal calculates a luminance distribution statistic of the original image, determines that the original image is a non-highlight image when the calculated luminance distribution statistic is lower than a preset threshold, and determines that the original image is a highlight image when the luminance distribution statistic is greater than or equal to the preset threshold. The determination mode about the preset threshold value can be determined by using the luminance distribution statistical characteristics of the sample highlight image set.
S205: and the camera terminal adjusts the initial lens shading compensation coefficient of the pixel point in the highlight image according to the brightness information of the highlight image to obtain the target lens shading compensation coefficient of the pixel point.
In this step, the camera terminal can determine the adjustment weight of the pixel point in the highlight image according to the brightness information of the highlight image, and then adjust the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point to obtain the target lens shading compensation coefficient of the pixel point.
S206: and the camera shooting terminal corrects the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
In this step, the camera terminal can multiply the target lens shading compensation coefficient of the pixel point with the pixel value of the corresponding pixel point in the original image, so as to correct the lens shading.
Therefore, in the above embodiment, adaptive adjustment may be performed on the interpolated lsc table according to the brightness information of the original image, so that after the highlight or high-dynamic scene image is subjected to lens shading correction, the detail information of the highlight area can be effectively retained, and the information loss amount caused by lens shading correction is reduced. The method can improve the environmental adaptability of the lens shadow correction module, reduce the loss of detail information after the correction of the highlight area and improve the image quality after the correction of the lens shadow.
In another possible implementation, because the highlight image may have both the highlight region and the non-highlight region, the adjustment weight of the pixel point in the highlight region and the adjustment weight of the pixel point in the non-highlight region in the highlight image may also be determined according to the brightness information of the highlight image. It can be understood that the adjustment weight of the pixel point in the highlight area is smaller than that of the pixel point in the non-highlight area, wherein the value range of the adjustment weight may be (0, 1).
Based on the adjustment weight of the pixel point in the highlight region and the adjustment weight of the pixel point in the non-highlight region in the highlight image, in this embodiment, the image processor of the camera terminal may obtain the target lens shading compensation coefficient of the pixel point in the highlight region by multiplying the adjustment weight of the pixel point in the highlight region by the initial lens shading compensation coefficient of the pixel point in the highlight region, and multiply the adjustment weight of the pixel point in the non-highlight region by the initial lens shading compensation coefficient of the pixel point in the non-highlight region to obtain the target lens shading compensation coefficient of the pixel point in the non-highlight region. And adjusting the weight value of the highlight area to make the target lens shadow compensation coefficient of the pixel point of the highlight area smaller than the initial lens shadow compensation coefficient of the pixel point of the highlight area. Illustratively, the initial lens shading compensation coefficient of the pixel point in the highlight region is 4, and after the adjustment, the target lens shading compensation coefficient of the pixel point in the highlight region is 1.
In order to discuss the lens shading correction method more systematically, the present application further describes the process of the lens shading correction method with reference to the flowchart of the lens shading correction algorithm process shown in fig. 3, and the lens shading correction algorithm includes the following steps, as shown in fig. 3:
s301: an image processor of the camera terminal acquires image data of an original image.
The image data of the original image includes an image size, luminance information, color information, and the like.
S302: and an image processor of the camera terminal determines a lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters and the image statistic value information.
S303: and an image processor of the camera terminal performs interpolation on the lens shadow compensation coefficient table and calculates the initial lens shadow compensation coefficient of the pixel point in the original image.
S304: an image processor of the camera terminal judges whether the original image is a highlight image. If the image is a highlight image, the process proceeds to step S305, and if the image is not a highlight image, the process proceeds to step S306.
In this step, the camera terminal may calculate a luminance distribution statistic using luminance information of the original image, compare the luminance distribution statistic with a preset threshold, and determine whether the original image is a highlight image.
S305: and an image processor of the camera terminal determines the adjustment weight of the pixel points in the highlight image according to the brightness information of the highlight image.
S306: the image processor of the camera terminal sets the adjustment weight to a value of 1.
It should be noted that the method steps of S302-S306 may be adjusted according to actual requirements, and may also be executed simultaneously, and this embodiment does not limit the order of execution in sequence.
S307: and an image processor of the camera terminal multiplies the adjustment weight of the pixel point of the highlight area by the initial lens shadow compensation coefficient of the pixel point of the highlight area to obtain a target lens shadow compensation coefficient of the pixel point of the highlight area, and corrects the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
S308: and an image processor of the camera terminal outputs the corrected highlight image for post image processing.
Therefore, the method can reasonably suppress the shadow compensation gain of the highlight area, and effectively reserve the details and the edge information of the highlight area. Compared with the prior art, if the lens shading compensation coefficient of the highlight area is not adjusted, the highlight area information in the original image may be lost due to lens shading correction, and the lost information cannot be recovered in other subsequent processing modules.
The present application further explains a process of the lens shading correction method with reference to the adaptive adjustment method of shading compensation gain shown in fig. 4, and with reference to fig. 4, the adaptive adjustment method includes the following steps:
s401: the camera terminal acquires brightness information of the highlight image.
S402: and the camera terminal acquires brightness information according to the highlight image and determines the adjustment weight of the pixel points in the highlight image.
In this step, the highlight image includes a highlight region and a non-highlight region, so that the adjustment weights of the pixels in the highlight region and the non-highlight region can be determined, and the adjustment weight of the pixels in the highlight region is smaller than the adjustment weight of the pixels in the non-highlight region.
S403: the camera terminal obtains the adjustment weight of the pixel point in the highlight image to carry out self-adaptive adjustment, and obtains the adjustment weight of the target pixel point.
In this step, it should be noted that, the lens shading compensation coefficient of a general pixel point is 1 to 4, and the target lens shading compensation coefficient of the pixel point in the highlight region is made smaller than the initial lens shading compensation coefficient of the pixel point in the highlight region by adjusting the adjustment weight of the pixel point in the highlight region, and the target lens shading compensation coefficient of the pixel point in the highlight region is made approximately 1.
S404: the camera terminal obtains a lens shadow compensation coefficient table for determining the highlight image, interpolates the lens shadow compensation coefficient table, and calculates the initial lens shadow compensation coefficient of the pixel point in the highlight image.
S405: and the camera terminal obtains the adjustment weight of the pixel point in the highlight image and the initial lens shadow compensation coefficient of the pixel point in the highlight image to obtain the target lens shadow compensation coefficient of the pixel point.
S406: and the camera terminal acquires a target lens shadow compensation coefficient according to the pixel point to correct the highlight image.
In another embodiment of the present disclosure, an apparatus for correcting lens shading, as shown in fig. 5, includes: the image processing device comprises an acquisition unit 501 used for acquiring an original image, a determination unit 502, wherein the determination unit 502 determines a lens shading compensation coefficient table of the original image, and the determination unit 502 determines that the original image is a highlight image according to brightness information in the original image, namely, determines that the original image is the highlight image. A calculating unit 503, configured to perform interpolation calculation processing on the lens shading compensation coefficient table of the highlight image, calculate an initial lens shading compensation coefficient of a pixel point in the highlight image, and output an initial lens shading compensation coefficient table forming the pixel point, and an adjusting unit 504, configured to adjust the initial lens shading compensation coefficient of the pixel point in the highlight image according to the brightness information of the highlight image, to obtain a target lens shading compensation coefficient of the pixel point. And the correcting unit 505 is configured to correct the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
In a possible implementation, the determining unit 502 is further configured to determine an adjustment weight of a pixel point in the highlight image according to the brightness information of the highlight image, and the adjusting unit 504 adjusts the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point to obtain a target lens shading compensation coefficient of the pixel point.
It should be noted that the highlight image includes a highlight region and a non-highlight region, and the determining unit 502 is further configured to determine the adjustment weight of the pixel points of the highlight region and the non-highlight region. And adjusting the weight of the pixel points in the highlight area to be smaller than that of the pixel points in the non-highlight area.
In another possible implementation, the calculating unit 503 is configured to multiply the adjustment weight of the pixel point in the highlight region by the initial lens shading compensation coefficient of the pixel point in the highlight region to obtain a target lens shading compensation coefficient of the pixel point in the highlight region, and multiply the adjustment weight of the pixel point in the non-highlight region by the initial lens shading compensation coefficient of the pixel point in the non-highlight region to obtain a target lens shading compensation coefficient of the pixel point in the non-highlight region. And the target lens shading compensation coefficient of the pixel point in the highlight area is smaller than the initial lens shading compensation coefficient of the pixel point in the highlight area.
In addition, the computing unit 503 is further configured to determine a lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters, and the image statistic information. The calculating unit 503 calculates a luminance distribution statistic of the original image, when the luminance distribution statistic is lower than a preset threshold, the determining unit 502 determines that the original image is a non-highlight image, and when the luminance distribution statistic is greater than or equal to the preset threshold, the determining unit 502 determines that the original image is a highlight image.
In other embodiments of the present application, embodiments of the present application disclose an apparatus, as shown in fig. 6, the apparatus may include: one or more processors 601; a memory 602; a display 603; one or more application programs (not shown); and one or more computer programs 604, which may be connected via one or more communication buses 605. Wherein the one or more computer programs 604 are stored in the memory 602 and configured to be executed by the one or more processors 601, the one or more computer programs 604 comprising instructions.
In another embodiment of the present disclosure, the present disclosure further provides a computer readable storage medium, having stored thereon computer instructions, which when executed, perform the steps of the above method.
In another embodiment of the present disclosure, the present disclosure further provides a camera terminal, including a memory and a processor, where the memory stores computer instructions capable of being executed on the processor, and the processor executes the computer instructions to perform the steps of the method.
In another embodiment of the disclosure, the present invention further provides a chip system, which is coupled to the memory and configured to read and execute the program instructions stored in the memory to perform the steps of the above method.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A method for correcting lens shading is applied to a camera terminal, and is characterized by comprising the following steps:
acquiring an original image;
determining a lens shading compensation coefficient table of the original image;
interpolating the lens shading compensation coefficient table, and calculating an initial lens shading compensation coefficient of a pixel point in the original image;
determining the original image as a highlight image according to the brightness information of the original image;
adjusting an initial lens shading compensation coefficient of a pixel point in the highlight image according to the brightness information of the highlight image to obtain a target lens shading compensation coefficient of the pixel point;
and correcting the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
2. The method of claim 1, wherein adjusting an initial lens shading compensation coefficient of a pixel point in the highlight image according to the brightness information of the highlight image to obtain a target lens shading compensation coefficient of the pixel point comprises:
determining the adjustment weight of a pixel point in the highlight image according to the brightness information of the highlight image;
and adjusting the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point to obtain a target lens shading compensation coefficient of the pixel point.
3. The method of claim 2, wherein determining the adjustment weight of the pixel point in the highlight image according to the brightness information of the highlight image comprises:
determining the adjustment weight of pixel points of a highlight area and a non-highlight area in the highlight image according to the brightness information of the highlight image;
and adjusting the weight of the pixel points in the highlight area to be smaller than that of the pixel points in the non-highlight area.
4. The method of claim 3, wherein adjusting the initial lens shading compensation coefficient of the pixel according to the adjustment weight of the pixel to obtain the target lens shading compensation coefficient of the pixel comprises:
multiplying the adjustment weight of the pixel point of the highlight area by the initial lens shading compensation coefficient of the pixel point of the highlight area to obtain a target lens shading compensation coefficient of the pixel point of the highlight area;
multiplying the adjustment weight of the pixel points in the non-highlight area by the initial lens shading compensation coefficient of the pixel points in the non-highlight area to obtain a target lens shading compensation coefficient of the pixel points in the non-highlight area;
and the target lens shading compensation coefficient of the pixel point of the non-highlight area is similar to or equal to the initial lens shading compensation coefficient of the pixel point of the non-highlight area.
5. The method according to any one of claims 1 to 4, wherein the determining a lens shading compensation coefficient table for the original image comprises:
and determining a lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters and the image statistic value information.
6. The method according to claim 2 or 3, wherein determining the original image as a highlight image according to the brightness information of the original image comprises:
calculating a luminance distribution statistic value of the original image;
when the brightness distribution statistic value is lower than a preset threshold value, determining that the original image is a non-highlight image;
and when the brightness distribution statistic is larger than or equal to the preset threshold value, determining that the original image is the highlight image.
7. The method of claim 6, wherein the threshold is determined based on a luminance distribution statistic of the sample set of highlight images.
8. A lens shading correction apparatus, comprising:
an acquisition unit configured to acquire an original image;
a determination unit that determines a lens shading compensation coefficient table of the original image; the image processing device is used for determining the original image as a highlight image according to the brightness information in the original image;
the calculation unit is used for interpolating a lens shadow compensation coefficient table of the highlight image and calculating an initial lens shadow compensation coefficient of a pixel point in the highlight image;
the adjusting unit is used for adjusting the initial lens shading compensation coefficient of a pixel point in the highlight image according to the brightness information of the highlight image to obtain a target lens shading compensation coefficient of the pixel point;
and the correction unit is used for correcting the lens shadow of the highlight image according to the target lens shadow compensation coefficient of the pixel point.
9. The apparatus according to claim 8, wherein the determining unit is further configured to determine the adjustment weight of the pixel point in the highlight image according to the brightness information of the highlight image;
the adjusting unit is further configured to adjust the initial lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point, so as to obtain a target lens shading compensation coefficient of the pixel point.
10. The apparatus according to claim 9, wherein the determining unit is further configured to determine, according to luminance information of the highlight image, adjustment weights of pixel points of highlight regions and non-highlight regions in the highlight image;
and adjusting the weight of the pixel points in the highlight area to be smaller than that of the pixel points in the non-highlight area.
11. The apparatus according to claim 10, wherein the computing unit is configured to multiply the adjustment weight of the pixel point in the highlight region by the initial lens shading compensation coefficient of the pixel point in the highlight region to obtain a target lens shading compensation coefficient of the pixel point in the highlight region; multiplying the adjustment weight of the pixel points in the non-highlight area by the initial lens shading compensation coefficient of the pixel points in the non-highlight area to obtain a target lens shading compensation coefficient of the pixel points in the non-highlight area;
and the target lens shading compensation coefficient of the pixel point of the high-brightness area is smaller than the initial lens shading compensation coefficient of the pixel point of the high-brightness area.
12. The apparatus according to any one of claims 8 to 11, wherein the computing unit is configured to determine a lens shading compensation coefficient table of the original image according to a current environment, a debugging parameter and image statistics information.
13. The apparatus according to claim 9 or 10, wherein the computing unit, when determining that the original image is a highlight image according to the luminance information of the original image, is specifically configured to:
calculating a luminance distribution statistic value of the original image;
when the luminance distribution statistic value is lower than a preset threshold value, the determining unit determines that the original image is a non-highlight image;
when the luminance distribution statistic is greater than or equal to the preset threshold, the determining unit determines that the original image is the highlight image.
14. A computer readable storage medium having computer instructions stored thereon for performing the steps of the method of any one of claims 1 to 7 when the computer instructions are executed.
15. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the method of any one of claims 1 to 7.
16. A chip system, coupled to a memory, for reading and executing program instructions stored in the memory to perform the steps of the method of any of claims 1 to 7.
CN202110547339.3A 2021-05-19 2021-05-19 Lens shadow correction method, device, medium and terminal Pending CN113284062A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110547339.3A CN113284062A (en) 2021-05-19 2021-05-19 Lens shadow correction method, device, medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110547339.3A CN113284062A (en) 2021-05-19 2021-05-19 Lens shadow correction method, device, medium and terminal

Publications (1)

Publication Number Publication Date
CN113284062A true CN113284062A (en) 2021-08-20

Family

ID=77279927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110547339.3A Pending CN113284062A (en) 2021-05-19 2021-05-19 Lens shadow correction method, device, medium and terminal

Country Status (1)

Country Link
CN (1) CN113284062A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113744332A (en) * 2021-09-07 2021-12-03 汇顶科技(成都)有限责任公司 Image correction method, storage method, device, electronic device and storage medium
CN113747066A (en) * 2021-09-07 2021-12-03 汇顶科技(成都)有限责任公司 Image correction method, image correction device, electronic equipment and computer-readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102281389A (en) * 2010-06-11 2011-12-14 三星电子株式会社 Apparatus and method for creating lens shading compensation table suitable for photography environment
CN104363389A (en) * 2014-11-11 2015-02-18 广东中星电子有限公司 Lens vignetting compensation method and system
TW201519654A (en) * 2013-11-12 2015-05-16 Novatek Microelectronics Corp Automatic color correction method and color correction module thereof
CN111372014A (en) * 2020-03-17 2020-07-03 展讯通信(上海)有限公司 Lens shadow compensation method and device, storage medium and terminal
CN111385438A (en) * 2018-12-28 2020-07-07 展讯通信(上海)有限公司 Compensating method and device for lens shading correction and computer readable storage medium
CN112070682A (en) * 2019-06-10 2020-12-11 杭州海康慧影科技有限公司 Method and device for compensating image brightness

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102281389A (en) * 2010-06-11 2011-12-14 三星电子株式会社 Apparatus and method for creating lens shading compensation table suitable for photography environment
TW201519654A (en) * 2013-11-12 2015-05-16 Novatek Microelectronics Corp Automatic color correction method and color correction module thereof
CN104363389A (en) * 2014-11-11 2015-02-18 广东中星电子有限公司 Lens vignetting compensation method and system
CN111385438A (en) * 2018-12-28 2020-07-07 展讯通信(上海)有限公司 Compensating method and device for lens shading correction and computer readable storage medium
CN112070682A (en) * 2019-06-10 2020-12-11 杭州海康慧影科技有限公司 Method and device for compensating image brightness
CN111372014A (en) * 2020-03-17 2020-07-03 展讯通信(上海)有限公司 Lens shadow compensation method and device, storage medium and terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113744332A (en) * 2021-09-07 2021-12-03 汇顶科技(成都)有限责任公司 Image correction method, storage method, device, electronic device and storage medium
CN113747066A (en) * 2021-09-07 2021-12-03 汇顶科技(成都)有限责任公司 Image correction method, image correction device, electronic equipment and computer-readable storage medium
CN113747066B (en) * 2021-09-07 2023-09-15 汇顶科技(成都)有限责任公司 Image correction method, image correction device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11218630B2 (en) Global tone mapping
US9288392B2 (en) Image capturing device capable of blending images and image processing method for blending images thereof
CN110022469B (en) Image processing method, image processing device, storage medium and electronic equipment
US9367916B1 (en) Method and system of run-time self-calibrating lens shading correction
CN113284062A (en) Lens shadow correction method, device, medium and terminal
CN113962884B (en) HDR video acquisition method and device, electronic equipment and storage medium
US20130121576A1 (en) Automatic tone mapping method and image processing device
CN111372014B (en) Lens shadow compensation method and device, storage medium and terminal
JP5358344B2 (en) Imaging apparatus and imaging method
WO2019104047A1 (en) Global tone mapping
CN110570384A (en) method and device for carrying out illumination equalization processing on scene image, computer equipment and computer storage medium
CN113706393A (en) Video enhancement method, device, equipment and storage medium
CN114429476A (en) Image processing method, image processing apparatus, computer device, and storage medium
CN113840048A (en) Method for intelligently adjusting brightness of four corners of camera picture
KR101337667B1 (en) Lens roll-off correction operation using values corrected based on brightness information
CN111556228B (en) Method and system for correcting lens shadow
CN115239578A (en) Image processing method and device, computer readable storage medium and terminal equipment
CN115187487A (en) Image processing method and device, electronic device and storage medium
CN115334294A (en) Video noise reduction method of local self-adaptive strength
CN111970451B (en) Image processing method, image processing device and terminal equipment
KR101070057B1 (en) Image processing method using adaptive gamma correction curve
KR101626155B1 (en) Apparatus for correcting channel sensitivity and lens shading of a photographed image and method thereof
CN116419076B (en) Image processing method and device, electronic equipment and chip
CN114071109B (en) Method for improving white balance instability and camera module
CN116939374B (en) Lens shading correction method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination