A kind of inter-linked controlling method and device of smart home
Technical field
The present invention relates to field of communication technology, in particular to the inter-linked controlling method and device of a kind of smart home.
Background technique
Along with the development of smart home commercialization, the linkage function inside household is increasingly by the concern of user.Example
Such as, it during smart television plays multimedia file, by the linkage between the background light around smart television, such as adjusts
The lamplight brightness of whole background light further increases user experience to create an atmosphere.
How the linkage control of smart home is realized, there is presently no solutions.
Summary of the invention
The embodiment of the invention provides a kind of inter-linked controlling method of smart home and devices, it is intended to realize smart television with
Color linkage between intelligent lamp group, improves the viewing effect and user experience of smart television.
In a first aspect, a kind of inter-linked controlling method of smart home, comprising:
The video image that smart television is played is obtained, and the video image is divided at least one subregion;
For each sub-regions of the video image, according to the rgb value for the pixel for including in the subregion, really
Make the main rgb value of the subregion, wherein corresponding one intelligent lamp group of each subregion;
By the main rgb value of the subregion and the identification information for being used to indicate the corresponding intelligent lamp group of the subregion, pass
It is defeated by gateway, so that main rgb value of the gateway according to the subregion, adjusts the corresponding intelligent lamp group of the subregion and issue
The color of light.
Optionally, by the main rgb value of the subregion and the mark for being used to indicate the corresponding intelligent lamp group of the subregion
Information is transferred to gateway, comprising:
By hypertext transfer protocol HTTP, by the main rgb value of the subregion and it is used to indicate the subregion pair
The identification information for answering intelligent lamp group, is transferred to gateway.
As a kind of possible implementation, for each sub-regions that the video image includes, according to the son
The rgb value for the pixel for including in region determines the main rgb value of the subregion, comprising:
For each sub-regions that the video image includes, according to the RGB for the pixel for including in the subregion
Value, determining has the quantity of the pixel of identical rgb value;
By the most rgb value of the quantity of corresponding pixel, it is determined as the main rgb value of the subregion.
As alternatively possible implementation, for each sub-regions that the video image includes, according to described
The rgb value for the pixel that subregion includes determines the main rgb value of the subregion, comprising:
For each sub-regions that the video image includes, the rgb value for the pixel for including by the subregion turns
Change HSL color mode into;
It include that pixel correspond to intensity value and brightness value in HSL color mode according to the subregion, described in determination
The main rgb value of subregion.
It optionally, include that pixel corresponds to intensity value and brightness value in HSL color mode according to the subregion, really
The main rgb value of the fixed subregion, comprising:
The color template selected according to user selects intensity value in institute from the pixel that the subregion includes
It states in the saturation degree threshold range that color template includes and brightness value is within the scope of the lightness threshold that the color template includes
Pixel;
From the rgb value for the pixel selected, a rgb value is selected to be determined as the main rgb value of the subregion.
It optionally, include that pixel corresponds to intensity value and brightness value in HSL color mode according to the subregion, really
The main rgb value of the fixed subregion, comprising:
The intensity value for determining each pixel that the subregion includes includes in the color template that user selectes
Saturation degree threshold range it is outer, and/or brightness value is outside the lightness threshold range that the color template includes;
According to the rgb value for the pixel for including in the subregion, determining has the quantity of the pixel of identical rgb value;
By the most rgb value of the quantity of corresponding pixel, it is determined as the main rgb value of the subregion.
Optionally, the method also includes: obtain the volume value for the video that the smart television is played;
The volume value that will acquire is transferred to the gateway, so that the gateway, according to the volume value received, adjustment is every
A intelligence lamp group issues the brightness of light.
Second aspect, a kind of inter-linked controlling method of smart home, comprising:
Receive the main rgb value of each subregion for the video image that smart television is played and for indicating the sub-district
The identification information of the corresponding intelligent lamp group in domain, the video image are divided at least one sub-regions;
The corresponding intelligent lamp group hair of the subregion is adjusted according to the main rgb value of the subregion for each subregion
The color of light out.
Optionally, the main rgb value of each subregion for the video image that smart television is played is received and for indicating
The identification information of the corresponding intelligent lamp group of the subregion, comprising:
By hypertext transfer protocol HTTP, the master of each subregion for the video image that smart television is played is received
Rgb value and identification information for indicating the corresponding intelligent lamp group of the subregion.
Optionally, the method also includes:
Receive the volume value for the video that the smart television is played;
According to the volume value, the brightness that each intelligent lamp group issues light is adjusted.
The third aspect, a kind of linkage control device of smart home, comprising:
Processing module, the video image played for obtaining smart television, and the video image is divided at least
One sub-regions;
Determining module, for each sub-regions for the video image, according to the picture for including in the subregion
The rgb value of vegetarian refreshments determines the main rgb value of the subregion, wherein corresponding one intelligent lamp group of each subregion;
Transmission module, for by the main rgb value of the subregion and being used to indicate the corresponding intelligent lamp group of the subregion
Identification information, be transferred to gateway, so that main rgb value of the gateway according to the subregion, it is corresponding to adjust the subregion
Intelligent lamp group issue light color.
Optionally, the transmission module is specifically used for:
By hypertext transfer protocol HTTP, by the main rgb value of the subregion and it is used to indicate the subregion pair
The identification information for answering intelligent lamp group, is transferred to gateway.
As a kind of possible implementation, the determining module is specifically used for:
For each sub-regions that the video image includes, according to the RGB for the pixel for including in the subregion
Value, determining has the quantity of the pixel of identical rgb value;By the most rgb value of the quantity of corresponding pixel, it is determined as described
The main rgb value of subregion.
As alternatively possible implementation, the determining module is specifically used for:
For each sub-regions that the video image includes, the rgb value for the pixel for including by the subregion turns
Change HSL color mode into;
It include that pixel correspond to intensity value and brightness value in HSL color mode according to the subregion, described in determination
The main rgb value of subregion.
Optionally, the determining module is specifically used for:
The color template selected according to user selects intensity value in institute from the pixel that the subregion includes
It states in the saturation degree threshold range that color template includes and brightness value is within the scope of the lightness threshold that the color template includes
Pixel;From the rgb value for the pixel selected, a rgb value is selected to be determined as the main rgb value of the subregion.
Optionally, the determining module is specifically used for:
The intensity value for determining each pixel that the subregion includes includes in the color template that user selectes
Saturation degree threshold range it is outer, and/or brightness value is outside the lightness threshold range that the color template includes;According to the son
The rgb value for the pixel for including in region, determining has the quantity of the pixel of identical rgb value;By the number of corresponding pixel
Most rgb values is measured, the main rgb value of the subregion is determined as.
Optionally, described device further include:
Module is obtained, for obtaining the volume value for the video that the smart television is played;
The transmission module is also used to: the volume value that the second acquisition module is got is transferred to the gateway, with
Make the gateway according to the volume value received, adjusts the brightness that each intelligent lamp group issues light.
Fourth aspect, a kind of gateway, comprising:
Receiving module, for receiving the main rgb value and use of each subregion for the video image that smart television is played
In the identification information for indicating the corresponding intelligent lamp group of the subregion, the video image is divided at least one sub-district
Domain;
Processing module, for adjusting the subregion pair according to the main rgb value of the subregion for each subregion
The intelligent lamp group answered issues the color of light.
Optionally, the receiving module is specifically used for:
By hypertext transfer protocol HTTP, the master of each subregion for the video image that smart television is played is received
Rgb value and identification information for indicating the corresponding intelligent lamp group of the subregion.
Optionally, the receiving module is also used to: receiving the volume value for the video that the smart television is played;
The processing module is also used to: according to the volume value, adjusting the brightness that each intelligent lamp group issues light.
In method and apparatus provided by the invention, the Video Image Segmentation that the smart television that will acquire plays is at least one
Sub-regions determine the subregion according to the rgb value for the pixel for including in the subregion for each subregion
Main rgb value, so that gateway can be based on the main rgb value of each subregion in the video image that smart television is played, to adjust
Whole intelligent lamp group corresponding with the subregion issues the color of light, since the main rgb value of each subregion can really reflect this
The tone of subregion adjusts the face that intelligent lamp group corresponding with the subregion issues light based on the main rgb value of each subregion
Color, the atmosphere that intelligent lamp group is built match the video image, and the atmosphere showed close to the video image improves
The viewing effect and user experience of smart television.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the inter-linked controlling method of the smart home provided in the embodiment of the present invention one;
Fig. 2 is a kind of flow diagram of the inter-linked controlling method of the smart home provided in the embodiment of the present invention two;
Fig. 3 is the system architecture schematic diagram in the embodiment of the present invention three;
Fig. 4 is a kind of flow diagram of the inter-linked controlling method of the smart home provided in the embodiment of the present invention three;
Fig. 5 A is the schematic diagram for the picture that interception smart television is currently playing in the embodiment of the present invention three;
Fig. 5 B is in the embodiment of the present invention three to the screenshot schematic diagram that is split that treated;
Fig. 6 is a kind of flow diagram of the main rgb value of the acquisition subregion provided in the embodiment of the present invention three;
Fig. 7 is a kind of schematic diagram of the linkage control device of the smart home provided in the embodiment of the present invention four;
Fig. 8 is a kind of schematic diagram of the gateway provided in the embodiment of the present invention five.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
The embodiment of the present invention is described in further detail with reference to the accompanying drawings of the specification.It should be appreciated that described herein
Embodiment only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention.
In the embodiment of the present invention one, a kind of inter-linked controlling method of smart home is provided, the executing subject of this method can
To be the processor in smart television, such as smart television, it is also possible to be independently disposed to the equipment outside smart television.Such as Fig. 1
It is shown, this method comprises:
S11, the video image that smart television is played is obtained, and the video image is divided at least one sub-district
Domain.
For example, in smart television playing process intelligence can be obtained by the screenshotss function in the smart television
The screenshot for the video image that TV is played.
In order to reduce processing complexity, optionally, every setting duration, the video image that smart television is played is obtained.
Wherein, setting duration can rule of thumb emulation or application environment set.A kind of possible value is 1.2
Second.
S12, each sub-regions for the video image, according to the rgb value for the pixel that the subregion includes,
Determine the main rgb value of the subregion, wherein corresponding one intelligent lamp group of each subregion.
Optionally, each intelligent lamp group includes at least one intelligent lamp.Between the subregion of video image and intelligent lamp group
Corresponding relationship preset, and can be adaptively adjusted according to factors such as the positions of intelligent lamp group.
S13, by the main rgb value of the subregion and it is used to indicate that the mark of the corresponding intelligent lamp group of the subregion to be believed
Breath, is transferred to gateway, so that main rgb value of the gateway according to the subregion, adjusts the corresponding intelligent lamp of the subregion
Group issues the color of light.
Optionally, the identification information of intelligent lamp group includes but is not limited to following information: the IP address of intelligent lamp group, intelligent lamp
The number information of the location information of group, intelligent lamp group.
Correspondingly, can determine corresponding intelligence according to the identification information after the gateway receives the identification information
Energy lamp group controls the intelligent lamp group determined further according to the main rgb value received.
According to the main rgb value of the subregion in the embodiment of the present invention, the corresponding intelligent lamp group hair of the subregion is adjusted
Out when the color of light, existing adjustment algorithm can be used, other adjustment algorithms can also be used, the present invention does not limit it
It is fixed.
In the embodiment of the present invention, the video image that the smart television got plays is divided at least one subregion,
The main rgb value of the subregion is determined according to the rgb value for the pixel for including in the subregion for each subregion, with
The main rgb value for each subregion in video image for playing gateway based on smart television, to adjust and the sub-district
The corresponding intelligent lamp group in domain issues the color of light, since the main rgb value of each subregion can really reflect the color of the subregion
It adjusts, the color that intelligent lamp group corresponding with the subregion issues light is adjusted based on the main rgb value of each subregion, so that intelligence
The atmosphere that lamp group is built can match the video image, the atmosphere showed close to the video image.
Further, in the embodiment of the present invention, before S11, the method also includes:
Receive gateway transmission for indicating that smart television is in the notification information of broadcast state.
Specifically, determining that the smart television starts to play video after receiving the notification information that gateway is sent, executing
S11~S13.
In the embodiment of the present invention, the video image that the smart television got plays is divided into M*N sub-regions, M table
Show the number in the region of horizontal partition, N indicates the number in the region vertically divided, and M and N are the integer more than or equal to 1.It can
Choosing, more uniform in order to divide, to improve processing accuracy, when segmentation, the numerical value of M and N are equal or close.
Preferably, determining the value of M and N according to the number of intelligent lamp group.The index of the index value of subregion and intelligent lamp group
It is worth the corresponding relationship of (i.e. identification information) are as follows: 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 transferred to net as a parameter (being denoted as Param1) for controlling intelligent lamp
It closes.
Specifically, if what is transmitted is the index value of subregion, index value and intelligent lamp group of the gateway according to subregion
Index value corresponding relationship, determine needed for adjust intelligent lamp group;If what is transmitted is the index value of intelligent lamp group, net
Close the intelligent lamp group adjusted needed for can directly determining out.
For example, being 9 sub-regions by Video Image Segmentation, wherein M=3, N if the quantity of backlight lamp group is 9
=3, the index value of subregion and a kind of possible way of realization of the corresponding relationship of the index value of intelligent lamp group are as shown in table 1.
Table 1
It is 5 sub-regions by Video Image Segmentation, wherein M=5, N=1, subregion if the quantity of backlight lamp group is 5
Index value and intelligent lamp group index value corresponding relationship a kind of possible way of realization it is as shown in table 2.
Table 2
In the embodiment of the present invention, each sub-regions for including for the video image in S13, according to the subregion
The rgb value for the pixel for including determines the main rgb value of the subregion, including the possible implementation of following two:
Mode 1 specifically includes:
For each sub-regions that the video image includes, according to the RGB for the pixel for including in the subregion
Value, determining has the quantity of the pixel of identical rgb value;
By the most rgb value of the quantity of corresponding pixel, it is determined as the main rgb value of the subregion.
For example, first counting the rgb value for the pixel that the subregion includes, wherein R=0~255, G=0~
255, B=0~255, it determines the quantity with the pixel of identical rgb value, forms the RGB color chart of the subregion,
It include the quantity of color classification and the corresponding pixel of each color in the table;Again by the rgb value of each color and the color
Quantity formation<the rgb value of corresponding pixel, RGB number>format key-value pair, rgb value are indicated with 16 systems.Wherein, R, G
As long as different with there is a value in B, as different colours;The quantity of the corresponding pixel of each color characterizes the color in image
The frequency of middle appearance;Then, the sequence according to the quantity of the corresponding pixel of each color from big to small, key-value pair is arranged
Sequence is simultaneously stored in Hash table (HashMap) with the format of key-value pair, a kind of possible way of realization of Hash table such as 3 institute of table
Show;
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 to make number one in table 3 includes is determined as to the main rgb value of the subregion, and
Gateway is transferred to as a parameter (being denoted as Param2).
Mode 2 specifically includes:
For each sub-regions that the video image includes, the rgb value for the pixel for including by the subregion turns
Change HSL (tone Hue, saturation degree Saturation and lightness Lightness) color mode into;
It include that pixel correspond to intensity value and brightness value in HSL color mode according to the subregion, described in determination
The main rgb value of subregion.
Specifically, the rgb value for each pixel that the subregion includes first can be converted into HSL color mode,
Further according to the intensity value and brightness value in the corresponding HSL color mode of each pixel, the main RGB of the subregion is determined
Value;Really the rgb value for the pixel that can also first include according to the subregion, counts the pixel with identical rgb value, i.e.,
The different rgb values that the subregion includes are made, then every kind of rgb value is converted into HSL color mode, it is last according to not
Intensity value and brightness value in corresponding HSL color mode with the pixel of rgb value, determine the main rgb value of the subregion.This
Inventive embodiments are not defined the specific implementation of which, can also use other implementation methods.
It include that pixel corresponds to intensity value and brightness value in HSL color mode according to the subregion in which,
The main rgb value for determining the subregion further comprises the possible implementation of following two:
Mode 21 specifically includes:
The color template selected according to user selects intensity value in institute from the pixel that the subregion includes
It states in the saturation degree threshold range that color template includes and brightness value is within the scope of the lightness threshold that the color template includes
Pixel;
From the rgb value for the pixel selected, a rgb value is selected to be determined as the main rgb value of the subregion.
In which, color template is introduced, the main rgb value of subregion can be determined, in this way, base according to the demand of user
The color that intelligent lamp group sending light corresponding with the subregion is adjusted in the main rgb value of each subregion, can make intelligent lamp
The built atmosphere of group is met the needs of users, the atmosphere for needing the video image to be showed closer to user.
Color template be it is pre-defined, can be updated according to user demand.Color template is for determining which user needs
Kind tone, for example, dynamic/dimness/subdued colour template.The definition of color template is according to bright in color mode
The value range of (Lightness) value/saturation degree (Saturation) value is spent to determine.Wherein, the lightness expression of color refers to color
Color light and shade variation, value range are 0%~100%, and the smaller closer black of value, color is darker, and the value the big closer
White, color are brighter;The saturation degree of color indicates the purity variation of color under same hue lightness, and value is bigger, and grey is fewer,
Color is more bright-coloured.For example, comparing in subdued colour template, the value range of saturation degree is 50%~100%, lightness
Value range is 50%~100%;Compare in dull colors template, the value range of saturation degree is 0%~25%, lightness
Value range is 0%~38%, etc..
In which, satisfy if there are intensity values in the rgb value that the subregion includes what the color template included
With degree threshold range in and rgb value of the brightness value within the scope of the lightness threshold that the color template includes, then from these RGB
A kind of rgb value is selected to be determined as the main rgb value of the subregion in value, for example, selecting corresponding pixel from these rgb values
The most rgb value of quantity, be determined as the main rgb value of the subregion.For another example, corresponding pixel is selected from these rgb values
The rgb value of the minimum number of point, is determined as main rgb value of the subregion, etc..It does not limit in which from selecting
In rgb value, a kind of rgb value is selected to be determined as the specific implementation of the main rgb value of the subregion.
Mode 22 specifically includes:
Determine the saturation that the intensity value for each pixel that the subregion includes includes in the color template
It spends outside threshold range, and/or brightness value is outside the lightness threshold range that the color template includes;
According to the rgb value for the pixel for including in the subregion, determining has the quantity of the pixel of identical rgb value;
By the most rgb value of the quantity of corresponding pixel, it is determined as the main rgb value of the subregion.
Under which, if the intensity value for each rgb value that the subregion includes is satisfied what the color template included
With degree threshold range outside, and/or brightness value outside the lightness threshold range that the color template includes, then select corresponding pixel
The most rgb value of the quantity of point, is determined as the main rgb value of the subregion.
The embodiment of the present invention does not limit the main rgb value that each subregion is determined using aforesaid way, can also use other
Mode such as presets RGB threshold value, selects maximum rgb value to be determined as the sub-district from the rgb value that selection meets RGB threshold value
The main rgb value in domain, etc..
By the main rgb value of the subregion and it is used to indicate the subregion pair based on any of the above-described embodiment, in S13
The identification information for the intelligent lamp group answered, is transferred to gateway, specifically includes:
By hypertext transfer protocol (HyperText Transfer Protocol, abbreviation HTTP), by the subregion
Main rgb value and identification information for indicating the corresponding intelligent lamp group of the subregion, be transferred to gateway.
It since http protocol is simple, is transmitted using HTTP, communication speed is fast, saves transmission time;Using HTTP into
Row transmission, can transmit any type of data object.
Based on any of the above-described embodiment, the method also includes: obtain the volume for the video that the smart television is played
Value;
The volume value that will acquire is transferred to the gateway, so that the gateway, according to the volume value received, adjustment is every
A intelligence lamp group issues the brightness of light.
In the embodiment of the present invention, the face that backlight lamp group issues light can not only be adjusted according to the main rgb value of each subregion
Color, the volume value for the video that can also be played according to the smart television adjust the brightness that intelligent lamp group issues light.It can lead to
Cross audio processing interface, get the volume value for the video that the smart television is played, the value range of volume value be [0,
100].The relationship of volume value and backlight lamp group be it is one-to-many, i.e., all backlight lamp groups are adjusted according to the volume value and issue the bright of light
Degree.
In the embodiment of the present invention, the main rgb value of each subregion is determined, and obtain the view that the smart television is played
The volume value of frequency is the process of two parallel processings.It can be simultaneously by the main rgb value and the subregion pair of the subregion
The intelligent lamp group answered and the volume value got, are transferred to gateway;Can also respectively by the main rgb value of the subregion and
The volume value subregion corresponding intelligent lamp group and got, is transferred to gateway.The present invention is not limited thereof.
Based on the same inventive concept, in the embodiment of the present invention two, a kind of inter-linked controlling method of smart home is provided, such as
Shown in Fig. 2, which comprises
S21, the main rgb value for receiving each subregion of video image that smart television is played and for indicating described
The identification information of the corresponding intelligent lamp group of subregion, the video image are divided at least one sub-regions;
S22, the corresponding intelligent lamp of the subregion is adjusted according to the main rgb value of the subregion for each subregion
Group issues the color of light.
In the embodiment of the present invention, above-mentioned steps S21~step S22 executing subject is gateway.
In the embodiment of the present invention, the main rgb value based on each subregion that the video image that smart television is played includes,
To adjust separately the color that intelligent lamp group corresponding with each subregion issues light, the atmosphere for enabling intelligent lamp group to be built
The video image is matched, the atmosphere showed close to the video image.
The master for each subregion for including according to the video image that smart television is played is not limited in the embodiment of the present invention
Rgb value adjusts the mode that the corresponding intelligent lamp group of the subregion issues the color of light, can both use existing adjustment side
Formula, can also be using other adjustment modes.For example, by the color that the corresponding intelligent lamp group of the subregion issues light adjust to
It is consistent with the main rgb value of the subregion;For another example, by the color that the corresponding intelligent lamp group of the subregion issues light adjust to this
The main rgb value of subregion is opposite;For another example, by the color that the corresponding intelligent lamp group of the subregion issues light adjust to the sub-district
The difference of the main rgb value in domain is in the threshold range of setting.
Optionally, the main rgb value of each subregion for the video image that smart television is played is received in S21 and is used for
Indicate the identification information of the corresponding intelligent lamp group of the subregion, comprising:
By HTTP, the main rgb value of each subregion for the video image that smart television is played is received and for table
Show the identification information of the corresponding intelligent lamp group of the subregion.
Based on any of the above-described embodiment, the method also includes:
Receive the volume value for the video that the smart television is played;According to the volume value, each intelligent lamp group is adjusted
Issue the brightness of light.
Specifically, being previously provided with the corresponding relationship of the brightness value of volume value and light, according to the volume value received, determine
The brightness value of the corresponding light of the volume value out, and it is the brightness value determined that each intelligent lamp group, which is issued the brightness adjustment of light,.
In the embodiment of the present invention, the relationship of volume value and backlight lamp group be it is one-to-many, i.e., adjusted according to the volume value all
The brightness of backlight lamp group sending light.
Below by a specific embodiment, to a kind of inter-linked controlling method of smart home provided in an embodiment of the present invention
It is described in detail.
System architecture in embodiment three, the present embodiment is as shown in figure 3, all devices in Fig. 3 are in same local
In net, multimedia file is stored in gateway.Pass through Digital Life Network Alliance (Digital between smart television and gateway
Living Network Alliance, abbreviation DLNA) agreement, carry out the push of multimedia file.Processing in smart television
Device receives the intelligence of gateway notice by User Datagram Protocol (User Datagram Protocol, abbreviation UDP)
After TV is in broadcast state, the method for executing above-mentioned S11~S13, and by the main rgb value for each subregion determined and
The subregion corresponding intelligent lamp group, volume value, send gateway to by HTTP.Gateway according to the main rgb value received and
The subregion corresponding intelligent lamp group, volume value, adjustment intelligent lamp issue the color and brightness of light.Specific process flow, such as Fig. 4
It is shown, comprising:
1, the state value for indicating the broadcast state of smart television is transferred to the processing in smart television by UDP by gateway
Device;
Wherein, state value is that PLAYING indicates that smart television starts to play video;State value is that STOPPED indicates intelligence
TV stops playing video;
2, processor is according to state value, it is determined whether the currently playing picture of interception smart television obtains corresponding bitmap
(bitmap)。
Specifically, processor is according to the screenshotss function of smart television, every 1.2 seconds to intelligence if state value is PLAYING
The video pictures that energy TV is played carry out a screenshot Bmain.Assuming that the B that a certain moment screenshot obtainsmainAs shown in Figure 5A.
3, processor is to BmainIt is split processing.
Specifically, using four intelligent lamp groups as example, by BmainCarry out 2 × 2 segmentations, as shown in Figure 5 B, 4 obtained sons
The index in region is respectively 1,2,3,4, i.e. M0N0, M0N1, M1N0, M1N1, the index of corresponding intelligence lamp group is respectively L0, L1,
L2, L3.A parameter Param1 by the index of intelligent lamp group as control light.
4, processor mentions respectively each takes subregion Mm-1Nn-1Main rgb value, m=1,2, n=1,2;
Specifically, counting the corresponding RGB color chart of pixel that each subregion includes, HSL color is turned according to RGB
Mode obtains the tone H, saturation degree S and lightness L of each color, further according to the S threshold range and L in selected color template
Threshold range screens color, determines main HSL color mode, then turn RGB algorithm by HSL color mode, then determine
Main HSL color mode out is converted to rgb value, a parameter Param2 as the control light for passing to gateway.
Below with subregion M1N1For, the main rgb value for how obtaining subregion is illustrated.As shown in Figure 6, comprising:
S61, count the subregion all pixels point rgb value.
Specifically, counting the color RGB key for all pixels point that the subregion includes according to dominant hue histogramming algorithm
Value pair, i.e.,<rgb value, RGB number>(S<rgbValue, countValue>), on the basis of the number of each color, by key assignments
It sorts, and is stored in HashMap to by sequence from big to small, as shown in table 3;
S62, the rgb value of each color is converted into HSL color mode;
Specifically, turning HSL color mode algorithm according to RGB, the saturation degree S and lightness of counted each color are obtained
L, and the saturation degree S of each color and lightness L are also stored in HashMap.
S63, judge the S and L of each color whether in color template in the value range of S and L;
Specifically, being screened according to selected color template to the color of the subregion, to compare subdued colour mould
For plate, the value range that the value range for comparing S in subdued colour template is 50%~100%, L is 50%~100%,
Its screening process is as follows:
Condition 1: for each color in the subregion, the value model of the S and L of the color S and L in color template
In enclosing, then retain the color;
Condition 2: for each color in the subregion, the S of the color not in color template in the value range of S,
Or the L of the color in the value range of L, then gives up the color not 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 |
<S, L>whether retain |
<#F2F2F0,N5> |
<60,1> |
Give up |
<#F6F3D2,N4> |
<53,13> |
Give up |
<#EDEE64,N3> |
<60,53> |
It saves |
<#A5A291,N2> |
<64,9> |
Give up |
<#D2B08B,N1> |
<33,33> |
Give up |
According to table 4, the domain color for finally determining the subregion is grass green, rgb value EDEE64.
It should be noted that in screening, further includes: condition 3: for each color in the subregion, if every kind of face
The S and L of color then take master of the maximum rgb value of number as the subregion not in color template in the value range of S and L
Rgb value.
5, each subregion corresponding Param1 and Param2 is sent to gateway.
Wherein, Param1=lightId, the ID of intelligent lamp group, shape data;
" redStr, greenStr, blueStr ", color value, each is 0~255 shape data to Param2=.
Processor is not limited in the embodiment of the present invention and sends each subregion corresponding Param1 and Param2 to gateway
Specific implementation.For example, processor can be by HTTP, with uniform resource locator (Uniform Resource
Locator, abbreviation URL) format, using android ContentProvider mechanism (i.e. to different application shared data machine
Make) send each subregion corresponding Param1 and Param2 to gateway.
6, gateway is converted Param2 by CIE color system (i.e. International Commission on Illumination define color system)
To the coordinate of CIE xyY chromatic diagram, color is indicated using the coordinate value of (x, y).
Wherein, the data relationship between CIE XYZ color system and RGB:
Wherein, X, Y, Z respectively indicate the additive primary colour in CIE XYZ color system, r, g, and b respectively indicates the red green of RGB
Blue component.Therefore, each color can be expressed as the mixing of X, Y and Z, but use more complicated and not intuitive.It is fixed
Justice one is called the color space of CIE xyY.The formula that CIE XYZ color system is converted to CIE xyY chromatic diagram is as follows:
Wherein, x, y are used to the x on X-Y scheme, y-coordinate value, i.e. designated color, and Y indicates brightness or the light of color
Degree.
By formula one and formula two, the relationship between CIE xyY chromatic diagram and rgb is obtained, as shown in formula three:
Wherein, X+Y+Z=0.6443r+1.192g+1.2032b.
According to formula three, it can be deduced that x, y value, the control parameter as intelligent lamp group.
Format after conversion is as follows:
Color [0]=x;
Color [1]=y.
7, gateway controls the color that corresponding intelligent lamp group issues light according to the x determined, y value and Param1.
8, processor obtains the volume value of the currently playing video of smart television by audio processing interface.
9, the volume value that processor will acquire sends gateway to.
It should be noted that obtaining the thread of volume value and the main rgb value of acquisition may be performed simultaneously.
10, gateway determines corresponding brightness value according to the corresponding relationship of volume value and brightness value.
11, brightness value described in gateway controls the brightness that intelligent lamp group issues light.
So far the function of linkage is completed.
Above method process flow can realize that the software program can store in storage medium with software program, when
When the software program of storage is called, above method step is executed.
Based on the same inventive concept, in the embodiment of the present invention four, a kind of linkage control device of smart home is provided, it should
Device includes the module for executing method shown in FIG. 1, as shown in fig. 7, described device includes:
Processing module 71, the video image played for obtaining smart television, and by the video image be divided into
Few sub-regions;
Determining module 72 includes according in the subregion for each sub-regions for the video image
The rgb value of pixel determines the main rgb value of the subregion, wherein corresponding one intelligent lamp group of each subregion;
Transmission module 73, for by the main rgb value of the subregion and being used to indicate that the subregion to correspond to intelligent lamp
The identification information of group, is transferred to gateway, so that the gateway adjusts the subregion pair according to the main rgb value of the subregion
The intelligent lamp group answered issues the color of light.
Optionally, the transmission module is specifically used for:
By HTTP, by the main rgb value of the subregion and the mark for being used to indicate the corresponding intelligent lamp group of the subregion
Know information, is transferred to gateway.
Optionally, the determining module is specifically used for:
For each sub-regions that the video image includes, according to the RGB for the pixel for including in the subregion
Value, determining has the quantity of the pixel of identical rgb value;By the most rgb value of the quantity of corresponding pixel, it is determined as described
The main rgb value of subregion.
Optionally, the determining module is specifically used for:
For each sub-regions that the video image includes, the rgb value for the pixel for including by the subregion turns
Change HSL color mode into;
It include that pixel correspond to intensity value and brightness value in HSL color mode according to the subregion, described in determination
The main rgb value of subregion.
Optionally, the determining module is specifically used for:
The color template selected according to user selects intensity value in institute from the pixel that the subregion includes
It states in the saturation degree threshold range that color template includes and brightness value is within the scope of the lightness threshold that the color template includes
Pixel;From the rgb value for the pixel selected, a rgb value is selected to be determined as the main rgb value of the subregion.
Optionally, the determining module is specifically used for:
The intensity value for determining each pixel that the subregion includes includes in the color template that user selectes
Saturation degree threshold range it is outer, and/or brightness value is outside the lightness threshold range that the color template includes;According to the son
The rgb value for the pixel for including in region, determining has the quantity of the pixel of identical rgb value;By the number of corresponding pixel
Most rgb values is measured, the main rgb value of the subregion is determined as.
Optionally, described device further include:
Module 74 is obtained, for obtaining the volume value for the video that the smart television is played;
The transmission module is also used to: the volume value that the second acquisition module is got is transferred to the gateway, with
Make the gateway according to the volume value received, adjusts the brightness that each intelligent lamp group issues light.
Based on the same inventive concept, in the embodiment of the present invention five, a kind of gateway is provided, which includes executing Fig. 2 institute
The module for the method shown, as shown in figure 8, the gateway includes:
Receiving module 81, for receive each subregion for the video image that smart television is played main rgb value and
For indicating that the identification information of the corresponding intelligent lamp group of the subregion, the video image are divided at least one sub-district
Domain;
Processing module 82, for adjusting the subregion according to the main rgb value of the subregion for each subregion
Corresponding intelligence lamp group issues the color of light.
Optionally, the receiving module is specifically used for:
By HTTP, the main rgb value of each subregion for the video image that smart television is played is received and for table
Show the identification information of the corresponding intelligent lamp group of the subregion.
Optionally, the receiving module is also used to: receiving the volume value for the video that the smart television is played;
The processing module is also used to: according to the volume value, adjusting the brightness that each intelligent lamp group issues light.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.