Lens shading correction method, device, medium and terminal
By adjusting the lens shadow compensation coefficient according to the image brightness information in the camera terminal, the problem of information loss in the highlight area in the existing technology is solved, and the image quality and detail retention are improved.
Patent Information
- Application Number
- CN202110547339.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-05-19
AI Technical Summary
Existing lens shading correction technology can easily cause edge and detail information loss or overexposure in high-brightness areas or high-dynamic area scenes, reducing image quality.
By acquiring the original image at the camera terminal, the lens shadow compensation coefficient table is determined, and the initial compensation coefficient of the pixel is adjusted according to the brightness information of the image, the target compensation coefficient is calculated, and the highlight image is corrected to avoid information loss caused by over-correction.
It effectively reduces the information loss caused by lens shadow correction in highlight areas, improves image quality and detail retention, and enhances the environmental adaptability of the correction module.
Smart Images

Figure CN113284062B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a lens shading correction method, device, medium and terminal. Background Art
[0002] The optical characteristics of the lens are that the center of the lens is more sensitive than the periphery, and the amount of light passing through gradually decreases from the center to the periphery of the lens, resulting in the image being bright in the middle and dark around. At the same time, due to the different refractive indices of the lens for light of different wavelengths and the different refraction angles of the lens at different positions, the captured image will also have a color cast around the periphery.
[0003] The above two phenomena are collectively referred to as lens shading, which will reduce the quality of the image. In order to improve the quality of the image, lens shading correction (LSC) technology is currently usually used to achieve shading compensation. However, in some scenes where the original image contains highlight areas or high dynamic areas, when the original image is subjected to shading compensation to eliminate lens shading, the edge and detail information of the highlight area may be lost or overexposed due to overcorrection, resulting in poor image quality. Summary of the invention
[0004] The object of the present invention is to provide a lens shading correction method, device, medium and terminal, which avoids the loss of detail information after highlight area correction and improves the image quality.
[0005] To achieve the above object, in a first aspect, the present invention provides a lens shading correction method, which is applied to a camera terminal, and the method comprises:
[0006] The camera terminal obtains the original image, determines the lens shading compensation coefficient table of the original image, interpolates the lens shading compensation coefficient table, calculates the initial lens shading compensation coefficient of the pixel points in the original image, and determines that the original image is a highlight image based on the brightness information of the original image. Then the camera terminal adjusts the initial lens shading compensation coefficient of the pixel points in the highlight image based on the brightness information of the highlight image to obtain the target lens shading compensation coefficient of the pixel points. Finally, the camera terminal corrects the lens shading of the highlight image based on the target lens shading compensation coefficient of the pixel points.
[0007] The beneficial effect of the lens shading correction method disclosed in the present invention is that after the camera terminal obtains the original image, the lens shading compensation coefficient table of the original image is determined, and after the table is interpolated, the initial lens shading compensation coefficient of the pixel point in the original image is calculated, and then whether it is a highlight image is determined according to the brightness information of the original image. When it is determined to be a 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 to obtain the target lens shading compensation coefficient of the pixel point. By correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point, the lens shading of the highlight image is effectively reduced, and the edge and detail information of the highlight area may be lost or overexposed due to overcorrection when the lens shading is eliminated by performing shadow compensation on the highlight image, thereby greatly improving the image quality.
[0008] In a possible implementation, an initial lens shading compensation coefficient of a pixel in the highlight image is adjusted according to brightness information of the highlight image to obtain a target lens shading compensation coefficient of the pixel, including: determining an adjustment weight of the pixel in the highlight image according to the brightness information of the highlight image; and adjusting the 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.
[0009] In a possible implementation, the adjustment weights of the pixels in the highlight image are determined according to the brightness information of the highlight image, including: determining the adjustment weights of the pixels in the highlight area and the non-highlight area in the highlight image according to the brightness information of the highlight image; wherein the adjustment weights of the pixels in the highlight area are smaller than the adjustment weights of the pixels in the non-highlight area. The beneficial effect is that the adjustment weights of the pixels in the highlight area are smaller than the adjustment weights of the pixels in the non-highlight area, thereby avoiding the loss of edge and detail information of the highlight area due to over-correction in the lens shading correction of the highlight image, thereby improving the image quality.
[0010] In a possible implementation, the initial lens shadow compensation coefficient of the pixel point is adjusted according to the adjustment weight of the pixel point to obtain the target lens shadow compensation coefficient of the pixel point, including: multiplying the adjustment weight of the pixel point in the highlight area by the initial lens shadow compensation coefficient of the pixel point in the highlight area to obtain the target lens shadow compensation coefficient of the pixel point in the highlight area; multiplying the adjustment weight of the pixel point in the non-highlight area by the initial lens shadow compensation coefficient of the pixel point in the non-highlight area to obtain the target lens shadow compensation coefficient of the pixel point in the non-highlight area; wherein the target lens shadow compensation coefficient of the pixel point in the non-highlight area is close to or equal to the initial lens shadow compensation coefficient of the pixel point in the non-highlight area.
[0011] In a possible implementation, determining the lens shading compensation coefficient table of the original image includes: determining the lens shading compensation coefficient table of the original image according to the current environment, debugging parameters and image statistical value information.
[0012] In one possible implementation, based on the brightness information of the original image, determining that the original image is a highlight image includes: calculating the brightness distribution statistics of the original image; when the brightness distribution statistics is lower than a preset threshold, determining that the original image is a non-highlight image; when the brightness distribution statistics is greater than or equal to the preset threshold, determining that the original image is a highlight image.
[0013] In a possible implementation, the preset threshold is determined according to statistical characteristics of brightness distribution of the sample highlight image set.
[0014] In a second aspect, an embodiment of the present invention provides a lens shading correction device, comprising:
[0015] An acquisition unit, used for acquiring an original image;
[0016] A determination unit, for determining a lens shading compensation coefficient table of an original image; and for determining that the original image is a highlight image according to brightness information in the original image;
[0017] A calculation unit, used to interpolate the lens shading compensation coefficient table of the highlight image and calculate the initial lens shading compensation coefficient of the pixel point in the highlight image;
[0018] An adjustment unit, used to adjust an initial lens shading compensation coefficient of a pixel point in the highlight image according to brightness information of the highlight image, so as to obtain a target lens shading compensation coefficient of the pixel point;
[0019] The correction unit is used to correct the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
[0020] The beneficial effect of the lens shading correction device disclosed in the present invention is that after the camera terminal obtains the original image, it determines the lens shading compensation coefficient table of the original image, and after interpolating the table, calculates the initial lens shading compensation coefficient of the pixel point in the original image, and then determines whether it is a highlight image according to the brightness information of the original image. When it is determined to be a 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 to obtain the target lens shading compensation coefficient of the pixel point. By correcting the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point, it effectively reduces the possibility that the edge and detail information of the highlight area will be lost or overexposed due to overcorrection when the lens shading is performed on the highlight image, thereby greatly improving the image quality.
[0021] In one possible implementation, the determination unit is also used to determine the adjustment weight of the pixel in the highlight image based on the brightness information of the highlight image, and then the adjustment unit adjusts 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.
[0022] In a possible implementation, the determination unit is further configured to determine the adjustment weights of the pixels in the highlight area and the non-highlight area of the highlight image according to the brightness information of the highlight image, wherein the adjustment weights of the pixels in the highlight area are smaller than the adjustment weights of the pixels in the non-highlight area.
[0023] In a possible implementation, the calculation unit is used to multiply the adjustment weight of the pixel point in the highlight area with the initial lens shadow compensation coefficient of the pixel point in the highlight area to obtain the target lens shadow compensation coefficient of the pixel point in the highlight area; multiply the adjustment weight of the pixel point in the non-highlight area with the initial lens shadow compensation coefficient of the pixel point in the non-highlight area to obtain the target lens shadow compensation coefficient of the pixel point in the non-highlight area;
[0024] The target lens shading compensation coefficient of the pixel point in the highlight area is less than the initial lens shading compensation coefficient of the pixel point in the highlight area.
[0025] In a possible implementation, the computing unit is used to determine a lens shading compensation coefficient table of the original image according to the current environment, debugging parameters and image statistical value information.
[0026] In a possible implementation, when the calculation unit determines that the original image is a highlight image according to the brightness information of the original image, the calculation unit is specifically used to: calculate the brightness distribution statistics of the original image;
[0027] When the brightness distribution statistical value is lower than a preset threshold, the determination unit determines that the original image is a non-highlight image;
[0028] When the brightness distribution statistical value is greater than or equal to a preset threshold, the determining unit determines that the original image is a highlight image.
[0029] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed, the steps of the above method are executed.
[0030] In a fourth aspect, an embodiment of the present invention provides a terminal, comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and the processor executes the steps of the above method when executing the computer instructions.
[0031] In a fifth aspect, an embodiment of the present invention provides a chip system, which is coupled to a memory and is used to read and execute program instructions stored in the memory to perform the steps of the above method. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1A A schematic diagram of a two-dimensional lens shadow disclosed in the present invention;
[0033] Figure 1B It is a schematic diagram of a three-dimensional lens shading compensation coefficient table disclosed in the present invention;
[0034] Figure 1C It is a schematic diagram showing the loss of details after the image in the highlight area is corrected by the lens shading correction technology disclosed in the present invention;
[0035] Figure 2 It is a flow chart of the lens shading correction method of the embodiment disclosed by the present invention;
[0036] Figure 3 It is a flowchart of the lens shading correction algorithm process of the embodiment disclosed by the present invention;
[0037] Figure 4 It is a flow chart of a method for adaptively adjusting shadow compensation gain according to an embodiment of the present invention;
[0038] Figure 5 It is a structural block diagram of a lens shading correction method device according to an embodiment of the present invention;
[0039] Figure 6 It is a schematic diagram of a device according to Embodiment 1 disclosed in the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, 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 in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0041] Due to the influence of the optical characteristics of the lens, when some camera terminals such as mobile phones or cameras shoot, the captured images will have brightness shadows (luma shading) where the brightness gradually darkens from the center of the image to the surrounding areas, or color shading where the colors of the center of the image are inconsistent with those of the surrounding areas, thereby reducing the image quality.
[0042] In the prior art, in order to improve the image quality, lens shading correction (LSC) technology is used to correct the image. Most lens shading correction technologies use the grid method. Figure 1A and Figure 1B As shown, Figure 1A is a two-dimensional lens shadow diagram. Figure 1B It is a schematic diagram of a three-dimensional lens shading compensation coefficient table. Among them, the grid method includes a calibration stage and an operation stage. In the calibration stage, the original image is captured and obtained. The original image obtained by the capture is an image with a bright center and gradually darkened around. Then the original image is input into the calculation module to obtain the lens shading compensation coefficient. The output lens shading compensation coefficient is a lens shading compensation coefficient table with a size of M×N. Among them, M×N is smaller than the size of the original image. In the operation stage, for the original image captured by the terminal, the lens compensation coefficient table is mapped to the original original image. According to the lens shading compensation coefficients of multiple vertices of the grid, the lens shading compensation coefficient of each pixel in the grid can be calculated. For each original pixel of the original image, the brightness value of the original pixel is amplified according to the calculated lens shading compensation coefficient of the corresponding pixel, and the processed image can be obtained.
[0043] refer to Figure 1C As shown, Figure 1C A schematic diagram of the loss of details after image correction of highlight areas using existing lens shading correction technology. Figure 1C The lines in the dotted frame 100 in the original image are lost after the lens shading correction. It can be seen that in some scenes with high-brightness or high-dynamic scenes, the use of lens shading correction technology may cause the edge and detail information of the high-brightness area in the image to be lost due to over-correction.
[0044] In order to solve the above problems, an embodiment of the present invention provides a lens shading correction method, which can be applied to a camera terminal. Figure 2 As shown, the method includes:
[0045] S201: The camera terminal obtains an original image.
[0046] The image data of the original image includes image size, brightness information, color information, etc.
[0047] S202: The camera terminal determines a lens shading compensation coefficient table of the original image.
[0048] In this step, the camera terminal can determine the lens shading compensation coefficient table of the final original image according to the current environment, debugging parameters and image statistics information. Specifically, the image processor of the camera terminal calculates the input image according to the current environment, debugging parameters and image statistics information to obtain the lens shading compensation coefficient (lsc table).
[0049] S203: The camera terminal interpolates the lens shading compensation coefficient table to calculate initial lens shading compensation coefficients for pixels in the original image.
[0050] In this step, since color shadows appear differently under different light sources, the lsc tables under several common light sources are generally pre-calibrated. Then, a set of lsc tables is calculated based on the current environmental information. The calculated lsc tables are then interpolated to obtain the initial lens shading compensation coefficient corresponding to each pixel in the original image.
[0051] S204: The camera terminal determines that the original image is a highlight image according to the brightness information of the original image.
[0052] In this step, one possible implementation is that the camera terminal first calculates the brightness distribution statistics of the original image, and when the calculated brightness distribution statistics is lower than a preset threshold, the original image is determined to be a non-highlight image, and when the brightness distribution statistics is greater than or equal to the preset threshold, the original image is determined to be a highlight image. The preset threshold can be determined by using the brightness distribution statistics of the sample highlight image set.
[0053] S205: 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.
[0054] In this step, the camera terminal can determine the adjustment weight of the pixel 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 according to the adjustment weight of the pixel to obtain the target lens shading compensation coefficient of the pixel.
[0055] S206: The camera terminal corrects the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
[0056] In this step, the camera 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 to achieve correction of the lens shading.
[0057] It can be seen that in the above embodiment, the interpolated lsc table can be adaptively adjusted according to the brightness information of the original image, so that the highlight or high dynamic scene image can effectively retain the detail information of the highlight area after the lens shading correction, and reduce the amount of information loss caused by the lens shading correction. This 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.
[0058] In another possible implementation, because the highlight image may have both highlight areas and non-highlight areas, the adjustment weights of the pixels in the highlight area and the adjustment weights of the pixels in the non-highlight area of the highlight image can also be determined based on the brightness information of the highlight image. It can be understood that the adjustment weight of the pixels in the highlight area is less than the adjustment weight of the pixels in the non-highlight area, where the value range of the adjustment weight can be (0,1]. In order to avoid over-correction in the highlight area, the present application will further adjust the adjustment weight of the highlight area.
[0059] Based on the adjustment weights of the pixels in the highlight area and the adjustment weights of the pixels in the non-highlight area in the highlight image, in this embodiment, the image processor of the camera terminal can obtain the target lens shadow compensation coefficient of the pixels in the highlight area by multiplying the adjustment weights of the pixels in the highlight area with the initial lens shadow compensation coefficient of the pixels in the highlight area, and obtain the target lens shadow compensation coefficient of the pixels in the non-highlight area by multiplying the adjustment weights of the pixels in the non-highlight area with the initial lens shadow compensation coefficient of the pixels in the non-highlight area. Among them, by adjusting the weight value of the highlight area, the target lens shadow compensation coefficient of the pixels in the highlight area is made smaller than the initial lens shadow compensation coefficient of the pixels in the highlight area. For example, the initial lens shadow compensation coefficient of the pixels in the highlight area is 4, and after adjustment, the target lens shadow compensation coefficient of the pixels in the highlight area is 1.
[0060] In order to more systematically discuss the above lens shading correction method, this application further combines Figure 3 The flowchart of the lens shading correction algorithm process shown in FIG. 1 is used to explain the process of the lens shading correction method. Figure 3 As shown, the lens shading correction algorithm includes the following steps:
[0061] S301: The image processor of the camera terminal obtains image data of the original image.
[0062] The image data of the original image includes image size, brightness information, color information, etc.
[0063] S302: The image processor of the camera terminal determines a lens shading compensation coefficient table of the original image according to the current environment, debugging parameters and image statistics information.
[0064] 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.
[0065] S304: The image processor of the camera terminal determines whether the original image is a highlight image. If it is a highlight image, the process proceeds to step S305; if not, the process proceeds to step S306.
[0066] In this step, the camera terminal may calculate the brightness distribution statistics using the brightness information of the original image, and compare the brightness distribution statistics with a preset threshold to determine whether the original image is a highlight image.
[0067] S305: The image processor of the camera terminal determines the adjustment weights of the pixels in the highlight image according to the brightness information of the highlight image.
[0068] S306: The image processor of the camera terminal sets the adjustment weight to a value of 1.
[0069] It should be noted that the method steps S302-S306 can be adjusted according to actual requirements and can be executed simultaneously. This embodiment does not limit the order of execution.
[0070] S307: The image processor of the camera terminal multiplies the adjustment weight of the pixel points in the highlight area by the initial lens shading compensation coefficient of the pixel points in the highlight area to obtain the target lens shading compensation coefficient of the pixel points in the highlight area, and corrects the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel points.
[0071] S308: The image processor of the camera terminal outputs the corrected highlight image for post-image processing.
[0072] It can be seen that the above method can achieve reasonable suppression of the highlight area shadow compensation gain and effectively retain the details and edge information of the highlight area. Compared with the prior art, if the highlight area lens shadow compensation coefficient is not adjusted, the highlight area information in the original image may be lost due to lens shadow correction, and the lost information here cannot be restored in other subsequent processing modules.
[0073] This application further combines Figure 4 The adaptive adjustment method of the shadow compensation gain shown in FIG. 1 is used to explain the process of the lens shadow correction method. Figure 4 As shown, the adaptive adjustment method includes the following steps:
[0074] S401: The camera terminal obtains brightness information of a highlight image.
[0075] S402: The camera terminal obtains brightness information of the highlight image and determines adjustment weights of pixels in the highlight image.
[0076] In this step, the highlight image includes highlight areas and non-highlight areas, so the adjustment weights of the pixels in the highlight areas and non-highlight areas can be determined, and the adjustment weights of the pixels in the highlight areas are smaller than the adjustment weights of the pixels in the non-highlight areas.
[0077] S403: The camera terminal obtains and adaptively adjusts the adjustment weights of the pixels in the highlight image, and obtains the adjustment weights of the target pixels.
[0078] In this step, it should be noted that, generally, the lens shading compensation coefficient of the pixel point is 1-4. By adjusting the adjustment weights of the pixel points in the highlight area, the target lens shading compensation coefficient of the pixel points in the highlight area is made smaller than the initial lens shading compensation coefficient of the pixel points in the highlight area, and the target lens shading compensation coefficient of the pixel points in the highlight area is approximated to 1.
[0079] 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 initial lens shading compensation coefficients for pixels in the highlight image.
[0080] S405: The camera terminal obtains the 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.
[0081] S406: The camera terminal obtains the target lens shadow compensation coefficient according to the pixel point and performs correction processing on the highlight image.
[0082] In another embodiment disclosed in the present invention, a lens shading correction device is provided, referring to Figure 5 As shown, the device includes: an acquisition unit 501, which is used to acquire an original image, a determination unit 502, which 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 the brightness information in the original image, that is, determines that the original image is a highlight image. A calculation unit 503 is used to perform interpolation calculation processing on the lens shading compensation coefficient table of the highlight image, calculate the initial lens shading compensation coefficient of the pixel point in the highlight image, and output the initial lens shading compensation coefficient table for forming the pixel point, and an adjustment unit 504 is used 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 the target lens shading compensation coefficient of the pixel point. A correction unit 505 is used to correct the lens shading of the highlight image according to the target lens shading compensation coefficient of the pixel point.
[0083] In one possible implementation, the determination unit 502 is also used to determine the adjustment weight of the pixel in the highlight image based on the brightness information of the highlight image, and the adjustment unit 504 adjusts 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.
[0084] It should be noted that the highlight image includes a highlight area and a non-highlight area, and the determination unit 502 is also used to determine the adjustment weights of the pixels in the highlight area and the non-highlight area. The adjustment weight of the pixels in the highlight area is less than the adjustment weight of the pixels in the non-highlight area.
[0085] In another possible implementation, the calculation unit 503 is used to multiply the adjustment weight of the pixel points in the highlight area by the initial lens shading compensation coefficient of the pixel points in the highlight area to obtain the target lens shading compensation coefficient of the pixel points in the highlight area, and multiply 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 the target lens shading compensation coefficient of the pixel points in the non-highlight area. The target lens shading compensation coefficient of the pixel points in the highlight area is less than the initial lens shading compensation coefficient of the pixel points in the highlight area.
[0086] In addition, the calculation unit 503 is also used to determine the lens shading compensation coefficient table of the original image according to the current environment, debugging parameters and image statistics information. The calculation unit 503 calculates the brightness distribution statistics of the original image. When the brightness distribution statistics is lower than the preset threshold, the determination unit 502 determines that the original image is a non-highlight image. When the brightness distribution statistics is greater than or equal to the preset threshold, the determination unit 502 determines that the original image is a highlight image.
[0087] In other embodiments of the present application, the present application embodiment discloses a device, such as Figure 6 As shown, the device 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, and the above components may be connected via one or more communication buses 605. The one or more computer programs 604 are stored in the above memory 602 and are configured to be executed by the one or more processors 601, and the one or more computer programs 604 include instructions.
[0088] In another embodiment disclosed in the present invention, the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the steps of the above method are executed.
[0089] In another embodiment disclosed in the present invention, the present invention further provides a camera terminal, including a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and the processor executes the steps of the above method when executing the computer instructions.
[0090] In another embodiment disclosed in the present invention, the present invention further provides a chip system, which is coupled to a memory and is used to read and execute program instructions stored in the memory to perform the steps of the above method.
[0091] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0092] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can 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 each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0094] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A lens shading correction method, applied to a camera terminal, characterized in that: include: Get the original image; Determine a lens shading compensation coefficient table of the original image; Interpolating the lens shading compensation coefficient table to calculate initial lens shading compensation coefficients for pixels in the original image; Determining, according to brightness information of the original image, that the original image is a highlight image; According to the brightness information of the highlight image, an initial lens shading compensation coefficient of a pixel point in the highlight image is adjusted to obtain a target lens shading 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 the initial lens shading compensation coefficient of the pixel point in the highlight image to obtain the target lens shading compensation coefficient of the pixel point includes: Determining adjustment weights of pixels in the highlight image according to brightness information of the highlight image; According to the adjustment weight of the pixel point, an initial lens shading compensation coefficient of the pixel point is adjusted to obtain a target lens shading compensation coefficient of the pixel point; Determining, according to the brightness information of the highlight image, the adjustment weight of the pixel points in the highlight image, comprising: Determining adjustment weights of pixels in a highlight area and a non-highlight area in the highlight image according to brightness information of the highlight image; The pixel adjustment weight of the highlight area is smaller than the pixel adjustment weight of the non-highlight area.
2. The method according to claim 1, characterized in that: According to the adjustment weight of the pixel point, the initial lens shading compensation coefficient of the pixel point is adjusted to obtain the target lens shading compensation coefficient of the pixel point, including: 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 the target lens shading compensation coefficient of the pixel point in the highlight area; Multiplying the adjustment weight of the pixel point in the non-highlight area by the initial lens shading compensation coefficient of the pixel point in the non-highlight area to obtain the target lens shading compensation coefficient of the pixel point in the non-highlight area; The target lens shading compensation coefficient of the pixel points in the non-highlight area is close to or equal to the initial lens shading compensation coefficient of the pixel points in the non-highlight area.
3. The method according to any one of claims 1 to 2, characterized in that: The step of determining the lens shading compensation coefficient table of the original image comprises: A lens shading compensation coefficient table of the original image is determined according to the current environment, debugging parameters and image statistical value information.
4. The method according to claim 1 or 2, characterized in that: Determining, according to brightness information of the original image, that the original image is a highlight image includes: Calculating a brightness distribution statistical value of the original image; When the brightness distribution statistical value is lower than a preset threshold, determining that the original image is a non-highlight image; When the brightness distribution statistical value is greater than or equal to the preset threshold, it is determined that the original image is the highlight image.
5. The method according to claim 4, characterized in that The threshold is determined according to the statistical characteristics of brightness distribution of the sample highlight image set.
6. A lens shading correction device, characterized in that: include: An acquisition unit, used for acquiring an original image; A determination unit, which determines a lens shading compensation coefficient table of the original image; Used to determine that the original image is a highlight image according to brightness information in the original image; A calculation unit, used to interpolate the lens shading compensation coefficient table of the highlight image to calculate the initial lens shading compensation coefficient of the pixel point in the highlight image; An adjustment unit, configured to adjust an initial lens shading compensation coefficient of a pixel point in the highlight image according to brightness information of the highlight image, so as to obtain a target lens shading compensation coefficient of the pixel point; A correction unit, configured to correct the lens shading of the highlight image according to a target lens shading compensation coefficient of the pixel point; The determining unit is further configured to determine the adjustment weights of the pixels in the highlight image according to the brightness information of the highlight image; The adjustment unit is further used to 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; The determining unit is further used to determine the adjustment weights of the pixel points in the highlight area and the non-highlight area in the highlight image according to the brightness information of the highlight image; The pixel adjustment weight of the highlight area is smaller than the pixel adjustment weight of the non-highlight area.
7. The device according to claim 6, characterized in that The calculation unit is used to multiply the adjustment weight of the pixel point in the highlight area with the initial lens shading compensation coefficient of the pixel point in the highlight area to obtain the target lens shading compensation coefficient of the pixel point in the highlight area; and multiply the adjustment weight of the pixel point in the non-highlight area with the initial lens shading compensation coefficient of the pixel point in the non-highlight area to obtain the target lens shading compensation coefficient of the pixel point in the non-highlight area; The target lens shading compensation coefficient of the pixel points in the highlight area is smaller than the initial lens shading compensation coefficient of the pixel points in the highlight area.
8. The device according to any one of claims 6 to 7, characterized in that The calculation unit is used to determine the lens shading compensation coefficient table of the original image according to the current environment, debugging parameters and image statistical value information.
9. The device according to claim 6 or 7, characterized in that When the calculation unit determines that the original image is a highlight image according to the brightness information of the original image, the calculation unit is specifically used to: Calculating a brightness distribution statistical value of the original image; When the brightness distribution statistical value is lower than a preset threshold, the determining unit determines that the original image is a non-highlight image; When the brightness distribution statistical value is greater than or equal to the preset threshold, the determining unit determines that the original image is the highlight image.
10. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed, the steps of the method according to any one of claims 1 to 5 are executed.
11. A terminal comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method according to any one of claims 1 to 5 are performed.
12. A chip system, characterized in that: The chip system is coupled to a memory and is used to read and execute program instructions stored in the memory to perform the steps of the method described in any one of claims 1 to 5.
