CN114793270A - Color correction method and apparatus, electronic device, and storage medium - Google Patents

Color correction method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
CN114793270A
CN114793270A CN202210418767.0A CN202210418767A CN114793270A CN 114793270 A CN114793270 A CN 114793270A CN 202210418767 A CN202210418767 A CN 202210418767A CN 114793270 A CN114793270 A CN 114793270A
Authority
CN
China
Prior art keywords
characteristic
color
data
skin
spectral
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.)
Withdrawn
Application number
CN202210418767.0A
Other languages
Chinese (zh)
Inventor
张帆
康雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TetrasAI Technology Co Ltd
Original Assignee
Shenzhen TetrasAI Technology 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 Shenzhen TetrasAI Technology Co Ltd filed Critical Shenzhen TetrasAI Technology Co Ltd
Priority to CN202210418767.0A priority Critical patent/CN114793270A/en
Publication of CN114793270A publication Critical patent/CN114793270A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Spectrometry And Color Measurement (AREA)

Abstract

The present disclosure relates to a color correction method and apparatus, an electronic device, and a storage medium, the method including: acquiring color data of a first skin image by an image sensor having a plurality of color channels; obtaining a characteristic spectral response value of the first skin image according to the characteristic response parameters of the image sensor and color data of a plurality of color channels; and obtaining a second skin image according to the characteristic spectral response value and the first skin image. According to the color correction method disclosed by the embodiment of the disclosure, the characteristic response parameters of the image sensor can be calibrated by utilizing the spectrum data of the plurality of skin samples, and an accurate characteristic spectrum response value is obtained, namely, the characteristic of the spectrum presented under the irradiation of the light source, so that the accuracy of estimating the light source can be improved, the color correction can be carried out based on the estimated light source, the accuracy of color correction can be improved, and the second skin image with higher accuracy can be obtained.

Description

