[go: up one dir, main page]

WO2019062633A1 - Color shading correction method and device - Google Patents

Color shading correction method and device Download PDF

Info

Publication number
WO2019062633A1
WO2019062633A1 PCT/CN2018/106645 CN2018106645W WO2019062633A1 WO 2019062633 A1 WO2019062633 A1 WO 2019062633A1 CN 2018106645 W CN2018106645 W CN 2018106645W WO 2019062633 A1 WO2019062633 A1 WO 2019062633A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel point
color
pixel
image
feature
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.)
Ceased
Application number
PCT/CN2018/106645
Other languages
French (fr)
Chinese (zh)
Inventor
尹玄武
左坤隆
郗东苗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2019062633A1 publication Critical patent/WO2019062633A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
    • 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/84Camera processing pipelines; Components thereof for processing colour signals

Definitions

  • the present application relates to the field of image processing and, more particularly, to methods and apparatus for color shading correction in the field of image processing.
  • the size of the digital camera module is required to be smaller and smaller, which brings various side effects to the output image, one of which is color shading.
  • Color shading refers to the color gradient from the center to the edge in the image output by the color camera module.
  • the front side of the digital image sensor is equipped with an infrared cut-off (IR-CUT) filter, which blocks the infrared light while transmitting visible light to ensure the accuracy of color reproduction.
  • IR-CUT infrared cut-off
  • the cutoff wavelength of the infrared cut filter varies with the angle of the incident light, causing the sensor center to be different from the edge cutoff wavelength, which is represented by the color shading of the image.
  • the reduction in the size of the camera module increases the angle of the incident light, making the color shadow more prominent.
  • mismatching of devices such as the main lens and microlenses can also add color shading.
  • the degree of color shading changes as the reflectance spectrum of the scene changes, so the color shading needs to be dynamically corrected.
  • the prior art corrects color shading based on a color consistency model that includes a set of general contours and a set of transform coefficients corresponding to color temperatures.
  • the color temperature and the spectrum are not one-to-one correspondence. For example, the A-light and U30 color temperatures are close but the spectral difference is large, which causes the color consistency model to be rough, resulting in inaccurate color shading correction using the model.
  • the present application provides a method and apparatus for color shading correction that accurately corrects color shading of an image.
  • a method of color shading correction comprising:
  • a transform coefficient of the first pixel point by using a tone value of the first pixel point and a feature profile of the first pixel point, wherein the feature profile is used to represent an image of a plurality of statistically derived standard light sources a feature of a color shaded outline of a pixel in which the transform coefficient is used to indicate a degree of strength of the feature outline;
  • the embodiment of the present application first extracts a tone value of the first pixel of the first image, and then determines a model parameter of the first pixel according to the tone value of the first pixel and the feature contour of the first pixel (ie, transform a coefficient), further the model parameter and the color shading model of the first pixel, determining a color shading contour of the first image, and finally correcting the color shading of the first image according to the color shading contour of the first image. Since the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters.
  • the feature contour can represent the color shadow caused by a specific factor or a statistical feature
  • the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.
  • the method before determining the transform coefficient of the first pixel by using the tone value of the first pixel and the feature contour of the first pixel, the method further includes:
  • each feature contour can be used to represent the characteristics of the color shaded contours of the images of the plurality of standard light sources obtained by statistics. That is, each feature profile is a feature that is statistically derived from the color shadow profile of an image of multiple standard sources. At this time, each feature contour may correspond to a color shadow caused by a specific physical factor or a statistical feature, wherein the physical factor is, for example, a change in incident angle, a mismatch of a device such as a main lens and a microlens, and the like.
  • determining, by using a tone value of the first pixel and a feature profile of the first pixel, a transform coefficient of the first pixel including:
  • x represents the first pixel point
  • Is the transform coefficient of x and F k (x) is the k-dimensional feature profile of x
  • a k is a transform coefficient F k (x) is
  • k is The value ranges from 1 to N and represents the dimension of the feature profile
  • N is a positive integer greater than 1
  • H(x) represents the logarithm of the tone value at x.
  • the transform coefficient of the first region can be defined. Then there are:
  • the transform coefficient of the first region can be defined Then there are:
  • the transform coefficient of the first pixel in the first region may be used as the transform coefficient of the second pixel in the acquired first image. That is to say, in the embodiment of the present application, the transform coefficients of the respective pixel points in the image are the same. At this time, the transform coefficient and the feature contour of the second pixel point can be brought into the image color shadow model to synthesize the color shadow outline of the image.
  • the color shading model can have the following form:
  • s (x) denotes a color shading profile of x
  • a k is f k (x) of transform coefficients
  • b k is f k (x) is translated
  • the coefficient, k ranges from 1 to N and represents the number of features
  • N is a positive integer greater than one.
  • the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.
  • the correcting the color shading of the second pixel point according to the color shadow profile of the second pixel point comprises:
  • a reciprocal of a color shading profile of the second pixel point is determined as a correction value of the second pixel point.
  • the correction table may include an image pixel point and a correction value of the pixel point, and the correction value of the pixel point may specifically be a reciprocal of the color shadow profile of the pixel point.
  • the product of the value of the R channel of the second pixel point x′ and the correction value of the rg tone is the value of the R channel of the second pixel point x′ after the correction
  • the value of the B channel of the second pixel point x′ and bg is the value of the B channel of the second pixel point x' after correction.
  • the embodiment of the present application provides a device for performing color shading correction, which is used to perform the method in any of the foregoing first aspect or any possible implementation manner of the first aspect, and specifically, the device includes A module of a method in any aspect or in any possible implementation of the first aspect.
  • an embodiment of the present application provides a color shading correction apparatus, including: a memory and a processor.
  • the memory is for storing instructions for executing the instructions stored by the memory, and when the processor executes the instructions stored by the memory, the executing causes the processor to perform any of the first aspect or the first aspect The method in the implementation.
  • the embodiment of the present application provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.
  • FIG. 1 is a schematic diagram of an application scenario of color shading correction according to an embodiment of the present application.
  • FIG. 2 is a schematic flow chart of a method for calibrating a color shading model according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method for color shading correction according to an embodiment of the present application.
  • FIG. 4 is a schematic block diagram of an apparatus for color shading correction in an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of another apparatus for color shading correction according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario of color shading correction according to an embodiment of the present application. Specifically, the light reflected by the scene 11 is projected through the lens 12, and a digital image signal is formed on the image sensor 13, and the digital image signal is first subjected to a dead pixel correction, black level compensation, etc. through the preprocessing module 14, and then the preprocessing is performed.
  • the image signal is input to a color shading estimation module 15, which estimates the color shading of the image signal to obtain a correction table for the image.
  • the correction module 16 corrects the image signal based on the correction table determined by the color shading estimation module.
  • the subsequent processing module 17 further performs subsequent processing on the corrected image signal to generate a final image 18.
  • the color shadow estimation module 15 has been improved in the embodiment of the present application.
  • the color shadow estimation module 15 can be applied to an Image Signal Processing (ISP) chip for processing image signals collected by the color camera module.
  • ISP Image Signal Processing
  • the image signal processing chip can be installed separately or integrated into a mobile phone, digital camera, tablet, personal digital assistant or other device that can capture images, or can be installed separately or integrated into a desktop computer, video conferencing station or other internal or external camera. In the device to capture images. Therefore, the apparatus having the image processing chip can perform color shading correction on a still image or a video image.
  • x is the pixel point
  • i(x) is the ideal image signal of x without color shading
  • s(x) is the color shadow outline of x, which may also be called color shading component or color shading information
  • h(x) is The actual image signal of x.
  • the image signal may specifically be a tone value of the image.
  • the color shading estimation module 15 may correct the color shading of the image based on the color shading model.
  • the color shading model can be used to represent the mapping relationship of the color shading outline, the feature outline, and the transform coefficients of the image.
  • the color shading model can have the following form:
  • s (x) denotes a color shading profile of x
  • a k is f k (x) of transform coefficients
  • b k is f k (x) is translated
  • the coefficient, k ranges from 1 to N and represents the number of features
  • N is a positive integer greater than one.
  • each feature contour in equation (2) can be used to represent features of the color shaded contours of the images of the plurality of standard light sources obtained by statistics. That is, each feature profile is a feature that is statistically derived from the color shadow profile of an image of multiple standard sources. At this time, each feature contour may correspond to a color shadow caused by a specific physical factor or a statistical feature, wherein the physical factor is, for example, a change in incident angle, a mismatch of a device such as a main lens and a microlens, and the like.
  • the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.
  • color shading model in the embodiment of the present application is not limited to the form of the above formula (2), and may be, for example, various variants of the formula (2) (for example, logarithm of f k (x) or s(x) The embodiment of the present application does not limit this.
  • FIG. 2 is a schematic flow chart showing a method for calibrating a feature contour in a color shading model according to an embodiment of the present application. It should be understood that FIG. 2 illustrates the steps or operations of the method of calibrating the feature contours in the color shading model, but these steps or operations are merely examples, and other embodiments of the present application may also perform other operations or variants of the operations in FIG. . Moreover, the various steps in FIG. 2 may be performed in a different order than that presented in FIG. 2, and it is possible that not all operations in FIG. 2 are to be performed.
  • the image sensor 13 of FIG. 1 can be used to acquire an image.
  • a standard light source is projected onto the scene 11, and the scene 11 projects light of the standard light source through the lens 12 to form an image of the standard light source on the image sensor 13. Since the cutoff wavelength of the infrared cut filter on the image sensor 13 becomes shorter as the incident angle increases, and the reduction in the size of the camera module increases the incident light angle, the image acquired in 201 has a color shading.
  • a flat field image of each standard light source can be acquired. That is to say, the scene 11 at this time may be a scene with no color and a flat surface such as white paper or white wall.
  • the actual color at different locations in the image is related to the color shading component of the location, and the actual color is independent of the properties of the scene 11 itself (eg, surface color and curvature of the surface, etc.).
  • the standard light source is an artificial light source that simulates various ambient light, such as American kitchen window spotlight A, family hotel lamp F, simulated sunlight D50, and international standard artificial daylight D65, which simulates the average northern sunlight.
  • D75 European Standard Warm White TL83, European, Japanese, Chinese store light source TL84, American Cool White Fluorescent (CWF), American Warm White Fluorescent (U30), USA Retailer Target - Target specifies light source U35, UV-light source (Ultra-Violet, UV) and other light sources.
  • a flat field image of each standard light source can be acquired. It can be understood that different standard light sources have different spectra, color temperatures, and power.
  • At least two standard light sources can be simultaneously projected on the scene, so that a flat field image in which at least two standard light sources work together can be formed on the image sensor.
  • one or more flat field images may be acquired for one standard light source, or one or more flat field images may be acquired when at least two standard light sources work together.
  • the color shadow outline of each pixel in the image can be extracted.
  • the Red Green Blue (RGB) value of each pixel in the image acquired in 201 can be obtained.
  • the RGB average value of each pixel point can be obtained for the plurality of flat field images, and the RGB average of each pixel point is obtained.
  • the value is the RGB value of each pixel of the flat field image when the standard source or at least two standard sources are combined.
  • a flat field image can be obtained.
  • at least two standard light sources work together a corresponding flat field image can be obtained.
  • the RGB value of all the pixels in the image can be referred to as the RGB value of the image.
  • the RGB values can be converted to tone values.
  • normalization processing can be performed on a basis of each optical center, respectively, to obtain a color shadow outline of each pixel.
  • the number of flat field images may be M, and M is a positive integer greater than one.
  • you can get the color shadow outline of the pixel Where j 1,...,M.
  • Extract feature contours Specifically, the feature contour of each of the above pixel points can be extracted.
  • the logarithm of the color shading profile of the rg tone of each standard light source flat field image extracted can be obtained.
  • N 1 represents the dimension of the feature vector
  • the dimension of the feature vector can be understood as the number of the feature vector and is a positive integer smaller than M.
  • the feature vector can be obtained by using a well-known method such as Principal Component Analysis (PCA) or Convolutional Neural Networks (CNN). Specifically, the process of obtaining the feature vector can be performed.
  • PCA Principal Component Analysis
  • CNN Convolutional Neural Networks
  • N 1 represents the dimension or number of feature contours of the rg hue.
  • the characteristic contour of the bg tone of the image can be obtained in the same way as the rg hue.
  • N 2 is a positive integer less than M, representing the dimension or number of feature contours of the bg hue.
  • the embodiment of the present application extracts a flat field image of a plurality of standard light sources, then extracts a color shadow profile of the flat field image of each standard light source, and extracts a set of feature contours according to the set of color shadow contours of all standard light sources.
  • Feature contours can characterize color shadows caused by a particular factor or statistical feature.
  • the above set of feature contours and a set of transform coefficients are combined by multiplication to form a color shading model described in the embodiment of the present application.
  • the transform coefficient can represent the strength of the factor or the statistical feature, and the multiplication can reflect the physical rule when the different factors are superimposed. Therefore, the color shadow model in the embodiment of the present application can accurately represent the complex color shadow. profile.
  • FIG. 3 is a schematic flowchart of a method for color shading correction according to an embodiment of the present application. Specifically, the method can be performed by the color shading estimation module 15 and the correction module 16 shown in FIG. It should be understood that FIG. 3 illustrates the steps or operations of the method of color shading correction, but these steps or operations are merely examples, and other embodiments of the present application may also perform other operations or variations of the various operations in FIG. Moreover, the various steps in FIG. 3 may be performed in a different order than that presented in FIG. 3, and it is possible that not all operations in FIG. 3 are to be performed.
  • the image sensor 13 of FIG. 1 can be used to acquire an image.
  • the lens 12 projects light reflected by a specific scene to the image sensor 13, and the image sensor 13 can transmit the digital image signal to the pre-processing module 14, and the pre-processing module 14 performs dead-point correction on the digital image signal, black.
  • An operation such as level compensation is performed, and then the digital image after the pre-processing is input to the color shading estimation module 15.
  • the digital image signal may be referred to as image or image data.
  • the tone value includes the rg tone component h rg and the bg tone component h bg .
  • the color shading estimation module 15 can obtain the rg hue component h rg and the bg hue component h bg of each pixel of the image according to the RGB values of the image received in 301.
  • the logarithm operations of h rg and h bg of each pixel determined in 302 can be respectively performed to obtain H rg and H bg .
  • the next step is to obtain a gradient for H rg and H bg respectively. with among them Can indicate the degree of change in H rg , It can indicate the degree of change in H bg .
  • a pixel point in which the hg of the bg tone in the image changes gently is determined.
  • a pixel point whose tone change is gentle may be referred to as a first pixel point, and an area to which the first pixel point belongs may be referred to as a first area. That is, the change in hue of the first pixel in the first region is less than or equal to the threshold.
  • the first region of the rg hue can be expressed as R rg , then:
  • x is any one of R rg , ie the first pixel, and th rg is the hue change threshold of the rg hue.
  • the first region of the bg hue can be expressed as R bg , then:
  • x is any one of R bg , ie the first pixel, and th bg is the hue change threshold of bg hue.
  • the scene corresponding to the first image acquired in 301 can be a specific scene in reality, the image can have rich colors.
  • the change in the hue of the image is relatively large, it can be considered that the color of the region where the hue changes is relatively large is the color of the scene itself. If the hue change of the image is relatively flat, it can be considered that the color of the area where the hue changes gently is the color shading outline.
  • the color shadow estimation module 15 may determine the feature contour of the first region according to a set of feature contours of each pixel point of the pre-stored image and coordinates of the pixel points of the first region.
  • a set of feature contours of each pixel point stored in advance may be a feature profile determined according to the method shown in FIG. 2 described above.
  • Step 304 can be performed by color shading estimation module 15.
  • the transform coefficient of the first region can be defined. Then there are:
  • x represents the first pixel point
  • F k (x) is the k-dimensional feature profile of x
  • A is a transform coefficient k F k (x) is
  • B k is F k (x) the translation factor
  • a k + b k 1
  • k ranges from 1 to N and represents the dimension of the feature profile
  • N is a positive integer greater than 1
  • H(x) represents the logarithm of the hue value at x.
  • the transform coefficient of the first region can be defined. Then there are:
  • the transform coefficient of the first region can be defined Then there are:
  • a color shaded outline is a color shade of the image that is characterized using a color shading model.
  • the feature contour of the first pixel point is substituted into the color shadow model, and a function expression of the color shadow contour of the first pixel point can be obtained. That is, the color shadow contour of the first pixel in the first region may be represented as a function of the transform coefficient of the first pixel, wherein the transform coefficient of the first pixel is an independent variable, first The color shadow outline of a pixel is a dependent variable.
  • the tone value is the actual image signal of the extracted image.
  • the hue value of the first pixel point can be made equal to the color shadow outline of the first pixel point, namely:
  • h(x) is the hue value of the first region.
  • the transform coefficient The value of the value is the optimum value of the transform coefficient of the first pixel.
  • the above formula (3) means When the difference between the gradient of the logarithm of the actual tone value of the first pixel point and the gradient of the logarithm of the color shadow profile of the first pixel point is the smallest The value.
  • the transform coefficient The value is not limited to the above formula (3), for example, the transform coefficient can also be determined.
  • the ratio of the gradient of the logarithm of the actual tone value of the first pixel to the gradient of the logarithm of the color shadow profile of the first pixel is closest to 1
  • the value of the application is not limited in this embodiment.
  • the pixel point in the first image is referred to as the second pixel point.
  • the transform coefficient of the first pixel in the first region may be used as the transform coefficient of the second pixel in the acquired first image. That is to say, in the embodiment of the present application, the transform coefficients of the respective pixel points in the image are the same.
  • the transform coefficient and the feature contour of the second pixel point can be brought into the image color shadow model to synthesize the color shadow outline of the image.
  • the color shadow outline s(x') of the second pixel point x' is in the following form:
  • f k (x ') is of x'
  • a k is f k (x ') of transform coefficients
  • b k is f k (x') of the translation factor
  • a k + b k 1
  • N is a positive integer greater than 1 and represents the number of the characteristic contours f k (x')
  • k ranges from 1 to N.
  • the color shadow outline of the rg hue of the first image can be determined as:
  • the color shadow outline of the bg tone of the first image is:
  • the correction module 16 may maintain the correction value in the correction table according to the color shading profile of the image determined by the color shading estimation module 15.
  • the correction table may include an image pixel point and a correction value of the pixel point, and the correction value of the pixel point may specifically be a reciprocal of the color shadow profile of the pixel point.
  • the correction value g rg (x') of the rg hue component of the second pixel point can be expressed as:
  • the correction value g bg (x') of the bg hue of the second pixel can be expressed as:
  • the correction module 16 can correct the color shading of the first image according to the correction table.
  • the R channel is corrected using a correction table of rg tone, namely:
  • r(x') is the value of the R channel of the second pixel point x' before correction
  • r c (x') is the value of the R channel of the second pixel point x' after correction
  • the B channel is corrected using a bg tone correction table, ie:
  • b(x') is the value of the B channel of the second pixel point x' before correction
  • b c (x') is the value of the B channel of the second pixel point x' after correction.
  • the correction module 16 After the correction module 16 corrects the color shading of the first region based on the correction table, the correction module 16 passes the image data to the subsequent processing module 17 for image processing.
  • the embodiment of the present application first extracts a tone value of the first pixel in the first region of the first image, and then determines the first pixel according to the tone value of the first pixel and the feature contour of the first pixel.
  • Model parameters ie, transform coefficients
  • the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters.
  • the feature contour can represent the color shadow caused by a specific factor or a statistical feature
  • the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.
  • FIG. 4 shows a schematic block diagram of a color shading correction apparatus 400 in accordance with an embodiment of the present application.
  • the device 400 can be a cell phone, a digital camera, a tablet, a personal digital assistant, or other device that can capture images, or a desktop computer, video conferencing station, or other device that captures images using internal or external cameras.
  • the apparatus 400 includes a receiving unit 410, an extracting unit 420, a determining unit 430, and a correcting unit 440.
  • the receiving unit 410 is configured to receive the first image.
  • the extracting unit 420 is configured to extract a tone value of the first pixel in the first region in the first image, wherein a gradient of the tone value of the first pixel is less than or equal to a threshold.
  • a determining unit 430 configured to determine, by using a tone value of the first pixel point and a feature contour of the first pixel point, a transform coefficient of the first pixel point, where the feature contour is used to represent a statistically obtained A feature of a color shaded outline of a pixel point in an image of a plurality of standard light sources, the transform coefficient being used to indicate a degree of strength of the feature outline.
  • the determining unit 430 is further configured to determine, according to the transform coefficient and the color shadow model of the first pixel, a color shadow contour of the second pixel in the first image, where the color shadow model is used to represent The mapping between the color shadow outline, the feature outline, and the transform coefficients of the pixels in the image.
  • the correcting unit 440 is configured to correct a color shadow of the second pixel point according to a color shadow profile of the second pixel point.
  • the embodiment of the present application first extracts a tone value of the first pixel in the first region of the first image, and then determines the first pixel according to the tone value of the first pixel and the feature contour of the first pixel.
  • Model parameters ie, transform coefficients
  • the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters.
  • the feature contour can represent the color shadow caused by a specific factor or a statistical feature
  • the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.
  • the extracting unit 420 is further configured to extract a color shadow profile of a pixel point of the flat field image of the plurality of standard light sources.
  • the determining unit 430 is further configured to determine a feature vector of a color shadow contour of a pixel point of the flat field image of the plurality of standard light sources, and determine the feature contour according to the feature vector.
  • the determining unit 430 is specifically configured to:
  • x represents the first pixel point
  • Is the transform coefficient of x and F k (x) is the k-dimensional feature profile of x
  • a k is a transform coefficient F k (x) is
  • k is The value ranges from 1 to N and represents the dimension of the feature profile
  • N is a positive integer greater than 1
  • H(x) represents the logarithm of the tone value at x.
  • the color shading model can have the following form:
  • s (x) denotes a color shading profile of x
  • a k is f k (x) of transform coefficients
  • b k is f k (x) is translated
  • the coefficient, k ranges from 1 to N and represents the number of features
  • N is a positive integer greater than one.
  • the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.
  • the color shadow profile of the second pixel determined by the determining unit 430 is:
  • the correction unit is specifically configured to:
  • the receiving unit 410, the extracting unit 420, the determining unit 430, and the correcting unit 440 may be implemented by a processor.
  • the color shading correction device 600 can include a processor 610 and a memory 620.
  • the memory 620 can be used to store feature contours and code executed by the processor 610, and the like.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 610 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 620, and the processor 610 reads the information in the memory 620 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
  • the color shading correction device 400 shown in FIG. 4 or the color shading correction device 600 shown in FIG. 5 can implement the respective processes corresponding to the method embodiments shown in FIG. 2 and FIG. 3, specifically, the color shading correction.
  • the device 400 or the color shading correction device 600 reference may be made to the descriptions in FIG. 2 and FIG. 3 above. To avoid repetition, details are not described herein again.
  • the size of the sequence numbers of the foregoing processes does not mean the order of execution sequence, and the order of execution of each process should be determined by its function and internal logic, and should not be applied to the embodiment of the present application.
  • the implementation process constitutes any limitation.
  • the embodiment of the present application further provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing a corresponding method in the foregoing method embodiment.
  • the embodiment of the present application further provides a computer program product, comprising: computer program code, when the computer program code is run by a processor of a device for color shading correction, causing the color shading correction device to execute The corresponding method in any of the above method embodiments.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present application which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

Provided in the present application are a color shading correction method and device, capable of accurately correcting color shading of an image. The method comprises: receiving a first image; extracting a hue value of a first pixel point in the first image for which a gradient is less than or equal to a threshold; determining a transformation coefficient of the first pixel point by using the hue value of the first pixel point and a feature contour of the first pixel, wherein the feature contour is used for representing a feature of a color shading contour of a pixel point in the image that is obtained by statistically analyzing multiple standard light sources, and the transformation coefficient is used for representing the degree of strength of the feature contour; determining a color shading contour of a second pixel point in the first image according to the transformation coefficient of the first pixel point and a color shading model; correcting a color shading of the second pixel point according to the color shading contour of the second pixel point.

Description

颜色阴影校正的方法和装置Method and device for color shading correction

本申请要求于2017年09月29日提交中国专利局、申请号为201710911423.2、申请名称为“颜色阴影校正的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 200910911423.2, filed on Sep. 29, 2017, the entire disclosure of which is incorporated herein by reference. .

技术领域Technical field

本申请涉及图像处理领域,并且更具体的,涉及图像处理领域中的颜色阴影校正的方法和装置。The present application relates to the field of image processing and, more particularly, to methods and apparatus for color shading correction in the field of image processing.

背景技术Background technique

由于无线终端及其它移动设备在轻薄设计方面的需求,要求数字摄像头模组的体积越来越小,这对输出的图像带来了多种副作用,其中之一便是颜色阴影(Color Shading)。颜色阴影是指彩色摄像头模组输出的图像中,从中心到边缘的颜色渐变。通常,在摄像头模组中,数字图像传感器正面都装有红外截止(IR-CUT)滤光片,在透过可见光的同时阻挡红外光,以保证颜色再现的准确性。但是,所述红外截止滤光片的截止波长随入射光角度的变化而变化,造成传感器中心与边缘截止波长不同,表现为图像的颜色阴影。并且,摄像头模组尺寸的减小会增大入射光角度,使得颜色阴影越发显著。此外,主镜头与微透镜等器件的不匹配也会加重颜色阴影。Due to the thin and light design requirements of wireless terminals and other mobile devices, the size of the digital camera module is required to be smaller and smaller, which brings various side effects to the output image, one of which is color shading. Color shading refers to the color gradient from the center to the edge in the image output by the color camera module. Generally, in the camera module, the front side of the digital image sensor is equipped with an infrared cut-off (IR-CUT) filter, which blocks the infrared light while transmitting visible light to ensure the accuracy of color reproduction. However, the cutoff wavelength of the infrared cut filter varies with the angle of the incident light, causing the sensor center to be different from the edge cutoff wavelength, which is represented by the color shading of the image. Moreover, the reduction in the size of the camera module increases the angle of the incident light, making the color shadow more prominent. In addition, mismatching of devices such as the main lens and microlenses can also add color shading.

颜色阴影的程度会随场景反射光谱的改变而改变,因此需要对颜色阴影进行动态校正。目前,现有技术基于颜色一致性模型对颜色阴影进行校正,该模型包括一组一般轮廓和一组对应于色温的变换系数。但是,色温和光谱并不是一一对应的,例如A光和U30色温接近但光谱差异很大,这会造成该颜色一致性模型粗糙,导致使用该模型造成颜色阴影校正不准确。The degree of color shading changes as the reflectance spectrum of the scene changes, so the color shading needs to be dynamically corrected. Currently, the prior art corrects color shading based on a color consistency model that includes a set of general contours and a set of transform coefficients corresponding to color temperatures. However, the color temperature and the spectrum are not one-to-one correspondence. For example, the A-light and U30 color temperatures are close but the spectral difference is large, which causes the color consistency model to be rough, resulting in inaccurate color shading correction using the model.

发明内容Summary of the invention

本申请提供一种颜色阴影校正的方法和装置,能够准确地对图像的颜色阴影进行校正。The present application provides a method and apparatus for color shading correction that accurately corrects color shading of an image.

第一方面,提供了一种颜色阴影校正的方法,该方法包括:In a first aspect, a method of color shading correction is provided, the method comprising:

接收第一图像;Receiving a first image;

提取所述第一图像中第一像素点的色调值,其中,所述第一像素点的色调值的梯度小于或等于阈值;Extracting a tone value of the first pixel in the first image, wherein a gradient of a tone value of the first pixel is less than or equal to a threshold;

利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,其中,所述特征轮廓用于表示统计得到的多个标准光源的图像中的像素点的颜色阴影轮廓的特征,所述变换系数用于表示所述特征轮廓的强弱程度;Determining a transform coefficient of the first pixel point by using a tone value of the first pixel point and a feature profile of the first pixel point, wherein the feature profile is used to represent an image of a plurality of statistically derived standard light sources a feature of a color shaded outline of a pixel in which the transform coefficient is used to indicate a degree of strength of the feature outline;

根据所述第一像素点的变换系数和颜色阴影模型,确定所述第一图像中的第二像素点 的颜色阴影轮廓,其中,所述颜色阴影模型用于表示图像中的像素点的颜色阴影轮廓、特征轮廓以及变换系数之间的映射关系;Determining a color shadow profile of a second pixel point in the first image according to a transform coefficient and a color shadow model of the first pixel, wherein the color shadow model is used to represent a color shadow of a pixel point in the image a mapping relationship between contours, feature contours, and transform coefficients;

根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正。Correcting the color shading of the second pixel point according to the color shading profile of the second pixel point.

本申请实施例首先提取第一图像的第一像素点的色调值,然后根据该第一像素点的色调值和该第一像素点的特征轮廓,确定该第一像素点的模型参数(即变换系数),进一步该第一像素点的模型参数和颜色阴影模型,确定第一图像的颜色阴影轮廓,最后根据该第一图像的颜色阴影轮廓对该第一图像的颜色阴影进行校正。由于本申请实施例通过直接使用图像的色调值来确定模型参数,而并不依赖于白平衡等其他模块获取模型参数,因而本申请实施例能够准确地确定模型参数。并且,本申请实施例中特征轮廓能够表征某一具体因素或统计特征所造成的颜色阴影,颜色阴影模型能够准确的表征复杂的颜色阴影轮廓,因而本申请实施例能够准确地对图像的颜色阴影进行校正。The embodiment of the present application first extracts a tone value of the first pixel of the first image, and then determines a model parameter of the first pixel according to the tone value of the first pixel and the feature contour of the first pixel (ie, transform a coefficient), further the model parameter and the color shading model of the first pixel, determining a color shading contour of the first image, and finally correcting the color shading of the first image according to the color shading contour of the first image. Since the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters. Moreover, in the embodiment of the present application, the feature contour can represent the color shadow caused by a specific factor or a statistical feature, and the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.

可选的,所述利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数之前,还包括:Optionally, before determining the transform coefficient of the first pixel by using the tone value of the first pixel and the feature contour of the first pixel, the method further includes:

提取所述多个标准光源的平场图像的像素点的颜色阴影轮廓;Extracting a color shadow outline of a pixel point of the flat field image of the plurality of standard light sources;

确定所述多个标准光源的平场图像的像素点的颜色阴影轮廓的特征向量,并根据所述特征向量确定所述特征轮廓。Determining a feature vector of a color shadow profile of a pixel of the flat field image of the plurality of standard light sources, and determining the feature profile based on the feature vector.

因此,特征轮廓可以用于表示统计得到的多个标准光源的图像的颜色阴影轮廓的特征。也就是说,每个特征轮廓都是从多个标准光源的图像的颜色阴影轮廓中统计得到的特征。这时,每个特征轮廓可以对应于某一具体物理因素或统计特征所造成的颜色阴影,其中,物理因素例如为入射角变化、主镜头与微透镜等器件的不匹配等。Thus, the feature contour can be used to represent the characteristics of the color shaded contours of the images of the plurality of standard light sources obtained by statistics. That is, each feature profile is a feature that is statistically derived from the color shadow profile of an image of multiple standard sources. At this time, each feature contour may correspond to a color shadow caused by a specific physical factor or a statistical feature, wherein the physical factor is, for example, a change in incident angle, a mismatch of a device such as a main lens and a microlens, and the like.

可选的,所述利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,包括:Optionally, determining, by using a tone value of the first pixel and a feature profile of the first pixel, a transform coefficient of the first pixel, including:

根据以下公式,确定所述第一像素点的变换系数:Determining the transform coefficients of the first pixel according to the following formula:

Figure PCTCN2018106645-appb-000001
Figure PCTCN2018106645-appb-000001

其中,x代表所述第一像素点,

Figure PCTCN2018106645-appb-000002
为x的变换系数且
Figure PCTCN2018106645-appb-000003
f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的维度,N为大于1的正整数,H(x)表示x处的色调值的对数。 Where x represents the first pixel point,
Figure PCTCN2018106645-appb-000002
Is the transform coefficient of x and
Figure PCTCN2018106645-appb-000003
F k (x) is the k-dimensional feature profile of x, A k is a transform coefficient F k (x) is, B k is F k (x) the translation factor and a k + b k = 1, k is The value ranges from 1 to N and represents the dimension of the feature profile, N is a positive integer greater than 1, and H(x) represents the logarithm of the tone value at x.

具体的,对于rg色调,可以定义第一区域的变换系数

Figure PCTCN2018106645-appb-000004
则有: Specifically, for the rg hue, the transform coefficient of the first region can be defined.
Figure PCTCN2018106645-appb-000004
Then there are:

Figure PCTCN2018106645-appb-000005
Figure PCTCN2018106645-appb-000005

对于bg色调,可以定义第一区域的变换系数

Figure PCTCN2018106645-appb-000006
则有: For bg hue, the transform coefficient of the first region can be defined
Figure PCTCN2018106645-appb-000006
Then there are:

Figure PCTCN2018106645-appb-000007
Figure PCTCN2018106645-appb-000007

可选的,本申请实施例中,可以将第一区域中的第一像素点的变换系数作为所获取的第一图像中的第二像素点的变换系数。也就是说,本申请实施例中,图像中的各个像素点的变换系数是相同的。这时,可以将该变换系数和第二像素点的特征轮廓带入图像颜色阴 影模型中,合成图像的颜色阴影轮廓。Optionally, in the embodiment of the present application, the transform coefficient of the first pixel in the first region may be used as the transform coefficient of the second pixel in the acquired first image. That is to say, in the embodiment of the present application, the transform coefficients of the respective pixel points in the image are the same. At this time, the transform coefficient and the feature contour of the second pixel point can be brought into the image color shadow model to synthesize the color shadow outline of the image.

具体的,颜色阴影模型可以具有如下形式:Specifically, the color shading model can have the following form:

Figure PCTCN2018106645-appb-000008
Figure PCTCN2018106645-appb-000008

其中,s(x)表示x的颜色阴影轮廓,f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。本申请实施例中,约定无颜色阴影处f k(x)=1,则为了保持f k(x)的归一化特性,a k+b k=1。 Wherein, s (x) denotes a color shading profile of x, f k (x) for the first K x dimension of the feature profile, a k is f k (x) of transform coefficients, b k is f k (x) is translated The coefficient, k, ranges from 1 to N and represents the number of features, and N is a positive integer greater than one. In the embodiment of the present application, it is agreed that the colorless shadow f k (x)=1, in order to maintain the normalized property of f k (x), a k +b k =1.

本申请实施例中,变换系数a k用于描述该变换系数a k对应的特征轮廓f k(x)的强弱程度。因此,本申请实施例中的颜色阴影模型通过采用多个特征轮廓相乘的方式,能够表征多个因素或统计特征叠加时的颜色阴影分量。 In the embodiment of the present application, the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.

这时,所述第二像素点的颜色阴影轮廓为:At this time, the color shadow outline of the second pixel point is:

Figure PCTCN2018106645-appb-000009
Figure PCTCN2018106645-appb-000009

其中,x'代表所述第二像素点,s(x')表示x'的颜色阴影轮廓,f k(x')为x'的第k维的特征轮廓,a k为f k(x')的变换系数,b k为f k(x')的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。 Wherein, x 'representing the second pixel, s (x') represented by x 'shadow color profile, f k (x') as x 'of the k-dimensional feature profile, a k is F k (x' The transform coefficient, b k is the translation coefficient of f k (x'), and a k +b k =1, k ranges from 1 to N and represents the number of features, N is greater than 1 Positive integer.

可选的,所述根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正包括:Optionally, the correcting the color shading of the second pixel point according to the color shadow profile of the second pixel point comprises:

将所述第二像素点的颜色阴影轮廓的倒数确定为所述第二像素点的校正值。具体的,校正表可以包括图像像素点和该像素点的校正值,像素点的校正值具体可以为该像素点的颜色阴影轮廓的倒数。A reciprocal of a color shading profile of the second pixel point is determined as a correction value of the second pixel point. Specifically, the correction table may include an image pixel point and a correction value of the pixel point, and the correction value of the pixel point may specifically be a reciprocal of the color shadow profile of the pixel point.

根据所述第二像素点的校正值对所述第二像素点的颜色阴影进行校正。具体的,第二像素点x'的R通道的值与rg色调的校正值的乘积为校正之后第二像素点x'的R通道的值,第二像素点x'的B通道的值与bg色调的校正值的乘积为校正之后第二像素点x'的B通道的值。Correcting the color shading of the second pixel point according to the correction value of the second pixel point. Specifically, the product of the value of the R channel of the second pixel point x′ and the correction value of the rg tone is the value of the R channel of the second pixel point x′ after the correction, and the value of the B channel of the second pixel point x′ and bg The product of the correction value of the hue is the value of the B channel of the second pixel point x' after correction.

第二方面,本申请实施例提供了一种颜色阴影校正的装置,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法,具体的,该装置包括用于执行上述第一方面或第一方面任意可能的实现方式中的方法的模块。In a second aspect, the embodiment of the present application provides a device for performing color shading correction, which is used to perform the method in any of the foregoing first aspect or any possible implementation manner of the first aspect, and specifically, the device includes A module of a method in any aspect or in any possible implementation of the first aspect.

第三方面,本申请实施例提供了一种颜色阴影校正的装置,包括:存储器和处理器。其中,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第一方面或第一方面的任意可能的实现方式中的方法。In a third aspect, an embodiment of the present application provides a color shading correction apparatus, including: a memory and a processor. Wherein the memory is for storing instructions for executing the instructions stored by the memory, and when the processor executes the instructions stored by the memory, the executing causes the processor to perform any of the first aspect or the first aspect The method in the implementation.

第四方面,本申请实施例提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。In a fourth aspect, the embodiment of the present application provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing the method in the first aspect or any possible implementation manner of the first aspect.

附图说明DRAWINGS

图1是本申请实施例的一种颜色阴影校正的应用场景的示意图。FIG. 1 is a schematic diagram of an application scenario of color shading correction according to an embodiment of the present application.

图2是本申请实施例的一种标定颜色阴影模型的方法的示意性流程图。2 is a schematic flow chart of a method for calibrating a color shading model according to an embodiment of the present application.

图3是本申请实施例的一种颜色阴影校正的方法的示意性流程图。FIG. 3 is a schematic flowchart of a method for color shading correction according to an embodiment of the present application.

图4是本申请实施例的一种颜色阴影校正的装置的示意性框图。4 is a schematic block diagram of an apparatus for color shading correction in an embodiment of the present application.

图5是本申请实施例的另一种颜色阴影校正的装置的示意性框图。FIG. 5 is a schematic block diagram of another apparatus for color shading correction according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in the present application will be described below with reference to the accompanying drawings.

图1是本申请实施例的一种颜色阴影校正的应用场景的示意图。具体的,场景11反射的光经镜头12投射,在图像传感器13上形成数字图像信号,该数字图像信号首先经过预处理模块14进行坏点校正、黑电平补偿等操作,然后将预处理之后的图像信号输入到颜色阴影估计模块15,颜色阴影估计模块15对图像信号的颜色阴影进行估计,得到该图像的校正表。校正模块16根据颜色阴影估计模块确定的校正表,对图像信号进行校正。后续处理模块17进一步对校正之后的图像信号进行后续处理,生成最终图像18。FIG. 1 is a schematic diagram of an application scenario of color shading correction according to an embodiment of the present application. Specifically, the light reflected by the scene 11 is projected through the lens 12, and a digital image signal is formed on the image sensor 13, and the digital image signal is first subjected to a dead pixel correction, black level compensation, etc. through the preprocessing module 14, and then the preprocessing is performed. The image signal is input to a color shading estimation module 15, which estimates the color shading of the image signal to obtain a correction table for the image. The correction module 16 corrects the image signal based on the correction table determined by the color shading estimation module. The subsequent processing module 17 further performs subsequent processing on the corrected image signal to generate a final image 18.

本申请实施例对颜色阴影估计模块15进行了改进。颜色阴影估计模块15可以应用于图像信号处理(Image Signal Processing,ISP)芯片中,用于对彩色摄像头模组采集到的图像信号进行处理。图像信号处理芯片可以单独安装或集成于手机、数码相机、平板电脑、个人数字助理或其他可以捕获图像的装置中,或者单独安装或集成于桌式电脑、视频会议台或其他使用内部或外部相机来捕获图像的装置中。因此,具有该图像处理芯片的装置可以对静态图像或视频图像进行颜色阴影校正。The color shadow estimation module 15 has been improved in the embodiment of the present application. The color shadow estimation module 15 can be applied to an Image Signal Processing (ISP) chip for processing image signals collected by the color camera module. The image signal processing chip can be installed separately or integrated into a mobile phone, digital camera, tablet, personal digital assistant or other device that can capture images, or can be installed separately or integrated into a desktop computer, video conferencing station or other internal or external camera. In the device to capture images. Therefore, the apparatus having the image processing chip can perform color shading correction on a still image or a video image.

通常,颜色阴影的作用方式可以用以下公式(1)表示In general, the way color shading works can be expressed by the following formula (1)

h(x)=s(x)·i(x)       (1)h(x)=s(x)·i(x) (1)

其中,x代表像素点,i(x)是x的无颜色阴影的理想图像信号,s(x)是x的颜色阴影轮廓,也可以称为颜色阴影分量或颜色阴影信息,h(x)是x的实际的图像信号。并且,在公式(1)中,图像信号具体可以为图像的色调值。Where x is the pixel point, i(x) is the ideal image signal of x without color shading, s(x) is the color shadow outline of x, which may also be called color shading component or color shading information, h(x) is The actual image signal of x. Also, in the formula (1), the image signal may specifically be a tone value of the image.

本申请实施例中,颜色阴影估计模块15可以基于颜色阴影模型对图像的颜色阴影进行校正。这里,颜色阴影模型可以用于表示图像的颜色阴影轮廓、特征轮廓以及变换系数的映射关系。具体的,颜色阴影模型可以具有如下形式:In the embodiment of the present application, the color shading estimation module 15 may correct the color shading of the image based on the color shading model. Here, the color shading model can be used to represent the mapping relationship of the color shading outline, the feature outline, and the transform coefficients of the image. Specifically, the color shading model can have the following form:

Figure PCTCN2018106645-appb-000010
Figure PCTCN2018106645-appb-000010

其中,s(x)表示x的颜色阴影轮廓,f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。本申请实施例中,约定无颜色阴影处f k(x)=1,则为了保持f k(x)的归一化特性,a k+b k=1。 Wherein, s (x) denotes a color shading profile of x, f k (x) for the first K x dimension of the feature profile, a k is f k (x) of transform coefficients, b k is f k (x) is translated The coefficient, k, ranges from 1 to N and represents the number of features, and N is a positive integer greater than one. In the embodiment of the present application, it is agreed that the colorless shadow f k (x)=1, in order to maintain the normalized property of f k (x), a k +b k =1.

具体而言,公式(2)中的特征轮廓可以用于表示统计得到的多个标准光源的图像的颜色阴影轮廓的特征。也就是说,每个特征轮廓都是从多个标准光源的图像的颜色阴影轮廓中统计得到的特征。这时,每个特征轮廓可以对应于某一具体物理因素或统计特征所造成的颜色阴影,其中,物理因素例如为入射角变化、主镜头与微透镜等器件的不匹配等。并且,变换系数a k用于描述该变换系数a k对应的特征轮廓f k(x)的强弱程度。因此,本申请实施例中的颜色阴影模型通过采用多个特征轮廓相乘的方式,能够表征多个因素或统计特征叠加时的颜色阴影分量。 In particular, the feature contours in equation (2) can be used to represent features of the color shaded contours of the images of the plurality of standard light sources obtained by statistics. That is, each feature profile is a feature that is statistically derived from the color shadow profile of an image of multiple standard sources. At this time, each feature contour may correspond to a color shadow caused by a specific physical factor or a statistical feature, wherein the physical factor is, for example, a change in incident angle, a mismatch of a device such as a main lens and a microlens, and the like. And, the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.

应注意,本申请实施例中的颜色阴影模型并不限于上述公式(2)的形式,例如还可以是公式(2)各种变形(例如对f k(x)或s(x)取对数、倒数或者求导等),本申请实施例 对此不限定。 It should be noted that the color shading model in the embodiment of the present application is not limited to the form of the above formula (2), and may be, for example, various variants of the formula (2) (for example, logarithm of f k (x) or s(x) The embodiment of the present application does not limit this.

图2示出了本申请实施例的一种标定颜色阴影模型中的特征轮廓的方法的示意性流程图。应理解,图2示出了标定颜色阴影模型中的特征轮廓的方法的步骤或操作,但这些步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图2中的各个操作的变形。此外,图2中的各个步骤可以按照与图2呈现的不同的顺序来执行,并且有可能并非要执行图2中的全部操作。FIG. 2 is a schematic flow chart showing a method for calibrating a feature contour in a color shading model according to an embodiment of the present application. It should be understood that FIG. 2 illustrates the steps or operations of the method of calibrating the feature contours in the color shading model, but these steps or operations are merely examples, and other embodiments of the present application may also perform other operations or variants of the operations in FIG. . Moreover, the various steps in FIG. 2 may be performed in a different order than that presented in FIG. 2, and it is possible that not all operations in FIG. 2 are to be performed.

201,采集图像。201, collecting an image.

具体的,可以使用图1中的图像传感器13来采集图像。具体而言,将标准光源投射在场景11上,场景11将标准光源的光经镜头12投射,在图像传感器13上形成标准光源的图像。由于图像传感器13上的红外截止滤光片的截止波长随入射角度的增大而变短,且摄像头模组尺寸的减小会增加入射光角度,因此,201中采集的图像会有颜色阴影。Specifically, the image sensor 13 of FIG. 1 can be used to acquire an image. Specifically, a standard light source is projected onto the scene 11, and the scene 11 projects light of the standard light source through the lens 12 to form an image of the standard light source on the image sensor 13. Since the cutoff wavelength of the infrared cut filter on the image sensor 13 becomes shorter as the incident angle increases, and the reduction in the size of the camera module increases the incident light angle, the image acquired in 201 has a color shading.

这里,可以采集每个标准光源的平场图像。也就是说,此时场景11可以是白纸或者白墙等没有颜色且表面平坦的场景。这样,图像中不同位置上的实际颜色与该位置的颜色阴影分量相关,且该实际颜色与场景11自身的属性(例如表面颜色以及表面的曲率等)无关。Here, a flat field image of each standard light source can be acquired. That is to say, the scene 11 at this time may be a scene with no color and a flat surface such as white paper or white wall. Thus, the actual color at different locations in the image is related to the color shading component of the location, and the actual color is independent of the properties of the scene 11 itself (eg, surface color and curvature of the surface, etc.).

这里,标准光源是指模拟各种环境光线下的人造光源,例如美式厨窗射灯A,家庭酒店用灯F,模拟太阳光D50,国际标准人工日光(Artificial Daylight)D65,模拟北方平均太阳光D75,欧洲标准暖白商店光源(Warm White)TL83,欧洲、日本、中国商店光源TL84,美国冷白商店光源(Cool White Fluorescent,CWF),美国暖白商店光源(Warm White Fluorescent,U30),美国零售商塔吉特-Target指定对色灯管U35、紫外灯光源(Ultra-Violet,UV)等光源等。这里,可以采集每个标准光源的平场图像。可理解,不同的标准光源具有不同的光谱、色温以及功率。Here, the standard light source is an artificial light source that simulates various ambient light, such as American kitchen window spotlight A, family hotel lamp F, simulated sunlight D50, and international standard artificial daylight D65, which simulates the average northern sunlight. D75, European Standard Warm White TL83, European, Japanese, Chinese store light source TL84, American Cool White Fluorescent (CWF), American Warm White Fluorescent (U30), USA Retailer Target - Target specifies light source U35, UV-light source (Ultra-Violet, UV) and other light sources. Here, a flat field image of each standard light source can be acquired. It can be understood that different standard light sources have different spectra, color temperatures, and power.

本申请实施例中,可以同时将至少两个标准光源投射在场景上,这样在图像传感器上可以形成至少两个标准光源共同作用的平场图像。本申请实施例中,对于一个标准光源,可以采集一个或多个平场图像,或者在至少两个标准光源共同作用时,可以采集一个或多个平场图像。In the embodiment of the present application, at least two standard light sources can be simultaneously projected on the scene, so that a flat field image in which at least two standard light sources work together can be formed on the image sensor. In the embodiment of the present application, one or more flat field images may be acquired for one standard light source, or one or more flat field images may be acquired when at least two standard light sources work together.

202,提取图像的颜色阴影轮廓。202. Extract a color shadow outline of the image.

具体的,可以提取图像中每个像素点的颜色阴影轮廓。首先,可以获取201中采集的图像中每个像素点的红绿蓝(Red Green Blue,RGB)值。当采集了一个标准光源或者至少两个标准光源共同作用时的多个平场图像时,可以对该多个平场图像求每个像素点的RGB平均值,并将每个像素点的RGB平均值作为该标准光源或至少两个标准光源共同作用时的平场图像的每个像素点的RGB值。这样,对于一个标准光源,可以得到一个平场图像。在至少两个标准光源共同作用时,可以得到对应的一个平场图像。Specifically, the color shadow outline of each pixel in the image can be extracted. First, the Red Green Blue (RGB) value of each pixel in the image acquired in 201 can be obtained. When a plurality of flat field images of a standard light source or at least two standard light sources are combined, the RGB average value of each pixel point can be obtained for the plurality of flat field images, and the RGB average of each pixel point is obtained. The value is the RGB value of each pixel of the flat field image when the standard source or at least two standard sources are combined. Thus, for a standard source, a flat field image can be obtained. When at least two standard light sources work together, a corresponding flat field image can be obtained.

这里,可以将图像中所有像素点的RGB值称为该图像的RGB值。在获取了每个平场图像的RGB值之后,可以将RGB值变换为色调值。具体而言,可以根据一个像素点的RGB值获得该像素点的rg色调分量和bg色调分量,rg色调分量为R值与G值的比值,bg色调分量为B值与G值的比值,即rg=R/G,bg=B/G。Here, the RGB value of all the pixels in the image can be referred to as the RGB value of the image. After the RGB values of each flat field image are acquired, the RGB values can be converted to tone values. Specifically, the rg tone component and the bg tone component of the pixel point can be obtained according to the RGB value of one pixel point, the rg tone component is a ratio of the R value to the G value, and the bg tone component is a ratio of the B value to the G value, that is, Rg=R/G, bg=B/G.

对于每个平场图像中每个像素点的色调,可以分别以每个光心为基准进行归一化处理,得到每个像素点的颜色阴影轮廓。这里,平场图像的个数可以为M,M为大于1的 正整数。具体而言,对于每个像素点的rg色调,可以获取该像素点的颜色阴影轮廓

Figure PCTCN2018106645-appb-000011
其中j=1,…,M。对于每个像素点的bg色调,可以获取该像素点的颜色阴影轮廓
Figure PCTCN2018106645-appb-000012
其中j=1,…,M。 For each color point of each pixel in the flat field image, normalization processing can be performed on a basis of each optical center, respectively, to obtain a color shadow outline of each pixel. Here, the number of flat field images may be M, and M is a positive integer greater than one. Specifically, for the rg tone of each pixel, the color shadow outline of the pixel can be obtained.
Figure PCTCN2018106645-appb-000011
Where j=1,...,M. For the bg hue of each pixel, you can get the color shadow outline of the pixel
Figure PCTCN2018106645-appb-000012
Where j=1,...,M.

203,判断是否提取了所有标准光源的颜色阴影轮廓。203. Determine whether the color shadow outlines of all standard light sources are extracted.

若否,对其他标准光源重复上述201和202的步骤。若是,则执行下一步204。If not, repeat steps 201 and 202 above for other standard sources. If yes, proceed to the next step 204.

204,提取特征轮廓。具体的,可以提取上述每个像素点的特征轮廓。204. Extract feature contours. Specifically, the feature contour of each of the above pixel points can be extracted.

具体而言,对提取的每个标准光源平场图像的rg色调的颜色阴影轮廓取对数可以得到

Figure PCTCN2018106645-appb-000013
将所有标准光源平场图像的rg色调的颜色阴影轮廓
Figure PCTCN2018106645-appb-000014
j=1,2,…,M视为一个集合,即平场图像的rg色调的颜色阴影轮廓集合可以表示为矩阵
Figure PCTCN2018106645-appb-000015
Specifically, the logarithm of the color shading profile of the rg tone of each standard light source flat field image extracted can be obtained.
Figure PCTCN2018106645-appb-000013
Color shaded outline of rg tones of all standard light source flat field images
Figure PCTCN2018106645-appb-000014
j=1, 2,..., M is regarded as a set, that is, the color shadow outline set of the rg tone of the flat field image can be expressed as a matrix
Figure PCTCN2018106645-appb-000015

然后,求矩阵

Figure PCTCN2018106645-appb-000016
的特征向量
Figure PCTCN2018106645-appb-000017
其中N 1表示该特征向量的维度,特征向量的维度可以理解为该特征向量的个数,且为小于M的正整数。本申请实施例中,可以使用主成分分析(Principal Component Analysis,PCA)、卷积神经网络(Convolutional Neural Networks,CNN)等比较公知的方法求该特征向量,具体的,求取特征向量的过程可以参见现有技术中的求矩阵的特征向量的方法,本申请实施例不再赘述。 Then, find the matrix
Figure PCTCN2018106645-appb-000016
Characteristic vector
Figure PCTCN2018106645-appb-000017
Where N 1 represents the dimension of the feature vector, and the dimension of the feature vector can be understood as the number of the feature vector and is a positive integer smaller than M. In the embodiment of the present application, the feature vector can be obtained by using a well-known method such as Principal Component Analysis (PCA) or Convolutional Neural Networks (CNN). Specifically, the process of obtaining the feature vector can be performed. For the method of the eigenvectors of the matrix in the prior art, the embodiments of the present application are not described again.

最后,可以求该特征向量

Figure PCTCN2018106645-appb-000018
的指数,得到图像的rg色调的特征轮廓
Figure PCTCN2018106645-appb-000019
这里N 1表示rg色调的特征轮廓的维度或个数。 Finally, you can find the eigenvector
Figure PCTCN2018106645-appb-000018
The index that gives the characteristic outline of the rg tones of the image
Figure PCTCN2018106645-appb-000019
Here N 1 represents the dimension or number of feature contours of the rg hue.

同理,可以采用与rg色调相同的方式,求图像的bg色调的特征轮廓

Figure PCTCN2018106645-appb-000020
Figure PCTCN2018106645-appb-000021
其中N 2为小于M的正整数,表示bg色调的特征轮廓的维度或个数。 In the same way, the characteristic contour of the bg tone of the image can be obtained in the same way as the rg hue.
Figure PCTCN2018106645-appb-000020
Figure PCTCN2018106645-appb-000021
Where N 2 is a positive integer less than M, representing the dimension or number of feature contours of the bg hue.

这里,特征轮廓的描述可以参见上文中的描述,为避免重复,这里不再赘述。Here, the description of the feature contour can be referred to the description above, and to avoid repetition, it will not be repeated here.

205,存储上述rg色调和bg色调的特征轮廓。具体的,可以存储每个像素点的每个色调的特征轮廓。205. Store the feature contours of the above rg hue and bg hue. Specifically, the feature contour of each tone of each pixel point can be stored.

因此,本申请实施例通过采集多个标准光源的平场图像,然后提取每个标准光源的平场图像的颜色阴影轮廓,并根据所有标准光源的颜色阴影轮廓的集合提取一组特征轮廓,该特征轮廓能够表征某一具体因素或统计特征所造成的颜色阴影。Therefore, the embodiment of the present application extracts a flat field image of a plurality of standard light sources, then extracts a color shadow profile of the flat field image of each standard light source, and extracts a set of feature contours according to the set of color shadow contours of all standard light sources. Feature contours can characterize color shadows caused by a particular factor or statistical feature.

进一步,上述一组特征轮廓与一组变换系数通过乘法结合构成本申请实施例中所述的颜色阴影模型。本申请实施例中,变换系数可以表征该因素或统计特征的强弱程度,乘法能够反映不同因素叠加时的物理规律,因此本申请实施例中的该颜色阴影模型能够准确的表征复杂的颜色阴影轮廓。Further, the above set of feature contours and a set of transform coefficients are combined by multiplication to form a color shading model described in the embodiment of the present application. In the embodiment of the present application, the transform coefficient can represent the strength of the factor or the statistical feature, and the multiplication can reflect the physical rule when the different factors are superimposed. Therefore, the color shadow model in the embodiment of the present application can accurately represent the complex color shadow. profile.

图3示出了本申请实施例的一种颜色阴影校正的方法的示意性流程图。具体的,该方法可以由图1中所示的颜色阴影估计模块15和校正模块16执行。应理解,图3示出了颜色阴影校正的方法的步骤或操作,但这些步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图3中的各个操作的变形。此外,图3中的各个步骤可以按照与图3呈现的不同的顺序来执行,并且有可能并非要执行图3中的全部操作。FIG. 3 is a schematic flowchart of a method for color shading correction according to an embodiment of the present application. Specifically, the method can be performed by the color shading estimation module 15 and the correction module 16 shown in FIG. It should be understood that FIG. 3 illustrates the steps or operations of the method of color shading correction, but these steps or operations are merely examples, and other embodiments of the present application may also perform other operations or variations of the various operations in FIG. Moreover, the various steps in FIG. 3 may be performed in a different order than that presented in FIG. 3, and it is possible that not all operations in FIG. 3 are to be performed.

301,接收第一图像。301. Receive a first image.

具体的,可以使用图1中的图像传感器13来采集图像。具体而言,镜头12将一个具体场景反射的光投射至图像传感器13,图像传感器13可以将该数字图像信号发送至预处理模块14,预处理模块14对该数字图像信号进行坏点校正、黑电平补偿等操作,然后将 预处理之后的数字图像输入至颜色阴影估计模块15。这里,该数字图像信号可以称为图像或者图像数据。Specifically, the image sensor 13 of FIG. 1 can be used to acquire an image. Specifically, the lens 12 projects light reflected by a specific scene to the image sensor 13, and the image sensor 13 can transmit the digital image signal to the pre-processing module 14, and the pre-processing module 14 performs dead-point correction on the digital image signal, black. An operation such as level compensation is performed, and then the digital image after the pre-processing is input to the color shading estimation module 15. Here, the digital image signal may be referred to as image or image data.

302,确定所述第一图像中的每个像素点的色调值。302. Determine a tone value of each pixel in the first image.

这里,色调值包括rg色调分量h rg和bg色调分量h bg。具体的,颜色阴影估计模块15可以根据301中接收的图像的RGB值获得该图像的每个像素点的rg色调分量h rg和bg色调分量h bgHere, the tone value includes the rg tone component h rg and the bg tone component h bg . Specifically, the color shading estimation module 15 can obtain the rg hue component h rg and the bg hue component h bg of each pixel of the image according to the RGB values of the image received in 301.

303,在所述第一图像中提取第一像素点,第一像素点为色调变化平缓的像素点。303. Extract a first pixel point in the first image, where the first pixel point is a pixel point whose tone change is gentle.

这时,可以分别对302中确定的每个像素点的h rg和h bg进行对数运算,得到H rg和H bg。下一步可以分别对H rg和H bg求梯度得到

Figure PCTCN2018106645-appb-000022
Figure PCTCN2018106645-appb-000023
其中
Figure PCTCN2018106645-appb-000024
可以表示H rg的变化程度,
Figure PCTCN2018106645-appb-000025
可以表示H bg的变化程度。 At this time, the logarithm operations of h rg and h bg of each pixel determined in 302 can be respectively performed to obtain H rg and H bg . The next step is to obtain a gradient for H rg and H bg respectively.
Figure PCTCN2018106645-appb-000022
with
Figure PCTCN2018106645-appb-000023
among them
Figure PCTCN2018106645-appb-000024
Can indicate the degree of change in H rg ,
Figure PCTCN2018106645-appb-000025
It can indicate the degree of change in H bg .

这时,可以根据

Figure PCTCN2018106645-appb-000026
确定图像中rg色调的色调变化平缓的像素点,根据
Figure PCTCN2018106645-appb-000027
确定图像中bg色调的色调变化平缓的像素点。这里,可以称色调变化平缓的像素点为第一像素点,将第一像素点所属的区域称为第一区域。也就是说,第一区域中的第一像素点的色调变化小于或等于阈值。 At this time, according to
Figure PCTCN2018106645-appb-000026
Determining the pixel point of the rg tone in the image with a gentle change in color, according to
Figure PCTCN2018106645-appb-000027
A pixel point in which the hg of the bg tone in the image changes gently is determined. Here, a pixel point whose tone change is gentle may be referred to as a first pixel point, and an area to which the first pixel point belongs may be referred to as a first area. That is, the change in hue of the first pixel in the first region is less than or equal to the threshold.

具体而言,rg色调的第一区域可以表示为R rg,则: Specifically, the first region of the rg hue can be expressed as R rg , then:

Figure PCTCN2018106645-appb-000028
Figure PCTCN2018106645-appb-000028

其中x为R rg中的任意一个像素点,即第一像素点,th rg为rg色调的色调变化阈值。 Where x is any one of R rg , ie the first pixel, and th rg is the hue change threshold of the rg hue.

bg色调的第一区域可以表示为R bg,则: The first region of the bg hue can be expressed as R bg , then:

Figure PCTCN2018106645-appb-000029
Figure PCTCN2018106645-appb-000029

其中x为R bg中的任意一个像素点,即第一像素点,th bg为bg色调的色调变化阈值。 Where x is any one of R bg , ie the first pixel, and th bg is the hue change threshold of bg hue.

可理解,因为301中获取的第一图像对应的场景可以为实际中的一个具体场景,因此该图像可以具有丰富的色彩。本申请实施例中,如果图像的色调变化比较大,则可以认为该色调变化比较大的区域的色彩为场景本身的颜色。如果图像的色调变化在比较平缓,则可以认为该色调变化平缓的区域的色彩为颜色阴影轮廓。It can be understood that because the scene corresponding to the first image acquired in 301 can be a specific scene in reality, the image can have rich colors. In the embodiment of the present application, if the change in the hue of the image is relatively large, it can be considered that the color of the region where the hue changes is relatively large is the color of the scene itself. If the hue change of the image is relatively flat, it can be considered that the color of the area where the hue changes gently is the color shading outline.

304,利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,其中,所述特征轮廓用于表示统计得到的多个标准光源的图像的颜色阴影轮廓的特征,所述变换系数用于表示所述特征轮廓的强弱程度。304. Determine a transform coefficient of the first pixel by using a tone value of the first pixel and a feature profile of the first pixel, where the feature profile is used to represent a plurality of standard light sources obtained by statistics A feature of a color shaded outline of the image, the transform coefficient being used to indicate the degree of strength of the feature profile.

具体而言,颜色阴影估计模块15可以根据预先存储的图像的每个像素点的一组特征轮廓和第一区域的像素点的坐标,确定第一区域的特征轮廓。这里,预先存储的每个像素点的一组特征轮廓可以是根据上述图2所示的方法确定的特征轮廓。Specifically, the color shadow estimation module 15 may determine the feature contour of the first region according to a set of feature contours of each pixel point of the pre-stored image and coordinates of the pixel points of the first region. Here, a set of feature contours of each pixel point stored in advance may be a feature profile determined according to the method shown in FIG. 2 described above.

然后,根据所述第一区域中的第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一区域的变换系数。步骤304可以由颜色阴影估计模块15执行。Then, a transform coefficient of the first region is determined according to a tone value of the first pixel in the first region and a feature contour of the first pixel. Step 304 can be performed by color shading estimation module 15.

这时,可以定义第一区域的变换系数

Figure PCTCN2018106645-appb-000030
则有: At this time, the transform coefficient of the first region can be defined.
Figure PCTCN2018106645-appb-000030
Then there are:

Figure PCTCN2018106645-appb-000031
Figure PCTCN2018106645-appb-000031

其中,x代表所述第一像素点,f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的维度,N为大于1的正整数,H(x)表示x处的色调值的对数。 Wherein x represents the first pixel point, F k (x) is the k-dimensional feature profile of x, A is a transform coefficient k F k (x) is, B k is F k (x) the translation factor And a k + b k =1, k ranges from 1 to N and represents the dimension of the feature profile, N is a positive integer greater than 1, and H(x) represents the logarithm of the hue value at x.

具体的,对于rg色调,可以定义第一区域的变换系数

Figure PCTCN2018106645-appb-000032
则有: Specifically, for the rg hue, the transform coefficient of the first region can be defined.
Figure PCTCN2018106645-appb-000032
Then there are:

Figure PCTCN2018106645-appb-000033
Figure PCTCN2018106645-appb-000033

对于bg色调,可以定义第一区域的变换系数

Figure PCTCN2018106645-appb-000034
则有: For bg hue, the transform coefficient of the first region can be defined
Figure PCTCN2018106645-appb-000034
Then there are:

Figure PCTCN2018106645-appb-000035
Figure PCTCN2018106645-appb-000035

下面将对公式(3)的推导过程进行说明。The derivation process of equation (3) will be described below.

具体而言,颜色阴影轮廓是利用颜色阴影模型表征的该图像的颜色阴影。本申请实施例中,将第一像素点的特征轮廓代入颜色阴影模型,可以得到第一像素点的颜色阴影轮廓的函数表达式。也就是说,这时可以将第一区域中的第一像素点的颜色阴影轮廓表示为所述第一像素点的变换系数的函数,其中,第一像素点的变换系数为自变量,第一像素点的颜色阴影轮廓为因变量。In particular, a color shaded outline is a color shade of the image that is characterized using a color shading model. In the embodiment of the present application, the feature contour of the first pixel point is substituted into the color shadow model, and a function expression of the color shadow contour of the first pixel point can be obtained. That is, the color shadow contour of the first pixel in the first region may be represented as a function of the transform coefficient of the first pixel, wherein the transform coefficient of the first pixel is an independent variable, first The color shadow outline of a pixel is a dependent variable.

色调值为所提取的图像的实际的图像信号。此时可以令第一像素点的色调值与第一像素点的颜色阴影轮廓相等,即:The tone value is the actual image signal of the extracted image. At this point, the hue value of the first pixel point can be made equal to the color shadow outline of the first pixel point, namely:

Figure PCTCN2018106645-appb-000036
Figure PCTCN2018106645-appb-000036

其中,h(x)为第一区域的色调值。Where h(x) is the hue value of the first region.

对等式(4)两边分别先取对数,再求梯度,可得:For the two sides of equation (4), first take the logarithm and then find the gradient, then you can get:

Figure PCTCN2018106645-appb-000037
Figure PCTCN2018106645-appb-000037

可以理解,在颜色阴影模型为理想模型时上述等式(4)和等式(5)成立。而在实际应用中,图像的色调值的对数的梯度与利用颜色阴影模型所表征的颜色阴影的对数的梯度往往不会完全相等。此时,图像的色调值的对数的梯度与利用颜色阴影模型所表征的颜色阴影的对数的梯度越接近,则表示根据颜色阴影模型表征的颜色阴影越能反映图像实际的颜色阴影。因此,可以确定第一像素点的实际的色调值的对数的梯度与第一像素点的颜色阴影轮廓的对数的梯度最接近时,变换系数

Figure PCTCN2018106645-appb-000038
的取值为第一像素点的变换系数的最优值。具体而言,上述公式(3)即表示
Figure PCTCN2018106645-appb-000039
为第一像素点的实际的色调值的对数的梯度与第一像素点的颜色阴影轮廓的对数的梯度的差值最小时
Figure PCTCN2018106645-appb-000040
的取值。 It can be understood that the above equations (4) and (5) are established when the color shading model is an ideal model. In practical applications, the gradient of the logarithm of the tonal value of the image and the logarithm of the color shade represented by the color shading model are often not exactly equal. At this time, the closer the gradient of the logarithm of the hue value of the image to the gradient of the logarithm of the color shading represented by the color shading model, the more the color shading represented by the color shading model reflects the actual color shading of the image. Therefore, it can be determined that when the gradient of the logarithm of the actual tone value of the first pixel point is closest to the gradient of the logarithm of the color shadow profile of the first pixel point, the transform coefficient
Figure PCTCN2018106645-appb-000038
The value of the value is the optimum value of the transform coefficient of the first pixel. Specifically, the above formula (3) means
Figure PCTCN2018106645-appb-000039
When the difference between the gradient of the logarithm of the actual tone value of the first pixel point and the gradient of the logarithm of the color shadow profile of the first pixel point is the smallest
Figure PCTCN2018106645-appb-000040
The value.

应理解,本申请实施例中,变换系数

Figure PCTCN2018106645-appb-000041
的取值并不限定于上述公式(3),例如还可以确定变换系数
Figure PCTCN2018106645-appb-000042
为第一像素点的实际的色调值的对数的梯度与第一像素点的颜色阴影轮廓的对数的梯度的比值最接近1时
Figure PCTCN2018106645-appb-000043
的取值,本申请实施例对此不限定。 It should be understood that, in the embodiment of the present application, the transform coefficient
Figure PCTCN2018106645-appb-000041
The value is not limited to the above formula (3), for example, the transform coefficient can also be determined.
Figure PCTCN2018106645-appb-000042
The ratio of the gradient of the logarithm of the actual tone value of the first pixel to the gradient of the logarithm of the color shadow profile of the first pixel is closest to 1
Figure PCTCN2018106645-appb-000043
The value of the application is not limited in this embodiment.

305,根据所述第一像素点的变换系数和颜色阴影模型,确定所述第一图像中的第二像素点的颜色阴影轮廓,其中,所述颜色阴影模型用于表示所述图像的颜色阴影轮廓、特征轮廓以及变换系数之间的映射关系。305. Determine, according to a transform coefficient and a color shadow model of the first pixel, a color shadow contour of a second pixel in the first image, where the color shadow model is used to represent a color shadow of the image. The mapping between contours, feature contours, and transform coefficients.

这里,称第一图像中的像素点为第二像素点。本申请实施例中,可以将第一区域中的第一像素点的变换系数作为所获取的第一图像中的第二像素点的变换系数。也就是说,本申请实施例中,图像中的各个像素点的变换系数是相同的。这时,可以将该变换系数和第二像素点的特征轮廓带入图像颜色阴影模型中,合成图像的颜色阴影轮廓。Here, the pixel point in the first image is referred to as the second pixel point. In the embodiment of the present application, the transform coefficient of the first pixel in the first region may be used as the transform coefficient of the second pixel in the acquired first image. That is to say, in the embodiment of the present application, the transform coefficients of the respective pixel points in the image are the same. At this time, the transform coefficient and the feature contour of the second pixel point can be brought into the image color shadow model to synthesize the color shadow outline of the image.

这时,所述第二像素点x'的颜色阴影轮廓s(x')为以下形式:At this time, the color shadow outline s(x') of the second pixel point x' is in the following form:

Figure PCTCN2018106645-appb-000044
Figure PCTCN2018106645-appb-000044

其中,f k(x')为x'的特征轮廓,a k为f k(x')的变换系数,b k为f k(x')的平移系数,且a k+b k=1,N为大于1的正整数且代表所述特征轮廓f k(x')的个数,k的取值范围为1至N。 Feature profile wherein, f k (x ') is of x', a k is f k (x ') of transform coefficients, b k is f k (x') of the translation factor and a k + b k = 1, N is a positive integer greater than 1 and represents the number of the characteristic contours f k (x'), and k ranges from 1 to N.

具体而言,对于rg色调,根据计算出的第一图像的模型参数

Figure PCTCN2018106645-appb-000045
可以确定第一图像的rg色调的颜色阴影轮廓为: Specifically, for the rg hue, based on the calculated model parameters of the first image
Figure PCTCN2018106645-appb-000045
The color shadow outline of the rg hue of the first image can be determined as:

Figure PCTCN2018106645-appb-000046
Figure PCTCN2018106645-appb-000046

对于bg色调,根据计算出的第一图像的模型参数

Figure PCTCN2018106645-appb-000047
可以确定第一图像的bg色调的颜色阴影轮廓为: For the bg hue, based on the calculated model parameters of the first image
Figure PCTCN2018106645-appb-000047
It can be determined that the color shadow outline of the bg tone of the first image is:

Figure PCTCN2018106645-appb-000048
Figure PCTCN2018106645-appb-000048

S306,根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正。S306. Correct color shading of the second pixel point according to a color shadow profile of the second pixel point.

具体的,校正模块16可以根据颜色阴影估计模块15确定的图像的颜色阴影轮廓,维护校正表中的校正值。具体的,校正表可以包括图像像素点和该像素点的校正值,像素点的校正值具体可以为该像素点的颜色阴影轮廓的倒数。Specifically, the correction module 16 may maintain the correction value in the correction table according to the color shading profile of the image determined by the color shading estimation module 15. Specifically, the correction table may include an image pixel point and a correction value of the pixel point, and the correction value of the pixel point may specifically be a reciprocal of the color shadow profile of the pixel point.

具体而言,第二像素点的rg色调分量的校正值g rg(x')可以表示为: Specifically, the correction value g rg (x') of the rg hue component of the second pixel point can be expressed as:

g rg(x')=1/s rg(x'); g rg (x')=1/s rg (x');

第二像素点的bg色调的校正值g bg(x')可以表示为: The correction value g bg (x') of the bg hue of the second pixel can be expressed as:

g bg(x')=1/s bg(x'); g bg (x')=1/s bg (x');

具体的,校正模块16可以根据校正表,对第一图像的颜色阴影进行校正。Specifically, the correction module 16 can correct the color shading of the first image according to the correction table.

具体的,采用rg色调的校正表对R通道进行校正,即:Specifically, the R channel is corrected using a correction table of rg tone, namely:

r c(x')=r(x')·g rg(x')   (9) r c (x')=r(x')·g rg (x') (9)

其中,r(x')为校正之前第二像素点x'的R通道的值,r c(x')为校正之后第二像素点x'的R通道的值。 Where r(x') is the value of the R channel of the second pixel point x' before correction, and r c (x') is the value of the R channel of the second pixel point x' after correction.

采用bg色调的校正表对B通道进行校正,即:The B channel is corrected using a bg tone correction table, ie:

b c(x')=b(x)·g bg(x')   (10) b c (x')=b(x)·g bg (x') (10)

其中,b(x')为校正之前第二像素点x'的B通道的值,b c(x')为校正之后第二像素点x'的B通道的值。 Where b(x') is the value of the B channel of the second pixel point x' before correction, and b c (x') is the value of the B channel of the second pixel point x' after correction.

在校正模块16根据校正表对第一区域的颜色阴影进行校正之后,校正模块16将图像数据传递给后续处理模块17进行图像处理。After the correction module 16 corrects the color shading of the first region based on the correction table, the correction module 16 passes the image data to the subsequent processing module 17 for image processing.

本申请实施例首先提取第一图像的第一区域中的第一像素点的色调值,然后根据该第一像素点的色调值和该第一像素点的特征轮廓,确定该第一像素点的模型参数(即变换系数),进一步该第一像素点的模型参数和颜色阴影模型,确定第一图像的颜色阴影轮廓,最后根据该第一图像的颜色阴影轮廓对该第一图像的颜色阴影进行校正。由于本申请实施例通过直接使用图像的色调值来确定模型参数,而并不依赖于白平衡等其他模块获取模型参数,因而本申请实施例能够准确地确定模型参数。并且,本申请实施例中特征轮廓能够表征某一具体因素或统计特征所造成的颜色阴影,颜色阴影模型能够准确的表征复杂的颜色阴影轮廓,因而本申请实施例能够准确地对图像的颜色阴影进行校正。The embodiment of the present application first extracts a tone value of the first pixel in the first region of the first image, and then determines the first pixel according to the tone value of the first pixel and the feature contour of the first pixel. Model parameters (ie, transform coefficients), further the model parameters and color shading models of the first pixel, determining a color shading contour of the first image, and finally performing color shading on the first image according to the color shading contour of the first image Correction. Since the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters. Moreover, in the embodiment of the present application, the feature contour can represent the color shadow caused by a specific factor or a statistical feature, and the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.

图4示出了本申请实施例的一种颜色阴影校正的装置400的示意性框图。该装置400 可以为手机、数码相机、平板电脑、个人数字助理或其他可以捕获图像的装置,或者桌式电脑、视频会议台或其他使用内部或外部相机来捕获图像的装置。具体的,该装置400包括接收单元410、提取单元420、确定单元430和校正单元440。FIG. 4 shows a schematic block diagram of a color shading correction apparatus 400 in accordance with an embodiment of the present application. The device 400 can be a cell phone, a digital camera, a tablet, a personal digital assistant, or other device that can capture images, or a desktop computer, video conferencing station, or other device that captures images using internal or external cameras. Specifically, the apparatus 400 includes a receiving unit 410, an extracting unit 420, a determining unit 430, and a correcting unit 440.

接收单元410,用于接收第一图像。The receiving unit 410 is configured to receive the first image.

提取单元420,用于提取所述第一图像中的第一区域中的第一像素点的色调值,其中,所述第一像素点的色调值的梯度小于或等于阈值。The extracting unit 420 is configured to extract a tone value of the first pixel in the first region in the first image, wherein a gradient of the tone value of the first pixel is less than or equal to a threshold.

确定单元430,用于利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,其中,所述特征轮廓用于表示统计得到的多个标准光源的图像中的像素点的颜色阴影轮廓的特征,所述变换系数用于表示所述特征轮廓的强弱程度。a determining unit 430, configured to determine, by using a tone value of the first pixel point and a feature contour of the first pixel point, a transform coefficient of the first pixel point, where the feature contour is used to represent a statistically obtained A feature of a color shaded outline of a pixel point in an image of a plurality of standard light sources, the transform coefficient being used to indicate a degree of strength of the feature outline.

所述确定单元430还用于根据所述第一像素点的变换系数和颜色阴影模型,确定所述第一图像中的第二像素点的颜色阴影轮廓,其中,所述颜色阴影模型用于表示图像中的像素点的颜色阴影轮廓、特征轮廓以及变换系数之间的映射关系。The determining unit 430 is further configured to determine, according to the transform coefficient and the color shadow model of the first pixel, a color shadow contour of the second pixel in the first image, where the color shadow model is used to represent The mapping between the color shadow outline, the feature outline, and the transform coefficients of the pixels in the image.

校正单元440,用于根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正。The correcting unit 440 is configured to correct a color shadow of the second pixel point according to a color shadow profile of the second pixel point.

本申请实施例首先提取第一图像的第一区域中的第一像素点的色调值,然后根据该第一像素点的色调值和该第一像素点的特征轮廓,确定该第一像素点的模型参数(即变换系数),进一步该第一像素点的模型参数和颜色阴影模型,确定第一图像的颜色阴影轮廓,最后根据该第一图像的颜色阴影轮廓对该第一图像的颜色阴影进行校正。由于本申请实施例通过直接使用图像的色调值来确定模型参数,而并不依赖于白平衡等其他模块获取模型参数,因而本申请实施例能够准确地确定模型参数。并且,本申请实施例中特征轮廓能够表征某一具体因素或统计特征所造成的颜色阴影,颜色阴影模型能够准确的表征复杂的颜色阴影轮廓,因而本申请实施例能够准确地对图像的颜色阴影进行校正。The embodiment of the present application first extracts a tone value of the first pixel in the first region of the first image, and then determines the first pixel according to the tone value of the first pixel and the feature contour of the first pixel. Model parameters (ie, transform coefficients), further the model parameters and color shading models of the first pixel, determining a color shading contour of the first image, and finally performing color shading on the first image according to the color shading contour of the first image Correction. Since the embodiment of the present application determines the model parameters by directly using the tonal value of the image, and does not rely on other modules such as white balance to acquire the model parameters, the embodiment of the present application can accurately determine the model parameters. Moreover, in the embodiment of the present application, the feature contour can represent the color shadow caused by a specific factor or a statistical feature, and the color shadow model can accurately represent the complex color shadow contour, and thus the embodiment of the present application can accurately image the color shadow of the image. Make corrections.

可选的,所述提取单元420还用于提取所述多个标准光源的平场图像的像素点的颜色阴影轮廓。所述确定单元430还用于确定所述多个标准光源的平场图像的像素点的颜色阴影轮廓的特征向量,并根据所述特征向量确定所述特征轮廓。Optionally, the extracting unit 420 is further configured to extract a color shadow profile of a pixel point of the flat field image of the plurality of standard light sources. The determining unit 430 is further configured to determine a feature vector of a color shadow contour of a pixel point of the flat field image of the plurality of standard light sources, and determine the feature contour according to the feature vector.

可选的,所述确定单元430具体用于:Optionally, the determining unit 430 is specifically configured to:

根据以下公式,确定所述第一像素点的变换系数:Determining the transform coefficients of the first pixel according to the following formula:

Figure PCTCN2018106645-appb-000049
Figure PCTCN2018106645-appb-000049

其中,x代表所述第一像素点,

Figure PCTCN2018106645-appb-000050
为x的变换系数且
Figure PCTCN2018106645-appb-000051
f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的维度,N为大于1的正整数,H(x)表示x处的色调值的对数。 Where x represents the first pixel point,
Figure PCTCN2018106645-appb-000050
Is the transform coefficient of x and
Figure PCTCN2018106645-appb-000051
F k (x) is the k-dimensional feature profile of x, A k is a transform coefficient F k (x) is, B k is F k (x) the translation factor and a k + b k = 1, k is The value ranges from 1 to N and represents the dimension of the feature profile, N is a positive integer greater than 1, and H(x) represents the logarithm of the tone value at x.

可选的,颜色阴影模型可以具有如下形式:Alternatively, the color shading model can have the following form:

Figure PCTCN2018106645-appb-000052
Figure PCTCN2018106645-appb-000052

其中,s(x)表示x的颜色阴影轮廓,f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,k的取值范围为1至N且代表所述特征轮廓的个数,N 为大于1的正整数。本申请实施例中,约定无颜色阴影处f k(x)=1,则为了保持f k(x)的归一化特性,a k+b k=1。 Wherein, s (x) denotes a color shading profile of x, f k (x) for the first K x dimension of the feature profile, a k is f k (x) of transform coefficients, b k is f k (x) is translated The coefficient, k, ranges from 1 to N and represents the number of features, and N is a positive integer greater than one. In the embodiment of the present application, it is agreed that the colorless shadow f k (x)=1, in order to maintain the normalized property of f k (x), a k +b k =1.

本申请实施例中,变换系数a k用于描述该变换系数a k对应的特征轮廓f k(x)的强弱程度。因此,本申请实施例中的颜色阴影模型通过采用多个特征轮廓相乘的方式,能够表征多个因素或统计特征叠加时的颜色阴影分量。 In the embodiment of the present application, the transform coefficient a k is used to describe the degree of strength of the feature contour f k (x) corresponding to the transform coefficient a k . Therefore, the color shading model in the embodiment of the present application can characterize a plurality of factors or color shading components when statistical features are superimposed by multiplying a plurality of feature contours.

可选的,所述确定单元430确定的所述第二像素点的颜色阴影轮廓为:Optionally, the color shadow profile of the second pixel determined by the determining unit 430 is:

Figure PCTCN2018106645-appb-000053
Figure PCTCN2018106645-appb-000053

其中,x'代表所述第二像素点,s(x')表示x'的颜色阴影轮廓,f k(x')为x'的第k维的特征轮廓,a k为f k(x')的变换系数,b k为f k(x')的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。 Wherein, x 'representing the second pixel, s (x') represented by x 'shadow color profile, f k (x') as x 'of the k-dimensional feature profile, a k is F k (x' The transform coefficient, b k is the translation coefficient of f k (x'), and a k +b k =1, k ranges from 1 to N and represents the number of features, N is greater than 1 Positive integer.

所述校正单元具体用于:The correction unit is specifically configured to:

将所述第二像素点的颜色阴影轮廓的倒数确定为所述第二像素点的校正值;Determining a reciprocal of a color shadow profile of the second pixel point as a correction value of the second pixel point;

根据所述第二像素点的校正值对所述第二像素点的颜色阴影进行校正。应注意,本发明实施例中,接收单元410、提取单元420、确定单元430和校正单元440可以由处理器实现。如图5所示,颜色阴影校正的装置600可以包括处理器610和存储器620。其中,存储器620可以用于存储特征轮廓和处理器610执行的代码等。Correcting the color shading of the second pixel point according to the correction value of the second pixel point. It should be noted that, in the embodiment of the present invention, the receiving unit 410, the extracting unit 420, the determining unit 430, and the correcting unit 440 may be implemented by a processor. As shown in FIG. 5, the color shading correction device 600 can include a processor 610 and a memory 620. The memory 620 can be used to store feature contours and code executed by the processor 610, and the like.

在实现过程中,上述方法的各步骤可以通过处理器610中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器620,处理器610读取存储器620中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 610 or an instruction in a form of software. The steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in the memory 620, and the processor 610 reads the information in the memory 620 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

图4所示的颜色阴影校正的装置400或图5所示的颜色阴影校正的装置600能够实现前述图2和图3所示的方法实施例对应的各个过程,具体的,该颜色阴影校正的装置400或颜色阴影校正的装置600可以参见上述图2和图3中的描述,为避免重复,这里不再赘述。The color shading correction device 400 shown in FIG. 4 or the color shading correction device 600 shown in FIG. 5 can implement the respective processes corresponding to the method embodiments shown in FIG. 2 and FIG. 3, specifically, the color shading correction. For the device 400 or the color shading correction device 600, reference may be made to the descriptions in FIG. 2 and FIG. 3 above. To avoid repetition, details are not described herein again.

应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in the various embodiments of the present application, the size of the sequence numbers of the foregoing processes does not mean the order of execution sequence, and the order of execution of each process should be determined by its function and internal logic, and should not be applied to the embodiment of the present application. The implementation process constitutes any limitation.

本申请实施例还提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行上述方法实施例中对应的方法的指令。The embodiment of the present application further provides a computer readable medium for storing a computer program, the computer program comprising instructions for executing a corresponding method in the foregoing method embodiment.

本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被颜色阴影校正的装置的处理器运行时,使得该颜色阴影校正的装置执行上述任方法实施例中对应的方法。The embodiment of the present application further provides a computer program product, comprising: computer program code, when the computer program code is run by a processor of a device for color shading correction, causing the color shading correction device to execute The corresponding method in any of the above method embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of the present application should be determined by the scope of the claims.

Claims (12)

一种颜色阴影校正的方法,其特征在于,包括:A method for color shading correction, comprising: 接收第一图像;Receiving a first image; 提取所述第一图像中的第一像素点的色调值,其中,所述第一像素点的色调值的梯度小于或等于阈值;Extracting a tone value of the first pixel in the first image, wherein a gradient of a tone value of the first pixel is less than or equal to a threshold; 利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,其中,所述特征轮廓用于表示统计得到的多个标准光源的图像中的像素点的颜色阴影轮廓的特征,所述变换系数用于表示所述特征轮廓的强弱程度;Determining a transform coefficient of the first pixel point by using a tone value of the first pixel point and a feature profile of the first pixel point, wherein the feature profile is used to represent an image of a plurality of statistically derived standard light sources a feature of a color shaded outline of a pixel in which the transform coefficient is used to indicate a degree of strength of the feature outline; 根据所述第一像素点的变换系数和颜色阴影模型,确定所述第一图像中的第二像素点的颜色阴影轮廓,其中,所述颜色阴影模型用于表示图像中的像素点的颜色阴影轮廓、特征轮廓以及变换系数之间的映射关系;Determining a color shadow profile of a second pixel point in the first image according to a transform coefficient and a color shadow model of the first pixel, wherein the color shadow model is used to represent a color shadow of a pixel point in the image a mapping relationship between contours, feature contours, and transform coefficients; 根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正。Correcting the color shading of the second pixel point according to the color shading profile of the second pixel point. 根据权利要求1所述的方法,其特征在于,所述利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,包括:The method according to claim 1, wherein the determining a transform coefficient of the first pixel by using a tone value of the first pixel and a feature profile of the first pixel includes: 根据以下公式,确定所述第一像素点的变换系数:Determining the transform coefficients of the first pixel according to the following formula:
Figure PCTCN2018106645-appb-100001
Figure PCTCN2018106645-appb-100001
其中,x代表所述第一像素点,
Figure PCTCN2018106645-appb-100002
为x的变换系数且
Figure PCTCN2018106645-appb-100003
f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的维度,N为大于1的正整数,H(x)表示x处的色调值的对数。
Where x represents the first pixel point,
Figure PCTCN2018106645-appb-100002
Is the transform coefficient of x and
Figure PCTCN2018106645-appb-100003
F k (x) is the k-dimensional feature profile of x, A k is a transform coefficient F k (x) is, B k is F k (x) the translation factor and a k + b k = 1, k is The value ranges from 1 to N and represents the dimension of the feature profile, N is a positive integer greater than 1, and H(x) represents the logarithm of the tone value at x.
根据权利要求1或2所述的方法,其特征在于,所述第二像素点的颜色阴影轮廓为:The method according to claim 1 or 2, wherein the color shadow outline of the second pixel point is:
Figure PCTCN2018106645-appb-100004
Figure PCTCN2018106645-appb-100004
其中,x'代表所述第二像素点,s(x')表示x'的颜色阴影轮廓,f k(x')为x'的第k维的特征轮廓,a k为f k(x')的变换系数,b k为f k(x')的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。 Wherein, x 'representing the second pixel, s (x') represented by x 'shadow color profile, f k (x') as x 'of the k-dimensional feature profile, a k is F k (x' The transform coefficient, b k is the translation coefficient of f k (x'), and a k +b k =1, k ranges from 1 to N and represents the number of features, N is greater than 1 Positive integer.
根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正包括:The method according to any one of claims 1 to 3, wherein the correcting the color shading of the second pixel point according to the color shading contour of the second pixel point comprises: 将所述第二像素点的颜色阴影轮廓的倒数确定为所述第二像素点的校正值;Determining a reciprocal of a color shadow profile of the second pixel point as a correction value of the second pixel point; 根据所述第二像素点的校正值对所述第二像素点的颜色阴影进行校正。Correcting the color shading of the second pixel point according to the correction value of the second pixel point. 根据权利要求1-4任一项所述的方法,其特征在于,所述利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数之前,还包括:The method according to any one of claims 1 to 4, wherein the determining the transformation of the first pixel point by using a tone value of the first pixel point and a feature contour of the first pixel point Before the coefficient, it also includes: 提取所述多个标准光源的平场图像的像素点的颜色阴影轮廓;Extracting a color shadow outline of a pixel point of the flat field image of the plurality of standard light sources; 确定所述多个标准光源的平场图像的像素点的颜色阴影轮廓的特征向量,并根据所述特征向量确定所述特征轮廓。Determining a feature vector of a color shadow profile of a pixel of the flat field image of the plurality of standard light sources, and determining the feature profile based on the feature vector. 一种颜色阴影校正的装置,其特征在于,包括:A device for color shading correction, comprising: 接收单元,用于接收第一图像;a receiving unit, configured to receive the first image; 提取单元,用于提取所述第一图像中的第一像素点的色调值,其中,所述第一像素点的色调值的梯度小于或等于阈值;An extracting unit, configured to extract a tone value of a first pixel in the first image, wherein a gradient of a tone value of the first pixel is less than or equal to a threshold; 确定单元,用于利用所述第一像素点的色调值和所述第一像素点的特征轮廓,确定所述第一像素点的变换系数,其中,所述特征轮廓用于表示统计得到的多个标准光源的图像中的像素点的颜色阴影轮廓的特征,所述变换系数用于表示所述特征轮廓的强弱程度;a determining unit, configured to determine, by using a tone value of the first pixel point and a feature contour of the first pixel point, a transform coefficient of the first pixel point, wherein the feature contour is used to represent a statistically obtained a feature of a color shaded outline of a pixel in an image of a standard light source, the transform coefficient being used to indicate a degree of strength of the feature outline; 所述确定单元还用于根据所述第一像素点的变换系数和颜色阴影模型,确定所述第一图像中的第二像素点的颜色阴影轮廓,其中,所述颜色阴影模型用于表示图像中的像素点的颜色阴影轮廓、特征轮廓以及变换系数之间的映射关系;The determining unit is further configured to determine a color shadow profile of the second pixel point in the first image according to the transform coefficient and the color shadow model of the first pixel, wherein the color shadow model is used to represent the image a color shadow contour, a feature contour, and a mapping relationship between transform coefficients of the pixel in the pixel; 校正单元,用于根据所述第二像素点的颜色阴影轮廓,对所述第二像素点的颜色阴影进行校正。And a correcting unit, configured to correct a color shadow of the second pixel point according to a color shadow profile of the second pixel point. 根据权利要求6所述的装置,其特征在于,所述确定单元具体用于:The device according to claim 6, wherein the determining unit is specifically configured to: 根据以下公式,确定所述第一像素点的变换系数:Determining the transform coefficients of the first pixel according to the following formula:
Figure PCTCN2018106645-appb-100005
Figure PCTCN2018106645-appb-100005
其中,x代表所述第一像素点,
Figure PCTCN2018106645-appb-100006
为x的变换系数且
Figure PCTCN2018106645-appb-100007
f k(x)为x的第k维的特征轮廓,a k为f k(x)的变换系数,b k为f k(x)的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的维度,N为大于1的正整数,H(x)表示x处的色调值的对数。
Where x represents the first pixel point,
Figure PCTCN2018106645-appb-100006
Is the transform coefficient of x and
Figure PCTCN2018106645-appb-100007
F k (x) is the k-dimensional feature profile of x, A k is a transform coefficient F k (x) is, B k is F k (x) the translation factor and a k + b k = 1, k is The value ranges from 1 to N and represents the dimension of the feature profile, N is a positive integer greater than 1, and H(x) represents the logarithm of the tone value at x.
根据权利要求6或7所述的装置,其特征在于,所述确定单元确定所述第二像素点的颜色阴影轮廓为:The apparatus according to claim 6 or 7, wherein the determining unit determines a color shading profile of the second pixel point as:
Figure PCTCN2018106645-appb-100008
Figure PCTCN2018106645-appb-100008
其中,x'代表所述第二像素点,s(x')表示x'的颜色阴影轮廓,f k(x')为x'的第k维的特征轮廓,a k为f k(x')的变换系数,b k为f k(x')的平移系数,且a k+b k=1,k的取值范围为1至N且代表所述特征轮廓的个数,N为大于1的正整数。 Wherein, x 'representing the second pixel, s (x') represented by x 'shadow color profile, f k (x') as x 'of the k-dimensional feature profile, a k is F k (x' The transform coefficient, b k is the translation coefficient of f k (x'), and a k +b k =1, k ranges from 1 to N and represents the number of features, N is greater than 1 Positive integer.
根据权利要求6-8任一项所述的装置,其特征在于,所述校正单元具体用于:The device according to any one of claims 6-8, wherein the correcting unit is specifically configured to: 将所述第二像素点的颜色阴影轮廓的倒数确定为所述第二像素点的校正值;Determining a reciprocal of a color shadow profile of the second pixel point as a correction value of the second pixel point; 根据所述第二像素点的校正值对所述第二像素点的颜色阴影进行校正。Correcting the color shading of the second pixel point according to the correction value of the second pixel point. 根据权利要求6-9任一项所述的装置,其特征在于,还包括:The device according to any one of claims 6-9, further comprising: 所述提取单元还用于提取所述多个标准光源的平场图像的像素点的颜色阴影轮廓;The extracting unit is further configured to extract a color shadow profile of a pixel point of the flat field image of the plurality of standard light sources; 所述确定单元还用于确定所述多个标准光源的平场图像的像素点的颜色阴影轮廓的特征向量,并根据所述特征向量确定所述特征轮廓。The determining unit is further configured to determine a feature vector of a color shadow profile of a pixel point of the flat field image of the plurality of standard light sources, and determine the feature contour according to the feature vector. 一种颜色阴影校正的装置,其特征在于,包括:存储器和处理器,其中,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,以使得所述处理器执行如权利要求1-5任一项所述的方法。A color shading correction apparatus, comprising: a memory and a processor, wherein the memory is for storing an instruction, the processor is configured to execute the memory stored instruction, so that the processor executes as A method as claimed in any one of claims 1 to 5. 一种计算机可读介质,其特征在于,所述计算机可读介质用于存储计算机程序,所述计算机程序包括用于执行如权利要求1-5任一项所述的方法的指令。A computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of any of claims 1-5.
PCT/CN2018/106645 2017-09-29 2018-09-20 Color shading correction method and device Ceased WO2019062633A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710911423.2 2017-09-29
CN201710911423.2A CN109587466B (en) 2017-09-29 2017-09-29 Method and apparatus for color shading correction

Publications (1)

Publication Number Publication Date
WO2019062633A1 true WO2019062633A1 (en) 2019-04-04

Family

ID=65900594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106645 Ceased WO2019062633A1 (en) 2017-09-29 2018-09-20 Color shading correction method and device

Country Status (2)

Country Link
CN (1) CN109587466B (en)
WO (1) WO2019062633A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12273662B2 (en) 2020-01-15 2025-04-08 Huawei Technologies Co., Ltd. Image processing method and apparatus, terminal, and storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110298351A (en) * 2019-06-21 2019-10-01 上海邻致科技有限公司 A kind of method and device of color of image identification storage
CN112712568B (en) * 2020-12-16 2024-07-19 杭州博联智能科技股份有限公司 Color brightness recognition method, device, equipment and medium
CN112862714B (en) * 2021-02-03 2024-12-17 维沃移动通信有限公司 Image processing method and device
CN114972047B (en) * 2021-02-24 2025-05-27 北京小米移动软件有限公司 Image processing method, device and storage medium
CN113132695B (en) * 2021-04-21 2023-04-25 维沃移动通信有限公司 Lens shading correction method and device and electronic equipment
CN116405614B (en) * 2022-06-10 2024-01-30 上海玄戒技术有限公司 Lens shading correction method and device, electronic equipment, chip and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070119150A (en) * 2006-06-14 2007-12-20 주식회사 아이닉스 Shadow Compensation Device and Compensation Method
CN102313973A (en) * 2010-07-07 2012-01-11 奥林巴斯映像株式会社 Camera head with light path reflection-type zoom lens
CN103561206A (en) * 2007-04-24 2014-02-05 帝欧希数字光学科技(欧洲)有限公司 Techniques for adjusting the effect of applying kernels to signals to achieve desired effect on signals

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298781B (en) * 2011-08-16 2014-06-25 长沙中意电子科技有限公司 Motion shadow detection method based on color and gradient characteristics
CN103377474B (en) * 2012-04-27 2016-08-03 比亚迪股份有限公司 Camera lens shadow correction coefficient determines method, camera lens shadow correction method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070119150A (en) * 2006-06-14 2007-12-20 주식회사 아이닉스 Shadow Compensation Device and Compensation Method
CN103561206A (en) * 2007-04-24 2014-02-05 帝欧希数字光学科技(欧洲)有限公司 Techniques for adjusting the effect of applying kernels to signals to achieve desired effect on signals
CN102313973A (en) * 2010-07-07 2012-01-11 奥林巴斯映像株式会社 Camera head with light path reflection-type zoom lens

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12273662B2 (en) 2020-01-15 2025-04-08 Huawei Technologies Co., Ltd. Image processing method and apparatus, terminal, and storage medium

Also Published As

Publication number Publication date
CN109587466B (en) 2020-02-21
CN109587466A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109587466B (en) Method and apparatus for color shading correction
Afifi et al. When color constancy goes wrong: Correcting improperly white-balanced images
CN107451969B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN110660088A (en) An image processing method and device
EP4195662B1 (en) Color consistency correction method and device for multiple cameras
US11457189B2 (en) Device for and method of correcting white balance of image
CN112102386A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN109191403A (en) Image processing method and apparatus, electronic device, computer-readable storage medium
CN109688396B (en) Image white balance processing method and device and terminal equipment
CN108024055A (en) White balance processing method and device, mobile terminal and storage medium
WO2022257396A1 (en) Method and apparatus for determining color fringe pixel point in image and computer device
CN108230407B (en) Image processing method and device
WO2019011154A1 (en) White balance processing method and apparatus
CN108616700B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN113170028A (en) Method for generating image data of imaging algorithm based on machine learning
US9378564B2 (en) Methods for color correcting digital images and devices thereof
CN114331907A (en) Color shading correction method and device
TW201830337A (en) Method and apparatus for performing automatic white balance on images
CN107396079A (en) Method and device for adjusting white balance
CN107464225A (en) Image processing method, device, computer readable storage medium and mobile terminal
Koskinen et al. Reverse imaging pipeline for raw RGB image augmentation
TWI649724B (en) Method and apparatus for determining a light source of an image and performing color vision adaptation on the image
US20180176528A1 (en) Light locus generation for automatic white balance
CN109040598B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
US9251567B1 (en) Providing color corrections to photos

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18860175

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18860175

Country of ref document: EP

Kind code of ref document: A1