The inter-linked controlling method of a kind of Smart Home and device
Technical field
The present invention relates to communication technical field, particularly to inter-linked controlling method and the dress of a kind of Smart Home
Put.
Background technology
Along with the development of Smart Home commercialization, the linkage function within household is increasingly closed by user
Note.Such as, play during multimedia file at intelligent television, by with intelligent television around background
Linkage between lamp, as adjusted the lamplight brightness of background light, builds atmosphere, improves Consumer's Experience further.
How to realize the coordinated signals of Smart Home, there is presently no solution.
Summary of the invention
Embodiments provide inter-linked controlling method and the device of a kind of Smart Home, it is intended to realize intelligence
Color linkage between TV and intelligent lamp group, improves viewing effect and the Consumer's Experience of intelligent television.
First aspect, the inter-linked controlling method of a kind of Smart Home, including:
Obtain the video image that intelligent television is play, and described video image is divided at least one sub-district
Territory;
For each subregion of described video image, according to the pixel comprised in described subregion
Rgb value, determines the main rgb value of described subregion, wherein, the corresponding intelligent lamp of every sub regions
Group;
By the main rgb value of described subregion and be used for representing the mark of described subregion correspondence intelligent lamp group
Information, is transferred to gateway, so that described gateway is according to the main rgb value of described subregion, adjusts described son
Intelligent lamp group corresponding to region sends the color of light.
Optionally, by the main rgb value of described subregion and be used for representing described subregion correspondence intelligent lamp
The identification information of group, is transferred to gateway, including:
By HTML (Hypertext Markup Language) HTTP, by the main rgb value of described subregion and be used for representing described
The identification information of subregion correspondence intelligent lamp group, is transferred to gateway.
As a kind of possible implementation, each subregion that described video image is comprised, according to
The rgb value of the pixel comprised in described subregion, determines the main rgb value of described subregion, including:
Each subregion comprised for described video image, according to the pixel comprised in described subregion
Rgb value, determine the quantity of the pixel with identical rgb value;
By rgb values most for the quantity of corresponding pixel, it is defined as the main rgb value of described subregion.
As alternatively possible implementation, each subregion comprised for described video image, root
According to the rgb value of the pixel that described subregion comprises, determine the main rgb value of described subregion, including:
Each subregion that described video image is comprised, the pixel that described subregion is comprised
Rgb value is converted into HSL color mode;
The intensity value in pixel correspondence HSL color mode and brightness value is comprised according to described subregion,
Determine the main rgb value of described subregion.
Optionally, according to described subregion comprise intensity value in pixel correspondence HSL color mode and
Brightness value, determines the main rgb value of described subregion, including:
The color template selected according to user, from the pixel that described subregion comprises, selects saturation
Value is in the saturation threshold range that described color template comprises and brightness value comprises at described color template
Pixel in the range of lightness threshold;
From the rgb value of the pixel selected, a rgb value is selected to be defined as the master of described subregion
Rgb value.
Optionally, according to described subregion comprise intensity value in pixel correspondence HSL color mode and
Brightness value, determines the main rgb value of described subregion, including:
Determine the color mould that the intensity value of each pixel that described subregion comprises all is selected user
The lightness threshold model that the saturation threshold range that plate comprises is outer and/or brightness value all comprises at described color template
Outside enclosing;
According to the rgb value of the pixel comprised in described subregion, determine the pixel with identical rgb value
The quantity of point;
By rgb values most for the quantity of corresponding pixel, it is defined as the main rgb value of described subregion.
Optionally, described method also includes: obtain the volume value of the video that described intelligent television is play;
The volume value got is transferred to described gateway, so that described gateway is according to the volume value received,
Adjust each intelligent lamp group and send the brightness of light.
Second aspect, the inter-linked controlling method of a kind of Smart Home, including:
Receive the main rgb value of every sub regions of the video image that intelligent television is play and for representing
The identification information of the intelligent lamp group that described subregion is corresponding, described video image is divided at least one height
Region;
For every sub regions, according to the main rgb value of described subregion, adjust described subregion corresponding
Intelligent lamp group sends the color of light.
Optionally, receive every sub regions of video image that intelligent television is play main rgb value and
For representing the identification information of intelligent lamp group that described subregion is corresponding, including:
By HTML (Hypertext Markup Language) HTTP, receive the Mei Gezi district of the video image that intelligent television is play
The main rgb value in territory and for representing the identification information of intelligent lamp group that described subregion is corresponding.
Optionally, described method also includes:
Receive the volume value of the video that described intelligent television is play;
According to described volume value, adjust each intelligent lamp group and send the brightness of light.
The third aspect, the linkage control device of a kind of Smart Home, including:
Processing module, for obtaining the video image that intelligent television is play, and divides described video image
For at least one subregion;
Determine module, for each subregion for described video image, wrap according in described subregion
The rgb value of the pixel contained, determines the main rgb value of described subregion, wherein, every sub regions pair
Answer an intelligent lamp group;
Transport module, for by the main rgb value of described subregion and be used for representing that described subregion is corresponding
The identification information of intelligent lamp group, is transferred to gateway, so that described gateway is according to the main RGB of described subregion
Value, adjusts intelligent lamp group corresponding to described subregion and sends the color of light.
Optionally, described transport module specifically for:
By HTML (Hypertext Markup Language) HTTP, by the main rgb value of described subregion and be used for representing described
The identification information of subregion correspondence intelligent lamp group, is transferred to gateway.
As a kind of possible implementation, described determine module specifically for:
Each subregion comprised for described video image, according to the pixel comprised in described subregion
Rgb value, determine the quantity of the pixel with identical rgb value;By the quantity of corresponding pixel
Many rgb values, are defined as the main rgb value of described subregion.
As alternatively possible implementation, described determine module specifically for:
Each subregion that described video image is comprised, the pixel that described subregion is comprised
Rgb value is converted into HSL color mode;
The intensity value in pixel correspondence HSL color mode and brightness value is comprised according to described subregion,
Determine the main rgb value of described subregion.
Optionally, described determine module specifically for:
The color template selected according to user, from the pixel that described subregion comprises, selects saturation
Value is in the saturation threshold range that described color template comprises and brightness value comprises at described color template
Pixel in the range of lightness threshold;From the rgb value of the pixel selected, select a rgb value
It is defined as the main rgb value of described subregion.
Optionally, described determine module specifically for:
Determine the color mould that the intensity value of each pixel that described subregion comprises all is selected user
The lightness threshold model that the saturation threshold range that plate comprises is outer and/or brightness value all comprises at described color template
Outside enclosing;According to the rgb value of the pixel comprised in described subregion, determine the picture with identical rgb value
The quantity of vegetarian refreshments;By rgb values most for the quantity of corresponding pixel, it is defined as the master of described subregion
Rgb value.
Optionally, described device also includes:
Acquisition module, for obtaining the volume value of the video that described intelligent television is play;
Described transport module is additionally operable to: the volume value that described second acquisition module gets is transferred to described net
Close, so that described gateway is according to the volume value received, adjusts each intelligent lamp group and send the brightness of light.
Fourth aspect, a kind of gateway, including:
Receiver module, for receiving the main RGB of every sub regions of the video image that intelligent television is play
Value and for representing the identification information of intelligent lamp group that described subregion is corresponding, described video image is divided
For at least one sub regions;
Processing module, for for every sub regions, according to the main rgb value of described subregion, adjusts institute
State intelligent lamp group corresponding to subregion and send the color of light.
Optionally, described receiver module specifically for:
By HTML (Hypertext Markup Language) HTTP, receive the Mei Gezi district of the video image that intelligent television is play
The main rgb value in territory and for representing the identification information of intelligent lamp group that described subregion is corresponding.
Optionally, described receiver module is additionally operable to: receive the volume of the video that described intelligent television is play
Value;
Described processing module is additionally operable to: according to described volume value, adjusts each intelligent lamp group and sends the brightness of light.
In the method and apparatus that the present invention provides, by the Video Image Segmentation that the intelligent television got is play it is
At least one subregion, for every sub regions, according to the RGB of the pixel comprised in described subregion
Value, determines the main rgb value of this subregion, so that the video that gateway can be play based on intelligent television
The main rgb value of the every sub regions in image, adjusts the intelligent lamp group corresponding with this subregion and sends light
Color, owing to the main rgb value of every sub regions can truly reflect the tone of this subregion, based on often
The main rgb value of sub regions adjusts the intelligent lamp group corresponding with this subregion and sends the color of light so that
The atmosphere that intelligent lamp group is built can mate this video image, presses close to the atmosphere that this video image is showed,
Improve viewing effect and the Consumer's Experience of intelligent television.
Accompanying drawing explanation
Fig. 1 illustrates for the flow process of the inter-linked controlling method of a kind of Smart Home provided in the embodiment of the present invention one
Figure;
Fig. 2 illustrates for the flow process of the inter-linked controlling method of a kind of Smart Home provided in the embodiment of the present invention two
Figure;
Fig. 3 is the system architecture schematic diagram in the embodiment of the present invention three;
Fig. 4 illustrates for the flow process of the inter-linked controlling method of a kind of Smart Home provided in the embodiment of the present invention three
Figure;
Fig. 5 A is the schematic diagram intercepting the currently playing picture of intelligent television in the embodiment of the present invention three;
Fig. 5 B is the schematic diagram after sectional drawing carries out in the embodiment of the present invention three dividing processing;
The flow process signal of the Fig. 6 a kind of main rgb value obtaining subregion for providing in the embodiment of the present invention three
Figure;
Fig. 7 is the schematic diagram of the linkage control device of a kind of Smart Home of offer in the embodiment of the present invention four;
The schematic diagram of the Fig. 8 a kind of gateway for providing in the embodiment of the present invention five.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the present invention
Accompanying drawing in embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention, it is clear that
Described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based in the present invention
Embodiment, those of ordinary skill in the art obtained under not making creative work premise all its
His embodiment, broadly falls into the scope of protection of the invention.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.Should be appreciated that herein
Described embodiment is merely to illustrate and explains the present invention, is not intended to limit the present invention.
In the embodiment of the present invention one, it is provided that the inter-linked controlling method of a kind of Smart Home, the execution of the method
Main body can be intelligent television, such as the processor etc. in intelligent television, it is also possible to be to be independently disposed to Intelligent electric
Depending on outer equipment.As it is shown in figure 1, the method includes:
The video image that S11, acquisition intelligent television are play, and described video image is divided at least one
Sub regions.
Illustrate, in intelligent television playing process, can by the screenshotss function in this intelligent television,
Obtain the sectional drawing of the video image that intelligent television is play.
In order to reduce process complexity, optionally, every setting duration, what acquisition intelligent television was play regards
Frequently image.
Wherein, set duration can rule of thumb emulation or applied environment be set.A kind of possible taking
Value is 1.2 seconds.
S12, each subregion for described video image, the pixel comprised according to described subregion
Rgb value, determine the main rgb value of described subregion, wherein, the corresponding intelligence of every sub regions
Lamp group.
Optionally, each intelligent lamp group includes at least one intelligent lamp.The subregion of video image and intelligent lamp
Corresponding relation between group presets, and can carry out adaptability tune according to factors such as the positions of intelligent lamp group
Whole.
S13, by the main rgb value of described subregion and be used for representing the intelligent lamp group that described subregion is corresponding
Identification information, be transferred to gateway, so that described gateway is according to the main rgb value of described subregion, adjust
The intelligent lamp group that described subregion is corresponding sends the color of light.
Optionally, the identification information of intelligent lamp group includes but not limited to following information: the IP ground of intelligent lamp group
Location, the positional information of intelligent lamp group, the number information of intelligent lamp group.
Accordingly, after described gateway receives this identification information, it is right to determine according to this identification information
The intelligent lamp group answered, further according to the main rgb value received, controls the intelligent lamp group determined
System.
Main rgb value according to described subregion in the embodiment of the present invention, adjusts the intelligence that described subregion is corresponding
When energy lamp group sends the color of light, existing adjustment algorithm can be used, it would however also be possible to employ other adjustment algorithm,
The present invention is not limited thereof.
In the embodiment of the present invention, the video image that the intelligent television got is play is divided at least one son
Region, for every sub regions, according to the rgb value of the pixel comprised in described subregion, determines
The main rgb value of this subregion, so that every in the video image that can be play based on intelligent television of gateway
The main rgb value of sub regions, adjusts the intelligent lamp group corresponding with this subregion and sends the color of light, by
Main rgb value in every sub regions can truly reflect the tone of this subregion, based on every sub regions
Main rgb value adjusts the intelligent lamp group corresponding with this subregion and sends the color of light so that intelligent lamp group institute
The atmosphere built can mate this video image, presses close to the atmosphere that this video image is showed.
Further, in the embodiment of the present invention, before S11, described method also includes:
Receive gateway send for representing that intelligent television is in the announcement information of broadcast state.
Concrete, after receiving the announcement information that gateway sends, determine that described intelligent television commences play out video,
Perform S11~S13.
In the embodiment of the present invention, the video image that the intelligent television got is play is divided into M*N son
Region, M represents the number in the region of horizontal partition, and N represents the number in the region of vertical segmentation, M and N
It is the integer more than or equal to 1.Optionally, more uniform in order to split, to improve processing accuracy, point
When cutting, the numerical value of M and N is equal or close.
It is also preferred that the left determine the value of M and N according to the number of intelligent lamp group.The index value of subregion and intelligence
The corresponding relation of the index value (i.e. identification information) of lamp group is: Li=Mm*Nn, wherein, i=m+n-2,
M=0,1 ..., M, n=0,1 ..., N.The index value of subregion or the index value of intelligent lamp group are as controlling intelligent lamp
A parameter (being designated as Param1) be transferred to gateway.
Concrete, if transmitted is the index value of subregion, then gateway is according to the index value of subregion and intelligence
The corresponding relation of the index value of energy lamp group, determines the intelligent lamp group of required adjustment;If transmitted is intelligence
The index value of lamp group, then gateway can directly determine the intelligent lamp group of required adjustment.
Illustrate, if the quantity of backlight group is 9, be then 9 sub regions by Video Image Segmentation, its
In, M=3, N=3, the index value of subregion is possible with the one of the corresponding relation of the index value of intelligent lamp group
Way of realization as shown in table 1.
Table 1
If the quantity of backlight group is 5, then it is 5 sub regions, wherein, M=5 by Video Image Segmentation,
A kind of possible way of realization of the corresponding relation of the index value of N=1, the index value of subregion and intelligent lamp group
As shown in table 2.
Table 2
In the embodiment of the present invention, each subregion comprised for described video image in S13, according to institute
State the rgb value of the pixel that subregion comprises, determine the main rgb value of described subregion, including following
Two kinds of possible implementations:
Mode 1, specifically include:
Each subregion comprised for described video image, according to the pixel comprised in described subregion
Rgb value, determine the quantity of the pixel with identical rgb value;
By rgb values most for the quantity of corresponding pixel, it is defined as the main rgb value of described subregion.
Illustrate, first add up the rgb value of the pixel that described subregion comprises, wherein, R=0~255,
G=0~255, B=0~255, determine the quantity of the pixel with identical rgb value, forms described sub-district
The RGB color chart in territory, this table includes color classification and the quantity of pixel corresponding to each color;
Again the quantity of pixel corresponding with this color for the rgb value of each color is formed rgb value, RGB
Number > key-value pair of form, rgb value represents with 16 systems.Wherein, as long as R, G and B have a value
Difference, is different colours;The quantity of the pixel that each color is corresponding characterizes this color to be occurred in the picture
Frequency;Then, according to the quantity order from big to small of pixel corresponding to each color, by key-value pair
Being ranked up and be stored in Hash table (HashMap) with the form of key-value pair, the one of Hash table may
Way of realization as shown in table 3;
Table 3
Key-value pair |
Color classification |
<#F2F2F0,N5> |
Canescence |
<#F6F3D2,N4> |
Rice white |
<#EDEE64,N3> |
Grass green |
<#A5A291,N2> |
Silver color |
<#D2B08B,N1> |
The colour of skin |
...... |
...... |
Wherein, N5 > N4 > N3 > N2 > N1.
Further, the rgb value that the key-value pair made number one in table 3 comprises is defined as this subregion
Main rgb value, and it is transferred to gateway as a parameter (being designated as Param2).
Mode 2, specifically include:
Each subregion that described video image is comprised, the pixel that described subregion is comprised
Rgb value is converted into HSL (tone Hue, saturation Saturation and lightness Lightness) color mode;
The intensity value in pixel correspondence HSL color mode and brightness value is comprised according to described subregion,
Determine the main rgb value of described subregion.
Concrete, the rgb value of each pixel that can be first comprised by described subregion is all converted into HSL
Color mode, further according to the intensity value in the HSL color mode that each pixel is corresponding and brightness value,
Determine the main rgb value of described subregion;The RGB of the pixel that can also first comprise according to described subregion
Value, counts the pixel with identical rgb value, i.e. determines the different RGB that described subregion comprises
Value, more every kind of rgb value is converted into HSL color mode, finally according to the picture with different rgb value
Intensity value and brightness value in the HSL color mode that vegetarian refreshments is corresponding, determine the main rgb value of described subregion.
Which is not implemented and is defined by the embodiment of the present invention, it would however also be possible to employ other implementation methods.
In which, comprise the intensity value in pixel correspondence HSL color mode according to described subregion
And brightness value, determine the main rgb value of described subregion, farther include the realization side that following two is possible
Formula:
Mode 21, specifically include:
The color template selected according to user, from the pixel that described subregion comprises, selects saturation
Value is in the saturation threshold range that described color template comprises and brightness value comprises at described color template
Pixel in the range of lightness threshold;
From the rgb value of the pixel selected, a rgb value is selected to be defined as the master of described subregion
Rgb value.
In which, introduce color template, the main RGB of subregion according to the demand of user, can be determined
Value, so, main rgb value based on every sub regions adjusts the intelligent lamp group corresponding with this subregion and sends out
Go out the color of light, it is possible to the atmosphere making intelligent lamp group be built meets the demand of user, need closer to user
The atmosphere that this video image is showed.
Color template is pre-defined, can be updated according to user's request.Color template is used for determining user
Need which kind of tone, such as, dynamic/dimness/subdued colour template.The definition of color template, be
Span according to lightness (Lightness) value/saturation (Saturation) value in color mode is come really
Fixed.Wherein, the lightness of color represents the light and shade change referring to color, and span is 0%~100%, value
The least closer to black, color is the darkest, and value is the biggest closer to white, and color is the brightest;The saturation of color
Representing the purity change of color under same hue lightness, value is the biggest, and Lycoperdon polymorphum Vitt is the fewest, and color is the most bright-coloured.Lift
Example illustrates, comparing in subdued colour template, the span of saturation is 50%~100%, lightness
Span is 50%~100%;Relatively in dull colors template, the span of saturation be 0%~
25%, the span of lightness is 0%~38%, etc..
In which, if there is intensity value at described color template in the rgb value that comprises of described subregion
The saturation threshold range comprised is interior and brightness value is in the range of the lightness threshold that described color template comprises
Rgb value, then select a kind of rgb value to be defined as the main rgb value of described subregion from these rgb values,
Such as, from these rgb values, select the rgb value that the quantity of the pixel of correspondence is most, be defined as described
The main rgb value of subregion.And for example, from these rgb values, select the minimum number of the pixel of correspondence
Rgb value, is defined as the main rgb value of described subregion, etc..Which do not limits from selecting
In rgb value, a kind of rgb value is selected to be defined as the specific implementation of main rgb value of described subregion.
Mode 22, specifically include:
Determine that the intensity value of each pixel that described subregion comprises all comprises at described color template
Saturation threshold range outer and/or brightness value is all outside the lightness threshold scope that described color template comprises;
According to the rgb value of the pixel comprised in described subregion, determine the pixel with identical rgb value
The quantity of point;
By rgb values most for the quantity of corresponding pixel, it is defined as the main rgb value of described subregion.
Under which, if the intensity value of each rgb value that described subregion comprises is at described color template
The lightness threshold scope that the saturation threshold range comprised is outer and/or brightness value comprises at described color template
Outward, then select the rgb value that the quantity of the pixel of correspondence is most, be defined as the main RGB of described subregion
Value.
The embodiment of the present invention does not limit the main rgb value using aforesaid way to determine every sub regions, it is also possible to
Adopt in other ways, as preset RGB threshold value, meet the rgb value of RGB threshold value from selection and select
The rgb value selecting maximum is defined as the main rgb value of this subregion, etc..
Based on any of the above-described embodiment, by the main rgb value of described subregion and be used for representing institute in S13
State the identification information of intelligent lamp group corresponding to subregion, be transferred to gateway, specifically include:
By HTML (Hypertext Markup Language) (HyperText Transfer Protocol is called for short HTTP), by described
The main rgb value of subregion and for representing the identification information of intelligent lamp group that described subregion is corresponding, passes
It is defeated by gateway.
Owing to http protocol is simple, using HTTP to be transmitted, communication speed is fast, saves the transmission time;
Use HTTP to be transmitted, any type of data object can be transmitted.
Based on any of the above-described embodiment, described method also includes: obtain the video that described intelligent television is play
Volume value;
The volume value got is transferred to described gateway, so that described gateway is according to the volume value received,
Adjust each intelligent lamp group and send the brightness of light.
In the embodiment of the present invention, backlight group can not only be adjusted according to the main rgb value of every sub regions and send out
Go out the color of light, it is also possible to according to the volume value of the video that described intelligent television is play, adjust intelligent lamp group
Send the brightness of light.Audio Processing interface can be passed through, get the video that described intelligent television play
Volume value, the span of volume value is [0,100].Volume value is one-to-many with the relation of backlight group, i.e.
Adjust all backlight groups according to this volume value and send the brightness of light.
In the embodiment of the present invention, determine the main rgb value of every sub regions, and obtain described intelligent television
The volume value of the video play is the process of two parallel processings.Can be simultaneously by the master of described subregion
Rgb value and intelligent lamp group corresponding to described subregion and the volume value got, be transferred to gateway;Also
Can be respectively by intelligent lamp group corresponding to the main rgb value of described subregion and described subregion with obtain
The volume value arrived, is transferred to gateway.The present invention is not limited thereof.
Based on same inventive concept, in the embodiment of the present invention two, it is provided that the coordinated signals of a kind of Smart Home
Method, as in figure 2 it is shown, described method includes:
S21, receive the main rgb value of every sub regions of video image that intelligent television is play and be used for
Representing the identification information of the intelligent lamp group that described subregion is corresponding, described video image is divided at least one
Sub regions;
S22, for every sub regions, according to the main rgb value of described subregion, adjust described subregion pair
The intelligent lamp group answered sends the color of light.
In the embodiment of the present invention, the executive agent of above-mentioned steps S21~step S22 is gateway.
In the embodiment of the present invention, the master of every sub regions that the video image play based on intelligent television includes
Rgb value, adjusts the intelligent lamp group corresponding with every sub regions respectively and sends the color of light so that intelligent lamp
The atmosphere that group is built can mate this video image, presses close to the atmosphere that this video image is showed.
The embodiment of the present invention does not limit the Mei Gezi district that the video image play according to intelligent television includes
The main rgb value in territory, adjusts the mode that intelligent lamp group corresponding to described subregion sends the color of light, both may be used
To use existing adjustment mode, it would however also be possible to employ other adjustment mode.Such as, by described subregion pair
The intelligent lamp group answered sends the color of light and adjusts to the main rgb value with this subregion consistent;And for example, by institute
State intelligent lamp group corresponding to subregion to send the color of light and adjust to the main rgb value with this subregion contrary;
And for example, the color that intelligent lamp group corresponding for described subregion sends light adjusts to the main RGB with this subregion
The difference of value is in the threshold range set.
Optionally, S21 receives the main RGB of every sub regions of the video image that intelligent television is play
Value and for representing the identification information of intelligent lamp group that described subregion is corresponding, including:
By HTTP, receive the video image that intelligent television is play every sub regions main rgb value with
And it is used for the identification information of the intelligent lamp group representing that described subregion is corresponding.
Based on any of the above-described embodiment, described method also includes:
Receive the volume value of the video that described intelligent television is play;According to described volume value, adjust each intelligence
Energy lamp group sends the brightness of light.
Concrete, it is previously provided with the corresponding relation of volume value and the brightness value of light, according to the volume received
Value, determines the brightness value of the light that this volume value is corresponding, and each intelligent lamp group sends the brightness adjustment of light
For the brightness value determined.
In the embodiment of the present invention, volume value is one-to-many with the relation of backlight group, i.e. adjusts according to this volume value
Whole all backlight groups send the brightness of light.
Below by a specific embodiment, the linkage control to a kind of Smart Home that the embodiment of the present invention provides
Method processed is described in detail.
System architecture in embodiment three, the present embodiment is as it is shown on figure 3, all devices in Fig. 3 is in
In same LAN, multimedia file is stored in gateway.Digital living is passed through between intelligent television and gateway
Network alliance (Digital Living Network Alliance is called for short DLNA) agreement, carries out multimedia literary composition
The propelling movement of part.Processor in intelligent television, by UDP (User Datagram
Protocol, be called for short UDP), receive gateway notice intelligent television be in broadcast state after, perform above-mentioned
The method of S11~S13, and by corresponding to the main rgb value of every sub regions and this subregion determined
Intelligent lamp group, volume value, send gateway to by HTTP.Gateway according to the main rgb value received with
And intelligent lamp group corresponding to this subregion, volume value, adjust intelligent lamp and send color and the brightness of light.Specifically
Handling process, as shown in Figure 4, including:
1, gateway would indicate that by UDP the state value of broadcast state of intelligent television is transferred in intelligent television
Processor;
Wherein, state value is that PLAYING represents that intelligent television commences play out video;State value is
STOPPED represents that intelligent television stops playing video;
2, processor is according to state value, it is determined whether intercepts the picture that intelligent television is currently playing, obtains phase
The bitmap (bitmap) answered.
Concrete, if state value is PLAYING, then processor is according to the screenshotss function of intelligent television, often
The video pictures play intelligent television every 1.2 seconds carries out a sectional drawing Bmain.Assume a certain moment sectional drawing
The B obtainedmainAs shown in Figure 5A.
3, processor is to BmainCarry out dividing processing.
Concrete, with four intelligent lamp groups as example, by BmainCarry out 2 × 2 to split, as shown in Figure 5 B,
The index of 4 sub regions obtained is respectively 1,2,3,4, i.e. M0N0, M0N1, M1N0, M1N1,
The index of the intelligent lamp group of its correspondence is respectively L0, L1, L2, L3.Using the index of intelligent lamp group as control
One parameter Param1 of light.
4, processor carries respectively and each takes subregion Mm-1Nn-1Main rgb value, m=1,2, n=1,2;
Concrete, count the RGB color chart that pixel that every sub regions comprises is corresponding, according to RGB
Turn HSL color mode, obtain tone H, saturation S and lightness L of each color, further according to selected
Color is screened by S threshold range and L threshold range in color template, determines main HSL color
Pattern, then turn RGB algorithm, the more main HSL color mode conversion determined by HSL color mode
For rgb value, as parameter Param2 controlling light passing to gateway.
Below with subregion M1N1As a example by, the main rgb value how obtaining subregion is illustrated.Such as figure
Shown in 6, including:
S61, count the rgb value of all pixels of this subregion.
Concrete, according to dominant hue histogramming algorithm, count the face of all pixels that this subregion comprises
Color RGB key-value pair, i.e.<rgb value, RGB number>(S<rgbValue, countValue>), with often
On the basis of planting the number of color, by key-value pair by order sequence from big to small, and it is stored in HashMap
In, as shown in table 3;
S62, the rgb value of each color is converted to HSL color mode;
Concrete, turn HSL color mode algorithm according to RGB, satisfying of each color that acquisition is counted
With degree S and lightness L, and saturation S and lightness L of each color are also stored in HashMap.
S63, judge that S and L of each color is whether in color template in the span of S and L;
Concrete, according to selected color template, the color of this subregion is screened, milder with ratio
Color template as a example by, comparing the span of S in subdued colour template is 50%~100%, L's
Span is 50%~100%, and its screening process is as follows:
Condition 1: for each color in this subregion, S and L of this color all S in color template
With in the span of L, then retain this color;
Condition 2: for each color in this subregion, the S of this color not the taking of S in color template
In the range of value, or the L of this color in the span of L, does not then give up this color in color template.
According to above-mentioned condition 1 and condition 2, table 4 can be formed.
RGB key-value pair |
<S, L>key-value pair |
Whether<S, L>retains |
<#F2F2F0,N5> |
<60,1> |
Give up |
<#F6F3D2,N4> |
<53,13> |
Give up |
<#EDEE64,N3> |
<60,53> |
Preserve |
<#A5A291,N2> |
<64,9> |
Give up |
<#D2B08B,N1> |
<33,33> |
Give up |
According to table 4, finally determining that the domain color of this subregion is grass green, its rgb value is EDEE64.
It should be noted that when screening, also include: condition 3: for each color in this subregion,
If S and L of each color in the span of S and L, does not then take number maximum in color template
Rgb value as the main rgb value of this subregion.
5, Param1 and Param2 corresponding for every sub regions is sent to gateway.
Wherein, Param1=lightId, the ID of intelligent lamp group, shape data;
Param2=" redStr, greenStr, blueStr ", color value, each is the shape data of 0~255.
The embodiment of the present invention does not limit processor transmitted by Param1 and Param2 corresponding for every sub regions
To the specific implementation of gateway.Such as, processor can pass through HTTP, with URL
(Uniform Resource Locator is called for short URL) form, uses android ContentProvider
Param1 and Param2 corresponding for every sub regions is passed by mechanism (i.e. sharing data mechanism to different application)
Give gateway.
6, gateway is by CIE color system (i.e. the color system of International Commission on Illumination's definition), by Param2
Converting the coordinate obtaining CIE xyY chromaticity diagram, (x, coordinate figure y) represents color in use.
Wherein, the data relationship between CIE XYZ color system and RGB:
Wherein, X, Y, Z represent the additive primary colour in CIE XYZ color system respectively, and r, g, b represent respectively
The RGB component of RGB.Therefore, each color can be expressed as the mixing of X, Y and Z, but
It is that use is more complicated, and the most directly perceived.Define a color space being called CIE xyY.CIE XYZ
The formula that color system is converted to CIE xyY chromaticity diagram is as follows:
Wherein, x, y are used for the x on X-Y scheme, and y-coordinate value, i.e. designated color, Y represents color
Brightness or brightness.
By formula one and formula two, draw the relation between CIE xyY chromaticity diagram and rgb, such as formula three institute
Show:
Wherein, X+Y+Z=0.6443r+1.192g+1.2032b.
According to formula three, it can be deduced that x, y value, as the control parameter of intelligent lamp group.
Form after conversion is as follows:
Color [0]=x;
Color [1]=y.
7, gateway is according to the x determined, y value and Param1, controls corresponding intelligent lamp group and sends light
Color.
8, processor passes through Audio Processing interface, obtains the volume value of the currently playing video of intelligent television.
9, processor sends the volume value got to gateway.
It should be noted that the thread obtaining volume value and the main rgb value of acquisition can perform simultaneously.
10, gateway is according to the corresponding relation of volume value Yu brightness value, determines corresponding brightness value.
11, described in gateway, brightness value control intelligent lamp group sends the brightness of light.
So far the function of linkage is completed.
Said method handling process can realize with software program, and this software program can be stored in storage medium
In, when the software program of storage is called, perform said method step.
Based on same inventive concept, in the embodiment of the present invention four, it is provided that the coordinated signals of a kind of Smart Home
Device, this device includes the module of the method shown in Fig. 1 that performs, as it is shown in fig. 7, described device includes:
Processing module 71, for obtaining the video image that intelligent television is play, and draws described video image
It is divided at least one subregion;
Determine module 72, for each subregion for described video image, according in described subregion
The rgb value of the pixel comprised, determines the main rgb value of described subregion, wherein, every sub regions
A corresponding intelligent lamp group;
Transport module 73, for by the main rgb value of described subregion and be used for representing described subregion pair
Answer the identification information of intelligent lamp group, be transferred to gateway, so that described gateway is according to the main RGB of described subregion
Value, adjusts intelligent lamp group corresponding to described subregion and sends the color of light.
Optionally, described transport module specifically for:
By HTTP, by the main rgb value of described subregion and be used for representing described subregion correspondence intelligence
The identification information of lamp group, is transferred to gateway.
Optionally, described determine module specifically for:
Each subregion comprised for described video image, according to the pixel comprised in described subregion
Rgb value, determine the quantity of the pixel with identical rgb value;By the quantity of corresponding pixel
Many rgb values, are defined as the main rgb value of described subregion.
Optionally, described determine module specifically for:
Each subregion that described video image is comprised, the pixel that described subregion is comprised
Rgb value is converted into HSL color mode;
The intensity value in pixel correspondence HSL color mode and brightness value is comprised according to described subregion,
Determine the main rgb value of described subregion.
Optionally, described determine module specifically for:
The color template selected according to user, from the pixel that described subregion comprises, selects saturation
Value is in the saturation threshold range that described color template comprises and brightness value comprises at described color template
Pixel in the range of lightness threshold;From the rgb value of the pixel selected, select a rgb value
It is defined as the main rgb value of described subregion.
Optionally, described determine module specifically for:
Determine the color mould that the intensity value of each pixel that described subregion comprises all is selected user
The lightness threshold model that the saturation threshold range that plate comprises is outer and/or brightness value all comprises at described color template
Outside enclosing;According to the rgb value of the pixel comprised in described subregion, determine the picture with identical rgb value
The quantity of vegetarian refreshments;By rgb values most for the quantity of corresponding pixel, it is defined as the master of described subregion
Rgb value.
Optionally, described device also includes:
Acquisition module 74, for obtaining the volume value of the video that described intelligent television is play;
Described transport module is additionally operable to: the volume value that described second acquisition module gets is transferred to described net
Close, so that described gateway is according to the volume value received, adjusts each intelligent lamp group and send the brightness of light.
Based on same inventive concept, in the embodiment of the present invention five, it is provided that a kind of gateway, this gateway includes holding
The module of the method shown in row Fig. 2, as shown in Figure 8, described gateway includes:
Receiver module 81, for receiving the main RGB of every sub regions of the video image that intelligent television is play
Value and for representing the identification information of intelligent lamp group that described subregion is corresponding, described video image is divided
For at least one sub regions;
Processing module 82, for for every sub regions, according to the main rgb value of described subregion, adjusts
The intelligent lamp group that described subregion is corresponding sends the color of light.
Optionally, described receiver module specifically for:
By HTTP, receive the video image that intelligent television is play every sub regions main rgb value with
And it is used for the identification information of the intelligent lamp group representing that described subregion is corresponding.
Optionally, described receiver module is additionally operable to: receive the volume value of the video that described intelligent television is play;
Described processing module is additionally operable to: according to described volume value, adjusts each intelligent lamp group and sends the brightness of light.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter
Calculation machine program product.Therefore, the present invention can use complete hardware embodiment, complete software implementation or knot
The form of the embodiment in terms of conjunction software and hardware.And, the present invention can use and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (include but not limited to disk memory,
CD-ROM, optical memory etc.) form of the upper computer program implemented.
The present invention is with reference to method, equipment (system) and computer program product according to embodiments of the present invention
The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding
The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating
The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one
The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set
In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory
Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart
The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices
Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one
The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know base
This creativeness concept, then can make other change and amendment to these embodiments.So, appended right is wanted
Ask and be intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification without deviating from this to the present invention
Bright spirit and scope.So, if the present invention these amendment and modification belong to the claims in the present invention and
Within the scope of its equivalent technologies, then the present invention is also intended to comprise these change and modification.