CN107977999B - Intelligent color taking method and device - Google Patents

Intelligent color taking method and device Download PDF

Info

Publication number
CN107977999B
CN107977999B CN201711261798.5A CN201711261798A CN107977999B CN 107977999 B CN107977999 B CN 107977999B CN 201711261798 A CN201711261798 A CN 201711261798A CN 107977999 B CN107977999 B CN 107977999B
Authority
CN
China
Prior art keywords
color
base
tone
saturation
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711261798.5A
Other languages
Chinese (zh)
Other versions
CN107977999A (en
Inventor
施文祥
伍志鹏
王志华
杨天行
刘晓波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201711261798.5A priority Critical patent/CN107977999B/en
Publication of CN107977999A publication Critical patent/CN107977999A/en
Application granted granted Critical
Publication of CN107977999B publication Critical patent/CN107977999B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to an intelligent color taking method, which comprises the following steps: acquiring a picture to be displayed; counting a predetermined number of colors appearing most in the picture; extracting the color with the saturation within a preset range and the highest brightness from the preset number of colors as base color mixing; and softening the base color.

Description

Intelligent color taking method and device
Technical Field
The invention relates to the technical field of computer networks, in particular to an intelligent color-taking method and device.
Background
The intelligent color-taking technology is used for automatically selecting proper colors according to picture contents, is generally used for background colors around various pictures in products, is matched with poster pictures and the like, and enables the overall color matching effect of the products to be attractive and coordinated
At present, the intelligent color picking method generally adopts the following method:
the picture pixel with the most color is selected. This approach is based on a statistical approach, analyzing the color values that appear most in the picture content as the key values for the entire color sampling. That is, the color with the most appearance is used as the background color of the picture, and the picture is displayed together with the color.
The scheme is simple to implement, but the problem of excessive color matching in the product can occur, so that the overall style of the product is disordered. Especially, when partial picture themes are bright, the display of characters in the product is influenced. And when the theme color of the picture is dark, the color effect of the whole product is dull.
The above is only a technical situation known to the inventors and does not certainly represent the prior art constituting the present invention.
Disclosure of Invention
To solve one or more of the problems of the prior art, the present invention provides an intelligent color extraction method, including: acquiring a picture to be displayed; counting a predetermined number of colors appearing most in the picture; extracting the color with the saturation within a preset range and the highest brightness from the preset number of colors as base color mixing; and softening the base color.
According to one aspect of the invention, the intelligent color extraction method further comprises the following steps: and if the tone of the base tone is between 0 and 60 or 331 and 360 and the proportion of the base tone in the picture to be displayed is higher than a certain threshold value, setting the saturation S of the base tone to be 0.
According to an aspect of the invention, said predetermined number is 5, and/or said predetermined range is 15-85.
According to one aspect of the invention, the threshold is 35%.
According to one aspect of the invention, the softening process comprises:
comparing the base toned hue to a set of reference colors, wherein the set of reference colors includes a plurality of reference hues and corresponding saturations and brightnesses;
and taking a reference color closest to the color tone of the base color as the base color tone.
According to one aspect of the invention, the intelligent color extraction method further comprises the following steps: and displaying the picture to be displayed by taking the reference color as a background color.
The invention also relates to a computer-readable storage medium comprising computer-executable instructions stored thereon which, when executed by a processor, implement the intelligent color extraction method of any one of claims 1-5.
The invention also relates to a device comprising: acquiring a unit of a picture to be displayed; a unit for counting a predetermined number of colors appearing most in the picture; a unit for extracting a color having a saturation within a predetermined range and a highest brightness from the predetermined number of colors as a base tone; and a unit for softening the base color.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow diagram of a smart color extraction method according to one embodiment of the invention;
FIG. 2 is a schematic diagram of an intelligent color fetching device according to one embodiment of the invention; and
fig. 3 is a block diagram of a computer program product arranged in accordance with at least some embodiments of the invention.
Detailed Description
In the following, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the description of the present invention, it should be noted that unless otherwise explicitly stated or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection, either mechanically, electrically, or in communication with each other; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, "above" or "below" a first feature means that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact with each other via another feature therebetween. Also, the first feature being "on," "above" and "over" the second feature includes the first feature being directly on and obliquely above the second feature, or merely indicating that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature includes the first feature being directly above and obliquely above the second feature, or simply meaning that the first feature is at a lesser level than the second feature.
The following disclosure provides many different embodiments or examples for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Of course, they are merely examples and are not intended to limit the present invention. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, the present invention provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or uses of other materials.
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
In the invention, the picture content is analyzed by an intelligent color taking technology, a proper color tone with higher picture saturation is selected, and some algorithm adjustment is carried out on the color value, so that the color is softer.
An intelligent color extraction method 100 according to a first embodiment of the present invention is described below with reference to fig. 1.
In step S101, a picture to be displayed is acquired. The picture to be displayed is for example from a local memory, but may also be received from a network, for example via a wired or wireless network (e.g. a wireless local area network, a 4G, 3G network). The present invention is described in the context of a single picture. In the case of multiple pictures, only the first picture can be processed, and the eyeball vision is matched with the background color. Of course, embodiments that process multiple pictures simultaneously are also within the scope of the present invention. When the video/animation is included on the page, the video/animation can be treated as a picture according to the state of the still picture before playing. Those skilled in the art can readily devise how to implement the teachings of the present invention.
In step S102, a predetermined number of colors that appear most in the picture are counted. According to a preferred embodiment of the present invention, if the picture pixels are large, the picture pixels can be cropped and reduced in advance, and then the predetermined number of colors appearing in the cropped and reduced picture is counted, so that the calculation performance required for processing the picture can be saved, and the display efficiency can be improved. For example, the most occurring 5 or 3 color values are obtained as an alternative. For example, five or three color values ranked as the top five or the top three in the number of occurrences in the picture are counted as an alternative. The skilled person can also select more color values as alternatives according to the actual needs. Each color can be identified, for example, using HSV mode, where h (hue) represents hue, s (saturation) represents saturation, and v (value) represents brightness.
In step S103, a color having the highest saturation S within a predetermined range and the highest brightness is extracted as a base tone from the predetermined number of colors. According to a preferred embodiment of the invention, the predetermined range of saturation S is, for example, 15-85. This gives a high color brightness and no black/white color.
The base tone is subjected to a softening process in step S104. The color value H is mainly three colors of red, green and blue. The color is closer to the condition of red, green and blue single colors, the S saturation is higher, the color is strong and gorgeous, the visual stimulation is strong, the user is not favorable for browsing information in the product, the long-time watching is not favorable, and the S saturation and the V brightness are dynamically adjusted through an algorithm according to the hue of the color value H, so that the S saturation and the B brightness are reduced when the color is purer, and the color is softer. According to an embodiment of the present invention, the processing method of the base tone softening is as follows,
and according to the identification degree of human eyes, taking 12 reference h values between 0 and 360, and setting proper S saturation and V brightness for the 12 reference h values. A set of 12 reference hue h values and corresponding saturation and luminance values according to one embodiment of the invention is shown below.
Example 1 h:0s:80v:62
Example 2 h:11s:81v:69
Example 3 h 29s 83v 70
Example 4 h 65s 82v 55
Example 5 h:148s:78v:53
Example 6 h:168s:85v:60
Example 7 h 190s 82v 55
Example 8 h 210s 85v 65
Example 9 h:227s:74v:54
Example 10 h:270s:53v:44
Example 11 h:342s:85v:71
Example 12 h 358s 85v 62
And according to the h value of the base color mixing, replacing the saturation S and the brightness V of the base color mixing with the S and the V of one of the reference h values which are closest to the h value of the base color mixing to obtain a new HSV color as the base color mixing.
According to an embodiment of the present invention, the intelligent color extraction method 100 further includes: in the step S103, if the hue of the base color is between 0-60 or 331-360 and the ratio of the base color to the picture to be displayed is higher than a certain threshold, the saturation H of the base color is set to 0 (the color saturation 0 is visually black). According to a preferred embodiment of the invention, the threshold value is for example 35%.
According to an embodiment of the present invention, the intelligent color extraction method 100 further includes: and displaying the picture to be displayed by taking the reference color as a background color. In the present invention, the background color refers to the color of any area within a certain range around the picture, and has a relatively broad meaning, for example, including the color around the picture, the background color of the matching of the picture, and the like.
As shown in fig. 2, according to another embodiment of the invention, the invention also relates to a device 200 comprising:
a unit 201 for acquiring a picture to be displayed;
a unit 202 for counting a predetermined number of colors appearing most in the picture;
a unit 203 for extracting a color having the highest saturation within a predetermined range and the highest brightness from the predetermined number of colors as a base tone;
a unit 204 for softening the base color.
According to a preferred embodiment of the invention, the device is for example a mobile phone, a tablet, an IPAD, a desktop computer or the like.
Fig. 3 is a block diagram of a computer program product 300 arranged in accordance with at least some embodiments of the invention. The signal bearing medium 302 may be embodied as or include a computer readable medium 306, a computer recordable medium 308, a computer communication medium 310, or a combination thereof, which stores programming instructions 304 that may configure a processing unit to perform all or some of the processes previously described. The instructions may include, for example, one or more executable instructions for causing one or more processors to: acquiring a picture to be displayed; counting a predetermined number of colors appearing most in the picture; extracting the color with the saturation between the preset ranges and the highest brightness value from the preset number of colors as base color mixing; and softening the base color.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. An intelligent color sampling method comprises the following steps:
s101: acquiring a picture to be displayed;
s102: counting a predetermined number of colors appearing most in the picture;
s103: extracting a color having a saturation between predetermined ranges and a highest luminance value from the predetermined number of colors as a base tone,
s104: dynamically adjusting the saturation and brightness of the base color mixing to soften the base color mixing;
wherein dynamically adjusting the saturation and brightness of the base palette comprises: comparing the base toned hue to a set of reference colors, wherein the set of reference colors includes a plurality of reference hues and corresponding saturations and brightnesses; and replacing the saturation and the brightness of the base color tone with the saturation and the brightness of one reference color closest to the color tone of the base color tone.
2. The intelligent color extraction method according to claim 1, wherein step S103 further comprises: and if the tone of the base tone is between 0 and 60 or 331 and 360 and the proportion of the base tone in the picture to be displayed is higher than a certain threshold value, setting the saturation of the base tone to be 0.
3. The intelligent color extraction method according to claim 1 or 2, wherein the predetermined number is 5, and/or the predetermined range is 15-85.
4. The intelligent color extraction method according to claim 2, wherein the threshold value is 35%.
5. The intelligent color extraction method according to any one of claims 1, 2 and 4, further comprising: and displaying the picture to be displayed by taking the base color as a background color.
6. The intelligent color extraction method according to any one of claims 1, 2 and 4, wherein in step S102, HSV is used to represent the predetermined number of colors.
7. A computer-readable storage medium comprising computer-executable instructions stored thereon which, when executed by a processor, implement the intelligent color extraction method of any one of claims 1-6.
8. An intelligent color sampling device, comprising:
acquiring a unit of a picture to be displayed;
a unit for counting a predetermined number of colors appearing most in the picture;
a unit for extracting a color having a saturation within a predetermined range and a highest brightness from the predetermined number of colors as a base tone;
a unit for dynamically adjusting the saturation and brightness of the base color adjustment to soften the base color adjustment;
wherein the unit for dynamically adjusting the saturation and brightness of the base color adjustment to soften the base color adjustment is configured to: comparing the base toned hue to a set of reference colors, wherein the set of reference colors includes a plurality of reference hues and corresponding saturations and brightnesses; and replacing the saturation and the brightness of the base color tone with the saturation and the brightness of one reference color closest to the color tone of the base color tone.
9. The intelligent color sampling device according to claim 8, wherein the means for extracting, from the predetermined number of colors, a color with the highest saturation within a predetermined range and the highest brightness as the base color tone is further configured to: and if the tone of the base tone is between 0 and 60 or 331 and 360 and the proportion of the base tone in the picture to be displayed is higher than a certain threshold value, setting the saturation of the base tone to be 0.
10. The intelligent color extraction device according to claim 8 or 9, wherein the predetermined number is 5, and/or the predetermined range is 15-85.
11. The intelligent color sampling device according to claim 9, wherein the threshold is 35%.
12. The intelligent color sampling device according to any one of claims 8, 9 and 11, further comprising: and displaying the unit of the picture to be displayed by taking the base color as a background color.
13. The intelligent color sampling device according to any one of claims 8, 9 and 11, wherein the unit for counting the predetermined number of colors that appear most in the picture is further configured to represent the predetermined number of colors with HSV.
CN201711261798.5A 2017-12-04 2017-12-04 Intelligent color taking method and device Active CN107977999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711261798.5A CN107977999B (en) 2017-12-04 2017-12-04 Intelligent color taking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711261798.5A CN107977999B (en) 2017-12-04 2017-12-04 Intelligent color taking method and device

Publications (2)

Publication Number Publication Date
CN107977999A CN107977999A (en) 2018-05-01
CN107977999B true CN107977999B (en) 2021-01-08

Family

ID=62009125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711261798.5A Active CN107977999B (en) 2017-12-04 2017-12-04 Intelligent color taking method and device

Country Status (1)

Country Link
CN (1) CN107977999B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1694155A (en) * 2005-01-17 2005-11-09 深圳创维-Rgb电子有限公司 Method for regulating display color of display device
CN101083774A (en) * 2006-05-31 2007-12-05 深圳Tcl工业研究院有限公司 Color temperature dynamic regulation method
CN101378515A (en) * 2008-07-12 2009-03-04 青岛海信电器股份有限公司 Method for transferring video signal colors and television set
CN101431687A (en) * 2008-12-05 2009-05-13 硅谷数模半导体(北京)有限公司 Dynamic contrast and color management method and apparatus
CN101790101A (en) * 2010-04-01 2010-07-28 昆山锐芯微电子有限公司 Method and device for adjusting image saturation
CN101866627A (en) * 2010-06-29 2010-10-20 彩虹集团公司 Method for controlling direct illumination-type white light LED backlight
CN102193783A (en) * 2010-03-09 2011-09-21 腾讯科技(北京)有限公司 Method and system for adjusting skin brightness of browser and electronic equipment
CN104954844A (en) * 2015-06-25 2015-09-30 深圳Tcl数字技术有限公司 User position based image adjusting method and device as well as television system
CN105336286A (en) * 2014-07-29 2016-02-17 杭州海康威视数字技术股份有限公司 Spliced screen color adjusting method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10152804B2 (en) * 2015-02-13 2018-12-11 Smugmug, Inc. System and method for dynamic color scheme application
CN104965631B (en) * 2015-05-26 2020-05-15 深圳市万普拉斯科技有限公司 Desktop color matching method and device and intelligent terminal
CN105761283B (en) * 2016-02-14 2018-12-25 广州神马移动信息科技有限公司 A kind of picture key color extraction method and device
CN106201535B (en) * 2016-07-14 2019-08-23 广州神马移动信息科技有限公司 The method and apparatus that toolbar background color is converted with the domain color of picture
CN106780634B (en) * 2016-12-27 2019-06-18 努比亚技术有限公司 Picture dominant tone extracting method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1694155A (en) * 2005-01-17 2005-11-09 深圳创维-Rgb电子有限公司 Method for regulating display color of display device
CN101083774A (en) * 2006-05-31 2007-12-05 深圳Tcl工业研究院有限公司 Color temperature dynamic regulation method
CN101378515A (en) * 2008-07-12 2009-03-04 青岛海信电器股份有限公司 Method for transferring video signal colors and television set
CN101431687A (en) * 2008-12-05 2009-05-13 硅谷数模半导体(北京)有限公司 Dynamic contrast and color management method and apparatus
CN102193783A (en) * 2010-03-09 2011-09-21 腾讯科技(北京)有限公司 Method and system for adjusting skin brightness of browser and electronic equipment
CN101790101A (en) * 2010-04-01 2010-07-28 昆山锐芯微电子有限公司 Method and device for adjusting image saturation
CN101866627A (en) * 2010-06-29 2010-10-20 彩虹集团公司 Method for controlling direct illumination-type white light LED backlight
CN105336286A (en) * 2014-07-29 2016-02-17 杭州海康威视数字技术股份有限公司 Spliced screen color adjusting method and device
CN104954844A (en) * 2015-06-25 2015-09-30 深圳Tcl数字技术有限公司 User position based image adjusting method and device as well as television system

Also Published As

Publication number Publication date
CN107977999A (en) 2018-05-01

Similar Documents

Publication Publication Date Title
EP3992788B1 (en) Dark-mode display interface processing method, electronic device, and storage medium
WO2017059732A1 (en) Display device for adjusting display colour gamut and method for adjusting display colour gamut therefor
EP3293954A1 (en) Method and system for adjusting screen brightness
CN100418132C (en) Apparatus and method for improving recognition performance for dark region of image
CN109472839B (en) Image generation method and device, computer equipment and computer storage medium
CN106780635B (en) Picture adaptation method and system of intelligent terminal
CN110809120B (en) Light supplementing method for shot picture, smart television and computer readable storage medium
CN111064942B (en) Image processing method and apparatus
CN107799093A (en) Adjust method, terminal and the computer-readable recording medium of screen luminance of terminal
US20180108324A1 (en) Display Device and Display Control Method Thereof
CN103616954A (en) Virtual keyboard system, implementation method and mobile terminal
CN103065290A (en) Device and method for correcting skin color in photo
CN114494672A (en) Data processing method, device and equipment
CN111796889A (en) Terminal interface color correction method and device, electronic equipment and terminal
CN104992680A (en) Electronic ink screen graying method
US9589338B2 (en) Image processing apparatus, image processing system, image processing method, and non-transitory computer readable medium for varied luminance adjustment in different image regions
CN107205142B (en) A kind of method, apparatus and display equipment of image color offset
CN112069480A (en) Display method and device, storage medium and wearable device
EP2711817A2 (en) Theme display method and device thereof
CN107977999B (en) Intelligent color taking method and device
WO2017143812A1 (en) Method and device for differentiating objects
CN105278907B (en) Display methods and mobile terminal
CN108205795A (en) Face image processing process and system during a kind of live streaming
KR20190011659A (en) Skin undertone determining method and an electronic device
CN107395999A (en) Light compensation method, device and mobile terminal

Legal Events

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