Color correction method and apparatus, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a color correction method and apparatus, an electronic device, and a storage medium.
Background
In the fields of photography and medical cosmetology, accurate reduction of skin color of skin images is required, which requires obtaining skin color images with high reduction degree based on skin images photographed under different light sources. In this process, estimation of the light source (sometimes also referred to as color temperature estimation) is important.
In the related art, there are generally two types of methods for estimating the light source, i.e., estimating from a gray region and estimating from a skin color region. The gray area estimation method has good stability and high color reduction accuracy, but an accurate gray area detection result is difficult to obtain, and the overall accuracy is influenced. The reliability of skin color region detection is relatively high, but due to the diversity of skin colors, the accuracy of the skin color block calibration-based method in the related art is not high.
Disclosure of Invention
The disclosure provides a color correction method and apparatus, an electronic device, and a storage medium.
According to an aspect of the present disclosure, there is provided a color correction method including: acquiring color data of a plurality of color channels of a first skin image by an image sensor having a plurality of color channels; obtaining a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, wherein the characteristic response parameter is used for representing a relation parameter between spectral response information of the multiple color channels of the image sensor and the color data acquired by the image sensor, and the spectral response information is inherent information of the image sensor and is used for representing response information of the multiple color channels of the image sensor to a spectrum of a light source; and obtaining a second skin image after color correction according to the characteristic spectral response value and the first skin image.
According to the color correction method disclosed by the embodiment of the disclosure, the characteristic response parameters of the image sensor can be calibrated by utilizing the spectrum data of the plurality of skin samples, and an accurate characteristic spectrum response value is obtained, namely, the characteristic of the spectrum presented under the irradiation of the light source, so that the accuracy of estimating the light source can be improved, the color correction can be carried out based on the estimated light source, the accuracy of color correction can be improved, and the second skin image with higher accuracy can be obtained.
In a possible implementation manner, the obtaining a second skin image after color correction according to the characteristic spectral response value and the first skin image includes: performing light source estimation on the first skin image according to the characteristic spectral response value to obtain a light source confidence coefficient of the first skin image, wherein the light source confidence coefficient is represented as a confidence coefficient of at least one light source when the first skin image is shot; determining a white balance gain and a color correction matrix according to the light source confidence coefficient; and carrying out color correction on the first skin image according to the white balance gain and the color correction matrix to obtain the second skin image.
By the method, the confidence coefficient of the light source can be determined based on the characteristic spectrum response value, the light source during shooting is further determined, color correction can be performed based on the light source, and correction accuracy is improved.
In one possible implementation, the acquiring, by an image sensor having a plurality of color channels, color data of a plurality of color channels of a first skin image includes: detecting a skin area in an image to be processed to obtain the first skin image; color data for a plurality of color channels of the first skin image is determined.
In this way, an image of the region where the skin is present can be acquired in an arbitrary image, and color data of a plurality of color channels of the image can be determined.
In one possible implementation, the obtaining the characteristic spectral response value of the first skin image according to the characteristic response parameter of the image sensor and the color data of the plurality of color channels includes one of: determining a mean value of the color data of the plurality of color channels, and determining the characteristic spectral response value according to the mean value of the color data and the characteristic response parameter; or determining the characteristic spectral response information of a plurality of pixel points of the first skin image according to the color data of the plurality of color channels and the characteristic response parameters, and determining the characteristic spectral response value of the first skin image according to the characteristic spectral response information of the plurality of pixel points.
By the method, the characteristic spectral response value can be obtained in two ways, and the calculation flexibility is improved.
In one possible implementation, the method further includes: acquiring characteristic information of skin sample spectral data; and obtaining characteristic response parameters between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information.
In this way, a characteristic response parameter representing a relationship between the spectral response information and the characteristic information may be obtained, providing a data basis for illuminant estimation and color correction.
In one possible implementation manner, the acquiring characteristic information of the skin sample spectrum data includes: sampling a preset interval of the skin sample spectrum data according to a preset sampling interval to obtain first spectrum sampling data; and performing component analysis on the first spectrum sampling data to obtain the characteristic information.
By the method, the operation pressure can be reduced through sampling, representative components can be obtained through component analysis, and the accuracy of characteristic information is improved.
In a possible implementation manner, the obtaining, according to the spectral response information of the image sensor and the feature information, a feature response parameter between the spectral response information of the image sensor and the feature information includes: acquiring spectral response information of the image sensor; sampling the preset interval of the spectral response information according to a preset sampling interval to obtain second spectral sampling data; and fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter.
By the mode, the inherent spectral response information of the image sensor can be sampled to reduce the operation pressure, and the actually measured and extracted characteristic information is fitted with the second spectral sampling data to improve the accuracy of the characteristic response parameters.
In one possible implementation, the fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sample data to obtain the characteristic response parameter includes one of: performing regression analysis on the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter; or training a neural network through the characteristic information of the skin sample spectrum data and the second spectrum sampling data, and determining the network parameters of the trained neural network as the characteristic response parameters.
By the method, the characteristic response parameters can be obtained in various ways, and the flexibility of operation is improved.
According to an aspect of the present disclosure, there is provided a color correction apparatus including: the device comprises a color data acquisition module, a color data acquisition module and a color data acquisition module, wherein the color data acquisition module is used for acquiring color data of a plurality of color channels of a first skin image through an image sensor with a plurality of color channels; a characteristic spectral response value obtaining module, configured to obtain a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, where the characteristic response parameter is used to represent a relationship parameter between spectral response information of the multiple color channels of the image sensor and the color data obtained by the image sensor, and the spectral response information is intrinsic information of the image sensor and is used to represent response information of the multiple color channels of the image sensor to a spectrum of a light source; and the color correction module is used for obtaining a second skin image after color correction according to the characteristic spectral response value and the first skin image.
In one possible implementation, the color correction module is further configured to: performing light source estimation on the first skin image according to the characteristic spectral response value to obtain a light source confidence coefficient of the first skin image, wherein the light source confidence coefficient is represented as a confidence coefficient of at least one light source when the first skin image is shot; determining a white balance gain and a color correction matrix according to the light source confidence coefficient; and carrying out color correction on the first skin image according to the white balance gain and the color correction matrix to obtain the second skin image.
In one possible implementation manner, the color data obtaining module is further configured to: detecting a skin area in an image to be processed to obtain the first skin image; color data for a plurality of color channels of the first skin image is determined.
In one possible implementation, the characteristic spectral response value obtaining module is further configured to: determining a mean value of the color data of the plurality of color channels, and determining the characteristic spectral response value according to the mean value of the color data and the characteristic response parameter; or determining the characteristic spectral response information of a plurality of pixel points of the first skin image according to the color data of the plurality of color channels and the characteristic response parameters, and determining the characteristic spectral response value of the first skin image according to the characteristic spectral response information of the plurality of pixel points.
In one possible implementation, the apparatus further includes: a characteristic response parameter obtaining module to: acquiring characteristic information of skin sample spectral data; and obtaining characteristic response parameters between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information.
In one possible implementation manner, the characteristic response parameter obtaining module is further configured to: sampling a preset interval of the skin sample spectrum data according to a preset sampling interval to obtain first spectrum sampling data; and performing component analysis on the first spectrum sampling data to obtain the characteristic information.
In a possible implementation manner, the feature response parameter obtaining module is further configured to: acquiring spectral response information of the image sensor; sampling the preset interval of the spectral response information according to a preset sampling interval to obtain second spectral sampling data; and fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter.
In one possible implementation manner, the characteristic response parameter obtaining module is further configured to: performing regression analysis on the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter; or training a neural network through the characteristic information of the skin sample spectrum data and the second spectrum sampling data, and determining the network parameters of the trained neural network as the characteristic response parameters.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow diagram of a color correction method according to an embodiment of the present disclosure;
FIGS. 2A, 2B, 2C and 2D are schematic diagrams illustrating an application of a color correction method according to an embodiment of the present disclosure;
FIG. 3 shows a block diagram of a color correction apparatus according to an embodiment of the present disclosure;
FIG. 4 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 5 shows a block diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 shows a flow chart of a color correction method according to an embodiment of the present disclosure, as shown in fig. 1, the method comprising:
in step S11, acquiring color data of a plurality of color channels of a first skin image by an image sensor having a plurality of color channels;
in step S12, obtaining a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, wherein the characteristic response parameter is used to represent a relation parameter between spectral response information of the multiple color channels of the image sensor and the color data obtained by the image sensor, and the spectral response information is intrinsic information of the image sensor and is used to represent response information of the multiple color channels of the image sensor to a spectrum of a light source;
in step S13, a color corrected second skin image is obtained according to the characteristic spectral response value and the first skin image.
According to the color correction method disclosed by the embodiment of the disclosure, the characteristic response parameters of the image sensor can be calibrated by utilizing the spectrum data of the plurality of skin samples, and an accurate characteristic spectrum response value is obtained, namely, the characteristic of the spectrum presented under the irradiation of the light source, so that the accuracy of estimating the light source can be improved, the color correction can be carried out based on the estimated light source, the accuracy of color correction can be improved, and the second skin image with higher accuracy can be obtained.
In a possible implementation manner, for a case that the reduction degree of the skin color is not high in the related art, the present disclosure calibrates characteristic response parameters between spectral response information of each color channel of the image sensor and spectral characteristics of the spectral samples by using a plurality of samples, and may determine a characteristic spectral response value of the image by measuring a plurality of mean values and characteristic response parameters of color data of a plurality of color channels in the image by using the calibrated image sensor, where the characteristic spectral response value may represent spectral characteristics responded under irradiation of various light sources, and therefore, a light source may be estimated by using the characteristic spectral response value, and color correction may be performed based on the estimated light source.
In one possible implementation, using the above method, the light source illuminating the skin may be estimated and color corrected to restore the exact skin color to obtain the second skin image. The skin color is usually determined by pigments such as eumelanin (eumelanin), pheomelanin (pheomelanin), and the like. These pigments have their specific absorption spectra, and therefore, in addition to the R, G, B three color channels used in the related art, the spectral features of the skin can be approximated by more color channels (e.g., C (cyan) channel, M (magenta) channel, Y (yellow) channel) to accurately estimate the light source and restore the skin color. The present disclosure does not limit the specific number and color type of "multiple color channels".
In one possible implementation manner, in step S11, color data of the multiple color channels in the first skin image may be obtained first. In an example, if three channels (RGB channels) of sensors are used for acquisition, each pixel in the acquired image has color data for three color channels of RGB (i.e., red, green, and blue), and if more channels (e.g., six channels of RGBCMY) of sensors are used for acquisition, each pixel in the acquired image has color data for six color channels of RGBCMY. In an example, to accurately restore the skin color, a CMOS (complementary metal oxide semiconductor) sensor having six color channels of RGBCMY may be used as the image sensor for detection, and color data of the six color channels of RGBCMY may be obtained for each pixel in the image. The present disclosure does not limit the type of image sensor.
In one possible implementation, step S11 may include: detecting a skin area in an image to be processed to obtain the first skin image; color data for a plurality of color channels of the first skin image is determined.
In one possible implementation, if the acquired image is a generic image that includes a skin site (i.e., includes not only the skin site but also other things), a first skin image may be acquired first in the image to be processed. For example, the image to be processed is an image including a face region, and the image to be processed may be detected to obtain an image of the face region, that is, a first skin image including a face skin. In an example, a face region may be subjected to screenshot to obtain a first skin image, or the region where the face is located may be directly used as the first skin image without screenshot, and in subsequent processing, only the region is processed.
In a possible implementation manner, the color data of the multiple color channels of the first skin image may be obtained by the image sensor with multiple color channels, for example, to be more skin-adaptive, a CMOS sensor with six channels rgbmy may be used as the image sensor for detection, and the color data of the six color channels of each pixel point of the first skin image is obtained. For example, in a camera including the described CMOS sensor with six channels RGBCMY, each pixel in the captured image may have color data for the six channels RGBCMY.
In this way, an image of the area where the skin is located can be acquired in an arbitrary image, and color data of a plurality of color channels of the image can be determined.
In one possible implementation manner, in step S12, to obtain the characteristic spectral response value of the first skin image, the color data of each pixel point of the first skin image and the characteristic response parameter may be used to determine the characteristic spectral response value of the entire image. Step S12 may include: one of the following: determining the mean value of the color data of a plurality of color channels according to the color data of the plurality of color channels, and determining the characteristic spectral response value according to the mean value of the color data and the characteristic response parameter; or determining the characteristic spectral response information of a plurality of pixel points of the first skin image according to the color data of the plurality of color channels and the characteristic response parameters, and determining the characteristic spectral response value of the first skin image according to the characteristic spectral response information of the plurality of pixel points. That is, the mean value of the color data of each pixel point may be determined first, and the mean value is calculated by using the characteristic response parameter to obtain the characteristic spectral response value of the first skin image, or the characteristic response parameter is used to calculate the color data of each pixel point to obtain the characteristic spectral response information of each pixel point, and the characteristic spectral response information of each pixel point is calculated to obtain the characteristic spectral response value of the entire first skin image.
In a possible implementation manner, a manner of determining a mean value of color data of each pixel point and then calculating the mean value by using the characteristic response parameter is described. The color data of the area where the skin is located can be counted to obtain the average value of the color data of the six color channels of the first skin image. The average value of the color channel can be obtained by averaging the color data of the same color channel of each pixel point, for example, when the detection is performed by sensors of six channels, the average value of the six color channels can be obtained.
In an example, the spectral data for each color channel may be averaged to obtain a mean value for each color channel. For example, the color data of the R color channel of each pixel may be averaged to obtain the mean value of the R color channel, the color data of the G color channel of each pixel may be averaged to obtain the mean value of the G color channel, the color data of the B color channel of each pixel may be averaged to obtain the mean value of the B color channel, the color data of the C color channel of each pixel may be averaged to obtain the mean value of the C color channel, the color data of the M color channel of each pixel may be averaged to obtain the mean value of the M color channel, and the color data of the Y color channel of each pixel may be averaged to obtain the mean value of the Y color channel. After the mean values of the color channels are obtained, the characteristic spectrum response value of the first skin image can be obtained based on the mean values of the color channels and the characteristic response parameters of the image sensor.
In a possible implementation manner, a manner is described herein in which the color data of each pixel is first calculated using the characteristic response parameter, and the calculation result of each pixel is counted to obtain the characteristic spectral response value of the first skin image. The characteristic spectral response value may be a regression coefficient or a network parameter of a neural network, and the like, and the disclosure does not limit this, and the color data of a plurality of color channels of each pixel point may be calculated by a regression equation determined by the regression coefficient, or the color data of a plurality of color channels of each pixel point may be input to the neural network determined by the network parameter for calculation, so as to obtain the characteristic spectral response information of each pixel point, and further, the characteristic spectral response information of each pixel point may be counted, for example, information such as a mean value, a variance, and the like of the characteristic spectral response information of each pixel point is calculated, so as to obtain the characteristic spectral response value of the first skin image.
By the method, the characteristic spectral response value can be obtained in two ways, and the calculation flexibility is improved.
In a possible implementation manner, when solving the characteristic spectral response value, the characteristic response parameter is an important parameter required for the solution, the characteristic response parameter is used to represent a relationship parameter between spectral response information of a plurality of color channels of the image sensor and the color data acquired by the image sensor, and when solving the characteristic response parameter, a parameter of a relationship between the spectral response information of each color channel of the image sensor and the characteristic information of the spectrum (spectral data of a plurality of color channels actually acquired from a plurality of skin samples by the image sensor and extracted characteristic information) may be acquired. The spectral response information is inherent information of the image sensor and is used for representing response information of a plurality of color channels of the image sensor to spectra of light sources, for example, a spectral curve of each color channel of the image sensor under illumination of various light sources, for example, a curve formed by light intensities of each color channel in response to the spectra of various wavelengths. The spectral response value is a spectral response of a specific image obtained by the image sensor, that is, a specific value on a spectral curve, and may be obtained by processing a characteristic response parameter (that is, a parameter representing a relationship between spectral characteristic information and color data) using color data of the specific image, for example, by performing relationship conversion using the characteristic response parameter.
Therefore, a relation parameter (i.e., a characteristic response parameter) between actual data and intrinsic information may be determined based on spectral data actually acquired in the skin sample and spectral response information intrinsic to the image sensor, and then color data of a specific image actually acquired may be processed based on the relation parameter (characteristic response parameter) to determine a spectral response of the image sensor for the specific image, i.e., a characteristic spectral response value, which is also a corresponding value of the image on a spectral curve, and thus, the characteristic spectral response value is: when the image sensor detects a specific image obtained under the illumination of a specific light source, the specific information (specific information related to spectral response) of the image presented can be used for estimating the specific light source when the image is obtained according to the specific information, and further performing color correction on the image.
In one possible implementation, the characteristic response parameter may be obtained by fitting a plurality of samples. The method further comprises the following steps: acquiring characteristic information of skin sample spectral data; and obtaining characteristic response parameters between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information.
In this way, a characteristic response parameter representing a relationship between the spectral response information and the characteristic information may be obtained, providing a data basis for illuminant estimation and color correction.
In one possible implementation, the skin sample spectrum data is data obtained by detecting a plurality of skin sample images through a spectrometer, and may also be data in a spectrum database, for example, the spectrum data of a plurality of skin samples in a TR X0012: 1998 standard spectrum database. The skin sample spectral data may include spectral data for a plurality of skin complexions, for example, the spectral data for a yellow skin, a white skin, and a black skin.
In one possible implementation, a characteristic response parameter representing a relationship between spectral response information of a color channel and characteristic information of a spectrum is obtained. The characteristic information of the spectral data can be obtained, and the relation between the characteristic information and the spectral response information of the image sensor is determined, so that the characteristic response parameter can be obtained.
In a possible implementation manner, the feature information may include a data feature, a color feature, an appearance feature, and the like, and when the feature information of the spectral data is obtained, the data feature of the spectral data may be obtained by performing a plurality of data operations on the spectral data. Acquiring characteristic information of skin sample spectral data, comprising: sampling a preset interval of skin sample spectrum data according to a preset sampling interval to obtain first spectrum sampling data; and performing component analysis on the first spectrum sampling data to obtain the characteristic information.
In one possible implementation, the skin sample spectral data may be represented as a graph of spectral data for each color channel. When first skin spectral data is obtained through the detection equipment, the data volume can be larger, for example, every nanometer wavelength all has corresponding spectral data, for reducing the operating pressure, improve the fitting efficiency, prevent overfitting simultaneously, can sample spectral data to under the prerequisite that influences the fitting precision less, improve the fitting efficiency, and reduce the possibility of overfitting.
In an example, the spectral data within a preset interval may be sampled at preset intervals, for example, at intervals of 10nm within an interval of 400nm to 700nm (e.g., visible light interval), and the first spectral sample data is obtained. The spectral data in the preset interval are sampled, the sampled data in the preset interval can be obtained, the operational capability is applied to the preset interval, for example, the visible light interval, the spectral data outside the preset interval can not be collected, the operational pressure during sampling can be reduced, the operational resources during fitting can be used in an effective interval (for example, the visible light interval), the operational resources are not wasted in the ineffective interval, and the interference of the data in the ineffective interval on the fitting precision can be prevented.
In one possible implementation, after sampling to obtain the first spectrum sample data, the first spectrum sample data may be subjected to component analysis, and data characteristics, i.e., characteristic information, of the first spectrum sample data may be obtained. In the feature extraction, the first spectrum sampling data may be calculated by principal component analysis (principal component analysis), independent component analysis (independent component analysis), independent subspace analysis (independent subspace analysis), K-SVD, and the like, so as to obtain feature information. In obtaining the feature information through principal component analysis, any number of principal components (for example, the first three) may be selected as the feature information as needed, which is not limited by the present disclosure.
By the method, the operation pressure can be reduced through sampling, representative components can be obtained through component analysis, and the accuracy of characteristic information is improved.
In one possible implementation, after obtaining the above-described characteristic information, a characteristic response parameter representing a relationship between the characteristic information and spectral response information of the image sensor may be obtained. The spectral response information of the image sensor is inherent information of the image sensor, that is, a spectral response curve of the image sensor for a plurality of color channels of light of each wavelength, that is, a response spectrum for light of each wavelength.
In one possible implementation manner, obtaining a characteristic response parameter between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information includes: acquiring spectral response information of the image sensor; sampling the preset interval of the spectral response information according to a preset sampling interval to obtain second spectral sampling data; and performing fitting processing according to the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter.
By the mode, the inherent spectral response information of the image sensor can be sampled to reduce the operation pressure, and the actually measured and extracted characteristic information is fitted with the second spectral sampling data to improve the accuracy of characteristic response parameters.
In a possible implementation manner, the spectral response information of the image sensor may be obtained, for example, the spectral response information may be information provided by the device itself, the image sensor may also be tested by using light of multiple wavelengths to determine its response information to light of each wavelength in multiple color channels, and further, a spectral response curve of each wavelength for light of multiple color channels may also be drawn based on the spectral response information.
In one possible implementation, since the characteristic information is obtained by the first spectral sampling data, the data interval and the data range of the characteristic information are determined based on the data interval and the data range of the first spectral sampling data. In order to obtain a better fitting effect, the spectral response information can be sampled at the same preset interval and sampling interval to obtain second spectral sampling data, so that the data interval and the data range of the second spectral sampling data are consistent with those of the first spectral sampling data and are matched with the characteristic information.
In a possible implementation manner, after the second spectrum sampling data is obtained, fitting may be performed on the second spectrum sampling data with a larger number of color channels and the feature information, so as to obtain a feature response parameter representing a relationship between the second spectrum sampling data and the feature information.
In one possible implementation, the second spectral sample data may include spectral response data of multiple channels, and the data responses of the multiple data channels may be fitted in multiple ways, so that the fitting result approximates the value of the feature information. Performing fitting processing according to the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter, wherein the fitting processing comprises one of the following steps: performing regression analysis on the characteristic information of the skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameters; or training the neural network through the characteristic information of the skin sample spectrum data and the second spectrum sampling data, and determining the network parameters of the trained neural network as the characteristic response parameters.
In an example, the fitting method may include regression analysis, such as multiple linear regression analysis, multiple nonlinear regression analysis, multiple exponential regression analysis, multiple logarithmic regression analysis, logistic regression analysis, etc., and the disclosure does not limit the specific category of regression analysis.
In an example, the fitting method may include a neural network method, and the neural network may be trained using the feature information and the second spectrum sampling data, for example, the second spectrum sampling data may be used as an input quantity of the neural network to obtain an output quantity of the neural network, and a loss function of the neural network may be determined using a difference between the output quantity and the feature information, so as to adjust a parameter of the neural network in a direction in which the loss function decreases.
In an example, the fitting method described above may also include other methods, such as interpolation, etc., and the present disclosure does not limit the specific type of fitting method.
By the method, the characteristic response parameters can be obtained in various ways, and the flexibility of operation is improved.
In one possible implementation manner, after obtaining the characteristic response parameter, that is, obtaining the relationship between the spectral response information and the characteristic information, in step S12, the characteristic spectral response value of the first skin image may be determined based on the average value of the color data of each color channel and the characteristic response parameter, or the color data of a plurality of color channels of each pixel point may be operated based on the characteristic response parameter, and the operation result is averaged, so as to obtain the characteristic spectral response value of the first skin image, that is, the color data detected by the image sensor is converted by using the relationship between the spectral response information and the characteristic information of the image sensor, so as to obtain the characteristic spectral response value. In an example, if the characteristic response parameter is determined by regression analysis, the mean value may be operated by a regression equation (an equation having the characteristic response parameter as a regression parameter), and the characteristic spectral response value may be obtained. In an example, if the characteristic response parameter is determined by a neural network, the mean value may be input to the neural network, and the obtained output quantity is the characteristic spectral response value.
In a possible implementation manner, in step S13, after obtaining the characteristic spectral response value (i.e., the characteristic responded under the illumination of the light source), the light source may be estimated according to the characteristic spectral response value, and then color correction is performed based on the estimated light source. Step S13 may include: performing light source estimation on the first skin image according to the characteristic spectral response value to obtain a light source confidence coefficient of the first skin image, wherein the light source confidence coefficient is represented as a confidence coefficient of at least one light source when the first skin image is shot; determining a white balance gain and a color correction matrix according to the light source confidence coefficient; and carrying out color correction on the first skin image according to the white balance gain and the color correction matrix to obtain a second skin image.
In a possible implementation manner, the light source may be estimated by a proximity algorithm (nearest neighbor), a support vector machine classification (supporting vector classification), a linear classification (e.g., perceptron (perceptron)), and the like, so as to obtain a confidence of the light source when the first skin image is captured. In an example, the light source confidence indicates the confidence of various light sources, for example, when the first skin image is captured, the confidence that the light source irradiating the skin in the first skin image is sunlight is 80%, the confidence that the incandescent lamp is 10%, the confidence that the fluorescent lamp is 5%, and the like, and the specific numerical value of the light source confidence is not limited by the present disclosure.
In one possible implementation, after determining the light source confidence, the light source illuminating the skin when the first skin image is taken may be determined based on the light source confidence, and color correction may be performed based on characteristics of the light source. For example, a white balance gain and a color correction matrix are determined according to the characteristics of the light source, and color correction is performed.
In one possible implementation, with the illuminant confidence, an illuminant type can be determined and color correction can be performed according to the particular illuminant type. As above, if the confidence that the light source type is sunlight is the highest, the light source illuminating the skin in the first skin image may be determined to be sunlight, and color correction may be performed according to the characteristics of the sunlight. In an example, various parameters of sunlight may be queried to determine parameters for color correction, e.g., white balance gain and color correction matrix. In another example, if the estimated light source is not a typical light source such as sunlight, incandescent lamp, etc. and cannot directly query the parameters of the light source, and thus the parameters of the color correction, such as the white balance gain and the color correction matrix, can be obtained by interpolating similar light sources. Further, the first skin image may be color corrected by a white balance gain and a color correction matrix to obtain a corrected second skin image.
In a possible implementation, the estimation of the confidence of the light source may not be performed, but the color correction may be performed directly using the characteristic spectral response value of the first skin image. For example, the relationship (e.g., functional relationship or trained neural network) between the characteristic spectral response value and the white balance gain and color correction matrix may be obtained by fitting or training the neural network, and the characteristic spectral response value of the first skin image is solved through the functional relationship, or input into the trained neural network to obtain the white balance gain and color correction matrix, and then color correction is performed on the first skin image through the white balance gain and color correction matrix.
In another example, the color corrected second skin image may also be directly output based on the characteristic spectral response values of the first skin image and the first skin image, for example, the relationship between the characteristic spectral response values and the image before color correction and the image after color correction may be obtained by using neural network training or the like, and then the characteristic spectral response values of the first skin image and the first skin image are input into the trained neural network, and the color corrected second skin image may be directly output. The present disclosure does not limit the specific manner in which the first skin image is color corrected using the characteristic spectral response value.
By the method, the confidence coefficient of the light source can be determined based on the characteristic spectrum response value, the light source during shooting is further determined, color correction can be performed based on the light source, and correction accuracy is improved.
According to the color correction method disclosed by the embodiment of the disclosure, the characteristic response parameters of the image sensor can be calibrated by utilizing the spectral data of a plurality of skin samples, in the calibration process, the spectral data in the preset interval is sampled according to the preset sampling interval, the fitting efficiency can be improved, overfitting can be prevented at the same time, the interference of the data in the invalid interval on the fitting precision can be prevented, the accurate characteristic response parameters are obtained, and further, the accurate characteristic spectral response values are obtained based on the spectral data detected by the image sensor, namely, the characteristic of the spectrum responded under the irradiation of the light source, the accuracy of the estimated light source can be improved, the color correction can be carried out based on the estimated light source, the accuracy of the color correction can be improved, and the second skin image with higher accuracy can be obtained.
Fig. 2A, 2B, 2C, and 2D show application diagrams of a color correction method according to an embodiment of the present disclosure. The characteristic response parameters of the image sensor may first be calibrated based on the spectral data of a plurality of skin sample images in the TR X0012: 1998 standard spectral database. In an example, a plurality of spectral data of the skin of the yellow, white and black people may be included in the database, and the spectral data has three color channels of RGB.
In one possible implementation manner, the spectral data of the plurality of skin samples can be sampled within an interval of 400nm to 700nm at a sampling interval of 10nm, and the sampling data can be obtained. And the first three principal components are obtained as characteristic information by a principal component analysis method. As shown in the line graphs of fig. 2A, 2B and 2C, in which the abscissa of fig. 2A, 2B and 2C is wavelength and the ordinate is light intensity, the spectrum data of a plurality of skin samples are sampled at sampling intervals of 10nm in an interval of 400nm to 700nm, and the obtained sampled data are shown as data points in fig. 2A, 2B and 2C. The spectral data of each skin sample image can be sampled and subjected to principal component analysis according to the method, and the characteristic information of each spectral data is obtained.
In one possible implementation, an image sensor having six color channels of rgbmy may be used due to the color characteristics of the skin. When the characteristic response parameters of the image sensor are calibrated, the spectral response information of the image sensor (i.e., the spectral response curves of the six color channels, as shown in fig. 2D) is sampled at sampling intervals of 10nm in an interval of 400nm to 700nm, and sampled data is obtained. Further, the sampled data of the spectral response information may be fitted to the characteristic information, and the obtained fitted curves are shown as the curves in fig. 2A, 2B and 2C. The regression parameters in the fitting process are characteristic response parameters and are also parameters of the regression equation.
In one possible implementation, color data for six color channels for each pixel of the skin image may be determined by an image sensor having six color channels of RGBCMY. And calculating the mean value of each color channel, and then substituting the mean values into a regression equation determined by the characteristic response parameters to obtain a characteristic spectrum response value, and estimating a light source according to the characteristic spectrum response value, for example, estimating the confidence coefficient of the light source through a support vector machine, and using the light source with the highest confidence coefficient as the light source when the skin image is shot, and then determining a white balance gain and a color correction matrix through the characteristics of the light source, and further performing color correction on the skin image.
In a possible implementation manner, the color correction method can be used in the fields of photography, medical cosmetology and the like, and is used for accurately restoring the complexion of the skin image and providing an accurate color basis for subsequent processing. The present disclosure does not limit the application field of the color correction method.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides a color correction apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the color correction methods provided by the present disclosure, and the corresponding technical solutions and descriptions thereof and the corresponding descriptions in the methods section are omitted for brevity.
Fig. 3 shows a block diagram of a color correction apparatus according to an embodiment of the present disclosure, as shown in fig. 3, the apparatus including: a color data acquisition module 11, configured to acquire color data of a plurality of color channels of a first skin image through an image sensor having the plurality of color channels; a characteristic spectral response value obtaining module 12, configured to obtain a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, where the characteristic response parameter is used to indicate a relation parameter between spectral response information of the multiple color channels of the image sensor and the color data obtained by the image sensor, and the spectral response information is inherent information of the image sensor and is used to indicate response information of the multiple color channels of the image sensor to a spectrum of a light source; and a color correction module 13, configured to obtain a second skin image after color correction according to the characteristic spectral response value and the first skin image.
In one possible implementation, the color correction module is further configured to: performing light source estimation on the first skin image according to the characteristic spectral response value to obtain a light source confidence coefficient of the first skin image, wherein the light source confidence coefficient is represented as a confidence coefficient of at least one light source when the first skin image is shot; determining a white balance gain and a color correction matrix according to the light source confidence coefficient; and carrying out color correction on the first skin image according to the white balance gain and the color correction matrix to obtain the second skin image.
In one possible implementation manner, the color data obtaining module is further configured to: detecting a skin area in an image to be processed to obtain the first skin image; color data for a plurality of color channels of the first skin image is determined.
In one possible implementation, the characteristic spectral response value obtaining module is further configured to: determining a mean value of the color data of the plurality of color channels, and determining the characteristic spectral response value according to the mean value of the color data and the characteristic response parameter; or determining the characteristic spectral response information of a plurality of pixel points of the first skin image according to the color data of the plurality of color channels and the characteristic response parameters, and determining the characteristic spectral response value of the first skin image according to the characteristic spectral response information of the plurality of pixel points.
In one possible implementation, the apparatus further includes: a characteristic response parameter obtaining module to: acquiring characteristic information of skin sample spectral data; and obtaining characteristic response parameters between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information.
In one possible implementation manner, the characteristic response parameter obtaining module is further configured to: sampling a preset interval of the skin sample spectrum data according to a preset sampling interval to obtain first spectrum sampling data; and performing component analysis on the first spectrum sampling data to obtain the characteristic information.
In one possible implementation manner, the characteristic response parameter obtaining module is further configured to: acquiring spectral response information of the image sensor; sampling the preset interval of the spectral response information according to a preset sampling interval to obtain second spectral sampling data; and fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameters.
In a possible implementation manner, the feature response parameter obtaining module is further configured to: performing regression analysis on the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter; or training a neural network through the characteristic information of the plurality of skin sample spectrum data and the second spectrum sampling data, and determining the network parameters of the trained neural network as the characteristic response parameters.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement the above method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The disclosed embodiments also provide a computer program product comprising computer readable code, which when run on a device, a processor in the device executes instructions for implementing the color correction method provided in any of the above embodiments.
The disclosed embodiments also provide another computer program product for storing computer readable instructions, which when executed, cause a computer to perform the operations of the color correction method provided in any of the above embodiments.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 4 illustrates a block diagram of an electronic device 800 in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 4, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile and non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense an edge of a touch or slide action, but also detect a duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 5 illustrates a block diagram of an electronic device 1900 in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 5, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, that are executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may further include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, stored in memory 1932 TM ,Mac OS X TM ,Unix TM ,Linux TM ,FreeBSD TM Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer-readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as punch cards or in-groove raised structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be interpreted as a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the disclosure are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (11)

