CN113949856A - Picture adjusting method and device and electronic equipment - Google Patents

Picture adjusting method and device and electronic equipment Download PDF

Info

Publication number
CN113949856A
CN113949856A CN202010681126.5A CN202010681126A CN113949856A CN 113949856 A CN113949856 A CN 113949856A CN 202010681126 A CN202010681126 A CN 202010681126A CN 113949856 A CN113949856 A CN 113949856A
Authority
CN
China
Prior art keywords
color
picture
value
subarea
determining
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
CN202010681126.5A
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.)
Oneplus Technology Shenzhen Co Ltd
Original Assignee
Oneplus Technology Shenzhen 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 Oneplus Technology Shenzhen Co Ltd filed Critical Oneplus Technology Shenzhen Co Ltd
Priority to CN202010681126.5A priority Critical patent/CN113949856A/en
Publication of CN113949856A publication Critical patent/CN113949856A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/02Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The invention relates to the technical field of display, and discloses a picture adjusting method and device and electronic equipment. The picture adjusting method is applied to electronic equipment and comprises the following steps: acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value; and adjusting the color value of each subarea picture according to the color gain value of each subarea picture. The method and the device can improve the authenticity of the picture by determining the corresponding color gain value based on the color temperature of the partition picture through the pre-established corresponding relation among the color point coordinate, the color temperature and the color gain value so as to adjust the color value of each partition picture.

Description

