CN115546035A - Data processing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115546035A
CN115546035A CN202110726738.6A CN202110726738A CN115546035A CN 115546035 A CN115546035 A CN 115546035A CN 202110726738 A CN202110726738 A CN 202110726738A CN 115546035 A CN115546035 A CN 115546035A
Authority
CN
China
Prior art keywords
ambient light
coordinate
color
color coordinate
color temperature
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.)
Pending
Application number
CN202110726738.6A
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110726738.6A priority Critical patent/CN115546035A/en
Publication of CN115546035A publication Critical patent/CN115546035A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T5/94
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The disclosure relates to a data processing method and apparatus, an electronic device, and a storage medium. The electronic device includes: obtaining ambient light color temperature and ambient light color coordinates outside a display screen of the electronic device; acquiring a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic temperature point according to the ambient light color coordinate and the ambient light color temperature; determining a target radiation curve based on the difference and a preset difference threshold value and acquiring a mapping matrix corresponding to the target radiation curve; and acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed. The display color temperature of the display screen in the embodiment is adjusted by changing the adjustment according to the fixed black body radiation curve into the adjustment according to different radiation curves, so that the effect that the display color temperature of the display screen is matched with the ambient light is achieved, the display color temperature is adaptive to the perception of human eyes to the color temperature and the environment, and the visual experience is improved.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of display control technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
With the wide application of electronic devices, some electronic devices have color temperature adjusting functions on their display screens, such as a manual eye protection mode and an automatic color temperature adjustment based on an ambient light sensor, so as to keep the display color temperature consistent with the ambient light color temperature.
For this reason, a black body radiation curve defining the color coordinate positions of white points of a display screen at different color temperatures is stored in advance in the electronic device in the related art. Alternatively, as the color temperature of the ambient light changes, the display white point in the chromaticity space will vary along the blackbody radiation curve.
However, when the color of the ambient light changes sharply, the color temperature of the display screen does not match the color temperature of the ambient light after the color temperature of the display screen is adjusted according to the above scheme, and the use experience is reduced.
Disclosure of Invention
The present disclosure provides a data processing method and apparatus, an electronic device, and a storage medium to solve the deficiencies of the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided a data processing method applied to an electronic device, the method including:
acquiring ambient light color temperature and ambient light color coordinates outside a display screen of the electronic equipment;
acquiring a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic temperature point according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves;
determining a target radiation curve based on the difference and a preset difference threshold value and acquiring a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves;
and acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed.
Optionally, obtaining a difference between a preset black body radiation curve and the ambient light color temperature isochromatic point according to the ambient light color coordinate and the ambient light color temperature includes:
acquiring a first color coordinate of a point, matched with the ambient light color coordinate, in a chromaticity space where the black body radiation curve is located;
acquiring a second color coordinate of a point on the blackbody radiation curve, wherein the point has the same color temperature as the ambient light color temperature;
and acquiring the distance between the first color coordinate and the second color coordinate, and taking the distance as the difference value.
Optionally, a first color coordinate of a point, in the chromaticity space where the black body radiation curve is located, that matches the ambient light color coordinate is obtained, and the following formula is adopted for calculation:
Figure BDA0003138952820000021
in formula (II) u' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate representing the ambient light coordinate.
Optionally, a second color coordinate of a point on the blackbody radiation curve having the same color temperature as the ambient light color temperature is obtained, and the following formula is adopted to calculate:
Figure BDA0003138952820000022
u 'in the formula' blackbody Abscissa, v 'representing second color coordinate' blackbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the point of the isochromatic temperature on the black-body radiation curve c A ordinate indicating an isochromatic temperature point on the black body radiation curve;
Figure BDA0003138952820000031
Figure BDA0003138952820000032
optionally, a distance between the first color coordinate and the second color coordinate is obtained, and the following formula is adopted for calculation:
Figure BDA0003138952820000033
in the formula, duv in Indicating the distance between the first color coordinates and the second color coordinates.
Optionally, determining a target radiation curve based on the difference and a preset difference threshold includes:
acquiring the sign of the difference value;
determining a target threshold range in which the difference value is located according to the difference value and the sign;
and acquiring a target radiation curve corresponding to the target threshold range according to the corresponding relation between the preset threshold range and the radiation curve.
Optionally, obtaining the sign of the difference comprises:
when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate, determining that the sign of the difference value is a positive sign;
and when the abscissa of the first color coordinate is larger than the abscissa of the second color coordinate and the ordinate of the first color coordinate is smaller than the ordinate of the second color coordinate, determining that the sign of the difference value is a negative sign.
Optionally, obtaining a mapping matrix corresponding to the target radiation curve includes:
determining a target color temperature corresponding to the ambient light color temperature of the display screen based on a preset corresponding relation between the ambient light color temperature and the display screen color temperature;
determining a third color coordinate of the white point color of the display screen according to the difference value and the target color temperature;
and remapping all colors in the chromaticity space according to the third color coordinate to obtain a mapping matrix corresponding to the target radiation curve.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus applied to an electronic device, the apparatus including:
the coordinate acquisition module is used for acquiring ambient light color temperature and ambient light color coordinates outside a display screen of the electronic equipment;
the difference value acquisition module is used for acquiring a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic point according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves;
the matrix acquisition module is used for determining a target radiation curve based on the difference value and a preset difference value threshold and acquiring a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves;
and the image processing module is used for acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed.
Optionally, the difference obtaining module includes:
the first coordinate obtaining unit is used for obtaining a first color coordinate of a point, matched with the ambient light color coordinate, in a chromaticity space where the blackbody radiation curve is located;
the second coordinate acquisition unit is used for acquiring a second color coordinate of a point on the blackbody radiation curve, wherein the point has the same color temperature as the ambient light color temperature;
and the difference value acquisition unit is used for acquiring the distance between the first color coordinate and the second color coordinate, and taking the distance as the difference value.
Optionally, the first coordinate obtaining unit calculates the first color coordinate by using the following formula:
Figure BDA0003138952820000041
u 'in the formula' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate representing the ambient light coordinate.
Optionally, the second coordinate obtaining unit calculates the second color coordinate by using the following formula:
Figure BDA0003138952820000042
in formula (II) u' blackbody Abscissa, v 'representing second color coordinate' blackbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the isochromatic temperature point on the black body radiation curve c A vertical coordinate representing the isochromatic temperature points on the black body radiation curve;
Figure BDA0003138952820000051
Figure BDA0003138952820000052
optionally, the difference obtaining unit calculates by using the following formula:
Figure BDA0003138952820000053
in the formula, duv in Indicating the distance between the first color coordinates and the second color coordinates.
Optionally, the matrix obtaining module includes:
a sign obtaining unit configured to obtain a sign of the difference value;
the range acquisition unit is used for determining a target threshold range where the difference value is located according to the difference value and the sign;
and the range acquisition unit is used for acquiring a target radiation curve corresponding to the target threshold range according to the corresponding relation between the preset threshold range and the radiation curve.
Optionally, the symbol obtaining unit includes:
the positive sign acquisition subunit is used for determining that the sign of the difference value is a positive sign when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate;
and the negative sign acquisition subunit is used for determining that the sign of the difference value is a negative sign when the abscissa of the first color coordinate is larger than the abscissa of the second color coordinate and the ordinate of the first color coordinate is smaller than the ordinate of the second color coordinate.
Optionally, the matrix obtaining module includes:
the color temperature acquisition unit is used for determining a target color temperature corresponding to the color temperature of the ambient light on the basis of a preset corresponding relation between the color temperature of the ambient light and the color temperature of the display screen;
the coordinate acquisition unit is used for determining a third color coordinate of the white point color of the display screen according to the difference value and the target color temperature;
and the matrix acquisition unit is used for remapping all colors in a chromaticity space according to the third color coordinate to obtain a mapping matrix corresponding to the target radiation curve.
According to a third aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing a computer program executable by the processor;
wherein the processor is configured to execute the computer program in the memory to implement the method of any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, in which an executable computer program is capable of implementing the method according to any one of the above when executed by a processor.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
it can be known from the foregoing embodiments that, in the scheme provided by the embodiments of the present disclosure, the ambient light color temperature and the ambient light color coordinate outside the display screen of the electronic device are obtained; then, acquiring a difference value between a preset black body radiation curve and a color temperature point such as the ambient light color temperature according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves; then, determining a target radiation curve based on the difference and a preset difference threshold value and acquiring a mapping matrix corresponding to the target radiation curve; and finally, acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed. Like this, the demonstration colour temperature of display screen in this embodiment is changed into according to the radiant curve of difference and is adjusted by adjusting according to fixed black body radiant curve, reaches the demonstration colour temperature of display screen and the effect that the environment light matches, makes it adapt to the perception of people's eye to colour temperature and environment, promotes visual experience.
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.
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 is a flow chart illustrating a method of data processing in accordance with an exemplary embodiment.
FIG. 2 is a flowchart illustrating obtaining a difference between a first color coordinate and a second color coordinate according to one exemplary embodiment.
FIG. 3 is a flow chart illustrating acquiring a target radiation profile according to an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating the setting of 3 radiation curves in the chromaticity space according to an exemplary embodiment.
FIG. 5 is a schematic diagram illustrating acquisition of a target radiation profile according to an exemplary embodiment.
FIG. 6 is a block diagram illustrating a data processing apparatus according to an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The following exemplary described embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In order to solve the foregoing technical problem, embodiments of the present disclosure provide a data processing method and apparatus, an electronic device, and a storage medium, which can be applied to an electronic device, where the electronic device may include a fixed device and a mobile device, and the fixed device includes but is not limited to: personal Computers (PCs), televisions, and the like; the mobile devices include, but are not limited to: cell-phone, panel computer, wearable equipment etc.. The electronic equipment has a color temperature adjusting function. FIG. 1 is a flow chart illustrating a method of data processing in accordance with an exemplary embodiment. Referring to fig. 1, a data processing method includes steps 11 to 14.
In step 11, an ambient light color temperature and an ambient light color coordinate outside a display screen of the electronic device are obtained.
In this embodiment, be provided with at least one Ambient Light Sensor (ALS) in the electronic equipment, its quantity can set up according to specific scene. Taking 1 ambient light sensor as an example, the ambient light sensor may obtain an ambient light signal of an environment where the electronic device is located, for example, when the external light intensity is weakened, the ambient light sensor may detect a weaker ambient light signal, and transmit the color temperature of the ambient light signal to the processor of the electronic device.
In one example, the ambient light sensor obtaining the ambient light color temperature may include: (1) take a frame of image data and divide it into M x N blocks, e.g., 25 x 25. Then, basic information of each block, including the number of white pixels and component means (R/G and B/G) of R/G/B channels, is counted. (2) And (3) finding all white blocks in the image according to the number of the white pixels counted in the step (1), and judging the color temperature according to the color temperature curve. (3) All possible color temperatures in the image can be obtained at this time, and if the image is a single light source, the color temperature corresponding to the maximum number of white blocks can be used as the current color temperature. For example, in 25 × 25=625 blocks, 100 effective white blocks are found, and 80 white blocks in the 100 white blocks represent a color temperature of about 4500K, where the current color temperature may take the value of 4500K.
In an example, the ambient light sensor senses a color of the ambient light, a plurality of channels (including but not limited to an RGB three channel, a white light channel, and an infrared light channel) of the ambient light sensor may output corresponding light intensity values, and the electronic device may calculate the color of the ambient light according to the plurality of light intensity values output by the ambient light sensor and the weight value corresponding to each channel, and determine an ambient light color coordinate matching the color of the ambient light according to a relationship (i.e., a chromaticity space) between the color and the color coordinate.
In practical applications, it is considered that part of the electronic devices adopt OLED display screens, and the OLED display screens can transmit part of visible light, and the visible light transmitted through the screens can be used for detecting the intensity of ambient light. However, the transmittance of the OLED display cannot reach 100%, and therefore, an ambient light sensor with higher sensitivity is required. For example, the above-mentioned ambient light sensor may be a front-facing camera, and because only one layer of glass cover plate is arranged above the front-facing camera, the influence of the light emission of the display screen is small, that is, when the front-facing camera is used as the ambient light sensor, it is beneficial to obtain accurate ambient light color temperature and ambient light color coordinates. For another example, the sensitivity of the ambient light sensor may also be improved by increasing the integration time of the ambient light sensor or increasing the area of the photoelectric conversion unit on the ambient light sensor. A skilled person can select a suitable scheme for improving the ambient light sensitivity according to a specific scenario, and the corresponding scheme falls within the protection scope of the present disclosure.
In step 12, obtaining a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic point according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves.
In this embodiment, the electronic device may obtain a difference between the ambient light color temperature and the color temperature point on the preset black body radiation curve according to the ambient light color coordinate and the ambient light color temperature, see fig. 2, and includes steps 21 to 23.
In step 21, the electronic device may obtain a first color coordinate of a point, in the chromaticity space where the blackbody radiation curve is located, matching the color coordinate of the ambient light, and calculate by using the following formula:
Figure BDA0003138952820000091
in formula (II) u' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate represents the ambient light coordinate.
In this step, a plurality of preset radiation curves are stored in the electronic device, the black body radiation curve is one of the preset radiation curves, the other radiation curves are respectively located on two sides of the black body radiation curve, and a preset distance (i.e., a color temperature difference duv that appears subsequently) is arranged between each preset radiation curve and the black body radiation curve. Referring to fig. 4, a scene with 3 preset radiation curves set in the electronic device is shown in fig. 4, and includes: curve 1 is a black body radiation curve, curve 2 is a yellowish green curve, and curve 3 is a reddish purple curve. Curve 2 is used to cover a scene with a yellow or green light source, and curve 3 is used to cover a scene with a red or violet light source.
It should be noted that the number of the preset radiation curves can be set according to the computing resources of the electronic device and/or the coverage rate of (the light source in) the used scene. For example, as the processing resource increases, the number of the preset radiation curves may increase with the increase of the computing resource of the electronic device, and as the computing resource of the electronic device increases, the number of the preset radiation curves may decrease with the increase of the computing resource of the electronic device, that is, as the computing resource of the electronic device and the number of the preset radiation curves have a positive correlation relationship. Taking the coverage rate of the use scene as an example, when the preset radiation curves of the electronic device can cover the use scene of the electronic device to a certain ratio (for example, more than 95%), the number of the preset radiation curves does not need to be increased; when the coverage rate is lower than the ratio, the number of radiation curves can be increased, and when the ambient light source changes to pure red, pure green and other colors, the change scenes cannot be covered by the scheme in the related technology, so that the tearing phenomenon exists between the color temperature of the display screen and the color temperature of the ambient light, and the use experience is influenced.
In this example, the preset distance may be set according to an actual experiment, and in the actual experiment, the light emitting characteristic of the display screen, the default white point, and the color temperature of the display screen observed by human eyes may be evaluated in combination, so as to achieve an effect that the color temperatures corresponding to different preset radiation curves are matched with the ambient light. For convenience of description, in the following embodiments, the scheme of each embodiment is described by taking the example of setting 3 preset radiation curves.
In step 22, the electronic device may obtain a second color coordinate of a point on the blackbody radiation curve having the same color temperature as the color temperature of the ambient light, and calculate using the following formula:
Figure BDA0003138952820000101
u 'in the formula' blackbody Abscissa, v 'representing second color coordinate' blackbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the point of the isochromatic temperature on the black-body radiation curve c A vertical coordinate representing the isochromatic temperature points on the black body radiation curve;
Figure BDA0003138952820000102
Figure BDA0003138952820000103
in step 23, the electronic device may obtain a distance between the first color coordinate and the second color coordinate, and calculate the distance using the following formula:
Figure BDA0003138952820000104
in the formula, duv in Indicating the distance between the first color coordinates and the second color coordinates.
Then, the electronic device may use the distance as a difference between color temperature points on the black body radiation curve, such as the color temperature of the ambient light.
In step 13, determining a target radiation curve based on the difference and a preset difference threshold and obtaining a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves.
In this embodiment, the electronic device may determine a target radiation curve, see fig. 3, including steps 31 to 33.
In step 31, the electronic device may obtain the sign of the difference, that is:
when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate, determining that the sign of the difference value is a positive sign;
and when the abscissa of the first color coordinate is larger than the abscissa of the second color coordinate and the ordinate of the first color coordinate is smaller than the ordinate of the second color coordinate, determining that the sign of the difference is a negative sign.
Or duv in U's positive and negative' blackbody ,v′ blackbody And u' in ,v′ in Determines the relative position of:
u' in ,v′ in In u' blackbody ,v′ blackbody Above, i.e. u' in <u′ blackbody And v' in >v′ blackbody Time, duv in >0;
When u' in ,v′ in In u' blackbody ,v′ blackbody To the bottom, i.e. u' in >u′ blackbody And v' in <v′ blackbody Time duv in <0。
In step 32, the electronic device may determine a target threshold range in which the difference value is located according to the difference value and the sign. With reference to fig. 4, 3 preset radiation curves are provided in the electronic device, that is, the curve 1 is a blackbody radiation curve, the curve 2 is a yellowish green curve, and the curve 3 is a biased magenta curve. The difference between curve 2 and curve 1 is +0.1 and the difference between curve 3 and curve 1 is-0.2. Then based on the above differences, three threshold ranges may be determined including: less than-0.2, -0.2- +0.1 and more than +0.1. Similarly, when the preset radiation curve is plural, plural threshold ranges may be determined based on the above-described manner. That is, after determining the difference and the sign, the target threshold range within which the difference is located may be determined. For example, when the difference is +0.2, it is within the range of the target threshold value of-0.2 to +0.1.
It should be noted that the threshold ranges are less than-0.2, -0.2 to +0.1, and more than +0.1, which are only set to 3 threshold ranges from the mathematical point of view. In practical application, duv in May be determined in conjunction with subjective evaluation of the human eye, for example, three threshold ranges include: less than-0.4, -0.4- +0.3 and more than +0.3. Or, by increasing the threshold range from-0.2- +0.1 to-0.4- +0.3, the color temperature can be adjusted by switching to the curve 3 when the ambient light becomes relatively red or blue, instead of switching to the curve 3 when the ambient light is somewhat reddish, thereby achieving the effect that the color temperature of the display screen is not exactly the same as the color temperature of the ambient light. The technician can select a proper threshold range according to a specific scene, and under the condition that the color temperature of the display screen can be adjusted, the corresponding scheme falls into the protection scope of the disclosure.
In step 33, the electronic device may obtain a target radiation curve corresponding to the target threshold range according to a preset correspondence between the threshold range and the radiation curve. The electronic device may store a corresponding relationship between a preset threshold range and a radiation curve, for example, when the threshold range is-0.2- +0.1 corresponding to the curve 1, that is, the display color temperature of the display screen changes along the curve 1; when the color temperature is larger than +0.1, the curve is corresponding to the curve 2, namely, the display color temperature of the display screen changes along the curve 2; when the color temperature is less than-0.2, the curve 3 is corresponded, namely, the display color temperature of the display screen changes along the curve 3. Therefore, the corresponding difference duv when the ambient light corresponds to in When the target threshold value range is-0.2- +0.1, the target radiation curve is selected as curve 1, namely the display color temperature of the display screen changes along the curve 1; when duv in When the target radiation curve is larger than +0.1, the target radiation curve is selected to be a curve 2, namely the display color temperature of the display screen changes along the curve 2; when duv in Is less thanAt-0.2, the target radiation curve is selected to be curve 3, i.e. the display color temperature of the display screen varies along curve 3.
It should be noted that, in practical experiments, if the default white point of the display screen is above the black body radiation curve, the threshold value of the difference between the curve 2 and the curve 1 may be set to be larger than the threshold value of the difference between the curve 3 and the curve 1, and if the default white point of the display screen is below the black body radiation curve, the threshold value of the difference between the curve 3 and the curve 1 may be set to be larger than the threshold value of the difference between the curve 3 and the curve 1.
In this embodiment, the electronic device may further obtain a mapping matrix corresponding to the target radiation curve, which is shown in fig. 5 and includes steps 51 to 53. In step 51, the electronic device stores a preset corresponding relationship between the ambient light color temperature and the display screen color temperature. After obtaining the target ambient light color temperature, the electronic device may obtain a display screen color temperature corresponding to the ambient light color temperature, i.e., a target color temperature.
In step 52, the electronic device may determine a third color coordinate of the display screen white point color based on the difference and the target color temperature, i.e., the electronic device may be at a known duv in And a target color temperature CCT target Determining a third color coordinate u 'of a display screen target white point' target ,v′ target
In step 53, the electronic device may remap all colors in the chromaticity space according to the third color coordinate, and the mapping manner may refer to related technologies, which is not described herein again. Thus, the electronic equipment can obtain the mapping matrix A corresponding to the target radiation curve target
In step 14, a target RGB value of each pixel point in the image to be displayed is obtained according to the mapping matrix and the original RGB value of each pixel point, and is calculated by using the following formula:
Figure BDA0003138952820000121
in the formula, R origin ,G origin ,B origin For pixel data of the image to be displayed before the unadjusted color temperature, or calculated from pixel data of pixel pointsAn initial pixel value; r ', G ', B ' are for each R origin ,G origin ,B origin And adjusting the pixel data after the color temperature.
When the electronic device has a requirement for displaying the image to be displayed, the electronic device can display the image according to the pixel data after the color temperature is adjusted.
In this way, according to the scheme provided by the embodiment of the disclosure, the ambient light color temperature and the ambient light color coordinate outside the display screen of the electronic device are obtained; then, acquiring a difference value between a preset black body radiation curve and a color temperature point such as the ambient light color temperature according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves; then, determining a target radiation curve based on the difference and a preset difference threshold value and acquiring a mapping matrix corresponding to the target radiation curve; and finally, acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed. Like this, the demonstration colour temperature of display screen in this embodiment is changed into according to the radiation curve of difference and adjusts by adjusting according to fixed black body radiation curve, reaches the demonstration colour temperature of display screen and the effect that the environment light matches, makes its perception of adaptation people's eye to colour temperature and environment, promotes visual experience.
On the basis of the data processing method provided by the embodiment of the present disclosure, the embodiment of the present disclosure further provides a data processing apparatus applied to an electronic device, referring to fig. 6, where the apparatus includes:
the coordinate obtaining module 61 is configured to obtain an ambient light color temperature and an ambient light color coordinate outside a display screen of the electronic device;
a difference value obtaining module 62, configured to obtain, according to the ambient light color coordinate and the ambient light color temperature, a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic point; the black body radiation curve is one of preset radiation curves;
a matrix obtaining module 63, configured to determine a target radiation curve based on the difference and a preset difference threshold, and obtain a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves;
and the image processing module 64 is configured to obtain a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed.
In an embodiment, the difference obtaining module includes:
the first coordinate obtaining unit is used for obtaining a first color coordinate of a point, matched with the ambient light color coordinate, in a chromaticity space where the blackbody radiation curve is located;
the second coordinate acquisition unit is used for acquiring a second color coordinate of a point on the blackbody radiation curve, wherein the point has the same color temperature as the ambient light color temperature;
and the difference value acquisition unit is used for acquiring the distance between the first color coordinate and the second color coordinate, and taking the distance as the difference value.
In an embodiment, the first coordinate obtaining unit calculates the first color coordinate by using the following formula:
Figure BDA0003138952820000141
u 'in the formula' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate represents the ambient light coordinate.
In an embodiment, the second coordinate obtaining unit calculates the second color coordinate by using the following formula:
Figure BDA0003138952820000142
in formula (II) u' blockbody Abscissa, v 'representing second color coordinate' blockbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the isochromatic temperature point on the black body radiation curve c A ordinate indicating an isochromatic temperature point on the black body radiation curve;
Figure BDA0003138952820000143
Figure BDA0003138952820000144
in an embodiment, the difference obtaining unit calculates by using the following formula:
Figure BDA0003138952820000145
in the formula, duv in Representing the distance between the first color coordinate and the second color coordinate.
In one embodiment, the matrix acquisition module includes:
a sign obtaining unit configured to obtain a sign of the difference value;
the range acquisition unit is used for determining a target threshold range in which the difference value is located according to the difference value and the sign;
and the range acquisition unit is used for acquiring a target radiation curve corresponding to the target threshold range according to the corresponding relation between the preset threshold range and the radiation curve.
In one embodiment, the symbol acquisition unit includes:
the positive sign acquisition subunit is used for determining that the sign of the difference value is a positive sign when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate;
and the negative sign acquisition subunit is used for determining that the sign of the difference value is a negative sign when the abscissa of the first color coordinate is larger than the abscissa of the second color coordinate and the ordinate of the first color coordinate is smaller than the ordinate of the second color coordinate.
In one embodiment, the matrix acquisition module comprises:
the color temperature acquisition unit is used for determining a target color temperature corresponding to the ambient light color temperature on the basis of a preset corresponding relation between the ambient light color temperature and the display screen color temperature;
the coordinate acquisition unit is used for determining a third color coordinate of the white point color of the display screen according to the difference value and the target color temperature;
and the matrix acquisition unit is used for remapping all colors in a chromaticity space according to the third color coordinate to obtain a mapping matrix corresponding to the target radiation curve.
It should be noted that the content of the method embodiment shown in fig. 1 is matched with the content of the apparatus shown in this embodiment, and the content of the method embodiment may be referred to, which is not described herein again.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment. For example, the electronic device 700 may be a smartphone, a computer, a digital broadcast terminal, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 700 may include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor component 714, communication component 716, image capture component 718, and the aforementioned housings.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute computer programs. Further, processing component 702 may include one or more modules that facilitate interaction between processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include computer programs for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or 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 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700. The power supply 706 may include a power chip, and the controller may communicate with the power chip to control the power chip to turn on or off the switch device, so that the battery supplies or does not supply power to the motherboard circuit.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the target object. 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 input information from the target object. 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 the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The audio component 710 is configured to output and/or input audio file information. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio file information when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio file information may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio file information.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor component 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor component 714 may also detect a change in the position of the electronic device 700 or one of the components, the presence or absence of a target object in contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. In this example, the sensor assembly 714 may include a magnetic sensor, a gyroscope, and a magnetic field sensor, wherein the magnetic field sensor includes at least one of: hall sensor, thin film magneto resistance sensor, magnetic liquid acceleration sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi,2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives broadcast information or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 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 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital information processors (DSPs), digital information processing devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components.
In an exemplary embodiment, there is also provided an electronic device including:
a processor;
a memory for storing a computer program executable by the processor;
wherein the processor is configured to execute the computer program in the memory to implement the steps of the method of fig. 1.
In an exemplary embodiment, a computer readable storage medium, such as a memory including instructions, is also provided, the executable computer program being executable by a processor to implement the steps of the method as described in fig. 1. The readable storage medium may be, among others, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. A data processing method is applied to an electronic device, and the method comprises the following steps:
obtaining ambient light color temperature and ambient light color coordinates outside a display screen of the electronic device;
acquiring a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic point according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves;
determining a target radiation curve based on the difference and a preset difference threshold value and acquiring a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves;
and acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed.
2. The method of claim 1, wherein obtaining the difference between the isothermal point on the black body radiation curve and the ambient light color temperature according to the ambient light color coordinate and the ambient light color temperature comprises:
acquiring a first color coordinate of a point, matched with the ambient light color coordinate, in a chromaticity space where the black body radiation curve is located;
acquiring a second color coordinate of a point on the black body radiation curve, wherein the point has the same color temperature as the color temperature of the ambient light;
and acquiring the distance between the first color coordinate and the second color coordinate, and taking the distance as the difference value.
3. The method according to claim 2, wherein the first color coordinate of the point in the chromaticity space where the blackbody radiation curve is located, which matches the color coordinate of the ambient light, is obtained by using the following formula:
Figure FDA0003138952810000011
in formula (II) u' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate represents the ambient light coordinate.
4. The method of claim 2, wherein a second color coordinate of a point on the blackbody radiation curve having the same color temperature as the ambient light color temperature is obtained and calculated using the following formula:
Figure FDA0003138952810000021
in formula (II) u' blackbody Abscissa representing second color coordinateCoordinate, v' blackbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the isochromatic temperature point on the black body radiation curve c A vertical coordinate representing the isochromatic temperature points on the black body radiation curve;
Figure FDA0003138952810000022
Figure FDA0003138952810000023
5. the method of claim 2, wherein the distance between the first color coordinate and the second color coordinate is obtained by using the following formula:
Figure FDA0003138952810000024
in the formula, duv in Representing the distance between the first color coordinate and the second color coordinate.
6. The method of claim 1, wherein determining a target irradiance profile based on the difference and a preset difference threshold comprises:
acquiring the sign of the difference value;
determining a target threshold range in which the difference value is located according to the difference value and the sign;
and acquiring a target radiation curve corresponding to the target threshold range according to the corresponding relation between the preset threshold range and the radiation curve.
7. The method of claim 6, wherein obtaining the sign of the difference comprises:
when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate, determining that the sign of the difference value is a positive sign;
and when the abscissa of the first color coordinate is larger than the abscissa of the second color coordinate and the ordinate of the first color coordinate is smaller than the ordinate of the second color coordinate, determining that the sign of the difference value is a negative sign.
8. The method of claim 1, wherein obtaining a mapping matrix corresponding to the target radiation profile comprises:
determining a target color temperature corresponding to the ambient light color temperature of the display screen based on a preset corresponding relation between the ambient light color temperature and the display screen color temperature;
determining a third color coordinate of a white point color of the display screen according to the difference value and the target color temperature;
and remapping all colors in the chromaticity space according to the third color coordinate to obtain a mapping matrix corresponding to the target radiation curve.
9. A data processing apparatus, applied to an electronic device, the apparatus comprising:
the coordinate acquisition module is used for acquiring ambient light color temperature and ambient light color coordinates outside a display screen of the electronic equipment;
the difference value acquisition module is used for acquiring a difference value between a preset black body radiation curve and the ambient light color temperature isochromatic point according to the ambient light color coordinate and the ambient light color temperature; the black body radiation curve is one of preset radiation curves;
the matrix acquisition module is used for determining a target radiation curve based on the difference value and a preset difference value threshold and acquiring a mapping matrix corresponding to the target radiation curve; the target radiation curve is one of preset radiation curves;
and the image processing module is used for acquiring a target RGB value of each pixel point according to the mapping matrix and the original RGB value of each pixel point in the image to be displayed.
10. The apparatus of claim 9, wherein the difference acquisition module comprises:
the first coordinate obtaining unit is used for obtaining a first color coordinate of a point, matched with the ambient light color coordinate, in a chromaticity space where the blackbody radiation curve is located;
the second coordinate acquisition unit is used for acquiring a second color coordinate of a point on the blackbody radiation curve, wherein the point has the same color temperature as the ambient light color temperature;
and the difference value acquisition unit is used for acquiring the distance between the first color coordinate and the second color coordinate, and taking the distance as the difference value.
11. The apparatus according to claim 10, wherein the first coordinate obtaining unit calculates the first color coordinate using the following formula:
Figure FDA0003138952810000041
in formula (II) u' in Abscissa, v 'representing first color coordinate' in Ordinate, x, representing a first chromaticity coordinate in Abscissa, y, representing the coordinate of ambient light in The ordinate represents the ambient light coordinate.
12. The apparatus according to claim 10, wherein the second coordinate obtaining unit calculates the second color coordinates using the following formula:
Figure FDA0003138952810000042
u 'in the formula' blackbody Abscissa, v 'representing second color coordinate' blackbody Ordinate, x, representing second color coordinate c Abscissa, y, representing the isochromatic temperature point on the black body radiation curve c A vertical coordinate representing the isochromatic temperature points on the black body radiation curve;
Figure FDA0003138952810000043
Figure FDA0003138952810000044
13. the apparatus according to claim 10, wherein the difference value obtaining unit calculates using the following formula:
Figure FDA0003138952810000045
in the formula, dyv in Representing the distance between the first color coordinate and the second color coordinate.
14. The apparatus of claim 9, wherein the matrix acquisition module comprises:
a sign obtaining unit configured to obtain a sign of the difference value;
the range acquisition unit is used for determining a target threshold range in which the difference value is located according to the difference value and the sign;
and the range acquisition unit is used for acquiring a target radiation curve corresponding to the target threshold range according to the corresponding relation between the preset threshold range and the radiation curve.
15. The apparatus of claim 14, wherein the symbol acquisition unit comprises:
the positive sign acquisition subunit is used for determining that the sign of the difference value is a positive sign when the abscissa of the first color coordinate is smaller than the abscissa of the second color coordinate and the ordinate of the first color coordinate is larger than the ordinate of the second color coordinate;
and the negative sign acquisition subunit is used for determining that the sign of the difference value is a negative sign when the abscissa of the first color coordinate is greater than the abscissa of the second color coordinate and the ordinate of the first color coordinate is less than the ordinate of the second color coordinate.
16. The apparatus of claim 9, wherein the matrix acquisition module comprises:
the color temperature acquisition unit is used for determining a target color temperature corresponding to the color temperature of the ambient light on the basis of a preset corresponding relation between the color temperature of the ambient light and the color temperature of the display screen;
the coordinate acquisition unit is used for determining a third color coordinate of the white point color of the display screen according to the difference value and the target color temperature;
and the matrix acquisition unit is used for remapping all colors in the chromaticity space according to the third color coordinate to obtain a mapping matrix corresponding to the target radiation curve.
17. An electronic device, comprising:
a processor;
a memory for storing a computer program executable by the processor;
wherein the processor is configured to execute the computer program in the memory to implement the method of any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that an executable computer program in the storage medium, when executed by a processor, is capable of implementing the method according to any one of claims 1 to 8.
CN202110726738.6A 2021-06-29 2021-06-29 Data processing method and device, electronic equipment and storage medium Pending CN115546035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110726738.6A CN115546035A (en) 2021-06-29 2021-06-29 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110726738.6A CN115546035A (en) 2021-06-29 2021-06-29 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115546035A true CN115546035A (en) 2022-12-30