1. A color correction method, comprising:
acquiring color data of a plurality of color channels of a first skin image by an image sensor having a plurality of color channels;
obtaining a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, wherein the characteristic response parameter is used for representing a relation parameter between spectral response information of the multiple color channels of the image sensor and the color data acquired by the image sensor, and the spectral response information is inherent information of the image sensor and is used for representing response information of the multiple color channels of the image sensor to a spectrum of a light source;
and obtaining a second skin image after color correction according to the characteristic spectral response value and the first skin image.
2. The method according to claim 1, wherein obtaining a color corrected second skin image based on the characteristic spectral response value and the first skin image comprises:
performing light source estimation on the first skin image according to the characteristic spectral response value to obtain a light source confidence coefficient of the first skin image, wherein the light source confidence coefficient is represented as a confidence coefficient of at least one light source when the first skin image is shot;
determining a white balance gain and a color correction matrix according to the light source confidence coefficient;
and carrying out color correction on the first skin image according to the white balance gain and the color correction matrix to obtain the second skin image.
3. The method of claim 1, wherein acquiring color data for a plurality of color channels of a first skin image with an image sensor having a plurality of color channels comprises:
detecting a skin area in an image to be processed to obtain the first skin image;
color data for a plurality of color channels of the first skin image is determined.
4. The method of claim 1, wherein obtaining the characteristic spectral response value of the first skin image from the characteristic response parameter of the image sensor and the color data of the plurality of color channels comprises one of:
determining a mean value of the color data of the plurality of color channels, and determining the characteristic spectral response value according to the mean value of the color data and the characteristic response parameter; or
According to the color data of the color channels and the characteristic response parameters, determining characteristic spectrum response information of a plurality of pixel points of the first skin image, and determining a characteristic spectrum response value of the first skin image according to the characteristic spectrum response information of the pixel points.
5. The method of claim 1, further comprising:
acquiring characteristic information of skin sample spectral data;
and obtaining characteristic response parameters between the spectral response information of the image sensor and the characteristic information according to the spectral response information of the image sensor and the characteristic information.
6. The method of claim 5, wherein the obtaining characteristic information of the skin sample spectral data comprises:
sampling a preset interval of the skin sample spectrum data according to a preset sampling interval to obtain first spectrum sampling data;
and performing component analysis on the first spectrum sampling data to obtain the characteristic information.
7. The method according to claim 5 or 6, wherein the obtaining a feature response parameter between the spectral response information of the image sensor and the feature information according to the spectral response information of the image sensor and the feature information comprises:
acquiring spectral response information of the image sensor;
sampling the preset interval of the spectral response information according to a preset sampling interval to obtain second spectral sampling data;
and fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter.
8. The method of claim 7, wherein the fitting the characteristic information of the plurality of skin sample spectral data and the second spectral sample data to obtain the characteristic response parameter comprises one of:
performing regression analysis through the characteristic information of the plurality of skin sample spectral data and the second spectral sampling data to obtain the characteristic response parameter; or
Training a neural network through the characteristic information of the skin sample spectral data and the second spectral sampling data, and determining the network parameters of the trained neural network as the characteristic response parameters.
9. A color correction apparatus, comprising:
the device comprises a color data acquisition module, a color data acquisition module and a color data acquisition module, wherein the color data acquisition module is used for acquiring color data of a plurality of color channels of a first skin image through an image sensor with a plurality of color channels;
a characteristic spectral response value obtaining module, configured to obtain a characteristic spectral response value of the first skin image according to a characteristic response parameter of the image sensor and color data of the multiple color channels, where the characteristic response parameter is used to represent a relationship parameter between spectral response information of the multiple color channels of the image sensor and the color data obtained by the image sensor, and the spectral response information is intrinsic information of the image sensor and is used to represent response information of the multiple color channels of the image sensor to a spectrum of a light source;
and the color correction module is used for obtaining a second skin image after color correction according to the characteristic spectral response value and the first skin image.
10. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any one of claims 1 to 8.
11. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any one of claims 1 to 8.
CN202210418767.0A 2022-04-20 2022-04-20 Color correction method and apparatus, electronic device, and storage medium Withdrawn CN114793270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210418767.0A CN114793270A (en) 2022-04-20 2022-04-20 Color correction method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210418767.0A CN114793270A (en) 2022-04-20 2022-04-20 Color correction method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN114793270A true CN114793270A (en) 2022-07-26

