CN114531521B - Image processing method, device, storage medium and electronic equipment - Google Patents

Image processing method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114531521B
CN114531521B CN202011205961.8A CN202011205961A CN114531521B CN 114531521 B CN114531521 B CN 114531521B CN 202011205961 A CN202011205961 A CN 202011205961A CN 114531521 B CN114531521 B CN 114531521B
Authority
CN
China
Prior art keywords
characteristic value
correction table
color difference
standard light
shading correction
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
Application number
CN202011205961.8A
Other languages
Chinese (zh)
Other versions
CN114531521A (en
Inventor
刘君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011205961.8A priority Critical patent/CN114531521B/en
Publication of CN114531521A publication Critical patent/CN114531521A/en
Application granted granted Critical
Publication of CN114531521B publication Critical patent/CN114531521B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation

Abstract

The application discloses an image processing method, an image processing device, a storage medium and electronic equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining shading correction tables corresponding to an original image and a plurality of standard light sources respectively, calculating a first characteristic value and a second characteristic value of each standard light source according to three-color values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set, obtaining a color difference correction table, counting the first characteristic value and the second characteristic value in the color difference correction table, determining the shading correction tables corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction table and a comparison result of the second characteristic value and the second characteristic value set in the color difference correction table, calculating the target shading correction tables according to the shading correction tables corresponding to the two target standard light sources respectively, and carrying out shading compensation on the original image. According to the embodiment of the application, the lens shading correction can be carried out on the image, the chromatic aberration of the image is reduced after the correction, and the image quality is improved.

Description

Image processing method, device, storage medium and electronic equipment
Technical Field
The application belongs to the technical field of image processing, and particularly relates to an image processing method, an image processing device, a storage medium and electronic equipment.
Background
Due to the physical characteristics of the lens, the light flux of the lens gradually decreases from the center to the periphery. Therefore, an original image obtained by photographing through a lens such as a camera of a cellular phone may appear as a bright center and a gradually darkened periphery, severely affecting image quality. Currently, a common processing method in the industry is to perform lens shading correction (LSC for short) processing on an original image, so as to improve the image quality.
In the prior art, the processing is often performed through a table selection mechanism, specifically, a linear combination table of the shadow situation of a proper scene is selected from a plurality of groups of shadow correction tables of different standard light sources, then the lens shadow is compensated according to the table, and the method can cause chromatic aberration after the selected shadow correction table is used for compensating the lens shadow when the scene does not accord with the actual situation.
Disclosure of Invention
The application provides an image processing method, an image processing device, a storage medium and electronic equipment, which can carry out lens shading correction on an image, reduce the chromatic aberration of the image after correction and improve the image quality.
In a first aspect, an embodiment of the present application provides an image processing method, including:
Obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
determining shading correction tables corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction tables and a comparison result of the second characteristic value and the second characteristic value set;
calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
the first acquisition module is used for acquiring an original image and shading correction tables corresponding to various standard light sources respectively;
A first calculation module, configured to calculate a first feature value and a second feature value of each standard light source according to the tristimulus values in the plurality of shading correction tables, so as to obtain a first feature value set and a second feature value set;
the second acquisition module is used for acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
the selection module is used for determining a shading correction table corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction table and a comparison result of the second characteristic value and the second characteristic value set;
and the second calculation module is used for calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources and carrying out shading compensation on the original image according to the target shading correction table.
In a third aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the above-described image processing method.
In a fourth aspect, embodiments of the present application provide an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the steps of:
obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
determining shading correction tables corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction tables and a comparison result of the second characteristic value and the second characteristic value set;
calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
According to the image processing method provided by the embodiment of the invention, the shading correction tables corresponding to the original image and the plurality of standard light sources respectively can be obtained, the first characteristic value and the second characteristic value of each standard light source are calculated in the plurality of shading correction tables according to the three color values to obtain a first characteristic value set and a second characteristic value set, the color difference correction tables are obtained, the first characteristic value and the second characteristic value in the color difference correction tables are counted, the shading correction tables corresponding to the two target standard light sources respectively are determined according to the comparison result of the first characteristic value and the first characteristic value set in the color difference correction tables and the comparison result of the second characteristic value and the second characteristic value set in the color difference correction tables, the target shading correction tables are calculated according to the shading correction tables corresponding to the two target standard light sources respectively, and the original image is subjected to shading compensation. According to the embodiment of the application, the lens shading correction can be carried out on the image, the chromatic aberration of the image is reduced after the correction, and the image quality is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an image processing method according to an embodiment of the present application.
Fig. 2 is another flow chart of the image processing method according to the embodiment of the present application.
Fig. 3 is a schematic diagram of a first eigenvalue ranking result of an image processing method according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Fig. 5 is another schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements throughout, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on the illustrated embodiments of the present application and should not be taken as limiting other embodiments not described in detail herein.
In the following description, specific embodiments of the present application will be described with reference to steps and symbols performed by one or more computers, unless otherwise indicated. Thus, these steps and operations will be referred to in several instances as being performed by a computer, which as referred to herein performs operations that include processing units by the computer that represent electronic signals that represent data in a structured form. This operation transforms the data or maintains it in place in the computer's memory system, which may reconfigure or otherwise alter the computer's operation in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of the present application are described in the foregoing text and are not meant to be limiting, and one skilled in the art will recognize that various steps and operations described below may also be implemented in hardware.
The terms "first," "second," and "third," etc. in this application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the particular steps or modules listed and certain embodiments may include additional steps or modules not listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a flow chart of an image processing method according to an embodiment of the present application. The image processing method provided by the embodiment of the application is applied to the electronic equipment, and the specific flow can be as follows:
step 101, obtaining an original image and shading correction tables corresponding to various standard light sources respectively.
In one embodiment, the original image that needs to be processed may be acquired first. The original image may be an image of a current scene acquired by an imaging device of the electronic apparatus when shooting. The imaging device may be a front camera, a rear camera, or the like. And starting an imaging device of the electronic equipment to enable the imaging device to enter a shooting preview mode, displaying a shot scene on a display window of the electronic equipment, and defining a picture displayed by the display window at the moment as a preview image. The imaging device generally comprises five parts in hardware: a housing (motor), a lens, an infrared filter, an image sensor (e.g., CCD or COMS), a Flexible Printed Circuit Board (FPCB), and the like. In the photographing preview mode, in the process of displaying preview images, the lens is moved by the driving of the motor, and a photographed object is imaged on the image sensor through the lens. The image sensor converts the optical signal into an electric signal through optical-electrical conversion and transmits the electric signal to an image processing circuit for subsequent processing. The image processing circuitry may be implemented using hardware and/or software components, among other things, and may include various processing units defining an ISP (Image Signal Processing ) pipeline.
In an embodiment, the shadows under different light sources are different, so that the shadow correction tables can be calibrated under respective standard light sources, the shadow correction tables of the two-dimensional matrix are used to record the shadow types of the color channels, and the appropriate shadow correction tables are selected according to scene information to compensate for lens shadows. For example, a table selection mechanism can be used to process, namely, a linear combination table of suitable scene shadows is selected from a plurality of different standard light source shadows correction tables, and then lens shadows are compensated according to the table
In a specific implementation, the light source may include at least one of: standard light source H, standard light source a, standard light source TL84, standard light source CWF, standard light source D50, standard light source D65, standard light source D75, mixed light source FL1, mixed light source FL2, and mixed light source FL3. The standard light source is an artificial standard light source defined by the international commission on illumination (Commission Internationale de L' Eclairage, CIE). The standard light source H is simulated horizontal sunlight, and the color temperature is 2300K. The standard light source A is American kitchen window spotlight with a color temperature of 2856K. The standard light source TL84 is a european, japanese, chinese shop light source with a color temperature of 4000K. The standard light source CWF is a US cool white store light source (Cool White Fluorescent) with a color temperature 4150K. The standard light source D50 is simulated sunlight and has a color temperature of 5000K. The standard light source D65 is international standard artificial sunlight (Artificial Daylight) with a color temperature of 6500K. The standard light source D75 is used for simulating northern average sunlight, and the color temperature is 7500K. The mixed light source is a mixture of at least two standard light sources.
Step 102, calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in a plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set.
In an embodiment, the first characteristic value may be an R/G value, the second characteristic value may be a B/G value, and the first characteristic value and the second characteristic value may be regarded as reference points. Specifically, the R/G values of the shading correction tables of the standard light sources can be counted first and then sorted. And then counting and sequencing the B/G values of the shading correction tables of the standard light sources. For example, two axes may be established as an R/G axis and a B/G axis, respectively, and then the R/G values of the shading correction tables of the respective standard light sources are dropped on the R/G axis by size, and the B/G values of the shading correction tables of the respective standard light sources are dropped on the B/G axis by size, respectively.
Step 103, obtaining a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value with a first characteristic value set in the color difference correction table, and comparing the second characteristic value with a second characteristic value set in the color difference correction table.
In an embodiment, the color difference correction table may be an output table of a color shading algorithm. In the prior art, a fixed reference shading correction table is often used for performing lens shading compensation on an image, then color difference correction is performed through a color shading algorithm, the object of the color shading algorithm is the image with color difference after the reference shading correction table is compensated, the color difference is related to a scene, so that the color difference of some scenes is serious, and the color difference of some scenes is slight. Therefore, in the embodiment of the application, the output table of the color shading algorithm is directly used as a table selecting mechanism and the reference shading correction table is dynamically replaced.
Specifically, the embodiment may use the same statistical method in step 102 to calculate the R/G value and the B/G value in the color difference correction table. In order to facilitate discrimination, the R/G value in the color difference correction table may be denoted as X, and the B/G value in the color difference correction table may be denoted as Y.
Step 104, determining the shading correction tables corresponding to the two target standard light sources respectively according to the comparison result of the first characteristic value and the first characteristic value set and the comparison result of the second characteristic value and the second characteristic value set in the color difference correction tables.
In an embodiment, the X and Y values may be respectively located on the R/G axis and the B/G axis of the standard light source, so that a position of the first feature value in the first sorting result and a position of the second feature value in the second sorting result in the color difference correction table may be obtained, and then the shading correction tables respectively corresponding to the two target standard light sources are determined according to the positions.
Further, the final target shading correction tables selected in the present embodiment are combined according to the shading correction tables of the two target standard light sources and the weights thereof. Therefore, the shading correction tables of the two target standard light sources can be determined according to the falling point of the X value on the R/G axis, and then the weight proportion of each of the two shading correction tables is determined according to the falling point of the Y value on the B/G axis, so that the target shading correction tables are obtained through combination.
Step 105, calculating a target shading correction table according to the shading correction tables corresponding to the two target standard light sources respectively, and performing shading compensation on the original image according to the target shading correction table.
In practical use, the calculated target shading correction table is used as a reference shading correction table, lens shading is compensated, then a threshold value for performing chromatic aberration correction is required to be set for judging what degree of low-frequency chromatic aberration is a correction object, if the threshold value is set too large, the compensation is performed, a general scene is regarded as a repaired object, clouds on the sky, light makeup on the face or face color cast during self-shooting can be possibly corrected, and the like. If the threshold is set too small, serious chromatic aberration cannot be coped with. If a fixed reference shading correction table is used, a larger threshold value needs to be set to cover a scene with serious chromatic aberration, but overcompensation may be caused. The embodiment of the application can make a table selection mechanism according to the color difference correction table, can reduce the color difference of the input image of the color shading algorithm, and makes the change added to the reference shading correction table minimum, thereby reducing the set threshold value and reducing the overcompensation phenomenon.
The color-shaping is a low-frequency signal, so that the color-shaping can be detected by filtering with a low-pass filter. That is, after performing shading compensation on the original image according to the target shading correction table, the method further includes:
Acquiring low-frequency color difference information in the shadow compensated image;
screening the low-frequency color difference information according to a preset value to obtain target color difference information to be corrected;
and correcting the target color difference information.
Further, after the final image is obtained by performing lens shading compensation and chromatic aberration correction, noise reduction processing may be performed, and then the electronic device may perform Tone Mapping processing (Tone Mapping) on the noise reduced image, so as to obtain the target image. It can be understood that the tone mapping process on the image after noise reduction can improve the image contrast of the image, so that the target image has a higher dynamic range and a better imaging effect. The electronic device may also present the tone mapped image as a preview image of the current scene on a screen of the electronic device.
It will be appreciated that the actual resolution of the preview image is greater than the resolution of the screen display, and that no better display is achieved than if the actual resolution of the preview image is equal to the resolution of the screen display. Therefore, before the preview image is displayed on the screen of the electronic device, the current resolution of the screen is firstly obtained, and then the downsampling process is carried out on the preview image according to the current resolution of the screen, so that the resolution of the preview image is consistent with the current resolution of the screen. Thus, the synthesizing efficiency of multi-frame synthesis can be improved, and the display effect is not reduced even when the preview image is displayed.
As can be seen from the foregoing, the image processing method provided in the embodiment of the present application may obtain shading correction tables corresponding to multiple standard light sources, respectively calculate a first feature value and a second feature value of each standard light source in the multiple shading correction tables according to the tristimulus values, so as to obtain a first feature value set and a second feature value set, obtain a color difference correction table, count the first feature value and the second feature value in the color difference correction table, determine shading correction tables corresponding to two target standard light sources respectively according to a comparison result of the first feature value and the first feature value set in the color difference correction table and a comparison result of the second feature value and the second feature value set in the color difference correction table, calculate a target shading correction table according to the shading correction tables corresponding to the two target standard light sources respectively, and perform shading compensation on an original image. According to the embodiment of the application, the lens shading correction can be carried out on the image, the chromatic aberration of the image is reduced after the correction, and the image quality is improved.
The image processing method of the present application will be further described below on the basis of the method described in the above embodiment. Referring to fig. 2, fig. 2 is another flow chart of an image processing method according to an embodiment of the present application, where the image processing method includes:
Step 201, obtain an original image and shading correction tables corresponding to the multiple standard light sources respectively.
In an embodiment, the original image may be an image of a current scene acquired by an imaging device of the electronic device during shooting, and the image needs to be subjected to lens shading compensation later. The shading correction table records shading types of each color channel using a shading correction table of a two-dimensional matrix. The plurality of standard light sources may include a standard light source H, a standard light source a, a standard light source TL84, a standard light source CWF, a standard light source D50, a standard light source D65, a standard light source D75, a mixed light source FL1, a mixed light source FL2, a mixed light source FL3, and the like.
Step 202, respectively, counting the first characteristic values and the second characteristic values of each standard light source in a plurality of shading correction tables, sorting the plurality of first characteristic values to obtain a first sorting result, and sorting the plurality of second characteristic values to obtain a second sorting result.
In an embodiment, the first characteristic value may be an R/G value, the second characteristic value may be a B/G value, and the first characteristic value and the second characteristic value may be regarded as reference points. For example, two axes may be established as an R/G axis and a B/G axis, respectively, and then the R/G values of the shading correction tables of the respective standard light sources are dropped on the R/G axis by size, and the B/G values of the shading correction tables of the respective standard light sources are dropped on the B/G axis by size, respectively. Fig. 3 is a schematic diagram of a first feature value ordering result of the image processing method according to the embodiment of the present application, as shown in fig. 3. Wherein the standard light sources include TL84, CWF, D65, D50, A and H, and on the R/G axis, the R/G values of each standard light source shading correction table are ordered by size. It can be seen that R (TL 84), R (CWF), R (D65), R (D50), R (A) and R (H) are in this order from small to large.
In an embodiment, after the first sorting result and the second sorting result are obtained, the values on the R/G axis or the B/G axis may be further grouped. For example, in fig. 3, R (TL 84) is closer to R (CWF), R (D65) is closer to R (D50), and R (a) is closer to R (H). Therefore, the six values on the R/G axis can be divided into three groups of { R (TL 84), R (CWF) }, { R (D65), R (D50) }, { R (A), R (H) }. That is, after the first feature values are ranked to obtain a first ranking result and the second feature values are ranked to obtain a second ranking result, the method further includes:
acquiring the difference values between all adjacent first characteristic values in the first sequencing result;
dividing the plurality of first characteristic values according to the difference value to obtain a plurality of groups.
Step 203, obtaining a color difference correction table and counting a first characteristic value and a second characteristic value in the color difference correction table.
In an embodiment, the color difference correction table may be an output table of a color shading algorithm. The same statistical method as in step 202 may be used in this embodiment to count the R/G value and the B/G value in the color difference correction table described above. For example, the R/G value in the color difference correction table may be denoted as X, and the B/G value in the color difference correction table may be denoted as Y.
Step 204, determining the position of the first characteristic value in the color difference correction table in the first sorting result, and determining the target first characteristic value before and after the position.
Step 205, obtaining target standard light sources corresponding to the two target first feature values respectively, and a shading correction table of the target standard light sources.
For example, if X < R (CWF), the determined two target first feature values may be R (TL 84) and R (CWF), so the corresponding shading correction tables are Tab (TL 84) and Tab (CWF). If R (CWF) < X < R (D65), the determined two target first feature values may be R (TL 84) and R (D65) or R (TL 84) and R (D50) or R (CWF) and R (D65) or R (CWF) and R (D50), and the shading correction tables corresponding to the two target first feature values are Tab (TL 84) and Tab (D65) or Tab (TL 84) and Tab (D50) or Tab (CWF) and Tab (D65) or Tab (CWF) and Tab (D50), respectively.
Step 206, determining respective coefficients of the shading correction tables corresponding to the two target standard light sources respectively according to the positions of the second characteristic values in the color difference correction tables in the second sorting result.
Step 207, calculating the sum of products of the shading correction tables corresponding to the two target standard light sources and the respective coefficients to obtain the target shading correction table.
In this embodiment, the above X and Y values fall on the R/G axis and the B/G axis of the standard light source, respectively, so that the shading correction tables respectively corresponding to the two target standard light sources and the respective coefficients of the two shading correction tables can be obtained. And finally calculating the sum of products of the shading correction tables corresponding to the two target standard light sources and the respective coefficients to obtain the target shading correction table.
For example, if X < R (CWF), tab (base) =a+tab (TL 84) + (1-a) ×tab (CWF). Wherein a is a real number between 0 and 1. In this embodiment, the value of the coefficient a can be determined by bringing the B/G of Tab (base) closest to Y.
If R (CWF) < X < R (D65), tab (base) is the following 4 combinations:
Tab(base0)=a*Tab(TL84)+(1-a)*Tab(D65)
Tab(base1)=b*Tab(TL84)+(1-b)*Tab(D50)
Tab(base2)=c*Tab(CWF)+(1-c)*Tab(D65)
Tab(base3)=d*Tab(CWF)+(1-d)*Tab(D50)
since there are a plurality of combinations, the values of the 4 sets of coefficients a, B, c, and d can be determined by first making R (base) =x, and then determining which set of base the final result is by making B (base) closest to Y.
If R (D65) < X < R (D50), tab (base) is the following 4 combinations:
Tab(base0)=a*Tab(TL84)+(1-a)*Tab(D50)
Tab(base1)=b*Tab(TL84)+(1-b)*Tab(A)
Tab(base2)=c*Tab(CWF)+(1-c)*Tab(D50)
Tab(base3)=c*Tab(CWF)+(1-c)*Tab(A)。
if R (D50) < X < R (A), let Tab (base) be the following 4 combinations:
Tab(base0)=a*Tab(TL84)+(1-a)*Tab(A)
Tab(base1)=b*Tab(TL84)+(1-b)*Tab(H)
Tab(base2)=c*Tab(CWF)+(1-c)*Tab(A)
Tab(base3)=d*Tab(CWF)+(1-d)*Tab(H)
if R (A) < X < R (H), let Tab (base) be the following 2 combinations:
Tab(base0)=a*Tab(TL84)+(1-a)*Tab(H)
Tab(base1)=b*Tab(CWF)+(1-b)*Tab(H)
step 208, performing shading compensation on the original image according to the target shading correction table.
Taking the calculated target shading correction table as a reference shading correction table, compensating lens shading, and setting a threshold, namely a threshold for chromatic aberration correction, for judging what degree of low-frequency chromatic aberration is a correction object. The embodiment of the application can make a table selection mechanism according to the color difference correction table, can reduce the color difference of the input image of the color shading algorithm, and makes the modification added to the reference shading correction table minimum, thereby reducing the set threshold and reducing the overcompensation phenomenon.
It can be seen from the foregoing that, the image processing method provided in the embodiment of the present application may obtain an original image, and a shading correction table corresponding to each of a plurality of standard light sources, count a first feature value and a second feature value of each of the standard light sources in the plurality of shading correction tables, sort the plurality of first feature values to obtain a first sorting result, sort the plurality of second feature values to obtain a second sorting result, obtain a color difference correction table, count the first feature value and the second feature value in the color difference correction table, determine a position of the first feature value in the color difference correction table in the first sorting result, respectively determine target first feature values before and after the position, obtain target standard light sources corresponding to the two target first feature values, respectively, and a shading correction table of the target standard light sources, respectively determine respective coefficients of the two target standard light sources in the second sorting result, calculate a sum of the shading correction tables corresponding to the two target standard light sources and respective coefficients, respectively, so as to obtain a target shading correction table, and compensate for the target shading of the original image. According to the embodiment of the application, the lens shading correction can be carried out on the image, the chromatic aberration of the image is reduced after the correction, and the image quality is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application. Wherein the image processing apparatus 30 comprises:
a first obtaining module 301, configured to obtain an original image and shading correction tables corresponding to multiple standard light sources respectively;
a first calculating module 302, configured to calculate a first feature value and a second feature value of each standard light source according to the tristimulus values in the plurality of shading correction tables, so as to obtain a first feature value set and a second feature value set;
a second obtaining module 303, configured to obtain a color difference correction table and count a first feature value and a second feature value in the color difference correction table, compare the first feature value in the color difference correction table with the first feature value set, and compare the second feature value in the color difference correction table with the second feature value set;
a selection module 304, configured to determine a shading correction table corresponding to each of the two target standard light sources according to a comparison result between the first feature value and the first feature value set in the color difference correction table and a comparison result between the second feature value and the second feature value set;
the second calculating module 305 is configured to calculate a target shading correction table according to the shading correction tables corresponding to the two target standard light sources, and perform shading compensation on the original image according to the target shading correction table.
In one embodiment, referring to fig. 5, the selecting module 304 may specifically include:
the sorting submodule 3041 is configured to sort the plurality of first feature values in the first feature value set to obtain a first sorting result, and sort the plurality of second feature values in the second feature value set to obtain a second sorting result;
a first determining submodule 3042, configured to determine a position of a first feature value in the color-difference correction table in the first sorting result, and determine target first feature values before and after the position, respectively;
an obtaining submodule 3043, configured to obtain target standard light sources corresponding to the two target first feature values respectively, and a shading correction table of the target standard light sources;
and a second determining submodule 3044, configured to determine respective coefficients of the shading correction tables corresponding to the two target standard light sources respectively according to the positions of the second feature values in the color difference correction tables in the second sorting result.
In an embodiment, the apparatus may further include:
a third obtaining module 306, configured to obtain, after the computing module 305 performs shading compensation on the original image according to the target shading correction table, low-frequency color difference information in the image after the shading compensation;
A screening module 307, configured to screen the low-frequency color difference information according to a preset value, so as to obtain target color difference information that needs to be corrected;
and a correction module 308, configured to correct the target color difference information.
As can be seen from the foregoing, the image processing apparatus 30 according to the embodiment of the present application may obtain the shading correction tables corresponding to the original image and the plurality of standard light sources respectively, calculate the first characteristic value and the second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables to obtain the first characteristic value set and the second characteristic value set, obtain the color difference correction table, count the first characteristic value and the second characteristic value in the color difference correction table, determine the shading correction tables corresponding to the two target standard light sources respectively according to the comparison result of the first characteristic value and the first characteristic value set in the color difference correction table and the comparison result of the second characteristic value and the second characteristic value set in the color difference correction table, calculate the target shading correction table according to the shading correction tables corresponding to the two target standard light sources respectively, and perform shading compensation on the original image. According to the embodiment of the application, the lens shading correction can be carried out on the image, the chromatic aberration of the image is reduced after the correction, and the image quality is improved.
In this embodiment, the image processing apparatus and the image processing method in the foregoing embodiment belong to the same concept, and any method provided in the image processing method embodiment may be run on the image processing apparatus, and detailed implementation processes of the method are shown in the image processing method embodiment, which is not described herein again.
The term "module" as used herein may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as implementing objects on the computing system. The apparatus and methods described herein may be implemented in software, but may also be implemented in hardware, which is within the scope of the present application.
The embodiment of the application also provides a storage medium, on which a computer program is stored, which when run on a computer causes the computer to execute the image processing method described above.
The embodiment of the application also provides electronic equipment, such as a tablet personal computer, a mobile phone and the like. The processor in the electronic device loads the instructions corresponding to the processes of one or more application programs into the memory according to the following steps, and the processor runs the application programs stored in the memory, so as to realize various functions:
Obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
determining shading correction tables corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction tables and a comparison result of the second characteristic value and the second characteristic value set;
calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Referring to fig. 6, the electronic device 400 includes a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 400 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device 400 and processes data by running or loading computer programs stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device 400.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by running the computer programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
In the embodiment of the present application, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more computer programs into the memory 402 according to the following steps, and the processor 401 executes the computer programs stored in the memory 402, so as to implement various functions, as follows:
obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
determining shading correction tables corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set in the color difference correction tables and a comparison result of the second characteristic value and the second characteristic value set;
Calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
Referring to fig. 7, in some embodiments, the electronic device 400 may further include: a display 403, radio frequency circuitry 404, audio circuitry 405, and a power supply 406. Wherein, the display 403, the radio frequency circuit 404, the audio circuit 405 and the power supply 406 are electrically connected to the processor 401 respectively.
The display 403 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces that may be composed of graphics, text, icons, video, and any combination thereof. The display 403 may include a display panel, which in some embodiments may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), or an Organic Light-Emitting Diode (OLED), or the like.
The radio frequency circuitry 404 may be used to transceive radio frequency signals to establish wireless communications with a network device or other electronic device via wireless communications. Typically, the radio frequency circuitry 501 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like.
The audio circuitry 405 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone. The audio circuit 506 may convert the received audio data into an electrical signal, transmit to a speaker, and be converted into a sound signal output by the speaker.
The power supply 406 may be used to power the various components of the electronic device 400. In some embodiments, the power supply 406 may be logically connected to the processor 401 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system. The power supply 406 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 7, the electronic device 400 may further include a camera, a bluetooth module, etc., which will not be described herein.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
It should be noted that, for the image processing method according to the embodiment of the present application, it will be understood by those skilled in the art that all or part of the flow of implementing the image processing method according to the embodiment of the present application may be implemented by controlling related hardware by a computer program, where the computer program may be stored in a computer readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and the execution may include the flow of the embodiment of the image processing method. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
For the image processing apparatus of the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules, if implemented as software functional modules and sold or used as a stand-alone product, may also be stored on a computer readable storage medium such as read-only memory, magnetic or optical disk, etc.
The foregoing describes in detail an image processing method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and specific examples are applied to illustrate principles and implementations of the present application, where the foregoing description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. An image processing method, characterized in that the method comprises the steps of:
obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set; the first characteristic value is an R/G value, and the second characteristic value is a B/G value;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
Determining a shading correction table corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set and a comparison result of the second characteristic value and the second characteristic value set in the color difference correction table, wherein the shading correction table comprises: respectively dropping the first characteristic value and the second characteristic value in the color difference correction table on an R/G axis and a B/G axis of the standard light source to obtain the position of the first characteristic value in a first sorting result and the position of the second characteristic value in a second sorting result in the color difference correction table, and determining the shading correction tables respectively corresponding to the two target standard light sources according to the positions;
calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
2. The image processing method according to claim 1, wherein the step of locating the first and second eigenvalues in the color difference correction table on the R/G axis and the B/G axis of the standard light source, respectively, to obtain the position of the first eigenvalue in the first sorting result and the position of the second eigenvalue in the second sorting result in the color difference correction table, and determining the shading correction tables respectively corresponding to the two target standard light sources according to the positions, comprises:
Sorting a plurality of first characteristic values in the first characteristic value set to obtain a first sorting result, and sorting a plurality of second characteristic values in the second characteristic value set to obtain a second sorting result;
determining the position of a first characteristic value in the color difference correction table in the first sorting result, and respectively determining a target first characteristic value before and after the position;
obtaining target standard light sources corresponding to the two target first characteristic values respectively and a shading correction table of the target standard light sources;
and determining respective coefficients of the shading correction tables corresponding to the two target standard light sources respectively according to the positions of the second characteristic values in the color difference correction tables in the second sorting result.
3. The image processing method according to claim 2, wherein the step of calculating the target shading correction table from the shading correction tables respectively corresponding to the two target standard light sources includes:
and calculating the sum of products of the shading correction tables corresponding to the two target standard light sources and the respective coefficients to obtain the target shading correction table.
4. The image processing method according to claim 2, wherein after sorting the plurality of first feature values to obtain a first sorting result and sorting the plurality of second feature values to obtain a second sorting result, the method further comprises:
Acquiring the difference values between all adjacent first characteristic values in the first sequencing result;
dividing the plurality of first characteristic values according to the difference value to obtain a plurality of groups.
5. The image processing method according to claim 1, wherein after shading compensation is performed on an original image according to the target shading correction table, the method further comprises:
acquiring low-frequency color difference information in the shadow compensated image;
screening the low-frequency color difference information according to a preset value to obtain target color difference information to be corrected;
and correcting the target color difference information.
6. The image processing method according to claim 1, wherein the step of calculating the first characteristic value and the second characteristic value of each standard light source from the tristimulus values in the plurality of shading correction tables, respectively, comprises:
calculating R/G values of the respective standard light sources as first characteristic values from the tristimulus values in the plurality of shading correction tables;
B/G values of the respective standard light sources are calculated as second characteristic values from the tristimulus values in the plurality of shading correction tables.
7. An image processing apparatus, characterized in that the apparatus comprises:
The first acquisition module is used for acquiring an original image and shading correction tables corresponding to various standard light sources respectively;
a first calculation module, configured to calculate a first feature value and a second feature value of each standard light source according to the tristimulus values in the plurality of shading correction tables, so as to obtain a first feature value set and a second feature value set; the first characteristic value is an R/G value, and the second characteristic value is a B/G value;
the second acquisition module is used for acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
the selection module is used for determining a shading correction table corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set and a comparison result of the second characteristic value and the second characteristic value set in the color difference correction table, and is specifically used for: respectively dropping the first characteristic value and the second characteristic value in the color difference correction table on an R/G axis and a B/G axis of the standard light source to obtain the position of the first characteristic value in a first sorting result and the position of the second characteristic value in a second sorting result in the color difference correction table, and determining the shading correction tables respectively corresponding to the two target standard light sources according to the positions;
And the second calculation module is used for calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources and carrying out shading compensation on the original image according to the target shading correction table.
8. The image processing apparatus according to claim 7, wherein the selecting module specifically includes:
the sorting sub-module is used for sorting a plurality of first characteristic values in the first characteristic value set to obtain a first sorting result, and sorting a plurality of second characteristic values in the second characteristic value set to obtain a second sorting result;
the first determining submodule is used for determining the position of the first characteristic value in the color difference correction table in the first sorting result and respectively determining a target first characteristic value before and after the position;
the acquisition sub-module is used for acquiring target standard light sources corresponding to the two target first characteristic values respectively and a shading correction table of the target standard light sources;
and the second determining submodule is used for determining respective coefficients of the shading correction tables corresponding to the two target standard light sources respectively according to the positions of the second characteristic values in the color difference correction tables in the second sorting result.
9. A storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the image processing method according to any one of claims 1 to 6.
10. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions, wherein the processor loads the instructions in the memory for performing the steps of:
obtaining an original image and shading correction tables corresponding to various standard light sources respectively;
calculating a first characteristic value and a second characteristic value of each standard light source according to the tristimulus values in the plurality of shading correction tables respectively to obtain a first characteristic value set and a second characteristic value set; the first characteristic value is an R/G value, and the second characteristic value is a B/G value;
acquiring a color difference correction table, counting a first characteristic value and a second characteristic value in the color difference correction table, comparing the first characteristic value in the color difference correction table with the first characteristic value set, and comparing the second characteristic value in the color difference correction table with the second characteristic value set;
determining a shading correction table corresponding to the two target standard light sources respectively according to a comparison result of the first characteristic value and the first characteristic value set and a comparison result of the second characteristic value and the second characteristic value set in the color difference correction table, wherein the shading correction table comprises: respectively dropping the first characteristic value and the second characteristic value in the color difference correction table on an R/G axis and a B/G axis of the standard light source to obtain the position of the first characteristic value in a first sorting result and the position of the second characteristic value in a second sorting result in the color difference correction table, and determining the shading correction tables respectively corresponding to the two target standard light sources according to the positions;
Calculating a target shading correction table according to the shading correction tables respectively corresponding to the two target standard light sources, and performing shading compensation on an original image according to the target shading correction table.
CN202011205961.8A 2020-11-02 2020-11-02 Image processing method, device, storage medium and electronic equipment Active CN114531521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011205961.8A CN114531521B (en) 2020-11-02 2020-11-02 Image processing method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011205961.8A CN114531521B (en) 2020-11-02 2020-11-02 Image processing method, device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114531521A CN114531521A (en) 2022-05-24
CN114531521B true CN114531521B (en) 2024-02-02

Family

ID=81619007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011205961.8A Active CN114531521B (en) 2020-11-02 2020-11-02 Image processing method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114531521B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116419076A (en) * 2022-06-07 2023-07-11 上海玄戒技术有限公司 Image processing method and device, electronic equipment and chip

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234824A (en) * 2018-03-26 2018-06-29 上海小蚁科技有限公司 Shadow correction detection parameters determine, correct detection method and device, storage medium, fisheye camera
CN109068025A (en) * 2018-08-27 2018-12-21 建荣半导体(深圳)有限公司 A kind of camera lens shadow correction method, system and electronic equipment
CN111586300A (en) * 2020-05-09 2020-08-25 展讯通信(上海)有限公司 Color correction method, device and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234824A (en) * 2018-03-26 2018-06-29 上海小蚁科技有限公司 Shadow correction detection parameters determine, correct detection method and device, storage medium, fisheye camera
CN109068025A (en) * 2018-08-27 2018-12-21 建荣半导体(深圳)有限公司 A kind of camera lens shadow correction method, system and electronic equipment
CN111586300A (en) * 2020-05-09 2020-08-25 展讯通信(上海)有限公司 Color correction method, device and readable storage medium

Also Published As

Publication number Publication date
CN114531521A (en) 2022-05-24

Similar Documents

Publication Publication Date Title
US9767544B2 (en) Scene adaptive brightness/contrast enhancement
US8670043B2 (en) Image processing apparatus for detecting a color flicker in an image
US8547450B2 (en) Methods and systems for automatic white balance
CN107038715B (en) Image processing method and device
CN110022469B (en) Image processing method, image processing device, storage medium and electronic equipment
CN107438163B (en) Photographing method, terminal and computer readable storage medium
CN104380727B (en) Image processing apparatus and image processing method
CN110266954B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110213502A (en) Image processing method, device, storage medium and electronic equipment
CN108200352B (en) Method, terminal and storage medium for adjusting picture brightness
CN114531521B (en) Image processing method, device, storage medium and electronic equipment
WO2019064753A1 (en) Image processing device, image capture device, image processing method, image capture method, and program
US20150237248A1 (en) Image processing method and image processing device
CN108540636A (en) A kind of photographic method and device based on dual camera
CN113066020A (en) Image processing method and device, computer readable medium and electronic device
CN106454140A (en) Information processing method and electronic device
US9854218B2 (en) Electronic system and image processing method
CN115699785A (en) Screen shooting control method, terminal device and storage medium
CN116668656A (en) Image processing method and electronic equipment
US20190279340A1 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
CN110278386A (en) Image processing method, device, storage medium and electronic equipment
CN115514948B (en) Image adjusting method and electronic device
CN105227944B (en) A kind of information processing method and electronic equipment
CN114567813A (en) Image quality improving method and device, playing equipment and computer readable storage medium
CN115514947B (en) Algorithm for automatic white balance of AI (automatic input/output) and electronic equipment

Legal Events

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