CN109166159A - Obtain the method, apparatus and terminal of the dominant hue of image - Google Patents
Obtain the method, apparatus and terminal of the dominant hue of image Download PDFInfo
- Publication number
- CN109166159A CN109166159A CN201811192232.6A CN201811192232A CN109166159A CN 109166159 A CN109166159 A CN 109166159A CN 201811192232 A CN201811192232 A CN 201811192232A CN 109166159 A CN109166159 A CN 109166159A
- Authority
- CN
- China
- Prior art keywords
- section
- value
- saturation degree
- hue
- intensity value
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Color Image Communication Systems (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
This application discloses the method, apparatus and terminal of a kind of dominant hue for obtaining image, belong to field of computer technology.The described method includes: obtaining the hue value and intensity value of the pixel in target image;According to distribution situation of the hue value in multiple form and aspect sections, the mass tone section of target image is determined;According to distribution situation of the intensity value in multiple saturation degree sections, the main saturation degree section of target image is determined;Inquiry obtains the corresponding main intensity value of the corresponding mass tone value in mass tone section and main saturation degree section;The dominant hue of target image is determined according to mass tone value and main intensity value.The application is by determining the dominant hue of target image according to the distribution situation of the hue value and intensity value of target image respectively in multiple form and aspect sections and multiple saturation degree sections, since terminal does not need accurately to acquire the highest hue value of the frequency of occurrences and intensity value, the computing cost of terminal is reduced.
Description
Technical field
This application involves field of computer technology, in particular to the method, apparatus of a kind of dominant hue for obtaining image and end
End.
Background technique
Dominant hue is the highest color of the frequency of occurrences in image.Such as smart phone, tablet computer, desktop computer it
In the terminal of class, exists and much need to carry out color analysis to image, acquire the application scenarios of image dominant hue.
In the related technology, the method for obtaining the dominant hue of image includes: the central processing unit (Central of terminal
Processing Unit, CPU) each of target image pixel is traversed, each pixel is acquired in RGB
There is frequency according to each Color Channel in the brightness value in each color channel in (Red Green Blue, RGB) color space
The highest brightness value of rate obtains the dominant hue of target image.
Central processing unit due to needing terminal in the related technology traverses each of target image pixel, statistics
Distribution of the brightness value in each pixel in RGB color, therefore the computing cost of central processing unit is larger, to lead
Cause in some cases, such as terminal CPU computation power it is poor in the case where, obtain the dominant hue of image when
Between it is longer.
Summary of the invention
The embodiment of the present application provides the method, apparatus and terminal of a kind of dominant hue for obtaining image, to solve correlation
The dominant hue time longer problem of technology acquisition image.The technical solution is as follows:
On the one hand, the embodiment of the present application provides a kind of method of dominant hue for obtaining image, and the method is held by terminal
Row, which comprises
Obtain the hue value and intensity value of the pixel in target image;
According to distribution situation of the hue value in multiple form and aspect sections, the mass-tone phase region of the target image is determined
Between;
According to distribution situation of the intensity value in multiple saturation degree sections, determine that the master of the target image is full
With degree section;
Inquiry obtains the corresponding main saturation of the corresponding mass tone value in the mass tone section and the main saturation degree section
Angle value;
The dominant hue mass tone section of the target image is determined according to the mass tone value and the main intensity value
The main main saturation degree section in saturation degree section mass tone section.
On the one hand, the embodiment of the present application provides a kind of device of dominant hue for obtaining image, and described device is applied to eventually
In end, described device includes:
Pattern process module obtains the corresponding reference of the target image for carrying out down-sampled processing to target image
The resolution ratio of image, the reference picture is lower than the target image;Obtain the form and aspect of each pixel in the reference picture
Value and intensity value, obtain the corresponding form and aspect section of each hue value and the corresponding saturation of each intensity value
Section is spent, the form and aspect section is the value interval of preset hue value in the terminal, and the saturation degree section is the end
The value interval of preset intensity value in end;
Central processing module obtains the most mass tone section of corresponding hue value quantity, and corresponding saturation for counting
The most main saturation degree section of angle value quantity;Inquiry obtains the corresponding mass tone value in the mass tone section and the master is full
Main intensity value corresponding with degree section;According to the mass tone value, the main intensity value and preset brightness value, obtain
The dominant hue of the target image.
On the one hand, the embodiment of the present application provides a kind of terminal, and the terminal includes processor and memory, the storage
At least one instruction is stored in device, described instruction is loaded by the processor and executed to realize acquisition image as described above
Dominant hue method.
On the one hand, the embodiment of the present application provides a kind of computer readable storage medium, is stored in the storage medium
At least one instruction, described instruction are loaded by processor and are executed the side to realize the dominant hue as described above for obtaining image
Method.
Technical solution bring beneficial effect provided by the embodiments of the present application is at least are as follows:
By obtaining the hue value and intensity value of the pixel in target image, according to hue value in multiple form and aspect sections
The distribution situation of distribution situation and intensity value in multiple saturation degree sections, the main saturation degree section in mass tone section determine
Mass tone section and main saturation degree section out, so that inquiry obtains the corresponding mass tone value in mass tone section and main saturation degree
The corresponding main intensity value in section, and then the dominant hue of target image is obtained, since mass tone value and main intensity value are bases
By what is tabled look-up, terminal does not need accurately to acquire appearance frequency in the mass tone section and main saturation degree section acquired
The highest hue value of rate and intensity value, therefore the computing cost of terminal is reduced, acquisition image is reduced to a certain extent
Dominant hue time.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 is the structural block diagram of terminal provided by the embodiments of the present application;
Fig. 2 is the schematic diagram of RGB color;
Fig. 3 is the schematic diagram in hsv color space;
Fig. 4 is the flow chart of the method for the dominant hue for the acquisition image that one exemplary embodiment of the application provides;
Fig. 5 is the flow chart of the method for the dominant hue for the acquisition image that one exemplary embodiment of the application provides;
Fig. 6 is the schematic diagram for the texture that one exemplary embodiment of the application provides;
Fig. 7 is the block diagram of the device of the dominant hue for the acquisition image that one exemplary embodiment of the application provides;
Fig. 8 is the structural block diagram of terminal provided by the embodiments of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party
Formula is described in further detail.
Firstly, to the invention relates to several nouns simply introduced:
RGB color: being a kind of by obtaining the red channel (Red, R), the channel green (Green, G), blue
The superposition of the channel (Blue, B) brightness value of totally three kinds of Color Channels defines the color standard of color.Illustratively, RGB color
Each color channel in space includes 256 grades of brightness values, and brightness is minimum when brightness value is 0, and brightness is most when brightness value is 255
It is high;When the brightness value of red channel is 0, the brightness value of green channel is 0, and when blue channel luminance value is 0, corresponding color is
Black;When the brightness value of red channel is 255, the brightness value of green channel is 255, corresponding when blue channel luminance value is 255
Color be white;When the brightness value of red channel is 255, the brightness value of green channel is 0, when blue channel luminance value is 0,
Corresponding color is red.
Form and aspect (Hue): being the corresponding spectrum colour of light of different wave length.Illustratively, form and aspect can be carried out by hue circle
Definition.For hue circle as unit of angle, value range is [0 °, 360 °], and according to sequence counter-clockwise since red, red is corresponding
0 °, green is 120 ° corresponding, and blue is 240 ° corresponding.
Saturation degree (Saturation): the chroma that is otherwise known as, purity are intended to indicate that the purity of color relative spectral color
Parameter.Illustratively, the value interval of saturation degree is [0,1], when purity highest, saturation degree 1;When purity is minimum, saturation degree
It is 0, the color that saturation degree is 0 does not have color.In usual children animation piece or children's book, the higher face of saturation degree is mostly used
Color, to adapt to the color perception of children.
Lightness (Value or Lightness): being to indicate brightness and darkness possessed by color.Illustratively, ash can be passed through
Benchmark of the test card as lightness is spent, the gray scale of black is defined as 0, white gray scale is defined as 10, between [0,10] etc.
It is divided into the gray scale interval of 10 different gray scales as gradation test card.
Hsv color space: also referred to as HSL color space is a kind of to define color according to form and aspect, saturation degree and lightness
Color standard.Illustratively, the color that form and aspect are 0 °, saturation degree 1, lightness are 10 is red.
Graphics processor (Graphics Processing Unit, GPU): core, vision processor, display are also known as shown
Chip, be it is a kind of exclusively carried out in the terminal of such as smart phone, tablet computer, desktop computer etc image operation work
Microprocessor.Graphics processor is corresponding with frame buffer memory (Frame Buffer).
Frame buffer memory: abbreviation frame buffer or video memory are a direct images of picture shown by the screen of terminal, again
Referred to as bit map (Bit Map) or grating.Each storage unit of frame buffer memory corresponds to a pixel on screen, whole
The corresponding frame image of a frame buffer memory.
Texture (Texture): being the continuous pixels collection with tonal properties and/or area attribute, and physics is practical
Show as one section of continuous space in frame buffer memory.Graphics processor can include form and aspect section and saturation degree area by building
Between texture the hue value and intensity value of image are sorted out.
Central processing unit: being one piece of ultra-large integrated circuit, is arithmetic core (Core) and the control of computer equipment
Core (Control Unit) processed.Its major function is the data in interpretive machine instruction and processing computer software.In
Central processor mainly includes arithmetic logical unit (Arithmetic Logic Unit, ALU) and cache memory
(Cache) and realize the data (Data) contacted between them, control and state bus (Bus).
The file transmission that the method for the dominant hue of acquisition image in the embodiment of the present application can be applied between terminal is answered
It is equally applicable to the scene of other dominant hues for needing to obtain image or, showing the application scenarios of image in terminal with scene,
The embodiment of the present application is without limitation.
The application scenarios of file transmission between terminal
The transmission that can realize file between terminal by wired or wireless network, receives terminal and is received by application program
After sending the file destination that terminal is sent, in the icon of the user interface displaying target file of application program, terminal is received by mesh
The icon or thumbnail for marking file acquire the dominant hue of target image, by the color tune of user interface as target image
The whole dominant hue for target image.
The dominant hue of target image is to receive terminal to be corresponded to according to the corresponding hue value in mass tone section, main saturation degree section
Intensity value and preset brightness value obtain, mass tone section is the highest color of hue value distribution frequency of reference picture
Phase section, main saturation degree section are the highest saturation degree sections of intensity value distribution frequency of reference picture, and reference picture is pair
Target image is down-sampled to handle obtained image, and the resolution ratio of reference picture is lower than the target image.
The application scenarios of image are shown in terminal
Application program in terminal is opened and after the application interface displaying target image of the application program, and terminal obtains
To the dominant hue of target image, the color of user interface is adjusted to the dominant hue of target image.
The dominant hue of target image is that terminal is corresponding full according to the corresponding hue value in mass tone section, main saturation degree section
It is obtained with angle value and preset brightness value, mass tone section is the highest form and aspect area of hue value distribution frequency of reference picture
Between, main saturation degree section is the highest saturation degree section of intensity value distribution frequency of reference picture, and reference picture is to target
The resolution ratio of the image that image drop sampling is handled, reference picture is lower than the target image.
Fig. 1 shows the structural block diagram of the terminal of one exemplary embodiment of the application offer.The terminal 100 includes: place
Device 110 and memory 120 are managed, processor 110 and memory 120 are realized by bus or other means to be communicated.Wherein, it handles
Device 110 includes central processing unit 111 and graphics processor 112, is stored with operating system 121 and application program in memory 120
122。
Operating system 121 is that the basic software of the secure access to computer hardware is provided for application program 122.
Application program 122 can be the application program with file transmitting function between terminal, pass through application in terminal 100
When program 122 receives the file destination that other terminals are sent, the icon of the file destination is target image, when file destination is
When image file, which is target image;Application program 122, which is also possible to have, reads simultaneously displaying target image function
The application program of energy.
Application program 122 has user interface, shows target image in user interface, application program 122 passes through calling
Graphics processor 112 obtains the hue value and intensity value of the pixel in target image, calls central processing unit 111 according to color
Mutually distribution situation of the value in multiple form and aspect sections, determines the mass tone section of the target image, is existed according to intensity value
Distribution situation in multiple saturation degree sections, determines the main saturation degree section of target image, and inquiry obtains mass tone section pair
The corresponding intensity value of hue value and main saturation degree section answered, determines target according to mass tone value and main intensity value
The color of user interface is adjusted to the dominant hue of target image by the dominant hue of image.
Terminal in the embodiment of the present application can be desktop computer, pocket computer on knee, mobile phone, tablet computer,
E-book reader, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert pressure
Contracting standard audio level 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic shadow
As expert's compression standard audio level 4) player etc..There is installation and operation in the terminal transmits function with file between terminal
The application program of energy, or, reading the application program of simultaneously displaying target image function.
Fig. 2 shows the schematic diagrames of RGB color, as shown in Fig. 2, rgb color space 200 can be considered as a three-dimensional
Solid space, X-axis, Y-axis and the Z axis of the three-dimensional space respectively indicate the red luma value of red channel, blue channel
The Green brightness value of blue intensity values and green channel, can by determine red channel, blue channel and green channel this
The brightness value of three kinds of Color Channels determines corresponding color in RGB color.
In RGB color, the brightness value in each color channel has 256 grades of intensity, the value range of intensity value be [0,
255], therefore, in RGB color, the stack combinations of the color of three kinds of Color Channels are 16777216 (256 × 256 × 256)
Kind may.
In the related technology, the method for the dominant hue of image is obtained are as follows: terminal is called in central processing unit traversal target image
Each pixel, obtain each pixel the red luma value of red channel, the blue intensity values of blue channel and
The Green brightness value of green channel, statistics obtain the highest red luma value of the frequency of occurrences in red channel, go out in blue channel
The highest Green brightness value of the frequency of occurrences in the existing highest blue intensity values of frequency, green channel, thus most according to the frequency of occurrences
High red luma value, blue intensity values and Green brightness value determines the dominant hue of target image.
The method for obtaining the dominant hue of image in the related technology has the disadvantage that
(1) in the related technology, central processing unit needs to carry out traversal statistics to target image, it will brings biggish calculating
Expense, so as to cause in some cases, such as terminal CPU computation power it is poor in the case where, obtain image
The time of dominant hue is longer.
(2) in the related technology, the dominant hue for the target image that terminal acquires is determined by one group of exact brightness value
, for example, the highest red luma value of the frequency of occurrences that central processing unit counts is 255, Green brightness value is 64, blue
Brightness value is 64, it is determined that the mass-tone is adjusted to brown, therefore, needs 16777216 kinds in RGB color in the related technology
Dominant hue color is determined during color is possible, and the calculation amount of central processing unit is larger, so as to cause the weaker terminal (example of computing capability
Such as mobile phone, tablet computer mobile terminal) dominant hue for obtaining target image is takeed a long time, or, cannot achieve to mesh
The acquisition of the dominant hue of logo image.
(3) in the related technology, the dominant hue of the target image acquired due to terminal is by one group of exact brightness value
Determining, close for dominant hue but different target image, the dominant hue that terminal acquires also is different, at certain
Under a little scenes, such as terminal shows the close but different target image of multiple dominant hues in user interface, since terminal obtains
The dominant hue that obtains is different, thus terminal show these target images when need the color of repeatedly adjustment user interface,
Cause to show that the consistency of user interface is poor.
Fig. 3 shows the schematic diagram in hsv color space, as shown in figure 3, hsv color space can be considered as a cylindrical coordinates
It is that the height z in cylindrical coordinates indicates brightness value, the radius r in cylindrical coordinates indicates intensity value, the radian φ table in cylindrical coordinate
Show hue value.Wherein, the value range of brightness value is [0,1], and the value range of intensity value is [0,1], the value of hue value
Range is [0 °, 360 °].
Hsv color space can intuitively show the relationship between color.For example, lightness, intensity value are identical, form and aspect
Different colors, height having the same and radius in hsv color space, but cylindrical section angle is different, thus this
Two kinds of colors have different shapes in hsv color space;Hue value is identical with intensity value, the different color of lightness,
There is same cross-sectional angle and radius, but height is different, therefore both colors have phase in HSV space in HSV space
Same shape, but there is different height.
Fig. 4 shows the flow chart of the method for the dominant hue for the acquisition image that one exemplary embodiment of the application provides.
As shown in figure 4, can be applied in terminal as shown in Figure 1 come in this way for example, this method comprises:
Step 401, the hue value and intensity value of the pixel in target image are obtained.
Wherein, target image can be deposits in the received image of the icon of the received file destination of terminal, terminal or terminal
Any one image in the image of storage.
When the color standard defaulted in terminal is hsv color space, after terminal acquires target image, target is obtained
The hue value and intensity value of pixel in image;When the color standard defaulted in terminal is RGB color, terminal is obtained
After obtaining target image, brightness value of the pixel in each Color Channel in target image is obtained, by pixel every
Brightness value in a Color Channel is converted into hue value, intensity value and brightness value in hsv color space, to obtain mesh
The hue value and intensity value of pixel in logo image.
Optionally, terminal carries out down-sampled processing to target image, obtain it is down-sampled after image, acquire down-sampled
The hue value and intensity value of the pixel in image afterwards.
Down-sampled is that terminal carries out reduction resolution processes to target image, obtain it is down-sampled after image process.Example
Such as, the resolution ratio of target image is 1000 × 1000 pixels, and down-sampled rate is 1/2, and terminal is according to down-sampled rate, to target image
Carry out it is down-sampled, obtain resolution ratio be 500 × 500 it is down-sampled after image.
Illustratively, terminal can be by way of the progress partiting row sampling of the pixel to target image and/or every column sampling
Carry out down-sampled processing, the application to down-sampled specific implementation without limitation.
After down-sampled processing, terminal only needs to handle the lower image of resolution ratio, and it is entire not need traversal
Target image is handled, and the computing cost of graphics processor is reduced.
Step 402, the distribution situation according to hue value in multiple form and aspect sections determines the mass-tone phase region of target image
Between.
Form and aspect section is the value interval divided according to form and aspect value range preset in terminal.For example, being preset in terminal
Form and aspect value range be universe hue value, the value interval of universe hue value is [0 °, 360 °], then can be by universe hue value
Be divided into 360 parts, respectively [0 °, 1 °], [1 °, 2 °] ..., [358 °, 359 °] and [359 °, 360 °], it is every portion value
Section is form and aspect section.
Optionally, it can be continuously, be also possible to discontinuous between form and aspect section.For example, the color in above-mentioned example
Phase section is the corresponding continuous form and aspect section of universe hue value;The corresponding discontinuous form and aspect section of universe hue value can be with
Be set as [0 °, 1 °], [2 °, 3 °] ..., [357 °, 358 °] and [359 °, 360 °].
Optionally, the value range in form and aspect section may include universe hue value, can not also include universe hue value.Example
Such as, when preset background colour is blue and green, can will with blue approximate form and aspect value interval [100 °, 140 °] and with it is green
Value range of the approximate form and aspect value interval of color [220 °, 260 °] as form and aspect section, the two value ranges are subdivided
For form and aspect section, which can be continuously, is also possible to discontinuous.
After terminal acquires the hue value of the pixel in target image, each hue value is included into corresponding form and aspect area
In, the corresponding hue value number in each form and aspect section is obtained, will include the most form and aspect area of hue value quantity in form and aspect section
Between be determined as mass tone section.
For example, it is 0.5 ° that terminal, which acquires hue value, then 0.5 ° of hue value is included into the form and aspect section of [0 °, 1 °]
In, if in the form and aspect section of [0 °, 1 °] only including 0.5 ° of this hue value, then terminal determines in the form and aspect section of [0 °, 1 °]
The hue value quantity for including is 1.
Step 403, the distribution situation according to intensity value in multiple saturation degree sections determines that the master of target image is full
With degree section.
Saturation degree section is the value interval divided according to saturation degree value range preset in terminal.For example, in terminal
Preset saturation degree value range is universe intensity value, and the value interval of universe intensity value is [0,1], then can be by universe
Hue value is divided into 10 parts, respectively [0,0.1], [0.1,0.2] ..., [0.8,0.9] and [0.9,1], it is every portion value
Section is saturation degree section.
Optionally, it can be continuously, be also possible to discontinuous between saturation degree section.For example, in above-mentioned example
Saturation degree section is the corresponding continuous saturation degree section of universe intensity value;Universe intensity value is corresponding discontinuous full
With degree section can be set as [0,0.1], [0.2,0.3] ..., [0.7,0.8] and [0.9,1].
Optionally, the value range in saturation degree section may include universe intensity value, can not also include universe saturation
Angle value.For example, application developer is not intended to for the color of user interface to be adjusted to, saturation degree is excessively high or saturation degree is too low
Saturation degree section can be arranged in saturation degree value range [0.3,0.7] in color.
After terminal acquires the intensity value of the pixel in target image, each intensity value is included into corresponding full
In degree section, the corresponding intensity value number in each saturation degree section is obtained, will include intensity value number in saturation degree section
It measures most saturation degree sections and determines to be main saturation degree section.
For example, it is 0.5 ° that terminal, which acquires intensity value, then 0.5 ° of hue value is included into the form and aspect section of [0 °, 1 °]
In, if in the form and aspect section of [0 °, 1 °] only including 0.5 ° of this hue value, then terminal determines in the form and aspect section of [0 °, 1 °]
The hue value quantity for including is 1.
Step 404, inquiry obtains the corresponding main saturation of the corresponding mass tone value in mass tone section and main saturation degree section
Angle value.
The corresponding hue value in each form and aspect section, the corresponding intensity value in each saturation degree section, for example, [0 °,
1 °] the corresponding hue value in form and aspect section be 0.5 °, the corresponding intensity value in saturation degree section of [0,0.1] is 0.05.
Terminal obtains the corresponding hue value in mass tone section according to inquiry, using the corresponding hue value in mass tone section as master
Hue value, inquiry obtain the corresponding intensity value in main saturation degree section, using the corresponding intensity value in pearl saturation degree section as master
Intensity value.
Step 405, the dominant hue of target image is determined according to mass tone value and main intensity value.
Terminal can determine the face in HSV space according to mass tone value, main intensity value and preset brightness value is obtained
Color, to obtain the dominant hue of target image.
In conclusion in the embodiment of the present application, by obtaining the hue value and intensity value of the pixel in target image,
Distribution situation according to hue value in multiple form and aspect sections distribution situation and intensity value in multiple saturation degree sections, it is main
Mass tone section and main saturation degree section are determined in the main saturation degree section in form and aspect section, so that inquiry obtains mass tone section pair
The corresponding main intensity value of mass tone value and main saturation degree section answered, and then the dominant hue of target image is obtained, due to master
Hue value and main intensity value are according to the mass tone section and main saturation degree section acquired by tabling look-up, terminal
It does not need accurately to acquire the highest hue value of the frequency of occurrences and intensity value, therefore reduces the computing cost of terminal,
The time for obtaining the dominant hue of image is reduced to a certain extent.
In the embodiment of the present application, by the way that by the corresponding hue value in each form and aspect section, each saturation degree section corresponds to one
A intensity value, can make hue value similar in hue value correspond to same hue value, and intensity value similar in intensity value is corresponding
Same intensity value, since the dominant hue of target image is determined according to mass tone value and main intensity value, at certain
Target image similar in dominant hue can be made to acquire identical dominant hue in a little situations, so that terminal is in display different target
When the dominant hue of image, the consistency of display dominant hue is improved.
Optionally, in the embodiment of the present application, by carrying out down-sampled processing to target image, obtain it is down-sampled after figure
Picture, terminal obtain it is down-sampled after image in pixel hue value and intensity value, to acquire target image
Dominant hue reduces the calculation amount of terminal, reduces to a certain extent since the resolution ratio of the image after down-sampled is lower
Obtain the time of target image dominant hue.
Fig. 5 shows the flow chart of the method for the dominant hue for the acquisition image that one exemplary embodiment of the application provides.
As shown in figure 5, this method can be applied in terminal as shown in Figure 1, this method comprises:
Step 501, graphics processor carries out down-sampled processing to target image, obtain it is down-sampled after image.
The process that graphics processor carries out down-sampled processing to target image can refer to the step 401 in Fig. 4 embodiment,
This is not repeated them here.
Illustratively, graphics processor carries out down-sampled processing to target image according to down-sampled rate preset in terminal,
For example, when the down-sampled rate of length and width is 1/2, it is down-sampled if the resolution ratio of target image is 1000 × 1000
The resolution ratio of image afterwards is 500 × 500, sets point for 500 × 500 for viewport (rasterisation number) in graphics processor
Resolution.When the display of the operating system of terminal is driven to open graphic library (Open Graphics Library, OpenGL),
Rasterization process is carried out to reference picture using glViewport instruction;When the display of the operating system of terminal is driven to metal
(Metal) when, rasterization process is carried out to reference picture using glViewport instruction.
Step 502, graphics processor obtain it is down-sampled after image in each pixel every kind of face in RGB color
Brightness value in chrominance channel.
The color standard defaulted in the operating system of usual terminal is RGB color, and graphics processor acquires drop
The red luma value, Green brightness value and blue intensity values of each pixel in image after sampling.
Illustratively, it is bright in red to acquire the purple pixel point that coordinate in reference picture is (1,1) for graphics processor
Angle value is 128, and Green brightness value is 0, blue intensity values 128.
Step 503, brightness value of the graphics processor according to each pixel in each color channel is calculated each
The hue value and intensity value of pixel.
Graphics processor is acquiring brightness value of each pixel in RGB color in each color channel
Afterwards, it needs to execute the processing that RGB color turns hsv color space to the brightness value in each color channel, that is, graphics processor
According to preset algorithm, brightness value of the pixel each in reference picture in RGB color in each color channel is turned
Turn to the hue value and intensity value in hsv color space.
Illustratively, graphics processor acquires the red luma value for the pixel that coordinate in reference picture is (1,1)
It is 128, Green brightness value is 0, and after blue intensity values are 128, by preset algorithm, the hue value for obtaining the pixel is
300 °, intensity value 1.
Step 504, preset form and aspect value range is divided into n form and aspect section by graphics processor, and n is positive integer.
Graphics processor is divided into n form and aspect section according to preset form and aspect value range, by the form and aspect value range.It can
Choosing, be continuously, or, being discontinuous between n form and aspect section between n form and aspect section;Preset form and aspect value range
For universe hue value, or, preset form and aspect value range is not universe hue value.
Illustratively, preset form and aspect value range is universe hue value, the value interval of universe hue value be [0 °,
360 °], since value is up to 1 in the frame buffer memory of graphics processor, graphics processor enables the value of universe hue value
Section be [0 °, 1 °], the value interval of [0 °, 1 °] is divided into 360 parts, respectively [0 °, 1/360 °], [1 °, 2/
360 °] ..., [358/360 °, 359/360 °] and [359/360 °, 1 °], it is every portion value interval be form and aspect section,
In, n=360.
Step 505, preset saturation degree value range is divided into m saturation degree section by graphics processor, and m is positive whole
Number.
Graphics processor is divided into m saturation degree according to preset saturation degree value range, by the saturation degree value range
Section.It optionally, is continuously, or, being discontinuous between m saturation degree section between m saturation degree section;It is preset full
It is universe intensity value with degree value range, or, preset saturation degree value range is not universe intensity value.
Illustratively, preset saturation degree value range is universe intensity value, and the value interval of universe intensity value is
[0,1], then universe hue value is divided into 10 parts by graphics processor, respectively [0,0.1], [0.1,0.2] ..., [0.8,
0.9] and [0.9,1], every portion value interval is saturation degree section, wherein m=10.
It should be noted that graphics processor can first carry out step 504, then execute step 505;Step can also be first carried out
Rapid 505, then step 504 is executed, it is not limited here.
Step 506, the hue value of each pixel is included into affiliated form and aspect section by graphics processor, and statistics is fallen
Enter the hue value quantity in each form and aspect section.
The hue value for each pixel that graphics processor will acquire is included into affiliated form and aspect section, and statistics obtains
The hue value quantity for including in each form and aspect section in n form and aspect section.For example, can will acquire 0.5/360 ° of terminal
Hue value is included into the form and aspect section of [0 °, 1/360 °], if form and aspect section [0 °, 1/360 °] only includes 0.5/360 ° of hue value, then
The corresponding hue value quantity in form and aspect section [0 °, 1/360 °] is 1.
Step 507, the intensity value of each pixel is included into affiliated saturation degree section by graphics processor, is counted
To the intensity value quantity for falling into each saturation degree section.
The hue value for each pixel that graphics processor will acquire is included into affiliated form and aspect section, and statistics obtains
The intensity value quantity that each saturation degree section includes in m saturation degree section.For example, terminal can will acquire 0.45
Intensity value is included into the saturation degree section of [0.4,0.5], if saturation degree section [0.4,0.5] only includes intensity value 0.45, then
The corresponding intensity value quantity in saturation degree section [0.4,0.5] is 1.
It should be noted that graphics processor can first carry out step 506, then execute step 507;Or, first carrying out step
507, then step 506 is executed, it is not limited here.
Step 508, the hue value quantity and each saturation degree section that graphics processor includes according to each form and aspect section
The intensity value quantity for including, building obtain the texture of n row m+1 column texel, and i is positive integer, and j is integer, 1≤i≤n, and 1
≤j≤m。
The hue value quantity and each saturation degree section that graphics processor includes according to obtained each form and aspect section are wrapped
The intensity value quantity contained, building obtains the texture of n row m+1 column texel, the line in the texture in frame buffer memory
Reason element T (i, j) indicates the saturation that -1 saturation degree section of hue value number and jth that i-th of form and aspect section includes includes
Angle value number.As j=1, the 0th saturation degree section is indicated without the saturation degree section, that is, the first row texture primitive in texture
Element does not include the intensity value quantity that saturation degree section and saturation degree section include.
Illustratively, when the display of the operating system of terminal is driven to OpenGL, texture type OpenGL
Texture;When the display of the operating system of terminal is driven to Metal, texture type is Metal Texture.
As shown in fig. 6, texture 600 includes n row, the texel of m+1 column, wherein first row texel T (i, 0) is
The hue value number that 1st form and aspect section to n-th of form and aspect section and each form and aspect section include, does not include saturation degree
The intensity value quantity that section and saturation degree section include.H in Fig. 6i(Pi) indicate the corresponding hue value in i-th of form and aspect section
Quantity is Pi, Sj(Qj) indicate that the corresponding intensity value quantity in j-th of saturation degree section is Qj。
Step 509, central processing unit reads each form and aspect section hue value quantity for including in the first row of texture, by the
It is determined as mass tone section comprising the most form and aspect section of hue value quantity in one column.
After terminal generates texture by graphics processor, by calling central processing unit to read the line in the first row of texture
Element is managed, the hue value quantity that each form and aspect section includes is obtained, will include that hue value quantity is most in first row texel
Form and aspect section be determined as mass tone section.
Illustratively, central processing unit can read to obtain mass tone section by following formula:
Wherein,Indicate that the hue value quantity in i-th of form and aspect section is Pi。
Step 510, central processing unit is read in the row where mass tone section, saturation degree that each saturation degree section includes
It is worth quantity, will includes that the most saturation degree section of intensity value quantity determines as main saturation degree area in the row where mass tone section
Between.
After determining mass tone section, central processing unit reads the texture primitive in the row in texture where mass tone section
Element is determined in the row comprising the saturation degree section that intensity value is most, will be determined comprising the most saturation degree section of intensity value
For main saturation degree section.
Illustratively, determining that mass tone section is HiAfterwards, central processing unit can read to obtain mass-tone by following formula
Phase section and main saturation degree section:
Wherein,It indicates in texture in the i-th row, form and aspect section SjIn hue value quantity be Qj。
Step 511, central processing unit is inquired to obtain the corresponding mass tone value in mass tone section and main saturation degree section pair
The main intensity value answered.
Each form and aspect section can be arranged corresponding hue value according to demand, and each saturation degree section can be arranged pair according to demand
The intensity value answered.For example, the corresponding hue value in form and aspect section of [0 °, 1/360 °] is 0.5 °, the saturation degree section of [0,0.1]
Corresponding intensity value is 0.05.
Central processing unit is inquired to obtain the corresponding hue value in mass tone section, using the corresponding hue value in mass tone section as
Mass tone value, inquiry obtain the corresponding intensity value in main saturation degree section, using the corresponding intensity value in pearl saturation degree section as
Main intensity value.
Step 512, central processing unit obtains target figure according to mass tone value, main intensity value and preset brightness value
The dominant hue of picture.
Central processing unit can determine in HSV space according to mass tone value, main intensity value and preset brightness value
Color, to obtain the dominant hue of target image.
Optionally, the color of the user interface of the display screen display of terminal is adjusted to target image by central processing unit
Dominant hue.
Illustratively, in the dialog interface application scenarios of instant communication application program, terminal acquires other terminals
The dominant hue of the icon of the file destination of transmission, or, after the dominant hue for the target image that other terminals are sent, by dialog interface
Color is adjusted to the color of the dominant hue.
Illustratively, in the application scenarios of the music-playing interface of music application program, terminal acquires envelope
After the dominant hue of face image, the color of music-playing interface is adjusted to the dominant hue of cover image.
In conclusion in the embodiment of the present application, by obtaining the hue value and intensity value of the pixel in target image,
Distribution situation according to hue value in multiple form and aspect sections distribution situation and intensity value in multiple saturation degree sections, it is main
Mass tone section and main saturation degree section are determined in the main saturation degree section in form and aspect section, so that inquiry obtains mass tone section pair
The corresponding main intensity value of mass tone value and main saturation degree section answered, and then the dominant hue of target image is obtained, due to master
Hue value and main intensity value are according to the mass tone section and main saturation degree section acquired by tabling look-up, terminal
It does not need accurately to acquire the highest hue value of the frequency of occurrences and intensity value, therefore reduces the computing cost of terminal,
The time for obtaining the dominant hue of image is reduced to a certain extent.
In the embodiment of the present application, by the way that by the corresponding hue value in each form and aspect section, each saturation degree section corresponds to one
A intensity value, can make hue value similar in hue value correspond to same hue value, and intensity value similar in intensity value is corresponding
Same intensity value, since the dominant hue of target image is determined according to mass tone value and main intensity value, at certain
Target image similar in dominant hue can be made to acquire identical dominant hue in a little situations, so that terminal is in display different target
When the dominant hue of image, the consistency of display dominant hue is improved.
Optionally, in the embodiment of the present application, by carrying out down-sampled processing to target image, obtain it is down-sampled after figure
Picture, terminal obtain it is down-sampled after image in pixel hue value and intensity value, to acquire target image
Dominant hue reduces the calculation amount of terminal, reduces to a certain extent since the resolution ratio of the image after down-sampled is lower
Obtain the time of target image dominant hue.
Optionally, in the embodiment of the present application, down-sampled processing is carried out to target image by graphics processor, is obtained each
After the hue value and intensity value of pixel, each hue value and intensity value are included by creation texture by respectively affiliated color
In phase section and saturation degree section, texture is read by central processing unit and obtains mass tone value and main intensity value, to obtain
The dominant hue of target image handles the entire process for obtaining dominant hue due to not needing central processing unit, reduces
The calculation amount of central processing unit to a certain extent reduces the time for obtaining the dominant hue of image.
Optionally, in the embodiment of the present application, by the way that preset form and aspect value range is not configured to universe hue value, and/
Or, preset saturation degree value range is not configured to universe intensity value, since terminal does not need for each hue value to be included into
Into the corresponding form and aspect section of universe hue value, and/or, terminal does not need each intensity value being included into universe intensity value
In corresponding saturation degree section, therefore the calculation amount of central processing unit is reduced, reduces obtain image to a certain extent
The time of dominant hue.
Optionally, in the embodiment of the present application, by will be set as discontinuous between form and aspect section, and/or, by saturation degree area
Between between be set as discontinuous, since terminal does not need for each hue value to be included into continuous form and aspect section, and/or, eventually
End does not need to be included into each intensity value in continuous saturation degree section, therefore reduces the calculation amount of central processing unit,
The time for obtaining the dominant hue of image is reduced to a certain extent.
Fig. 7 shows the structural frames of the device of the dominant hue for the acquisition image that one exemplary embodiment of the application provides
Figure.The device being implemented in combination with as the terminal 100 in Fig. 1 embodiment by software, hardware or both.The device packet
Include pattern process module 710 and central processing module 720.
Pattern process module 710, for obtaining the hue value and intensity value of the pixel in target image.
Central processing module 720 determines target image for distribution situation of the root hue value in multiple form and aspect sections
Mass tone section;According to distribution situation of the intensity value in multiple saturation degree sections, the main saturation of target image is determined
Spend section;Inquiry obtains the corresponding main intensity value of the corresponding mass tone value in mass tone section and main saturation degree section;According to
Mass tone value and main intensity value determine the dominant hue of target image.
In an alternative embodiment, pattern process module 710 are also used to determine form and aspect area belonging to each hue value
Between, statistics obtains the hue value quantity fallen into each form and aspect section.
Central processing module 720, is also used in each form and aspect section, comprising hue value quantity it is most be determined as mass-tone
Phase section.
In the embodiment that one can choose, pattern process module 710 is also used to determine belonging to each intensity value and satisfies
With degree section, statistics obtains the intensity value quantity fallen into each saturation degree section.
Central processing module 720 is also used to include intensity value quantity being determined as at most in each saturation degree section
Main saturation degree section.
In an alternative embodiment, pattern process module 710 are also used to determine saturation belonging to each intensity value
Section is spent, statistics obtains the intensity value quantity fallen into each saturation degree section.
Central processing module 720, the saturation degree section for being also used to have maximum intensity value quantity, determine based on satisfy
With degree section.
In an alternative embodiment, pattern process module 710 are also used to divide preset saturation degree value range
For m saturation degree section, m is positive integer;Each intensity value is included into affiliated saturation degree section.
Central processing module 720 is also used to statistics and obtains falling into satisfying in each saturation degree section in m saturation degree section
With angle value quantity.
In an alternative embodiment, pattern process module 710 are also used to the form and aspect for including according to each form and aspect section
The intensity value quantity that value quantity and each saturation degree section include constructs to obtain texture, which includes that n row m+1 is arranged
Texel, the texel of the i-th row jth column indicates hue value quantity and jth -1 that i-th of form and aspect section includes in texture
The intensity value quantity that a saturation degree section includes, i are positive integer, and j is integer, 1≤i≤n, 1≤j≤m.
Central processing module 710 is also used to read the hue value quantity that each form and aspect section includes in the first row of texture,
It will include that the most form and aspect section of hue value quantity is determined as mass tone section in first row.
In an alternative embodiment, central processing module 720 are also used to read in texture, where mass tone section
Row in each saturation degree section intensity value quantity for including, will include intensity value quantity in the row where mass tone section
Most saturation degree sections determines to be main saturation degree section.
In an alternative embodiment, pattern process module 710 are also used to carry out down-sampled processing to target image,
Obtain it is down-sampled after image;Obtain it is down-sampled after image in each pixel hue value and intensity value.
In an alternative embodiment, pattern process module 710 are also used to obtain each pixel in RGB color sky
Between middle each color channel brightness value;According to brightness value of each pixel in each color channel, it is calculated each
Hue value and intensity value of the pixel in hsv color space.
In an alternative embodiment, central processing module 710 are also used to the user of the display screen display of terminal
The color at interface is adjusted to dominant hue.
Fig. 8 shows the structural block diagram of the terminal 800 of one exemplary embodiment of the application offer.The terminal 800 can be with
It is portable mobile termianl, such as: smart phone, tablet computer, MP3 player (Moving Picture Experts
Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture
Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) player.Terminal 800 may be used also
Other titles such as user equipment, portable terminal can be referred to as.
Terminal 800 includes: processor 801, memory 802 and display screen 803.
Processor 801 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place
Reason device 801 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field-
Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed
Logic array) at least one of example, in hardware realize.Processor 801 also may include primary processor and coprocessor, master
Processor is the processor for being handled data in the awake state, also referred to as CPU;Coprocessor be for to
The low power processor that data under machine state are handled.In some embodiments, processor 801 can be integrated with figure
Processor, graphics processor are used to be responsible for the rendering and drafting of content to be shown needed for display screen;Or, processor 801 includes
Central processing and graphics processor.In some embodiments, processor 801 can also include AI (Artificial
Intelligence, artificial intelligence) processor, the AI processor is for handling the calculating operation in relation to machine learning.
Memory 802 may include one or more computer readable storage mediums, which can
To be tangible and non-transient.Memory 802 may also include high-speed random access memory and nonvolatile memory,
Such as one or more disk storage equipments, flash memory device.In some embodiments, non-transient in memory 802
Computer readable storage medium for storing at least one instruction, at least one instruction for performed by processor 801 with
The method for realizing the dominant hue of acquisition image provided herein.
Display screen 803 is for showing UI (User Interface, user interface).The UI may include figure, text, figure
Mark, video and its their any combination.Display screen 803 can also have acquisition on the surface or surface of touch display screen 803
The ability of the touch signal of top.The touch signal can be used as control signal and be input to processor 801 and be handled.It touches aobvious
Display screen 803 is for providing virtual push button and/or dummy keyboard, also referred to as soft button and/or soft keyboard.In some embodiments, it touches
Touching display screen 803 can be one, and the front panel of terminal 800 is arranged;In further embodiments, touch display screen 803 can be with
It is at least two, is separately positioned on the different surfaces of terminal 800 or in foldover design;In still other embodiments, display is touched
Screen 803 can be flexible display screen, be arranged on the curved surface of terminal 800 or on fold plane.Even, touch display screen 805
It can also be arranged to non-rectangle irregular figure, namely abnormity screen.Touch display screen 805 can use LCD (Liquid
Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode)
Etc. materials preparation.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal 800 of structure shown in Fig. 8, can wrap
It includes than illustrating more or fewer components, perhaps combine certain components or is arranged using different components.
The application also provides a kind of computer readable storage medium, be stored in the storage medium at least one instruction,
At least one section of program, code set or instruction set, at least one instruction or refer at least one section of program, the code set
The method for enabling collection be loaded by the processor and executed to realize the dominant hue of the acquisition image of above method embodiment offer.
Optionally, present invention also provides a kind of computer program products comprising instruction, when it runs on computers
When, so that computer executes the method for obtaining the dominant hue of image described in above-mentioned various aspects.
It should be understood that referenced herein " multiple " refer to two or more."and/or", description association
The incidence relation of object indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A
And B, individualism B these three situations.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and
Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.
Claims (15)
1. a kind of method for the dominant hue for obtaining image, which is characterized in that the method is executed by terminal, which comprises
Obtain the hue value and intensity value of the pixel in target image;
According to distribution situation of the hue value in multiple form and aspect sections, the mass tone section of the target image is determined;
According to distribution situation of the intensity value in multiple saturation degree sections, the main saturation degree of the target image is determined
Section;
Inquiry obtains the corresponding main saturation degree of the corresponding mass tone value in the mass tone section and the main saturation degree section
Value;
The dominant hue of the target image is determined according to the mass tone value and the main intensity value.
2. the method according to claim 1, wherein it is described according to the hue value in multiple form and aspect sections
Distribution situation determines the mass tone section of the target image, comprising:
Determine form and aspect section belonging to each hue value, statistics obtains the hue value number fallen into each form and aspect section
Amount;
By the form and aspect section with maximum hue value quantity, it is determined as the mass tone section.
3. according to the method described in claim 2, it is characterized in that, form and aspect area belonging to each hue value of the determination
Between, statistics obtains the hue value quantity fallen into each form and aspect section, comprising:
Preset form and aspect value range is divided into n form and aspect section, n is positive integer;
Each hue value is included into affiliated form and aspect section, statistics obtains falling into each color in n form and aspect section
Hue value quantity in phase section.
4. according to the method described in claim 3, it is characterized in that, described by the form and aspect area with maximum hue value quantity
Between, it is determined as the mass tone section, comprising:
The intensity value that the hue value quantity and each saturation degree section for including according to each form and aspect section include
Quantity constructs to obtain texture, and the texture includes the texel of n row m+1 column, the texture primitive of the i-th row jth column in the texture
Element indicates the intensity value quantity that -1 saturation degree section of hue value quantity and jth that i-th of form and aspect section includes includes, m
For positive integer, i is positive integer, and j is positive integer, 1≤i≤n, 1≤j≤m;
The hue value quantity that each form and aspect section includes in the first row of the texture is read, will include form and aspect in the first row
The most form and aspect section of value quantity is determined as the mass tone section.
5. the method according to claim 1, wherein it is described according to the intensity value in multiple saturation degree sections
In distribution situation, determine the main saturation degree section of the target image, comprising:
Determine saturation degree section belonging to each intensity value, statistics obtains falling into full in each saturation degree section
With angle value quantity;
By the saturation degree section with maximum intensity value quantity, it is determined as the main saturation degree section.
6. according to the method described in claim 5, it is characterized in that, saturation degree belonging to each intensity value of the determination
Section, statistics obtain the intensity value quantity fallen into each saturation degree section, comprising:
Preset saturation degree value range is divided into m saturation degree section, m is positive integer;
Each intensity value is included into affiliated saturation degree section, statistics obtains falling into m saturation degree section
Intensity value quantity in each saturation degree section.
7. according to the method described in claim 6, it is characterized in that, described by the saturation degree with maximum intensity value quantity
Section is determined as the main saturation degree section, comprising:
The intensity value that the hue value quantity and each saturation degree section for including according to each form and aspect section include
Quantity constructs to obtain texture, and the texture includes the texel of n row m+1 column, the texture primitive of the i-th row jth column in the texture
Element indicates the intensity value quantity that -1 saturation degree section of hue value quantity and jth that i-th of form and aspect section includes includes, n
For positive integer, i is positive integer, and j is positive integer, 1≤i≤n, 1≤j≤m;
It reads in the texture, the intensity value quantity that each saturation degree section includes in the row where the mass tone section,
It will include that the most saturation degree section of intensity value quantity is determined as the main saturation degree in the row where the mass tone section
Section.
8. method according to any one of claims 1 to 7, which is characterized in that the pixel obtained in target image
Hue value and intensity value, comprising:
Down-sampled processing is carried out to the target image, obtain it is down-sampled after image;
Obtain it is described it is down-sampled after image in each pixel hue value and intensity value.
9. according to the method described in claim 8, it is characterized in that, it is described obtain it is described it is down-sampled after image in each pixel
The hue value and intensity value of point, comprising:
Obtain the brightness value in each pixel each color channel in RGB RGB color;
According to brightness value of each pixel in each color channel, it is full in form and aspect that each pixel is calculated
With the hue value and intensity value in degree lightness hsv color space.
10. method according to any one of claims 1 to 7, which is characterized in that described according to the mass tone value and described
Main intensity value determines after the dominant hue of the target image, further includes:
The color of the user interface of the display screen display of the terminal is adjusted to the dominant hue.
11. a kind of device for the dominant hue for obtaining image, which is characterized in that described device is applied in terminal, described device packet
It includes:
Pattern process module, for obtaining the hue value and intensity value of the pixel in target image;
Central processing module determines the target for the distribution situation according to the hue value in multiple form and aspect sections
The mass tone section of image;According to distribution situation of the intensity value in multiple saturation degree sections, the target is determined
The main saturation degree section of image;Inquiry obtains the corresponding mass tone value in the mass tone section and the main saturation degree section
Corresponding main intensity value;The dominant hue of the target image is determined according to the mass tone value and the main intensity value.
12. device according to claim 11, which is characterized in that the pattern process module is also used to determine each institute
Form and aspect section belonging to hue value is stated, statistics obtains the hue value quantity fallen into each form and aspect section;
The central processing module, is also used in each form and aspect section, comprising hue value quantity it is most be determined as institute
State mass tone section.
13. device according to claim 12, which is characterized in that the pattern process module is also used to determine each institute
Saturation degree section belonging to intensity value is stated, statistics obtains the intensity value quantity fallen into each saturation degree section;
The central processing module is also used to include the most determination of intensity value quantity in each saturation degree section
For the main saturation degree section.
14. a kind of terminal, which is characterized in that the terminal includes processor and memory, is stored at least in the memory
One instruction, described instruction are loaded by the processor and are executed to realize the acquisition figure as described in claims 1 to 10 is any
The method of the dominant hue of picture.
15. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, institute in the storage medium
State the side for the dominant hue for obtaining image that instruction is loaded by processor and executed with realization as described in claims 1 to 10 is any
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811192232.6A CN109166159B (en) | 2018-10-12 | 2018-10-12 | Method and device for acquiring dominant tone of image and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811192232.6A CN109166159B (en) | 2018-10-12 | 2018-10-12 | Method and device for acquiring dominant tone of image and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109166159A true CN109166159A (en) | 2019-01-08 |
CN109166159B CN109166159B (en) | 2021-04-30 |
Family
ID=64878161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811192232.6A Active CN109166159B (en) | 2018-10-12 | 2018-10-12 | Method and device for acquiring dominant tone of image and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109166159B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783178A (en) * | 2019-01-24 | 2019-05-21 | 北京字节跳动网络技术有限公司 | A kind of color adjustment method of interface assembly, device, equipment and medium |
CN109884703A (en) * | 2019-03-20 | 2019-06-14 | 中国石油化工股份有限公司 | Color plane attributed graph digitizing solution based on hsv color model |
CN110210532A (en) * | 2019-05-15 | 2019-09-06 | 北京字节跳动网络技术有限公司 | Background colour generation method, device and electronic equipment |
CN110377860A (en) * | 2019-07-18 | 2019-10-25 | 百度(中国)有限公司 | A kind of page color method of adjustment, device and electronic equipment |
CN111612857A (en) * | 2020-05-28 | 2020-09-01 | 北京学之途网络科技有限公司 | Color obtaining method and device, electronic equipment and readable storage medium |
CN112015417A (en) * | 2020-09-01 | 2020-12-01 | 中国银行股份有限公司 | Method and device for determining theme color of application program |
CN112887694A (en) * | 2021-01-26 | 2021-06-01 | 腾讯音乐娱乐科技(深圳)有限公司 | Video playing method, device and equipment and readable storage medium |
CN113254690A (en) * | 2020-02-10 | 2021-08-13 | 华为技术有限公司 | Thumbnail display method and equipment |
CN113610185A (en) * | 2021-08-19 | 2021-11-05 | 江西应用技术职业学院 | Wood color sorting method based on dominant hue identification |
CN113630655A (en) * | 2021-08-13 | 2021-11-09 | 海信视像科技股份有限公司 | Method for changing color of peripheral equipment along with picture color and display equipment |
US20220415236A1 (en) * | 2021-06-24 | 2022-12-29 | Beijing Xiaomi Mobile Software Co., Ltd. | Display control method, display control device and storage medium |
WO2023284553A1 (en) * | 2021-07-13 | 2023-01-19 | 海信视像科技股份有限公司 | Display device and control method therefor |
CN116883610A (en) * | 2023-09-07 | 2023-10-13 | 园测信息科技股份有限公司 | Digital twin intersection construction method and system based on vehicle identification and track mapping |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819821A (en) * | 2012-07-24 | 2012-12-12 | 浙江大学 | Method for rapidly rematching colors of product appearance based on color style transfer |
CN103513946A (en) * | 2012-06-26 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Display control method and device |
CN103618886A (en) * | 2013-12-13 | 2014-03-05 | 厦门美图网科技有限公司 | Shooting method for intelligently decoloring according to main color tone |
CN106780634A (en) * | 2016-12-27 | 2017-05-31 | 努比亚技术有限公司 | Picture dominant tone extracting method and device |
JP2018134413A (en) * | 2018-02-21 | 2018-08-30 | 株式会社島津製作所 | Imaging apparatus |
-
2018
- 2018-10-12 CN CN201811192232.6A patent/CN109166159B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103513946A (en) * | 2012-06-26 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Display control method and device |
CN102819821A (en) * | 2012-07-24 | 2012-12-12 | 浙江大学 | Method for rapidly rematching colors of product appearance based on color style transfer |
CN103618886A (en) * | 2013-12-13 | 2014-03-05 | 厦门美图网科技有限公司 | Shooting method for intelligently decoloring according to main color tone |
CN106780634A (en) * | 2016-12-27 | 2017-05-31 | 努比亚技术有限公司 | Picture dominant tone extracting method and device |
JP2018134413A (en) * | 2018-02-21 | 2018-08-30 | 株式会社島津製作所 | Imaging apparatus |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783178A (en) * | 2019-01-24 | 2019-05-21 | 北京字节跳动网络技术有限公司 | A kind of color adjustment method of interface assembly, device, equipment and medium |
CN109884703B (en) * | 2019-03-20 | 2021-03-26 | 中国石油化工股份有限公司 | Color plane attribute graph digitalization method based on HSV color model |
CN109884703A (en) * | 2019-03-20 | 2019-06-14 | 中国石油化工股份有限公司 | Color plane attributed graph digitizing solution based on hsv color model |
CN110210532A (en) * | 2019-05-15 | 2019-09-06 | 北京字节跳动网络技术有限公司 | Background colour generation method, device and electronic equipment |
CN110377860A (en) * | 2019-07-18 | 2019-10-25 | 百度(中国)有限公司 | A kind of page color method of adjustment, device and electronic equipment |
CN113254690A (en) * | 2020-02-10 | 2021-08-13 | 华为技术有限公司 | Thumbnail display method and equipment |
CN111612857A (en) * | 2020-05-28 | 2020-09-01 | 北京学之途网络科技有限公司 | Color obtaining method and device, electronic equipment and readable storage medium |
CN111612857B (en) * | 2020-05-28 | 2024-03-26 | 北京明略昭辉科技有限公司 | Color acquisition method and device, electronic equipment and readable storage medium |
CN112015417A (en) * | 2020-09-01 | 2020-12-01 | 中国银行股份有限公司 | Method and device for determining theme color of application program |
CN112015417B (en) * | 2020-09-01 | 2023-08-08 | 中国银行股份有限公司 | Method and device for determining theme colors of application programs |
CN112887694A (en) * | 2021-01-26 | 2021-06-01 | 腾讯音乐娱乐科技(深圳)有限公司 | Video playing method, device and equipment and readable storage medium |
US20220415236A1 (en) * | 2021-06-24 | 2022-12-29 | Beijing Xiaomi Mobile Software Co., Ltd. | Display control method, display control device and storage medium |
WO2023284553A1 (en) * | 2021-07-13 | 2023-01-19 | 海信视像科技股份有限公司 | Display device and control method therefor |
CN113630655A (en) * | 2021-08-13 | 2021-11-09 | 海信视像科技股份有限公司 | Method for changing color of peripheral equipment along with picture color and display equipment |
CN113610185A (en) * | 2021-08-19 | 2021-11-05 | 江西应用技术职业学院 | Wood color sorting method based on dominant hue identification |
CN116883610A (en) * | 2023-09-07 | 2023-10-13 | 园测信息科技股份有限公司 | Digital twin intersection construction method and system based on vehicle identification and track mapping |
Also Published As
Publication number | Publication date |
---|---|
CN109166159B (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109166159A (en) | Obtain the method, apparatus and terminal of the dominant hue of image | |
CN106471545B (en) | Texture cell as image processing engine | |
CN1770205B (en) | Texture-based packing | |
JP6483221B2 (en) | 3D code generation method | |
CN108701351B (en) | Image display enhancement method and device | |
CN112215934A (en) | Rendering method and device of game model, storage medium and electronic device | |
CA2743039A1 (en) | Bezier curve drawing device, bezier curve drawing method, and recording medium | |
CN105164994A (en) | Semi-fixed-hue gamut compression | |
WO2023045857A1 (en) | Image processing method and apparatus, electronic device and storage medium | |
CN107799093A (en) | Adjust method, terminal and the computer-readable recording medium of screen luminance of terminal | |
CN109919837A (en) | Image data interpolation | |
TW201933046A (en) | Image processing method and device based on augmented reality, and electronic equipment | |
CN104641631B (en) | By the color enhancement of gamut extension | |
CN111080806A (en) | Map processing method and device, electronic device and storage medium | |
US20180097527A1 (en) | 32-bit hdr pixel format with optimum precision | |
EP3306570A1 (en) | Method and apparatus for processing image data | |
US20210097903A1 (en) | Image representation method, image representation device, and computer readable storage medium | |
KR101214674B1 (en) | Apparatus and method for generating mosaic image including text | |
JP3708476B2 (en) | Color gamut mapping system and method using composite color space | |
CN109614064A (en) | A kind of image display method, image display apparatus and terminal device | |
US11361476B2 (en) | Efficient color mapping systems and methods | |
CN111338627B (en) | Front-end webpage theme color adjustment method and device | |
KR20180037837A (en) | Method and apparatus for determining the number of bits assigned a channel based on a variation of the channel | |
JP4817792B2 (en) | Texture-based pixel packing | |
CN112513940A (en) | Alpha value determination device, alpha value determination method, program, and data structure of image data |
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 |