Family

ID=82461514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210418767.0A Withdrawn CN114793270A (en) 2022-04-20 2022-04-20 Color correction method and apparatus, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN114793270A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004045219A1 (en) * 2002-11-12 2004-05-27 Sony Corporation Light source estimating device, light source estimating method, and imaging device and image processing method
JP2005295419A (en) * 2004-04-05 2005-10-20 Mitsubishi Electric Corp Image pickup device, camera, and signal processing method
WO2007022413A2 (en) * 2005-08-18 2007-02-22 Qualcomm Incorporated Systems, methods, and apparatus for image processing, for color classification, and for skin color detection
CN109903256A (en) * 2019-03-07 2019-06-18 京东方科技集团股份有限公司 Model training method, chromatic aberration calibrating method, device, medium and electronic equipment
CN111586300A (en) * 2020-05-09 2020-08-25 展讯通信(上海)有限公司 Color correction method, device and readable storage medium
CN112164005A (en) * 2020-09-24 2021-01-01 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium
CN113766204A (en) * 2021-07-28 2021-12-07 荣耀终端有限公司 Method for adjusting light source color of image, electronic device and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004045219A1 (en) * 2002-11-12 2004-05-27 Sony Corporation Light source estimating device, light source estimating method, and imaging device and image processing method
JP2005295419A (en) * 2004-04-05 2005-10-20 Mitsubishi Electric Corp Image pickup device, camera, and signal processing method
WO2007022413A2 (en) * 2005-08-18 2007-02-22 Qualcomm Incorporated Systems, methods, and apparatus for image processing, for color classification, and for skin color detection
CN101288103A (en) * 2005-08-18 2008-10-15 高通股份有限公司 Systems, methods, and apparatus for image processing, for color classification, and for skin color detection
CN109903256A (en) * 2019-03-07 2019-06-18 京东方科技集团股份有限公司 Model training method, chromatic aberration calibrating method, device, medium and electronic equipment
CN111586300A (en) * 2020-05-09 2020-08-25 展讯通信(上海)有限公司 Color correction method, device and readable storage medium
CN112164005A (en) * 2020-09-24 2021-01-01 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium
CN113766204A (en) * 2021-07-28 2021-12-07 荣耀终端有限公司 Method for adjusting light source color of image, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘强;万晓霞;李婵;梁金星;谢德红;: "基于宽色域色彩光谱样本集的色度校正方法研究", 光谱学与光谱分析, no. 04 *