Family

ID=84705673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110726738.6A Pending CN115546035A (en) 2021-06-29 2021-06-29 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115546035A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079548A (en) * 2023-07-26 2023-11-17 上海傲显科技有限公司 Pixel processing method and device for elliptical angle screen and storage medium
CN117316122A (en) * 2023-11-21 2023-12-29 荣耀终端有限公司 Color temperature calibration method, electronic equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079548A (en) * 2023-07-26 2023-11-17 上海傲显科技有限公司 Pixel processing method and device for elliptical angle screen and storage medium
CN117316122A (en) * 2023-11-21 2023-12-29 荣耀终端有限公司 Color temperature calibration method, electronic equipment and medium
CN117316122B (en) * 2023-11-21 2024-04-09 荣耀终端有限公司 Color temperature calibration method, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN111508450B (en) Screen color conversion method and device, storage medium and electronic equipment
US10002577B2 (en) Color adjustment method and device, liquid crystal display
US10490162B2 (en) Display control method and device, and computer readable storage medium
WO2017024728A1 (en) Method and device for reducing display brightness
US10375366B2 (en) Method and apparatus for controlling screen of terminal device to emit light
CN107992182B (en) Method and device for displaying interface image
US10109248B2 (en) Method and device for adjusting liquid crystal display
CN115546035A (en) Data processing method and device, electronic equipment and storage medium
CN113257162B (en) Screen brightness adjusting method and device and storage medium
CN111696479B (en) Color gamut adjusting method and device
CN111210792A (en) Method and device for determining ambient light brightness, terminal and storage medium
CN107808626B (en) Method and device for adjusting color temperature of display screen and computer readable storage medium
WO2024045967A1 (en) Model adjustment method and device, display device, and storage medium
CN112905141A (en) Screen display method and device and computer storage medium
WO2016112730A1 (en) Method and device for adjusting display brightness
CN115731836A (en) Display effect control method and device of display screen, terminal equipment and medium
CN115145662A (en) Screen display brightness adjusting method and device and storage medium
CN108538261B (en) Display control method and device and display equipment
CN114067733A (en) Display screen correction method, display screen correction device and display chip
CN113257195A (en) Ambient light detection method and apparatus, electronic device, and storage medium
CN115762385A (en) Display effect control method and device of display screen, terminal equipment and medium
CN115394245A (en) Color temperature adjusting method and device, terminal and storage medium
CN115866133A (en) Terminal device control method and device, terminal device and storage medium
CN114414042A (en) Ambient light detection method and device, storage medium and electronic equipment
CN114760741A (en) RGB lamp correction method and device, electronic equipment, storage medium and chip

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