Picture adjusting method and device and electronic equipment
Technical Field
The present invention relates to the field of display technologies, and in particular, to a method and an apparatus for adjusting a picture, and an electronic device.
Background
White balance, an indicator describing the accuracy of white produced by mixing three primary colors of red, green and blue in a display. White balance is a very important concept in the field of television photography, by which a series of problems of color reproduction and tone processing can be solved. White balance adjustment generally includes three ways: preset white balance, manual white balance adjustment, and automatic tracking white balance adjustment.
At present, the white balance correction of a television system is realized by white picture correction, and only three color temperatures, namely cold color 12000, warm color 6500 and standard 9300, are provided at the same time, so that a user can select the color temperature in a menu according to the needs. And setting different color temperatures according to the current mode characteristics under different image modes. The image mode is changed when the difference of playing movies, TV plays, animations and the like, and different color temperatures are set, so that the set color temperature is fixed and unchanged in the whole film source playing process.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: the color temperature is fixed, so that the reality of the picture is insufficient.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a picture adjusting method, a device and an electronic apparatus, which can improve the reality of a picture.
In a first aspect, an embodiment of the present invention provides a picture adjustment method, which is applied to an electronic device, and the method includes:
acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture;
calculating the color temperature of each subarea picture corresponding to the current picture;
determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the corresponding relation;
and adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
In some embodiments, before obtaining the current picture, the method further includes pre-establishing a correspondence relationship between color point coordinates, color temperature, and color gain values, specifically including:
acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
and determining the matching relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
In some embodiments, the calculating the color temperature of each of the divided pictures includes:
determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
and calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
In some embodiments, the method further comprises:
and if the color blocks of any partition picture do not meet the preset condition, not adjusting the color values of the partition picture, wherein the preset condition comprises that the proportion of the color blocks is greater than a preset proportion threshold value.
In some embodiments, the color blocks include a first color block, a second color block, and a third color block, the preset ratio threshold includes a first ratio threshold, a second ratio threshold, and a third ratio threshold, and the preset condition includes:
the proportion of the first color block is larger than a first proportion threshold value, and/or the proportion of the second color block is larger than a second proportion threshold value, and/or the proportion of the third color block is larger than a third proportion threshold value.
In some embodiments, the method further comprises:
if the proportion of the specific color blocks in the effective color blocks is larger than a preset adjusting threshold value, dynamically adjusting the color gain value determined according to the corresponding relation.
In some embodiments, the color gain values are RGB gain values.
In a second aspect, an embodiment of the present invention provides a picture adjustment apparatus, applied to an electronic device, where the apparatus includes:
the device comprises a partition picture determining unit, a partition picture determining unit and a display unit, wherein the partition picture determining unit is used for acquiring a current picture, partitioning the current picture and determining a plurality of partition pictures corresponding to the current picture;
a color temperature calculation unit for calculating a color temperature of each of the divided pictures corresponding to the current picture;
the color gain value determining unit is used for determining the color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value;
and the color value adjusting unit is used for adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
In some embodiments, the apparatus further comprises: a correspondence relationship establishing unit, configured to establish in advance a correspondence relationship between color point coordinates, color temperature, and color gain values, and specifically configured to:
acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
and determining the matching relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
In some embodiments, the color temperature calculation unit is specifically configured to:
determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
and calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
In some embodiments, the apparatus further comprises:
and the preset condition unit is used for not adjusting the color value of the partition picture if the color blocks of any partition picture do not meet the preset condition, wherein the preset condition comprises that the proportion of the color blocks is greater than a preset proportion threshold value.
In some embodiments, the color blocks include a first color block, a second color block, and a third color block, the preset ratio threshold includes a first ratio threshold, a second ratio threshold, and a third ratio threshold, and the preset condition includes:
the proportion of the first color block is larger than a first proportion threshold value, and/or the proportion of the second color block is larger than a second proportion threshold value, and/or the proportion of the third color block is larger than a third proportion threshold value.
In some embodiments, the apparatus further comprises:
and the color gain value adjusting unit is used for dynamically adjusting the color gain value of each subarea picture determined according to the corresponding relation if the proportion of the specific color blocks in the effective color blocks is greater than a preset adjusting threshold value.
In some embodiments, the color gain values are RGB gain values.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described picture adjustment method.
In a fourth aspect, an embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions for causing an electronic device to execute the above-mentioned screen adjustment method.
In a fifth aspect, an embodiment of the present invention provides a computer program, where the computer program includes program instructions, and when the program instructions are executed by one or more processors in an electronic device, the electronic device is caused to execute the above-mentioned screen adjustment method.
The embodiment of the invention has the beneficial effects that: in contrast to the prior art, an image adjustment method provided in an embodiment of the present invention is applied to an electronic device, and the method includes: acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value; and adjusting the color value of each subarea picture according to the color gain value of each subarea picture. On one hand, the optimal color value of the picture under different scenes can be determined by pre-establishing the corresponding relation among the color point coordinate, the color temperature and the color gain value; on the other hand, the current picture is obtained and partitioned, and a plurality of partitioned pictures corresponding to the current picture are determined; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the corresponding relation; the color value of each subarea picture is adjusted according to the color gain value of each subarea picture, so that the color value can be accurately adjusted based on the subarea pictures, and the reality of the pictures is improved.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the invention;
FIG. 2 is a schematic diagram of a chromaticity diagram provided by an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for adjusting a screen according to an embodiment of the present invention;
fig. 4 is a flowchart of establishing a corresponding relationship according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of RGB gain values and color temperatures according to an embodiment of the present invention;
FIG. 6 is a detailed flowchart of step S20 in FIG. 3;
FIG. 7 is a flowchart of color block determination provided by an embodiment of the present invention;
FIG. 8 is a schematic flow chart of incremental compensation provided by an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a picture adjustment apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. The terms "first", "second", "third", and the like used in the present invention do not limit data and execution order, but distinguish the same items or similar items having substantially the same function and action.
Before the present invention is explained in detail, terms and expressions referred to in the embodiments of the present invention are explained, and the terms and expressions referred to in the embodiments of the present invention are applied to the following explanations.
(1) White balance: refers to the balance of white, and is an index of the accuracy of white color production by mixing the three primary colors red (R), green (G) and blue (B) in a display.
(2) Color point coordinates: also known as chromatic coordinates, are coordinates of colors, also called the table color system. The common color coordinates are x on the horizontal axis and y on the vertical axis. Color point coordinates, used to determine a point on the chromaticity diagram to accurately represent the color, are generally represented by (x, y).
(3) Color temperature: refers to a physical quantity in lighting optics that defines the color of a light source, i.e., a black body is heated to a temperature that emits light of the same color as the light emitted by the light source, and the temperature heated by the black body is referred to as the color temperature of the light source, referred to as color temperature, expressed in units of "K" (kelvin temperature units).
(4) Color gain value: refers to color gains in three primary colors, including a red gain (R gain), a green gain (G gain), and a blue gain (B gain).
(5) Color value: a color value corresponding to a color in different color modes is referred to, for example, a value corresponding to red in an RGB color mode is (255, 0, 0); the corresponding value of green in the RGB color mode is (0, 255, 0); the corresponding value of blue in the RGB color pattern is (0, 0, 255).
(6) Color block: the method refers to a block of a picture, each color block comprises a plurality of color block pixels, each color block pixel corresponds to a photosensitive pixel, and the photosensitive pixels are small squares of a single color and are basic composition units of the picture.
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment according to an embodiment of the present invention;
as shown in fig. 1, the application environment 300 includes an electronic device 100 and a touch device 200, wherein the touch device 200 is communicatively connected to the electronic device 100.
The electronic device 100 is in communication connection with the touch device 200, and includes a display panel for displaying a display screen, for example: presenting a television screen, where the touch device 200 is configured to send a control instruction to the electronic device 100, for example: the touch device 200 is connected to the electronic device 100, and the touch device 200 sends a switching image instruction to the electronic device 100, where the switching image instruction carries switching image information, so that the electronic device 100 switches the display image of the display screen to an image corresponding to the switching image information based on the switching image information.
The touch device 200 is in communication connection with the electronic device 100, and the touch device 200 includes a touch screen and/or physical keys, where the touch screen and/or the physical keys are used to provide an operation for a user, so that the user triggers the touch screen and/or the physical keys to generate a control instruction, and the touch device 200 sends the control instruction to the electronic device 100.
In some embodiments, the electronic device includes a first communication unit, the touch device includes a second communication unit, and the first communication unit and the second communication unit perform data and/or signal interaction based on a communication protocol to implement communication between the electronic device and the touch device. The communication protocols include, but are not limited to: TCP/IP (Transport Control Protocol/Internet Protocol, transmission Control Protocol/Internet Protocol), IPX/SPX (Internet packet exchange/sequence packet exchange) Protocol, Http (HyperText Transfer Protocol), infrared communication Protocol, and the like. Preferably, the first communication unit and the second communication unit in the present invention communicate with each other using an infrared communication protocol.
In some embodiments, the number of the electronic device 100 may be one or more, and the electronic device 100 includes: the number of the touch devices 200 may be one or more, and the touch devices 200 include a mobile terminal, a remote controller, an infrared emitter, and the like.
Referring to fig. 2, fig. 2 is a schematic diagram of a chromaticity diagram according to an embodiment of the invention;
as shown in fig. 2, the color temperature TCIn the range of 1000K-infinity. However, in a real daily environment, due to the influence of light and latitude, a general picture, for example: the television picture has a relatively normal effect in a color temperature range from 5000K to 17000K, and the picture exceeding the color temperature range is easy to have color cast, so that the picture reality is reduced. Therefore, the color temperature is divided into N ranges, where N is a positive integer, and the width of each range is: (17000- & lt5000- & gt)/N, and the color temperatures less than 5000K are all set to 5000K, and the color temperatures more than 17000K are all set to 17000K. By dividing the range of color temperatures, canThe color gain value corresponding to the color temperature can be determined more accurately.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating a method for adjusting a frame according to an embodiment of the present invention;
as shown in fig. 3, the screen adjustment method is applied to the electronic device, and specifically, an execution subject of the screen adjustment method is one or more processors of the electronic device, and the screen adjustment method includes:
step S10: acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture;
specifically, before the current picture is acquired, the method further includes: pre-establishing a corresponding relation among color point coordinates, color temperature and color gain values;
specifically, please refer to fig. 4 again, fig. 4 is a flowchart of establishing a corresponding relationship according to an embodiment of the present invention;
as shown in fig. 4, the step S11: pre-establishing a corresponding relationship among color point coordinates, color temperatures and color gain values, including:
step S111: acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
the electronic equipment acquires a multi-frame test picture sent by the touch equipment, wherein the multi-frame test picture comprises a plurality of pictures with different color temperatures and/or different brightness, and the electronic equipment determines the color point coordinates of each test picture of the multi-frame test picture respectively.
Specifically, the electronic device includes a test panel and/or a chromaticity measuring apparatus, where the test panel and/or the chromaticity measuring apparatus is configured to measure a color point coordinate (x, y) and a luminance value Lv of each color block pixel of the test picture, where each color block pixel is composed of three primary colors, namely, red R, green G, and blue B, and each primary color includes a color point coordinate and a luminance value, that is, the test panel and/or the chromaticity measuring apparatus is configured to measure a color point coordinate and a luminance value of each primary color, namely, R (x, y, Lv), G (x, y, Lv), and B (x, y, Lv), of each color block pixel of the test picture.
Step S112: calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
specifically, the color temperature of each primary color of each color block pixel is calculated according to the color point coordinates (x, y) of each color block pixel of each frame of the test picture, wherein the color temperature calculation formula is as follows:
Figure BDA0002585869340000091
and calculating the color temperature of each primary color of each color block pixel, averaging the color temperature of each primary color to obtain the average color temperature of each primary color, and taking the average color temperature of each primary color as the color temperature of the primary color of the frame test picture.
It is understood that there are other ways to calculate the corresponding color temperature according to the color point coordinates, which belong to the prior art and are not described herein again.
By calculating the color temperature of each primary color of each color block pixel of each frame of test picture, the corresponding color point coordinate and color temperature can be better matched for the color gain value, so that the corresponding relation among the color point coordinate, the color temperature and the color gain value is better established.
Step S113: dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
specifically, the color gain values in the embodiment of the present invention are RGB gain values, which include a red gain (R gain), a green gain (G gain), and a blue gain (B gain). Wherein, the adjustable range of the gain of each primary color is 0-2048, and the dynamic adjustment of the color gain value of each frame of test picture comprises:
and determining an adjustment interval of each frame of test picture, wherein the adjustment interval is within the adjustable range, and dynamically adjusting the color gain value of each frame of test picture in the adjustment interval, namely dynamically adjusting the gain of each primary color of each frame of test picture, including red gain, green gain and blue gain.
The matching of the corresponding color point coordinates and color temperature comprises:
for each frame of the test picture, the gain of each primary color matches the corresponding color point coordinate and color temperature, that is, for each frame of the test picture, the red gain, the green gain, and the blue gain matches the corresponding color point coordinate and color temperature, respectively establishing a first matching table of the red gain, a second matching table of the green gain, and a third matching table of the blue gain.
In the embodiment of the present invention, the adjustment interval of the gain of each primary color may be set artificially, for example: set to 400 to 512, i.e. (400,512), taking the adjustment interval (400,512) as an example, see tables 1, 2, and 3 below, where table 1 is a first matching table for red gain, table 2 is a second matching table for green gain, and table 3 is a third matching table for blue gain;
Figure BDA0002585869340000101
TABLE 1
Figure BDA0002585869340000102
Figure BDA0002585869340000111
TABLE 2
Figure BDA0002585869340000112
TABLE 3
Referring to fig. 5 again, fig. 5 is a schematic diagram of RGB gain values and color temperatures according to an embodiment of the invention;
as shown in fig. 5, the red gain R, the green gain G, and the blue gain B correspond to the X-axis, the Y-axis, and the Z-axis of the world coordinate system, i.e., the X, Y, Z values in the above tables 1, 2, and 3 represent the red gain R, the green gain G, and the blue gain B, respectively.
Wherein X in tables 1, 2, 3 represents the red gain R, Y represents the green gain G, Z represents the blue gain B, X represents the abscissa in the coordinates of the color point, Y represents the ordinate in the coordinates of the color point, Lv represents the luminance, Tc represents the color temperature.
The correspondence of color point coordinates, color temperature and color gain values can be established by the first matching table of red gain, the second matching table of green gain and the third matching table of blue gain. As can be seen from the above tables 1, 2, and 3, the values of BX and GX are close to be consistent, and the values of RY and BY are close to be consistent, so that BX ═ GX and RY ═ BY can be obtained, thereby establishing the 3D lut lookup table, in the embodiment of the present invention, the corresponding relation of the color point coordinate, the color temperature, and the color gain value is a lookup table, specifically, the corresponding relation is a 3D lut lookup table, which is equivalent to establishing a 3D lut lookup table of the color point coordinate, the color temperature, and RGB gain, the RGB gain includes R gain, G gain, and Bgain, i.e., R gain value, G gain value, and B gain value, respectively, and the 3D lut lookup table is used for processing the color value, i.e., RGB value.
It can be understood that when building the 3D lut look-up table, a plurality of discrete color point coordinates, color temperatures and color gain values are needed first, and the plurality of discrete color point coordinates, color temperatures and color gain values need not be continuous, which is equivalent to recording only a part of the colors, so that the speed of building the table can be increased.
Specifically, in the embodiment of the present invention, the RGB color model is taken as an example, and the color of each pixel in the picture is composed of three RGB colors, so that the 3D lut lookup table is stored in a three-dimensional array manner. If each pixel in the three-dimensional array is imagined as a point in solid space and R, G, B represents the coordinates of X, Y, Z, respectively, then all the pixels in the three-dimensional array may constitute a cube. Taking the example of an RGB value occupying 24bits, that is, three primary colors are recorded by 24-bit binary digits, and each primary color is recorded by 8-bit binary digits, so the value of R, G, B ranges from 0 to 255, and the number of corresponding color temperatures is 255 × 255, so the length, width and height of the cube are 255 × 255. When the color of a certain pixel after being processed needs to be obtained, the pixel at that position is the processed color as long as the value of R, G, B before the pixel is processed is taken as the coordinate of X, Y, Z in the 3D lut lookup table. In the embodiment of the present invention, the RGB values occupy 36bits, that is, three primary colors are recorded by 36-bit binary digits, and each primary color is recorded by 12-bit binary digits, that is, each primary color occupies 12bits, so that the value of R, G, B ranges from 0 to 4095, and the number of corresponding color temperatures is 4096 × 4096, and thus, the length, width, and height of the cube corresponding to the three-dimensional array is 4096 × 4096.
Step S114: and determining the matching relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
Specifically, since only a plurality of discrete color point coordinates, color temperatures, and color gain values are used when the 3D lut is built, and the plurality of discrete color point coordinates, color temperatures, and color gain values do not need to be continuous, which is equivalent to only recording a part of colors, in order to accurately establish the correspondence relationship between the color point coordinates, color temperatures, and color gain values, it is necessary to determine colors that are not in the 3D lut by interpolation, specifically, the interpolation is performed by an interpolation algorithm, and the interpolation algorithm includes but is not limited to: nearest neighbor interpolation, piecewise interpolation, spline interpolation, bilinear interpolation, bicubic interpolation, and the like. The matching relation of the coordinates, the color temperature and the color gain value of each color point is determined through interpolation, and then the corresponding relation is determined, so that the corresponding relation of the coordinates, the color temperature and the color gain value of each color point is more detailed, the color value can be determined quickly, and the speed of picture adjustment is improved.
In the embodiment of the invention, the adjusted values of R, G and B, namely R1, G1 and B1, are determined by inputting R, G and B signals, namely the values of R, G and B, and transforming through the 3D lut lookup table, and the 3D lut lookup table has corresponding coordinate points for each RGB value, so that the color gamut can be adjusted to be wide, the color cast can be calibrated, the color value of a picture is more accurate, and the presentation effect is better.
Specifically, a current picture is acquired, for example: if the electronic device is a television, acquiring a current television picture, and partitioning the current picture, specifically, partitioning the current picture includes:
determining the length and width of a current picture and determining the length and width of a partitioned picture;
the current picture is partitioned according to the length and width of the current picture and the length and width of the partition picture, and it can be understood that the length of the current picture is an integral multiple of the length of the partition picture, and the width of the current picture is an integral multiple of the width of the partition picture.
Or, determining the number of the partition pictures, and partitioning the current picture according to the number of the partition pictures, for example: if the number of the partition pictures is determined to be i x j, the length of the current picture is divided into i equal parts, the width of the current picture is divided into j equal parts, and therefore the current picture is divided into i x j partition pictures, wherein i and j are positive integers.
It can be understood that, in the embodiment of the present invention, it is assumed that the pictures are all standard rectangular or square pictures to facilitate dividing, and for the picture with an irregular pattern, the embodiment of the present invention performs processing by dividing small rectangles or small squares with equal areas, for example: and dividing the picture of the irregular figure into a plurality of small squares with equal areas.
Step S20: calculating the color temperature of each subarea picture corresponding to the current picture;
specifically, referring back to fig. 6, fig. 6 is a detailed flowchart of step S20 in fig. 3;
as shown in fig. 6, the step S20: calculating a color temperature of each of the divided pictures corresponding to the current picture, including:
step S21: determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
specifically, the determining the valid color blocks in each partition picture includes:
determining the proportion of effective pixels of each color block of each partition picture, if the proportion of the effective pixels of any color block is greater than a preset pixel proportion threshold value, determining that the color block is an effective color block, wherein the effective color block comprises various color blocks, such as: white color block, orange color block, blue color block, green color block, etc. Or, determining the proportion of the effective pixels of each color block of each partition picture in a histogram statistical manner, and if the proportion of the effective pixels of any color block is greater than a preset pixel proportion threshold value, determining that the color block is an effective color block. In the embodiment of the present invention, the effective pixels refer to effective color block pixels, which are pixel values actually participating in the photosensitive imaging. By determining the effective color blocks in each subarea picture, the color temperature of each color block can be better determined, thereby being beneficial to adjusting the color value of each subarea picture.
Step S22: and calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
Specifically, after determining effective color blocks in each partition screen, calculating a color temperature of each effective color block of the partition screen, where calculating the color temperature of each effective color block of the partition screen includes: and calculating the color temperature of each primary color of each color block pixel according to the color point coordinates of each color block pixel of the subarea picture, wherein the color temperature calculation formula refers to the formula (1) above, the color temperature of each primary color of each color block pixel is calculated, then the color temperature of each primary color of a plurality of color block pixels is averaged, so that the average color temperature of each primary color of the effective color blocks of the subarea picture is obtained, the average color temperature is used as the color temperature of each primary color of the effective color blocks, and the color temperature of each primary color of all the effective color blocks is calculated.
After the color temperature of each primary color of all the effective color blocks of the subarea picture is calculated, the color temperature of each primary color of all the effective color blocks of the subarea picture is averaged to obtain the average value of the color temperatures of all the effective color blocks, and the average value is determined to be the color temperature of the subarea picture. The average value of the color temperatures of all the effective color blocks is calculated, and the average value is determined as the color temperature of the subarea picture, so that the color temperature of the subarea picture can be better reflected, errors are reduced, the determination of the color gain value of the subarea picture is facilitated, and the accuracy of the color gain value is improved.
In an embodiment of the present invention, the method further comprises:
and if the color blocks of any partition picture do not meet the preset condition, not adjusting the color values of the partition picture, wherein the preset condition comprises that the proportion of the color blocks is greater than a preset proportion threshold value.
Wherein, by calculating the proportion of a plurality of color blocks in the partition picture, the plurality of color blocks include white blocks and/or orange blocks and/or blue blocks, the preset condition is used to determine whether to adjust the color values of the partition picture, that is, the RGB values of the partition picture, and the preset condition includes that the proportion of the plurality of color blocks is greater than a preset proportion threshold, for example: the method comprises the steps that a plurality of color blocks comprise white blocks, the preset condition is that the proportion of the white blocks in all the color blocks of a subarea picture is larger than a preset proportion threshold value, if the proportion of the white blocks in all the color blocks of the subarea picture is larger than a preset proportion threshold value, it is determined that the color blocks of the subarea picture meet the preset condition, at the moment, color value adjustment is conducted on the subarea picture, if the proportion of the white blocks in all the color blocks of the subarea picture is not larger than a preset proportion threshold value, it is determined that the color blocks of the subarea picture do not meet the preset condition, and at the moment, color value adjustment is not conducted on the subarea picture. In the embodiment of the present invention, the preset proportion threshold is manually set as required, for example: and if the proportion of the white color blocks in all the color blocks of the subarea picture is not more than 50%, determining that the color blocks of the subarea picture do not meet the preset condition, and at the moment, not adjusting the color values of the subarea picture.
Specifically, the color blocks include a first color block, a second color block, and a third color block, the preset ratio threshold includes a first ratio threshold, a second ratio threshold, and a third ratio threshold, and the preset condition includes:
the proportion of the first color block is larger than a first proportion threshold value, and/or the proportion of the second color block is larger than a second proportion threshold value, and/or the proportion of the third color block is larger than a third proportion threshold value.
Specifically, the first color block is a white color block, the second color block is an orange color block, the third color block is a blue color block, the preset condition includes that the proportion of the first color block is greater than a first proportion threshold value, that is, the proportion of the white color block to all the color blocks of the subarea picture is greater than the first proportion threshold value, the proportion of the second color block is greater than a second proportion threshold value, that is, the proportion of the orange color block to all the color blocks of the subarea picture is greater than a second proportion threshold value, and the proportion of the third color block is greater than a third proportion threshold value, that is, the proportion of the third color block to all the color blocks of the subarea picture is greater than a third proportion threshold value.
In the embodiment of the present invention, the first ratio threshold, the second ratio threshold, and the third ratio threshold may be artificially set as required, for example: the first proportional threshold is set to 50%, the second proportional threshold is set to 35%, and the third proportional threshold is set to 35%.
Wherein the preset conditions include: the ratio of the first color block is greater than a first ratio threshold, and/or the ratio of the second color block is greater than a second ratio threshold, and/or the ratio of the third color block is greater than a third ratio threshold, which is equivalent to determining that the partition picture meets the preset condition as long as any one or two or three of the first color block, the second color block and the third color block is greater than the ratio threshold corresponding to the first color block, the second color block and the third color block.
Preferably, the preset conditions in the embodiment of the present invention are that the proportion of the first color patch is greater than a first proportion threshold, the proportion of the second color patch is greater than a second proportion threshold, and the proportion of the third color patch is greater than a third proportion threshold. Specifically, please refer to fig. 7 again, fig. 7 is a flowchart of color block determination provided in the embodiment of the present invention;
as shown in fig. 7, the process of determining color blocks includes:
step S71: determining the proportion of the first color block, the proportion of the second color block and the proportion of the third color block of each partition picture;
specifically, the first color block is a white color block, the proportion of the first color block is the proportion of the white color block to all the color blocks of the partition picture, the second color block is an orange color block, the proportion of the second color block is the proportion of the orange color block to all the color blocks of the partition picture, the third color block is a blue color block, and the proportion of the third color block is the proportion of the blue color block to all the color blocks of the partition picture.
Step S72: judging whether the proportion of the first color block is larger than a first proportion threshold value or not;
specifically, the first proportional threshold may be manually set as required, for example: set to 40%, 45%, 50%, etc., preferably, the first ratio threshold in the embodiment of the present invention is set to 50%, and if the ratio of the first color patch is greater than 50%, the step S74 is proceeded to: judging whether the proportion of the second color block is larger than a second proportion threshold value or not; if the proportion of the first color block is not greater than 50%, the process proceeds to step S73: not adjusting the color value of the partitioned picture;
step S73: not adjusting the color value of the partitioned picture;
specifically, the not adjusting the color value of the partition image includes: and determining the color gain value of each subarea picture without the corresponding relation among the color point coordinates, the color temperature and the color gain value so as to maintain the color value of the subarea picture.
Step S74: judging whether the proportion of the second color block is larger than a second proportion threshold value or not;
specifically, the second ratio threshold may be set manually as needed, for example: set to 30%, 35%, 40%, etc., preferably, the second ratio threshold in the embodiment of the present invention is set to 35%, and if the ratio of the second color patch is greater than 35%, the process proceeds to step S75: judging whether the proportion of the third color block is greater than a third proportion threshold value; if the ratio of the second color patch is not greater than 35%, the process proceeds to step S73: not adjusting the color value of the partitioned picture;
step S75: judging whether the proportion of the third color block is greater than a third proportion threshold value;
specifically, the third ratio threshold may be set manually as needed, for example: set to 30%, 35%, 40%, etc., preferably, the third ratio threshold in the embodiment of the present invention is set to 35%, and if the ratio of the third color patch is greater than 35%, the process proceeds to step S76: adjusting the color value of the partition picture; if the proportion of the third color patch is not greater than 35%, the process proceeds to step S73: not adjusting the color value of the partitioned picture;
step S76: adjusting the color value of the partition picture;
specifically, the adjusting the color value of the partition image includes: and determining the color gain value of each subarea picture according to the corresponding relation of the color point coordinate, the color temperature and the color gain value, and adjusting the color value of the subarea picture to be the color gain value obtained through the corresponding relation.
Step S30: determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value;
specifically, according to the color temperature of each partition screen, the color gain value corresponding to the color temperature of the partition screen is obtained from the corresponding relationship. In the embodiment of the present invention, the corresponding relationship is a 3D lut, and since the 3D lut usually does not exhaust coordinates of each color point, color temperature, and color gain value, a color gain value corresponding to the color temperature of the partition screen may be determined based on the color temperature and the color gain value already existing in the 3D lut through an interpolation algorithm. Wherein the interpolation algorithm includes but is not limited to: nearest neighbor interpolation, piecewise interpolation, spline interpolation, bilinear interpolation, bicubic interpolation, and the like.
Step S40: and adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
Specifically, after determining the color gain value corresponding to the color temperature of the divided picture according to the corresponding relationship, the color value of each divided picture is adjusted to the color gain value determined by the corresponding relationship, the corresponding relationship in the embodiment of the present invention is a 3D lut lookup table, which is equivalent to adjusting the color value of each divided picture to the color gain value determined by the 3D lut lookup table, or the color gain value of each divided picture is adjusted to the color gain value corresponding to the color temperature of the divided picture obtained by interpolation through the 3D lut lookup table.
It can be understood that the whole adjustment of the current picture is realized by performing color value adjustment on each partition picture, which is equivalent to performing partition adjustment on the current picture, and replacing the original picture with each partition picture after the adjustment. By means of adjusting each partitioned picture in a partitioning mode, the embodiment of the invention can realize finer adjustment and improve the reality of the picture.
In an embodiment of the present invention, the method further comprises:
if the proportion of the specific color blocks in the effective color blocks is larger than a preset adjusting threshold value, dynamically adjusting the color gain value determined according to the corresponding relation.
Specifically, if the ratio of a specific color block in the effective color blocks is greater than a preset adjustment threshold, the color gain value determined according to the correspondence is dynamically adjusted, that is, the color gain value of the corresponding partition picture is adjusted, specifically, the color gain value of at least one primary color in the color gain values of the partition picture is adjusted. For example: the preset adjustment threshold is 70%, the specific color blocks are green color blocks, and if the proportion of the green color blocks in the effective color blocks is greater than 70%, the color gain values obtained according to the corresponding relationship are adjusted, for example: compensating for an increase in the color gain value of at least one of the color gain values, such as: the color gain values, i.e., the G values among the RGB values, are compensated for increase.
Specifically, please refer to fig. 8, fig. 8 is a schematic flow chart of augmentation compensation according to an embodiment of the present invention;
as shown in fig. 8, the compensating for the increase in the color gain value of at least one of the primary colors includes:
step S81: determining a proportion of particular ones of the valid color blocks;
specifically, the specific color block in the effective color block may be a white color block, an orange color block, a blue color block, or a green color block. Preferably, the specific color block in the embodiment of the present invention is a green color block.
Step S82: calculating the proportion value of a specific color block in the effective color blocks exceeding a preset adjustment threshold value;
specifically, the preset adjustment threshold may be manually set as required, for example: set to 60%, 70%, 80%, etc., and preferably, the embodiment of the present invention sets the preset adjustment threshold to 70%. And calculating the ratio of the specific color blocks in the effective color blocks to exceed the ratio value of a preset adjustment threshold, and taking the difference value as the ratio value for calculating the difference value between the ratio of the specific color blocks in the effective color blocks and the preset adjustment threshold.
It is understood that, if the proportion of a specific color block in the effective color blocks is not greater than the preset adjustment threshold, it is not necessary to calculate a proportion value of the specific color block in the effective color blocks exceeding the preset adjustment threshold.
Step S83: and performing increase compensation on the color gain value of at least one primary color in the color gain values based on a preset increase compensation relation.
Specifically, the increase compensation relationship is a relationship between the proportional value and the increase value, for example: the proportional value is in direct proportion to the increase value, for example, when the proportional value is 1%, the increase value is 1, and if the proportion of the green color blocks in the effective color blocks is 80%, and the preset adjustment threshold is 70%, the increase value is (80% -70%) (1/1%) is 10, that is, the green gain G gain in the color gain value is increased by 10.
It is understood that after the color gain value of at least one primary color in the color gain values is increased and compensated, the color gain value of each of the divided pictures is re-determined, and the color value of each of the divided pictures is adjusted to the color gain value after the increased and compensated color gain value, so as to better adjust the color value of each of the divided pictures, thereby achieving better adjustment of the color value of the current picture, and enabling a higher degree of realism of the picture.
In an embodiment of the present invention, a method for adjusting an image is provided, where the method is applied to an electronic device, and the method includes: acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value; and adjusting the color value of each subarea picture according to the color gain value of each subarea picture. On one hand, the optimal color value of the picture under different scenes can be determined by pre-establishing the corresponding relation among the color point coordinate, the color temperature and the color gain value; on the other hand, the current picture is obtained and partitioned, and a plurality of partitioned pictures corresponding to the current picture are determined; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the corresponding relation; the color value of each subarea picture is adjusted according to the color gain value of each subarea picture, so that the color value can be accurately adjusted based on the subarea pictures, and the reality of the pictures is improved.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a picture adjusting apparatus according to an embodiment of the present invention; the image adjusting apparatus 900 is applied to an electronic device, and in particular, to one or more processors of the electronic device.
As shown in fig. 9, the screen adjusting apparatus 900 includes:
a correspondence relationship establishing unit 901, configured to establish in advance a correspondence relationship between color point coordinates, color temperature, and color gain values;
a partition picture determining unit 902, configured to obtain a current picture, partition the current picture, and determine a plurality of partition pictures corresponding to the current picture;
a color temperature calculation unit 903 for calculating a color temperature of each divided picture corresponding to the current picture;
a color gain value determining unit 904, configured to determine a color gain value of each partition frame based on the color temperature of each partition frame according to a pre-established correspondence relationship between color point coordinates, color temperatures, and color gain values;
the color value adjusting unit 905 is configured to adjust a color value of each of the divided frames according to the color gain value of each of the divided frames.
In this embodiment of the present invention, the correspondence relationship establishing unit 901 is specifically configured to:
acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
the electronic equipment acquires a multi-frame test picture sent by the touch equipment, wherein the multi-frame test picture comprises a plurality of pictures with different color temperatures and/or different brightness, and the electronic equipment determines the color point coordinates of each test picture of the multi-frame test picture respectively.
Specifically, the electronic device includes a test panel and/or a chromaticity measuring apparatus, where the test panel and/or the chromaticity measuring apparatus is configured to measure a color point coordinate (x, y) and a luminance value Lv of each color block pixel of the test picture, where each color block pixel is composed of three primary colors, namely, red R, green G, and blue B, and each primary color includes a color point coordinate and a luminance value, that is, the test panel and/or the chromaticity measuring apparatus is configured to measure a color point coordinate and a luminance value of each primary color, namely, R (x, y, Lv), G (x, y, Lv), and B (x, y, Lv), of each color block pixel of the test picture.
Calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
specifically, the color temperature of each primary color of each color block pixel is calculated according to the color point coordinates (x, y) of each color block pixel of each frame of the test picture, wherein the color temperature calculation formula is shown in formula (1) in the above embodiment.
And calculating the color temperature of each primary color of each color block pixel, averaging the color temperature of each primary color to obtain the average color temperature of each primary color, and taking the average color temperature of each primary color as the color temperature of the primary color of the frame test picture.
It is understood that there are other ways to calculate the corresponding color temperature according to the color point coordinates, which belong to the prior art and are not described herein again.
By calculating the color temperature of each primary color of each color block pixel of each frame of test picture, the corresponding color point coordinate and color temperature can be better matched for the color gain value, so that the corresponding relation among the color point coordinate, the color temperature and the color gain value is better established.
Dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
specifically, the color gain values in the embodiment of the present invention are RGB gain values, which include a red gain (R gain), a green gain (G gain), and a blue gain (B gain). Wherein, the adjustable range of the gain of each primary color is 0-2048, and the dynamic adjustment of the color gain value of each frame of test picture comprises:
and determining an adjustment interval of each frame of test picture, wherein the adjustment interval is within the adjustable range, and dynamically adjusting the color gain value of each frame of test picture in the adjustment interval, namely dynamically adjusting the gain of each primary color of each frame of test picture, including red gain, green gain and blue gain.
The matching of the corresponding color point coordinates and color temperature comprises:
for each frame of the test picture, the gain of each primary color matches the corresponding color point coordinate and color temperature, that is, for each frame of the test picture, the red gain, the green gain, and the blue gain matches the corresponding color point coordinate and color temperature, respectively establishing a first matching table of the red gain, a second matching table of the green gain, and a third matching table of the blue gain.
And determining the matching relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
Specifically, since only a plurality of discrete color point coordinates, color temperatures, and color gain values are used when the 3D lut is built, and the plurality of discrete color point coordinates, color temperatures, and color gain values do not need to be continuous, which is equivalent to only recording a part of colors, in order to accurately establish the correspondence relationship between the color point coordinates, color temperatures, and color gain values, it is necessary to determine colors that are not in the 3D lut by interpolation, specifically, the interpolation is performed by an interpolation algorithm, and the interpolation algorithm includes but is not limited to: nearest neighbor interpolation, piecewise interpolation, spline interpolation, bilinear interpolation, bicubic interpolation, and the like. The corresponding relation among the coordinates of each color point, the color temperature and the color gain value is determined through interpolation, and then the corresponding relation is determined, so that the corresponding relation among the coordinates of the color points, the color temperature and the color gain value is more detailed, the color value can be determined quickly, and the speed of picture adjustment is improved.
In the embodiment of the invention, the adjusted values of R, G and B, namely R1, G1 and B1, are determined by inputting R, G and B signals, namely the values of R, G and B, and transforming through the 3D lut lookup table, and the 3D lut lookup table has corresponding coordinate points for each RGB value, so that the color gamut can be adjusted to be wide, the color cast can be calibrated, the color value of a picture is more accurate, and the presentation effect is better.
In an embodiment of the present invention, the color temperature calculating unit 903 is specifically configured to:
determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
specifically, the determining the valid color blocks in each partition picture includes:
determining the proportion of effective pixels of each color block of each partition picture, if the proportion of the effective pixels of any color block is greater than a preset pixel proportion threshold value, determining that the color block is an effective color block, wherein the effective color block comprises various color blocks, such as: white color block, orange color block, blue color block, green color block, etc. In the embodiment of the present invention, the effective pixels refer to effective color block pixels, which are pixel values actually participating in the photosensitive imaging. By determining the effective color blocks in each subarea picture, the color temperature of each color block can be better determined, thereby being beneficial to adjusting the color value of each subarea picture.
And calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
Specifically, after determining effective color blocks in each partition screen, calculating a color temperature of each effective color block of the partition screen, where calculating the color temperature of each effective color block of the partition screen includes: and calculating the color temperature of each primary color of each color block pixel according to the color point coordinates of each color block pixel of the subarea picture, wherein the color temperature calculation formula refers to the formula (1) above, the color temperature of each primary color of each color block pixel is calculated, then the color temperature of each primary color of a plurality of color block pixels is averaged, so that the average color temperature of each primary color of the effective color blocks of the subarea picture is obtained, the average color temperature is used as the color temperature of each primary color of the effective color blocks, and the color temperature of each primary color of all the effective color blocks is calculated.
After the color temperature of each primary color of all the effective color blocks of the subarea picture is calculated, the color temperature of each primary color of all the effective color blocks of the subarea picture is averaged to obtain the average value of the color temperatures of all the effective color blocks, and the average value is determined to be the color temperature of the subarea picture. The average value of the color temperatures of all the effective color blocks is calculated, and the average value is determined as the color temperature of the subarea picture, so that the color temperature of the subarea picture can be better reflected, errors are reduced, the determination of the color gain value of the subarea picture is facilitated, and the accuracy of the color gain value is improved.
In an embodiment of the present invention, the apparatus further includes:
a preset condition unit (not shown) configured to not adjust the color value of the partition image if the color blocks of any partition image do not satisfy a preset condition, where the preset condition includes that a ratio of the color blocks is greater than a preset ratio threshold.
Wherein, by calculating the proportion of a plurality of color blocks in the partition picture, the plurality of color blocks include white blocks and/or orange blocks and/or blue blocks, the preset condition is used to determine whether to adjust the color values of the partition picture, that is, the RGB values of the partition picture, and the preset condition includes that the proportion of the plurality of color blocks is greater than a preset proportion threshold, for example: the method comprises the steps that a plurality of color blocks comprise white blocks, the preset condition is that the proportion of the white blocks in all the color blocks of a subarea picture is larger than a preset proportion threshold value, if the proportion of the white blocks in all the color blocks of the subarea picture is larger than a preset proportion threshold value, it is determined that the color blocks of the subarea picture meet the preset condition, at the moment, color value adjustment is conducted on the subarea picture, if the proportion of the white blocks in all the color blocks of the subarea picture is not larger than a preset proportion threshold value, it is determined that the color blocks of the subarea picture do not meet the preset condition, and at the moment, color value adjustment is not conducted on the subarea picture. In the embodiment of the present invention, the preset proportion threshold is manually set as required, for example: and if the proportion of the white color blocks in all the color blocks of the subarea picture is not more than 50%, determining that the color blocks of the subarea picture do not meet the preset condition, and at the moment, not adjusting the color values of the subarea picture.
In this embodiment of the present invention, the color blocks include a first color block, a second color block, and a third color block, the preset ratio threshold includes a first ratio threshold, a second ratio threshold, and a third ratio threshold, and the preset condition includes:
the proportion of the first color block is larger than a first proportion threshold value, and/or the proportion of the second color block is larger than a second proportion threshold value, and/or the proportion of the third color block is larger than a third proportion threshold value.
Specifically, the first color block is a white color block, the second color block is an orange color block, the third color block is a blue color block, the preset condition includes that the proportion of the first color block is greater than a first proportion threshold value, that is, the proportion of the white color block to all the color blocks of the subarea picture is greater than the first proportion threshold value, the proportion of the second color block is greater than a second proportion threshold value, that is, the proportion of the orange color block to all the color blocks of the subarea picture is greater than a second proportion threshold value, and the proportion of the third color block is greater than a third proportion threshold value, that is, the proportion of the third color block to all the color blocks of the subarea picture is greater than a third proportion threshold value.
In the embodiment of the present invention, the first ratio threshold, the second ratio threshold, and the third ratio threshold may be artificially set as required, for example: the first proportional threshold is set to 50%, the second proportional threshold is set to 35%, and the third proportional threshold is set to 35%.
Wherein the preset conditions include: the ratio of the first color block is greater than a first ratio threshold, and/or the ratio of the second color block is greater than a second ratio threshold, and/or the ratio of the third color block is greater than a third ratio threshold, which is equivalent to determining that the partition picture meets the preset condition as long as any one or two or three of the first color block, the second color block and the third color block is greater than the ratio threshold corresponding to the first color block, the second color block and the third color block.
In an embodiment of the present invention, the apparatus further includes:
a color gain value adjusting unit (not shown) for dynamically adjusting the color gain value of each partition picture determined according to the corresponding relationship if the ratio of a specific color block in the effective color blocks is greater than a preset adjusting threshold value.
Specifically, if the ratio of a specific color block in the effective color blocks is greater than a preset adjustment threshold, the color gain value determined according to the correspondence is dynamically adjusted, that is, the color gain value of the corresponding partition picture is adjusted, specifically, the color gain value of at least one primary color in the color gain values of the partition picture is adjusted. For example: the preset adjustment threshold is 70%, the specific color blocks are green color blocks, and if the proportion of the green color blocks in the effective color blocks is greater than 70%, the color gain values obtained according to the corresponding relationship are adjusted, for example: compensating for an increase in the color gain value of at least one of the color gain values, such as: the color gain values, i.e., the G values among the RGB values, are compensated for increase.
In the embodiment of the invention, the color gain value is an RGB gain value.
In an embodiment of the present invention, a screen adjusting apparatus is provided and applied to an electronic device, the apparatus including: the corresponding relation establishing unit is used for establishing the corresponding relation among the color point coordinates, the color temperature and the color gain value in advance; the device comprises a partition picture determining unit, a partition picture determining unit and a display unit, wherein the partition picture determining unit is used for acquiring a current picture, partitioning the current picture and determining a plurality of partition pictures corresponding to the current picture; a color temperature calculation unit for calculating a color temperature of each of the divided pictures corresponding to the current picture; a color gain value determining unit, configured to determine a color gain value of each partition picture based on the color temperature of each partition picture according to the correspondence; and the color value adjusting unit is used for adjusting the color value of each subarea picture according to the color gain value of each subarea picture. On one hand, the optimal color value of the picture under different scenes can be determined by pre-establishing the corresponding relation among the color point coordinate, the color temperature and the color gain value; on the other hand, the current picture is obtained and partitioned, and a plurality of partitioned pictures corresponding to the current picture are determined; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the corresponding relation; the color value of each subarea picture is adjusted according to the color gain value of each subarea picture, so that the color value can be accurately adjusted based on the subarea pictures, and the reality of the pictures is improved.
Referring to fig. 10, fig. 10 is a schematic diagram of a hardware structure of an electronic device according to various embodiments of the present invention;
as shown in fig. 10, the electronic device 100 includes, but is not limited to: the electronic device 100 further includes a camera, and the electronic device includes a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, a power supply 1011, and the like. Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 10 does not constitute a limitation of the electronic device, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a television, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
A processor 110, configured to pre-establish a correspondence relationship between color point coordinates, color temperature, and color gain values; acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value; and adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
In the embodiment of the invention, on one hand, the optimal color values of pictures in different scenes can be determined by pre-establishing the corresponding relation among the color point coordinates, the color temperature and the color gain values; on the other hand, the current picture is obtained and partitioned, and a plurality of partitioned pictures corresponding to the current picture are determined; calculating the color temperature of each subarea picture corresponding to the current picture; determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the corresponding relation; the color value of each subarea picture is adjusted according to the color gain value of each subarea picture, so that the color value can be accurately adjusted based on the subarea pictures, and the reality of the pictures is improved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 may be used for receiving and sending signals during a message transmission or call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through a wireless communication system.
The electronic device 100 provides wireless broadband internet access to the user via the network module 102, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the electronic apparatus 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
The input unit 104 is used to receive an audio or video signal. The input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics processor 1041 processes a target image of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the network module 102. The microphone 1042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode.
The electronic device 100 also includes at least one sensor 105, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the electronic device 100 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 105 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. Touch panel 1071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 1071 (e.g., operations by a user on or near touch panel 1071 using a finger, stylus, or any suitable object or attachment). The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and receives and executes commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 1071 may be overlaid on the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 10, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the electronic device, and is not limited herein.
The interface unit 108 is an interface for connecting an external device to the electronic apparatus 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 100 or may be used to transmit data between the electronic apparatus 100 and the external device.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a program storage area and a data storage area, wherein the program storage area may store an application program 1091 (such as a sound playing function, an image playing function, etc.) and an operating system 1092, etc. required by at least one function; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the electronic device. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The electronic device 100 may further include a power source 1011 (such as a battery) for supplying power to various components, and preferably, the power source 1011 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption via the power management system.
In addition, the electronic device 100 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 110, a memory 109, and a computer program stored in the memory 109 and capable of running on the processor 110, where the computer program, when executed by the processor 110, implements each process of the foregoing image adjustment method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by one or more processors, the computer program implements each process of the foregoing image adjustment method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the computer program is not described herein again. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-described embodiments of the apparatus or device are merely illustrative, wherein the unit modules described as separate parts may or may not be physically separate, and the parts displayed as module units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (which may be a mobile terminal, a personal computer, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments of the present invention.
Finally, it should be noted that: the embodiments described above with reference to the drawings are only for illustrating the technical solutions of the present invention, and the present invention is not limited to the above-mentioned specific embodiments, which are only illustrative and not restrictive; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A picture adjusting method is applied to electronic equipment and is characterized by comprising the following steps:
acquiring a current picture, partitioning the current picture, and determining a plurality of partitioned pictures corresponding to the current picture;
calculating the color temperature of each subarea picture corresponding to the current picture;
determining a color gain value of each subarea picture based on the color temperature of each subarea picture according to the pre-established corresponding relation among the color point coordinates, the color temperature and the color gain value;
and adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
2. The method of claim 1, wherein prior to obtaining the current picture, the method further comprises: pre-establishing a corresponding relationship among color point coordinates, color temperatures and color gain values, specifically comprising:
acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
and determining the matching relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
3. The method according to claim 1 or 2, wherein the calculating the color temperature of each of the divided pictures comprises:
determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
and calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
4. The method of claim 3, further comprising:
and if the color blocks of any partition picture do not meet the preset condition, not adjusting the color values of the partition picture, wherein the preset condition comprises that the proportion of the color blocks is greater than a preset proportion threshold value.
5. The method of claim 4, wherein the color blocks comprise a first color block, a second color block, and a third color block, wherein the preset ratio threshold comprises a first ratio threshold, a second ratio threshold, and a third ratio threshold, and wherein the preset condition comprises:
the proportion of the first color block is larger than a first proportion threshold value, and/or the proportion of the second color block is larger than a second proportion threshold value, and/or the proportion of the third color block is larger than a third proportion threshold value.
6. The method of claim 3, further comprising:
if the proportion of the specific color blocks in the effective color blocks is larger than a preset adjusting threshold value, dynamically adjusting the color gain value determined according to the corresponding relation.
7. The method of any of claims 1 or 2 or 4-6, wherein the color gain values are RGB gain values.
8. A picture adjusting device applied to electronic equipment is characterized by comprising:
the device comprises a partition picture determining unit, a partition picture determining unit and a display unit, wherein the partition picture determining unit is used for acquiring a current picture, partitioning the current picture and determining a plurality of partition pictures corresponding to the current picture;
a color temperature calculation unit for calculating a color temperature of each of the divided pictures corresponding to the current picture;
a color gain value determining unit, configured to determine a color gain value of each partition picture based on the color temperature of each partition picture according to the correspondence;
and the color value adjusting unit is used for adjusting the color value of each subarea picture according to the color gain value of each subarea picture.
9. The apparatus of claim 8, further comprising:
a correspondence relationship establishing unit, configured to establish in advance a correspondence relationship between color point coordinates, color temperature, and color gain values, and specifically configured to:
acquiring a plurality of frames of test pictures, and determining the color point coordinates of each frame of test pictures of the plurality of frames of test pictures;
calculating corresponding color temperature according to the color point coordinates of each frame of test picture;
dynamically adjusting the color gain value of each frame of test picture, and matching the corresponding color point coordinate and color temperature;
and determining the corresponding relation of the coordinates, the color temperature and the color gain value of each color point through interpolation, and determining the corresponding relation.
10. The apparatus of claim 8, wherein the color temperature calculation unit is specifically configured to:
determining effective color blocks in each partition picture, wherein the effective color blocks comprise a plurality of color blocks;
and calculating the average value of the color temperatures of all the effective color blocks of the subarea picture, and determining the average value as the color temperature of the subarea picture.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the picture adjustment method of any one of claims 1-7.
12. A non-transitory computer-readable storage medium storing computer-executable instructions for causing an electronic device to perform the screen adjustment method according to any one of claims 1 to 7.
CN202010681126.5A 2020-07-15 2020-07-15 Picture adjusting method and device and electronic equipment Withdrawn CN113949856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010681126.5A CN113949856A (en) 2020-07-15 2020-07-15 Picture adjusting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010681126.5A CN113949856A (en) 2020-07-15 2020-07-15 Picture adjusting method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN113949856A true CN113949856A (en) 2022-01-18

Family

ID=79326249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010681126.5A Withdrawn CN113949856A (en) 2020-07-15 2020-07-15 Picture adjusting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113949856A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110017274A (en) * 2009-08-13 2011-02-21 엘지이노텍 주식회사 Method for correcting image
CN104618702A (en) * 2014-12-31 2015-05-13 湖南国科微电子有限公司 White block hypothesis based automatic white balance method of digital camera device
CN104935903B (en) * 2014-03-18 2018-06-15 韩华泰科株式会社 White balance correction apparatus and white balance correcting
CN108377373A (en) * 2018-05-10 2018-08-07 杭州雄迈集成电路技术有限公司 A kind of color rendition device and method pixel-based

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110017274A (en) * 2009-08-13 2011-02-21 엘지이노텍 주식회사 Method for correcting image
CN104935903B (en) * 2014-03-18 2018-06-15 韩华泰科株式会社 White balance correction apparatus and white balance correcting
CN104618702A (en) * 2014-12-31 2015-05-13 湖南国科微电子有限公司 White block hypothesis based automatic white balance method of digital camera device
CN108377373A (en) * 2018-05-10 2018-08-07 杭州雄迈集成电路技术有限公司 A kind of color rendition device and method pixel-based

Similar Documents

Publication Publication Date Title
CN110602473B (en) White balance calibration method and device
WO2018171493A1 (en) Image processing method and device, and storage medium
KR101766867B1 (en) Color adjustment method and device
CN109238460B (en) Method for obtaining ambient light intensity and terminal equipment
CN107908383B (en) Screen color adjusting method and device and mobile terminal
TWI658433B (en) Method and device of image blurring, computer reading storage medium and computer equipment
CN110908765A (en) Interface display method and device, terminal equipment and storage medium
CN107438163B (en) Photographing method, terminal and computer readable storage medium
TWI536847B (en) Method and apparatus for adjusting the color gamut of a color image
WO2020199878A1 (en) Display brightness adjusting method and related product
CN110969981B (en) Screen display parameter adjusting method and electronic equipment
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN109361867B (en) Filter processing method and mobile terminal
CN111491072B (en) Pixel clock frequency adjusting method and device and electronic equipment
CN107067842B (en) Color value adjusting method, mobile terminal and storage medium
CN108513067B (en) Shooting control method and mobile terminal
CN109286802A (en) Color gamut matching method, device, display terminal and readable storage medium storing program for executing
CN108040240B (en) White balance adjustment method and device and mobile terminal
CN111459233A (en) Display method, electronic device, and storage medium
CN107807488B (en) Camera assembly, aperture adjusting method and mobile terminal
CN109348212B (en) Image noise determination method and terminal equipment
CN110944163A (en) Image processing method and electronic equipment
CN109729280B (en) Image processing method and mobile terminal
CN111031242B (en) Image processing method and device
CN110493510B (en) Image processing method and terminal equipment

Legal Events

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

Application publication date: 20220118