Similar Documents

Publication Publication Date Title
CN107692997B (en) Heart rate detection method and device
CN107463052B (en) Shooting exposure method and device
CN106454336A (en) Method and device for detecting whether camera of terminal is covered or not, and terminal
CN112016344A (en) State detection method and device of signal indicator lamp and driving control method and device
CN110033784B (en) Audio quality detection method and device, electronic equipment and storage medium
CN107677377B (en) Method and device for determining color temperature
CN105651381A (en) Light sensor calibration method and device
CN106408567A (en) Imaging quality detection method and apparatus of camera
CN112016443B (en) Method and device for identifying same lines, electronic equipment and storage medium
CN112184787A (en) Image registration method and device, electronic equipment and storage medium
CN113486830A (en) Image processing method and device, electronic equipment and storage medium
CN105787322A (en) Fingerprint identification method and apparatus as well as mobile terminal
CN113139471A (en) Target detection method and device, electronic equipment and storage medium
CN113920465A (en) Method and device for identifying film trailer, electronic equipment and storage medium
CN111294576B (en) Automatic white balance processing method and device and electronic equipment
CN113887474A (en) Respiration rate detection method and device, electronic device and storage medium
WO2022057327A1 (en) Calibration method and apparatus, device, medium, program, and temperature measurement-based facial recognition apparatus
CN112033527A (en) Ambient brightness detection method, device, equipment and storage medium
CN114793270A (en) Color correction method and apparatus, electronic device, and storage medium
CN115883976A (en) Endoscope calibration method, device, electronic apparatus, and storage medium
CN107807121A (en) The determination method and apparatus of testing result
CN112509068A (en) Image dominant color recognition method and device, electronic equipment and storage medium
CN111968106A (en) Image processing method and device, electronic equipment and storage medium
CN111753753A (en) Image recognition method and device, electronic equipment and storage medium
CN111768394A (en) Image processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220726

WW01 Invention patent application withdrawn after publication