CN113284062B - Lens shading correction method, device, medium and terminal - Google Patents
Lens shading correction method, device, medium and terminal Download PDFInfo
- Publication number
- CN113284062B CN113284062B CN202110547339.3A CN202110547339A CN113284062B CN 113284062 B CN113284062 B CN 113284062B CN 202110547339 A CN202110547339 A CN 202110547339A CN 113284062 B CN113284062 B CN 113284062B
- Authority
- CN
- China
- Prior art keywords
- highlight
- lens shading
- image
- compensation coefficient
- shading compensation
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000003705 background correction Methods 0.000 title claims abstract description 33
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 206010064012 Central pain syndrome Diseases 0.000 description 1
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 206010070834 Sensitisation Diseases 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000003702 image correction Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008313 sensitization Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4023—Scaling 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/94—Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge 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 lens shading correction method, a device, a medium and a terminal, wherein the method can be applied to an image pickup terminal and comprises the following steps: obtaining an original image, determining a lens shading compensation coefficient table of the original image, interpolating the lens shading compensation coefficient table, 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 brightness information of the original image, 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 a target lens shading compensation coefficient of the pixel point, and finally correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point. The invention avoids the loss of detail information after the highlight region correction by confirming the highlight image and adaptively adjusting the highlight image, and improves the image quality after the lens shading correction.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a lens shading correction method, device, medium, and terminal.
Background
The optical characteristic of the lens is that the central sensitization of the lens is higher than the peripheral sensitization, and the light quantity gradually decreases from the center of the lens to the periphery, so that the phenomenon that the image is bright in the middle and dark in the periphery is caused. Meanwhile, due to the fact that the refractive indexes of the lenses are different for light rays with different wavelengths and the refractive angles of the lenses are different for different positions, the captured images can also have color cast around.
The above two phenomena are collectively called lens shading, which reduces the quality of an image, and in order to improve the quality of an image, a lens shading correction technique (LENS SHADING shading, LSC) is generally used at present to implement shading compensation. However, in some scenes where the original image contains a highlight region or a high dynamic region, when the shadow compensation is performed on the original image to eliminate the lens shadow, the edge and detail information of the highlight region due to overcorrection may be lost or overexposed, resulting in poor quality of the image.
Disclosure of Invention
The invention aims to provide a lens shading correction method, device, medium and terminal, which avoid the loss of detail information after highlight area correction and improve the quality of images.
In order to achieve the above object, in a first aspect, the present invention provides a lens shading correction method, applied to an image capturing terminal, including:
The method comprises the steps that an original image is obtained by an image capturing terminal, a lens shading compensation coefficient table of the original image is determined, interpolation is conducted on the lens shading compensation coefficient table, an initial lens shading 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 initial lens shading compensation coefficient of the pixel point in the highlight image is adjusted by the image capturing terminal according to the brightness information of the highlight image, a target lens shading compensation coefficient of the pixel point is obtained, and finally lens shading of the highlight image is corrected according to the target lens shading compensation coefficient of the pixel point by the image capturing terminal.
The lens shading correction method disclosed by the invention has the beneficial effects that: after the camera terminal acquires the original image, a lens shading compensation coefficient table of the original image is determined, interpolation is carried out on the table, an initial lens shading compensation coefficient of a pixel point in the original image is calculated, whether the image is a highlight image is determined according to brightness information of the original image, and when the image is determined to be the highlight image, the initial lens shading compensation coefficient of the pixel point in the highlight image is adjusted according to the brightness information of the highlight image, so that a target lens shading compensation coefficient of the pixel point is obtained. By correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point, the phenomenon that the edge of the highlight region and detail information are lost or overexposed due to overcorrection in the highlight region is likely to occur when the lens shading is eliminated by shading compensation of the highlight image is effectively reduced, and the quality of the image is greatly improved.
In one possible implementation, according to brightness information of a highlight image, adjusting an initial lens shading compensation coefficient of a pixel point in the highlight image to obtain a target lens shading compensation coefficient of the pixel point, including: according to the brightness information of the highlight image, determining the adjustment weight of the pixel point in 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 the adjustment weight of the pixel point in the highlight image according to the brightness information of the highlight image includes: according to the brightness information of the highlight image, determining the adjustment weights of the pixels of the highlight region and the non-highlight region in the highlight image; wherein the adjustment weight of the pixels in the highlight region is smaller than the adjustment weight of the pixels in the non-highlight region. The beneficial effects are that: the adjustment weight of the pixel points of the highlight region is smaller than that of the pixel points of the non-highlight region, so that in lens shading correction of the highlight image, the situation that the edge and detail information of the highlight region are lost due to over correction is avoided, and the image quality is improved.
In one possible implementation, according to an adjustment weight of a pixel, adjusting an initial lens shading compensation coefficient of the pixel to obtain a target lens shading compensation coefficient of the pixel, including: multiplying the adjustment weight of the pixel point of the highlight region with the initial lens shading compensation coefficient of the pixel point of the highlight region to obtain a target lens shading compensation coefficient of the pixel point of the highlight region; multiplying the adjustment weight of the pixel points in the non-highlight region by the initial lens shading compensation coefficient of the pixel points in the non-highlight region to obtain the target lens shading compensation coefficient of the pixel points in the non-highlight region; wherein the target lens shading compensation coefficient of the pixel point of the non-highlight region is similar or equal to the initial lens shading compensation coefficient of the pixel point of the non-highlight region.
In one possible implementation, determining a lens shading compensation coefficient table of 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 information.
In one possible implementation, determining that the original image is a highlight image based on luminance information of the original image includes: calculating the brightness distribution statistical value of the original image; when the brightness distribution statistical value is lower than a preset threshold value, determining that the original image is a non-highlight image; and when the brightness distribution statistical value is greater 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 from a luminance distribution statistic of the sample set of high-brightness images.
In a second aspect, an apparatus for correcting lens shading provided by an embodiment of the present invention includes:
an acquisition unit configured to acquire an original image;
A determining unit that determines a lens shading compensation coefficient table of an original image; the method comprises the steps of determining an original image to be a highlight image according to brightness information in the original image;
the calculating unit is used for interpolating the lens shading compensation coefficient table of the highlight image and calculating the initial lens shading compensation coefficient of the 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 shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
The lens shading correction device disclosed by the invention has the beneficial effects that: after the camera terminal obtains the original image, a lens shading compensation coefficient table of the original image is determined, the table is interpolated, an initial lens shading compensation coefficient of a pixel point in the original image is calculated, whether the image is a highlight image is determined according to brightness information of the original image, and when the image is determined to be the highlight image, the initial lens shading compensation coefficient of the pixel point in the highlight image is adjusted according to the brightness information of the highlight image, so that a target lens shading compensation coefficient of the pixel point is obtained. By correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point, the phenomenon that the edge of the highlight region and detail information are lost or overexposed due to overcorrection in the highlight region is likely to occur when the lens shading is eliminated by shading compensation of the highlight image is effectively reduced, and the quality of the image is greatly improved.
In one possible implementation, the determining unit is further configured to determine an adjustment weight of a pixel in the highlight image according to the brightness information of the highlight image, and then the adjusting unit adjusts an initial lens shading compensation coefficient of the pixel according to the adjustment weight of the pixel, to obtain a target lens shading compensation coefficient of the pixel.
In a possible implementation, the determining unit is further configured to determine the adjustment weights of the pixels of the highlight region and the non-highlight region in the highlight image according to the luminance information of the highlight image. Wherein the adjustment weight of the pixels in the highlight region is smaller than the adjustment weight of the pixels in the non-highlight region.
In one possible implementation, the computing unit is configured to multiply the adjustment weight of the pixel point of the highlight region with the initial lens shading compensation coefficient of the pixel point of the highlight region to obtain a target lens shading compensation coefficient of the pixel point of the highlight region; multiplying the adjustment weight of the pixel points in the non-highlight region by the initial lens shading compensation coefficient of the pixel points in the non-highlight region to obtain the target lens shading compensation coefficient of the pixel points in the non-highlight region;
wherein the target lens shading compensation coefficient of the pixel point of the highlight region is smaller than the initial lens shading compensation coefficient of the pixel point of the highlight region.
In one possible implementation, the computing unit is configured to determine a lens shading compensation coefficient table of the original image according to the current environment, the debug parameters, and the image statistics information.
In one possible implementation, the computing unit is specifically configured to, when determining that the original image is a highlight image according to luminance information of the original image: the calculation unit calculates the brightness distribution statistical value of the original image;
When the brightness distribution statistical value is lower than a preset threshold value, the determining unit determines that the original image is a non-highlight image;
when the brightness 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, where the computer instructions execute the steps of the above method when executed.
In a fourth aspect, an embodiment of the present invention provides a 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 steps of the method described above when executing the computer instructions.
In a fifth aspect, an embodiment of the present invention provides a chip system, coupled to a memory, for reading and executing program instructions stored in the memory to perform the steps of the above method.
Drawings
FIG. 1A is a schematic view of a two-dimensional lens shading disclosed in the present invention;
FIG. 1B is a schematic diagram of a three-dimensional lens shading compensation coefficient table according to the present disclosure;
FIG. 1C is a schematic diagram of detail loss after image correction of a highlight region by the lens shading correction technique of the present disclosure;
FIG. 2 is a flow chart of a lens shading correction method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a lens shading correction algorithm process according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of a method for adaptively adjusting shading compensation gain according to an embodiment of the present disclosure;
FIG. 5 is a block diagram illustrating a method and apparatus for correcting lens shading according to an embodiment of the present disclosure;
Fig. 6 is a schematic diagram of an apparatus according to an embodiment of the present disclosure.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. Unless otherwise defined, technical or scientific terms used herein should be given 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 the like means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof without precluding other elements or items.
When some image pickup terminals such as a mobile phone or a camera are used for shooting under the influence of optical characteristics of a lens, brightness shadows (luma shading) with gradually darkening brightness from the center of the image to the periphery or color shadows (color shading) with inconsistent colors of the center of the image and the periphery can appear in the shot image, so that the image quality is reduced.
In the prior art, in order to improve the image quality, a Lens Shading Correction (LSC) technique is adopted to correct the image. In most lens shading correction technologies, a grid method is adopted, and referring to fig. 1A and 1B, fig. 1A is a two-dimensional lens shading schematic diagram, and fig. 1B is a three-dimensional lens shading compensation coefficient table schematic diagram. 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 obtained original image is an image with 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 lens shading compensation coefficient table with a size of M x N. Wherein m×n is smaller than the size of the original image. In the operation stage, the lens compensation coefficient table is mapped to the original image aiming at the original image shot by the terminal, 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 amplifying the brightness value of each original pixel of the original image according to the calculated lens shading compensation coefficient of the corresponding pixel point, so as to obtain the processed image.
Referring to fig. 1C, fig. 1C is a schematic diagram showing detail loss after an image of a highlight region is corrected by using a lens shading correction technology. The lines in the dashed box 100 in the original drawing in fig. 1C cause the lines to be lost after lens shading correction. It can be seen that in some highlight scenes or in highly dynamic scenes, the adoption of the lens shading correction technology may cause that the highlight areas in the image lose edge and detail information due to overcorrection.
In order to solve the above-mentioned problems, an embodiment of the present invention provides a lens shading correction method, which can be applied to an image capturing terminal, as shown with reference to fig. 2, including:
s201: the camera terminal acquires an original image.
Wherein the image data of the original image includes image size, brightness information, color information, and the like.
S202: the camera terminal determines a lens shading compensation coefficient table of the original image.
In the step, the camera terminal can determine a final lens shading compensation coefficient table of the original image according to the current environment, the debugging parameters 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: the camera terminal interpolates 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, since color shadows appear differently under different light sources, generally, lsc tables under several common light sources are calibrated in advance, then a group of lsc tables is calculated according to current environment information, and then interpolation is performed on the calculated lsc tables to obtain an initial lens shadow compensation coefficient corresponding to each pixel point in the original image.
S204: and the camera terminal determines the original image to be a highlight image according to the brightness information of the original image.
In this step, one possible implementation is that the image capturing terminal calculates a brightness distribution statistic value of the original image first, determines that the original image is a non-highlight image when the calculated brightness distribution statistic value is lower than a preset threshold value, and determines that the original image is a highlight image when the brightness distribution statistic value is greater than or equal to the preset threshold value. The determination mode about the preset threshold value can be determined by utilizing the brightness distribution statistical characteristics of the sample highlight image set.
S205: and the image pickup 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 image capturing terminal may determine an adjustment weight of a pixel in the highlight image according to luminance information of the highlight image, and then adjust an initial lens shading compensation coefficient of the pixel according to the adjustment weight of the pixel, to obtain a target lens shading compensation coefficient of the pixel.
S206: and the image pickup terminal corrects the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
In this step, the image capturing terminal may multiply the target lens shading compensation coefficient of the pixel point by the pixel value of the corresponding pixel point in the original image, so as to implement correction of lens shading.
Therefore, in the above embodiment, the interpolated lsc table may be adaptively adjusted 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 region may be effectively maintained, and the information loss caused by lens shading correction may be reduced. The method can improve the environmental adaptability of the lens shading correction module, reduce the loss of detail information after the highlight area is corrected, and improve the image quality after the lens shading correction.
In another possible implementation, since there may be both a highlight region and a non-highlight region in the highlight image, the adjustment weight of the pixel of the highlight region and the adjustment weight of the pixel of the non-highlight region in the highlight image may also be determined according to the luminance information of the highlight image, respectively. It can be understood that the adjustment weight of the pixel point of the highlight region is smaller than that of the pixel point of the non-highlight region, wherein the value range of the adjustment weight can be (0, 1).
Based on the adjustment weight of the pixel point of the highlight region and the adjustment weight of the pixel point of the non-highlight region in the highlight image, in the implementation, the image processor of the image capturing terminal can obtain the target lens shading compensation coefficient of the pixel point of the highlight region by multiplying the adjustment weight of the pixel point of the highlight region with the initial lens shading compensation coefficient of the pixel point of the highlight region, and obtain the target lens shading compensation coefficient of the pixel point of the non-highlight region by multiplying the adjustment weight of the pixel point of the non-highlight region with the initial lens shading compensation coefficient of the pixel point of the non-highlight region. The target lens shading compensation coefficient of the pixel point of the highlight region is smaller than the initial lens shading compensation coefficient of the pixel point of the highlight region by adjusting the weight value of the highlight region. Illustratively, the initial lens shading compensation coefficient of the pixel point of the highlight region is 4, and after the overshoot is to be adjusted, the target lens shading compensation coefficient of the pixel point of the highlight region is 1.
In order to more systematically discuss the above lens shading correction method, the present application further describes the procedure of the lens shading correction method with reference to the flowchart of the procedure of the lens shading correction algorithm shown in fig. 3, and referring to fig. 3, the lens shading correction algorithm comprises the following steps:
S301: an image processor of the camera terminal acquires image data of an original image.
The image data of the original image includes image size, luminance information, color information, and the like.
S302: and the 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 information.
S303: the image processor of the camera terminal interpolates the lens shading compensation coefficient table to calculate the initial lens shading compensation coefficient of the pixel point in the original image.
S304: the image processor of the camera terminal judges whether the original image is a highlight image. If the image is highlighted, the process advances to step S305, and if the image is not highlighted, the process advances to step S306.
In this step, the image capturing terminal may calculate a luminance distribution statistic value using luminance information of the original image, and compare the luminance distribution statistic value with a preset threshold value to determine whether the original image is a highlight image.
S305: and the image processor of the image pickup terminal determines the adjustment weight of the pixel point in the highlight image according to the brightness information of the highlight image.
S306: the image processor of the imaging terminal sets the adjustment weight to a value of 1.
It should be noted that, the steps of the methods of S302 to S306 may be adjusted according to actual requirements, and may also be executed simultaneously, and the embodiment is not limited to the order of execution.
S307: the image processor of the image capturing terminal multiplies the adjustment weight of the pixel point of the highlight region by the initial lens shading compensation coefficient of the pixel point of the highlight region to obtain the target lens shading compensation coefficient of the pixel point of the highlight region, and corrects the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
S308: and outputting the corrected highlight image by an image processor of the camera terminal, and performing later image processing.
Therefore, the method can realize reasonable suppression of the shadow compensation gain of the highlight region, and effectively keep the details and the edge information of the highlight region. Compared with the prior art, if the adjustment of the lens shading compensation coefficient of the highlight region is not performed, the highlight region 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 describes a procedure of a lens shading correction method in combination with an adaptive adjustment method of shading compensation gain shown in fig. 4, and referring to fig. 4, the adaptive adjustment method includes the following steps:
S401: the image pickup terminal acquires brightness information of the highlight image.
S402: and the camera shooting terminal acquires brightness information according to the highlight image and determines the adjustment weight of the pixel point in the highlight image.
In this step, since the highlight region and the non-highlight region are included in the highlight image, the adjustment weights of the pixels of the highlight region and the non-highlight region can be determined, and the adjustment weights of the pixels of the highlight region are smaller than those of the pixels of 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, in general, the pixel point lens shading compensation coefficient is 1 to 4, the target lens shading compensation coefficient of the pixel point of the highlight region is made smaller than the initial lens shading compensation coefficient of the pixel point of the highlight region by adjusting the adjustment weight of the pixel point of the highlight region, and the target lens shading compensation coefficient of the pixel point of the highlight region is made approximately 1.
S404: the camera terminal obtains a lens shading compensation coefficient table for determining the highlight image, interpolates the lens shading compensation coefficient table, and calculates an initial lens shading compensation coefficient of a pixel point in the highlight image.
S405: the camera shooting terminal obtains a target lens shading compensation coefficient of the pixel point according to the adjustment weight of the pixel point in the highlight image and the initial lens shading compensation coefficient of the pixel point in the highlight image.
S406: and the camera shooting terminal acquires a target lens shadow compensation coefficient according to the pixel point and corrects the highlight image.
In another embodiment of the present disclosure, a lens shading correction device, as shown in fig. 5, includes: an obtaining unit 501, configured to obtain an original image, a determining unit 502, where the determining unit 502 determines a lens shading compensation coefficient table of the original image, and the determining unit 502 determines that the original image is a highlight image according to brightness information in the original image, that is, determines that the original image is a highlight image. A calculating unit 503, configured to perform interpolation calculation on a lens shading compensation coefficient table of the highlight image, calculate an initial lens shading compensation coefficient of a pixel in the highlight image, and output the initial lens shading compensation coefficient table forming the pixel, and an adjusting unit 504, configured to adjust the initial lens shading compensation coefficient of the pixel in the highlight image according to brightness information of the highlight image, to obtain a target lens shading compensation coefficient of the pixel. A correction unit 505 for correcting 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 in the highlight image according to the brightness information of the highlight image, and the adjusting unit 504 adjusts an initial lens shading compensation coefficient of the pixel according to the adjustment weight of the pixel, to obtain a target lens shading compensation coefficient of the pixel.
The highlight image includes a highlight region and a non-highlight region, and the determining unit 502 is further configured to determine adjustment weights of pixels of the highlight region and the non-highlight region. Wherein the adjustment weight of the pixels in the highlight region is smaller than the adjustment weight of the pixels in the non-highlight region.
In another possible implementation, the calculating unit 503 is configured to multiply the adjustment weight of the pixel point of the highlight region with the initial lens shading compensation coefficient of the pixel point of the highlight region to obtain the target lens shading compensation coefficient of the pixel point of the highlight region, and multiply the adjustment weight of the pixel point of the non-highlight region with the initial lens shading compensation coefficient of the pixel point of the non-highlight region to obtain the target lens shading compensation coefficient of the pixel point of the non-highlight region. Wherein the target lens shading compensation coefficient of the pixel point of the highlight region is smaller than the initial lens shading compensation coefficient of the pixel point of the highlight region.
In addition, the calculating unit 503 is further configured to determine a lens shading compensation coefficient table of the original image according to the current environment, the debug parameter and the image statistics information. Wherein the calculating unit 503 calculates 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 502 determines that the original image is a non-highlight image, and when the luminance distribution statistic value is greater than or equal to the preset threshold value, the determining unit 502 determines that the original image is a highlight image.
In other embodiments of the present application, an apparatus is disclosed, as shown in fig. 6, which may include: one or more processors 601; a memory 602; a display 603; one or more applications (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 that, when executed, perform the steps of the above-described method.
In another embodiment of the disclosure, the present invention further provides an image capturing 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 steps of the method when executing the computer instructions.
In another embodiment of the disclosure, the present invention further provides a chip system coupled to the memory for reading and executing the program instructions stored in the memory to perform the steps of the method described above.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the embodiment of the present application should be covered in the protection scope of the embodiment 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 (12)
1. A lens shading correction method applied to an image pickup terminal, comprising:
Acquiring an original image;
determining a lens shading compensation coefficient table of the original image;
Interpolation is carried out on the lens shading compensation coefficient table, and an initial lens shading compensation coefficient of a pixel point in the original image is calculated;
Determining that the original image is a highlight image according to the brightness information of the original image;
According to the brightness information of the highlight image, adjusting an initial lens shadow compensation coefficient of a pixel point in the highlight image to obtain a target lens shadow compensation coefficient of the pixel point;
Correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point;
According to the brightness information of the highlight image, adjusting an initial lens shading compensation coefficient of a pixel point in the highlight image to obtain a target lens shading compensation coefficient of the pixel point, wherein the method comprises the following steps:
according to the brightness information of the highlight image, determining the adjustment weight of the pixel points in the highlight image;
According to the adjustment weight of the pixel point, adjusting an initial lens shading compensation coefficient of the pixel point to obtain a target lens shading compensation coefficient of the pixel point;
according to the brightness information of the highlight image, determining the adjustment weight of the pixel point in the highlight image comprises the following steps:
according to the brightness information of the highlight image, determining the adjustment weights of the pixel points of the highlight region and the non-highlight region in the highlight image;
the adjustment weight of the pixel points of the highlight region is smaller than that of the pixel points of the non-highlight region.
2. The method of claim 1, 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 region with the initial lens shading compensation coefficient of the pixel point of the highlight region to obtain a target lens shading compensation coefficient of the pixel point of the highlight region;
Multiplying the adjustment weight of the pixel points in the non-highlight region with the initial lens shading compensation coefficient of the pixel points in the non-highlight region to obtain the target lens shading compensation coefficient of the pixel points in the non-highlight region;
The target lens shading compensation coefficient of the pixel point of the non-highlight region is similar to or equal to the initial lens shading compensation coefficient of the pixel point of the non-highlight region.
3. The method according to any one of claims 1 to 2, wherein said determining a lens shading compensation coefficient table of said 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 information.
4. The method according to claim 1 or 2, wherein determining that the original image is a highlight image based on luminance information of the original image comprises:
Calculating a brightness distribution statistical value of the original image;
when the brightness distribution statistical value is lower than a preset threshold value, determining that the original image is a non-highlight image;
And when the brightness distribution statistical value is greater than or equal to the preset threshold value, determining the original image as the highlight image.
5. The method of claim 4, wherein the threshold is determined based on a luminance distribution statistic of the sample collection of highlighted images.
6. A lens shading correction device, characterized by comprising:
an acquisition unit configured to acquire an original image;
a determining unit that determines a lens shading compensation coefficient table of the original image; the method comprises the steps of determining that an original image is a highlight image according to brightness information in the original image;
the calculating unit is used for interpolating the lens shading compensation coefficient table of the highlight image and calculating the initial lens shading compensation coefficient of the 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;
the correction unit is used for correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point;
the determining unit is further used for determining the adjustment weight of the pixel points in the highlight image according to the brightness information of the highlight image;
The adjusting unit is further configured to adjust an initial lens shading compensation coefficient of the pixel according to the adjustment weight of the pixel, so as to obtain a target lens shading compensation coefficient of the pixel;
the determining unit is further used for determining the adjustment weights of the pixels of the highlight region and the non-highlight region in the highlight image according to the brightness information of the highlight image;
the adjustment weight of the pixel points of the highlight region is smaller than that of the pixel points of the non-highlight region.
7. The apparatus according to claim 6, wherein the calculating unit is configured to multiply an adjustment weight of the pixel point of the highlight region with an initial lens shading compensation coefficient of the pixel point of the highlight region to obtain a target lens shading compensation coefficient of the pixel point of the highlight region; multiplying the adjustment weight of the pixel points in the non-highlight region with the initial lens shading compensation coefficient of the pixel points in the non-highlight region to obtain the target lens shading compensation coefficient of the pixel points in the non-highlight region;
the target lens shading compensation coefficient of the pixel point of the highlight area is smaller than the initial lens shading compensation coefficient of the pixel point of the highlight area.
8. The apparatus according to any one of claims 6 to 7, wherein the computing unit is configured to determine a lens shading compensation coefficient table of the original image according to a current environment, a debug parameter, and image statistics information.
9. The apparatus according to claim 6 or 7, wherein the calculating unit is configured to, when determining that the original image is a highlight image according to the luminance information of the original image:
Calculating a brightness distribution statistical value of the original image;
When the brightness distribution statistical value is lower than a preset threshold value, the determining unit determines that the original image is a non-highlight image;
And when the brightness distribution statistical value is greater than or equal to the preset threshold value, the determining unit determines that the original image is the highlight image.
10. A computer readable storage medium storing computer instructions which, when executed, perform the steps of the method of any one of claims 1 to 5.
11. 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 of claims 1 to 5.
12. 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 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110547339.3A CN113284062B (en) | 2021-05-19 | 2021-05-19 | Lens shading correction method, device, medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110547339.3A CN113284062B (en) | 2021-05-19 | 2021-05-19 | Lens shading correction method, device, medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113284062A CN113284062A (en) | 2021-08-20 |
CN113284062B true CN113284062B (en) | 2024-09-06 |
Family
ID=77279927
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110547339.3A Active CN113284062B (en) | 2021-05-19 | 2021-05-19 | Lens shading correction method, device, medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113284062B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113747066B (en) * | 2021-09-07 | 2023-09-15 | 汇顶科技(成都)有限责任公司 | Image correction method, image correction device, electronic equipment and computer readable storage medium |
CN113744332B (en) * | 2021-09-07 | 2025-04-15 | 深圳市汇顶科技股份有限公司 | Image correction method, storage method, device, electronic device and storage medium |
CN114331907B (en) * | 2021-12-31 | 2025-05-06 | 展讯半导体(南京)有限公司 | Color shading correction method and device |
CN114820315A (en) * | 2022-04-24 | 2022-07-29 | 武汉极目智能技术有限公司 | Image vignetting correction method for vehicle-mounted all-round splicing |
Citations (2)
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 |
CN112070682A (en) * | 2019-06-10 | 2020-12-11 | 杭州海康慧影科技有限公司 | Method and device for compensating image brightness |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI493967B (en) * | 2013-11-12 | 2015-07-21 | 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 |
CN111385438B (en) * | 2018-12-28 | 2022-03-25 | 展讯通信(上海)有限公司 | Compensating method and device for lens shading correction and computer readable storage medium |
CN111372014B (en) * | 2020-03-17 | 2022-04-22 | 展讯通信(上海)有限公司 | Lens shadow compensation method and device, storage medium and terminal |
-
2021
- 2021-05-19 CN CN202110547339.3A patent/CN113284062B/en active Active
Patent Citations (2)
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 |
CN112070682A (en) * | 2019-06-10 | 2020-12-11 | 杭州海康慧影科技有限公司 | Method and device for compensating image brightness |
Also Published As
Publication number | Publication date |
---|---|
CN113284062A (en) | 2021-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113284062B (en) | Lens shading correction method, device, medium and terminal | |
US11218630B2 (en) | Global tone mapping | |
US7733407B2 (en) | Image processing apparatus and method for preferably correcting distortion aberration | |
US8693801B2 (en) | Image processing device, image processing method, and integrated circuit | |
US20160037060A1 (en) | Generating a high dynamic range image using a temporal filter | |
CN113573032B (en) | Image processing method and projection system | |
US8781225B2 (en) | Automatic tone mapping method and image processing device | |
CN113706393B (en) | Video enhancement method, device, equipment and storage medium | |
US8280162B2 (en) | Image processing apparatus and recording medium recording image processing program | |
JP5358344B2 (en) | Imaging apparatus and imaging method | |
WO2019104047A1 (en) | Global tone mapping | |
CN109410152A (en) | Imaging method and apparatus, electronic device, computer-readable storage medium | |
CN115239578A (en) | Image processing method and device, computer readable storage medium and terminal equipment | |
WO2021127972A1 (en) | Image processing method and apparatus, imaging device, and movable carrier | |
US11074678B2 (en) | Biasing a noise filter to preserve image texture | |
CN114677295A (en) | Method and device for enhancing mirror highlight image of real scene and storage medium | |
CN115914601B (en) | Image processing method, system, electronic device, readable storage medium and chip | |
CN113840048B (en) | Method for intelligently adjusting brightness of four corners of camera picture | |
CN110782400A (en) | A kind of self-adaptive illumination uniform realization method and device | |
CN111556228B (en) | Method and system for correcting lens shadow | |
JP5932392B2 (en) | Image processing apparatus and image processing method | |
CN119693257A (en) | Image denoising method, device, equipment and computer-readable storage medium | |
CN116419076B (en) | Image processing method and device, electronic equipment and chip | |
KR101626155B1 (en) | Apparatus for correcting channel sensitivity and lens shading of a photographed image and method thereof | |
KR101070057B1 (en) | Image processing method using adaptive gamma correction curve |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |