Summary of the invention
The present invention provides a kind of control method and device of vehicle-mounted atmosphere lamp.
The technical scheme of the present invention is realized as follows:
On the one hand, a kind of control method of vehicle-mounted atmosphere lamp is provided, comprising:
Obtain the state parameter of voice applications on mobile unit;
According to the state parameter, the control parameter of vehicle-mounted atmosphere lamp is generated;
Based on the control parameter, the color and/or brightness of the vehicle-mounted atmosphere lamp are controlled.
Further, the state parameter for obtaining voice applications on mobile unit, comprising:
Obtain the image information for the application interface that voice applications are currently shown on mobile unit;
It is described according to the state parameter, generate the control parameter of vehicle-mounted atmosphere lamp, comprising:
According to described image information, color control parameter is determined;Wherein, the color control parameter, it is described for controllingThe color of vehicle-mounted atmosphere lamp.
Further, described according to described image information, determine color control parameter, comprising:
The number of pixels of various colors in described image is counted, and generates the face of characterization color and number of pixels corresponding relationshipColor Histogram;
Based on the color histogram, the color control parameter is determined.
Further, described to be based on the color histogram, determine color control parameter, comprising:
According to the corresponding color of the longest longitudinal stripe of length in the color histogram, the color control ginseng is determinedNumber.
Further, described to be based on the color histogram, determine color control parameter, comprising:
According to the color parameter value of color length and color of longitudinal stripe in the color histogram, determine selection according toAccording to parameter, wherein the color parameter value includes at least one of: hue value, intensity value and brightness value;
Based on the selection gist parameter, light color is selected;
According to the light color of selection, the color control parameter is generated.
Further, described according to described image information, determine color control parameter, comprising:
Described image is down-sampled, after acquisition is down-sampled image;
According to it is described it is down-sampled after image, determine the color control parameter.
Further, the state parameter for obtaining voice applications on mobile unit, comprising:
Obtain the audio frequency parameter of the currently playing audio of voice applications on the mobile unit;
It is described according to the state parameter, generate the control parameter of vehicle-mounted atmosphere lamp, comprising:
According to the audio frequency parameter, the brightness control parameter of the vehicle-mounted range lamp is generated, wherein the brightness control ginsengCount the brightness for controlling the vehicle-mounted atmosphere lamp.
Further, the audio frequency parameter for obtaining the currently playing audio of voice applications on the mobile unit, comprising:
Obtain the spectrum sequence of the currently playing audio of voice applications on the mobile unit;
It is described according to the audio frequency parameter, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
According to the spectrum sequence, the brightness control parameter of the vehicle-mounted range lamp is generated.
Further, described according to the spectrum sequence, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
By in the spectrum sequence, former and later two frequency spectrum datas successively subtract each other, and obtain one group of spectrum difference;
Based on the spectrum difference, the brightness control parameter of the vehicle-mounted range lamp is generated.
The present invention also provides a kind of control devices of vehicle-mounted atmosphere lamp, comprising:
Acquiring unit, for obtaining the state parameter of voice applications on mobile unit;
Generation unit, for generating the control parameter of vehicle-mounted atmosphere lamp according to the state parameter;
Control unit controls the color and/or brightness of the vehicle-mounted atmosphere lamp for being based on the control parameter.
The present invention also provides a kind of computer storage mediums, which is characterized in that the computer storage medium is stored withComputer executable instructions;After the computer executable instructions are performed, above-described vehicle-mounted atmosphere lamp can be realizedControl method.
The present invention also provides a kind of vehicle-mounted atmosphere lamps, comprising:
Atmosphere lamp;
The control equipment of vehicle-mounted atmosphere lamp, for realizing the control method of above-described vehicle-mounted atmosphere lamp.
Control method and device, storage medium and the vehicle-mounted atmosphere lamp of vehicle-mounted atmosphere lamp provided by the invention obtain vehicle-mountedThe state parameter of voice applications in equipment;According to the state parameter, the control parameter of vehicle-mounted atmosphere lamp is generated;Based on the controlParameter processed controls the color and/or brightness of the vehicle-mounted atmosphere lamp.The present invention obtains the state of the voice applications on mobile unitParameter generates control parameter, is controlled by control parameter the color of vehicle-mounted atmosphere lamp and/or brightness.Foundation of the present inventionThe state of voice applications on mobile unit, realizes the automatic control to vehicle-mounted atmosphere lamp;It is controlled according to the state of voice applicationsVehicle-mounted atmosphere lamp is made, the sound atmosphere of audio output construction is realized, the consistency for the lighting atmosphere built with vehicle-mounted atmosphere lampWith uniformity and harmonious property, reduce because atmosphere caused by sound atmosphere and lighting atmosphere are inconsistent is torn, and is further ledThe user of cause experiences the phenomenon of difference, and the user experience is improved.
Specific embodiment
In various embodiments of the present invention, the state parameter for obtaining the voice applications on mobile unit generates control ginsengNumber, controls the color of vehicle-mounted atmosphere lamp and/or brightness by control parameter.For purpose, the skill for making the embodiment of the present inventionArt scheme and advantage are more clearly understood, and the embodiment of the present invention is described in detail below in conjunction with attached drawing.
Fig. 1 is a kind of flow diagram of the control method of vehicle-mounted atmosphere lamp provided in an embodiment of the present invention, such as Fig. 1 instituteShow, the control method of the vehicle-mounted atmosphere lamp the following steps are included:
Step 101: obtaining the state parameter of voice applications on mobile unit;
Step 102: according to the state parameter, generating the control parameter of vehicle-mounted atmosphere lamp;
Step 103: being based on the control parameter, control the color and/or brightness of the vehicle-mounted atmosphere lamp.
Atmosphere lamp in the present invention has the function of the brightness that changes colour and change, and should use has the function of to change colour and change brightnessLamp, such as: with colour change function and change brightness function LED light or cold-cathode lamp, LED light by control red, green, blue threeThe color of primary-color LED array exports, and blends most of color in nature;LED light can also pass through the method for pulsewidth modulationChange the pulse duty factor of LED drive current to realize the brightness control to LED light.
Voice applications are in the equipment such as vehicle audio or vehicle-mounted radio, for playing the application of audio.Voice applications are broadcastThe audio put can be music, cross-talk, broadcast program etc., for example, the voice applications can include: dedicated for the sound of musicHappy application may also include the broadcasted application or radio station application in broadcasting station.
In some embodiments, the state parameter of voice applications is the state letter that voice applications are shown in useBreath, such as: the spectrum information of the currently playing audio of image information, voice applications for the application interface that voice applications are currently shown,Amplitude information, classification information of the currently playing audio of voice applications of the currently playing audio of voice applications etc..
The control parameter is the parameter that controllable atmosphere lamp is shown, such as: color control parameter, the atmosphere lamp of atmosphere lampBrightness control parameter, the lighting time control parameter of atmosphere lamp, duration control parameter etc. of turning on light of atmosphere lamp.
In further embodiments, the state parameter of the voice applications further include: instruction voice applications whether start and/Or whether it is in the status information of broadcast state.Indicate whether voice applications start and/or whether be in the state of broadcast stateInformation can be used for generating the control parameter for controlling the vehicle-mounted atmosphere lamp unlatching and/or closing.
Further, the state parameter for obtaining voice applications on mobile unit, comprising:
Obtain the image information for the application interface that voice applications are currently shown on mobile unit;
It is described according to the state parameter, generate the control parameter of vehicle-mounted atmosphere lamp, comprising:
According to described image information, color control parameter is determined;Wherein, the color control parameter, it is described for controllingThe color of vehicle-mounted atmosphere lamp.
It can be shown when voice applications play different audios on mobile unit, on the application interface of voice applications differentImage.Such as: when on mobile unit voice applications play be music album when, can show this on the application interface of voice applicationsThe cover image of music album;When on mobile unit voice applications play be cross-talk album when, the application interface of voice applicationsOn can show the cover image of the cross-talk album;When on mobile unit voice applications play be broadcast program when, voice applicationsApplication interface on can show the corresponding image of the broadcast program.
According to the image shown on the application interface of voice applications, color control parameter is determined.Color control parameter can be withThe relevant colors that vehicle-mounted atmosphere lamp shows above-mentioned image are controlled, such as: certain certain bits in a certain particular color, image in imageCorresponding color of the pixel set etc..
Optionally, according to face of the maximum color of color area as light in the theme color of album cover or imageColor, alternatively, selecting the color of most brilliant in colors to make there are a variety of theme colors or there are when the size approximation of multiple colorFor the color of light.
Further, described according to described image information, determine color control parameter, comprising:
The number of pixels of various colors in described image is counted, and generates the face of characterization color and number of pixels corresponding relationshipColor Histogram;
Based on the color histogram, the color control parameter is determined.
Color histogram is used by many image processing systems.Color histogram in the present invention characterizes color and picturePrime number purpose corresponding relationship can determine different color ratio shared in entire image according to the color histogram.
Optionally, judge whether described image is bitmap format, if not bitmap format, described image is converted into positionBitmap-format.Hexadecimal color code coding mode, RGB (Red Green Blue) coding mode etc. can be used in bitmap.
Further, described to be based on the color histogram, determine color control parameter, comprising:
According to the corresponding color of the longest longitudinal stripe of length in the color histogram, the color control ginseng is determinedNumber.
The length of longitudinal stripe in color histogram indicates that the distribution of color situation in image, the length of longitudinal stripe are got overThe number of pixels of corresponding color is more in long representative image.The corresponding color of the longest longitudinal stripe of length in color histogram,The shared maximum color of ratio as in entire image.
Further, described to be based on the color histogram, determine color control parameter, comprising:
According to the color parameter value of color length and color of longitudinal stripe in the color histogram, determine selection according toAccording to parameter, wherein the color parameter value includes at least one of: hue value, intensity value and brightness value;
Based on the selection gist parameter, light color is selected;
According to the light color of selection, the color control parameter is generated.
Firstly, selecting the most X kind color of accounting in image according to the length of longitudinal stripe in color histogram, wherein X>1;Secondly, the hexadecimal color code or RGB color code of color in color histogram are converted to HSL (HueSaturation Lightness) color code;Finally, again according to hue value, intensity value and the brightness value of color, from X kind faceColor selects a kind of color, the display color as lamp.It specifically, can be respectively to hue value, intensity value and brightness value pointOther setting range.Color outside the setting range of hue value, intensity value and brightness value is not as light color, alternatively, from X kindA kind of color is selected in color, as the display color of lamp, the corresponding hue value of the color, intensity value and brightness value existIn the setting range of the hue value, intensity value and brightness value.
The setting range of hue value, intensity value and brightness value can be set according to actual demand.Such as: hue value generationThe color gamut that table human eye can perceive can determine that hue value is corresponding according to the color parameter of atmosphere lamp and the hobby of user and setDetermine range;Saturation degree describes the variation of color purity under identical form and aspect, lightness, and numerical value is bigger, and the grey in color is fewer, faceColor is more bright-coloured, can set the threshold values of saturation degree, lower than the threshold values color not as lamp color, to be made with compared with chromatic colourFor the color of lamp;Brightness can control the light and shade variation of color, and numerical value is smaller, and color is darker, and closer to black, numerical value is got overGreatly, color is brighter, closer to white, it may be determined that the minimum threshold values of brightness and maximum threshold values select minimum threshold values and maximumDisplay color of the color as lamp between threshold values, to choose the color of suitable brightness as the color of lamp.
In some embodiments, the preset range can be to be set according to the light emitting properties of vehicle-mounted atmosphere lamp, for example, vehicleIt carries atmosphere lamp to be only capable of issuing the light of predetermined kind of color, then can directly be set at this time according to the light emitting properties of vehicle-mounted atmosphere etc. pre-Determine range.
Further, described according to described image information, determine color control parameter, comprising:
Described image is down-sampled, after acquisition is down-sampled image;
According to it is described it is down-sampled after image, determine the color control parameter.
The down-sampled size with downscaled images file reduces calculation amount and reduces the effect of memory used.
Further, the state parameter for obtaining voice applications on mobile unit, comprising:
Obtain the audio frequency parameter of the currently playing audio of voice applications on the mobile unit;
It is described according to the state parameter, generate the control parameter of vehicle-mounted atmosphere lamp, comprising:
According to the audio frequency parameter, the brightness control parameter of the vehicle-mounted range lamp is generated, wherein the brightness control ginsengCount the brightness for controlling the vehicle-mounted atmosphere lamp.
Audio data can be obtained by following two mode: being acquired by audio sampling device, audio sampling deviceIt include: microphone, microphone etc.;The voice applications on mobile unit, the control of vehicle-mounted atmosphere lamp and voice applications can also be passed throughEquipment can be the same equipment, which can directly read the voice applications out of voice applications memory headroomStatus information for example, directly directly reading audio data from memory, rather than is acquired by particular device (for example, microphone)The audio data or status information can be just obtained, to realize the information sharing inside control equipment, simplifies audio dataIt obtains.
Audio frequency parameter can be the acoustic characteristic of the audios such as audio frequency parameter, audio amplitude parameter, audio tamber parameterParameter.
Further, the audio frequency parameter for obtaining the currently playing audio of voice applications on the mobile unit, comprising:
Obtain the spectrum sequence of the currently playing audio of voice applications on the mobile unit;
It is described according to the audio frequency parameter, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
According to the spectrum sequence, the brightness control parameter of the vehicle-mounted range lamp is generated.
The sampling period for determining spectrum sequence carries out the frequency spectrum data of currently playing audio according to the sampling periodAcquisition, and then obtain the spectrum sequence of currently playing audio.Sampling period can set according to actual needs.
Further, described according to the spectrum sequence, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
By in the spectrum sequence, former and later two frequency spectrum datas successively subtract each other, and obtain one group of spectrum difference;
Based on the spectrum difference, the brightness control parameter of the vehicle-mounted range lamp is generated.
Can be by one group of spectrum difference, the absolute value of all spectrum differences is added, and it is corresponding to obtain this group of spectrum differenceSpectrum amplitude.The constraint relationship between spectrum amplitude and the brightness control parameter of lamp is established, and obtains lamp according to the constraint relationshipBrightness control parameter.Above-mentioned the constraint relationship can be functional relation etc..
The a reference value that the brightness of lamp can first be set, when being played without audio, lamp with a reference value display brightness of the brightness,Establish the corresponding relationship between spectrum difference and the luminance delta of lamp, when having audio broadcasting, the brightness of lamp by brightness benchmarkValue is added to obtain with the changing value of brightness, and then the luminance delta based on spectrum difference control lamp;Spectrum difference can also be establishedWith the corresponding relationship of the brightness of lamp, and then the brightness of lamp is directly determined based on spectrum difference.Light is realized by the above methodBrightness automatic regular movements with the broadcasting of audio.
For example, initial time user manually adjust or voice by way of can set vehicle-mounted atmosphere lamp this openingBrightness, the brightness can be used as a reference value, be determined the frequency of the audio at moment by manual or phonetic order in vehicle-mounted atmosphere lampSpectrum is as reference spectral corresponding with a reference value.It is subsequent, since audio plays continuity in the time domain, according to adjacentSpectrum difference between frequency spectrum is substantially equivalent to spectrum difference of each moment relative to reference spectral, utilizes this frequencySpectral difference value can dynamically control the variable quantity of brightness.
Optionally, described according to the spectrum sequence, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
Based on M period, the spectrum sequence is divided into M sub- spectrum sequences, wherein M > 1;
Determine the corresponding M sub- mean frequency value of the sub- spectrum sequence of the M;
Based on the M sub- mean frequency values, the brightness control parameter of the vehicle-mounted range lamp is generated, wherein the brightnessControl parameter is for controlling brightness of the vehicle-mounted atmosphere lamp within the period.
The constraint relationship between sub- mean frequency value and the brightness control parameter of lamp is established, specifically, sub- mean frequency value is bigger,The brighter display of the corresponding lamp of brightness control parameter of lamp;Sub- mean frequency value is smaller, the corresponding lamp of brightness control parameter of lampBrightness is darker.When audio is louder and more sonorous, light can brighten;When audio is relatively releived, light can be dimmed, and then realizes lightBrightness automatic regular movements with the broadcasting of audio.
Optionally, the audio frequency parameter for obtaining the currently playing audio of voice applications on the mobile unit, comprising:
Obtain the amplitude sequence of the currently playing audio of voice applications on the mobile unit;
It is described according to the audio frequency parameter, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
According to the amplitude sequence, the brightness control parameter of the vehicle-mounted range lamp is generated.
Optionally, described according to the amplitude sequence, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
Based on N number of period, the spectrum sequence is divided into N number of sub- amplitude sequence, wherein N > 1;
Determine the corresponding N number of sub- amplitude mean value of N number of sub- amplitude sequence;
Based on N number of sub- amplitude mean value, the brightness control parameter of the vehicle-mounted range lamp is generated, wherein the brightnessControl parameter is for controlling brightness of the vehicle-mounted atmosphere lamp within the period.
The constraint relationship between sub- amplitude mean value and the brightness control parameter of lamp is established, specifically, sub- amplitude mean value is bigger,The brighter display of the corresponding lamp of brightness control parameter of lamp;Sub- amplitude mean value is smaller, the corresponding lamp of brightness control parameter of lampBrightness is darker.When the amplitude ratio of audio is larger, light can brighten;The Amplitude Comparison hour of audio, light can be dimmed, and then realizeBrightness automatic regular movements with the broadcasting of audio of light.
Fig. 2 is a kind of control device composed structure schematic diagram of vehicle-mounted atmosphere lamp provided in an embodiment of the present invention, comprising:
Acquiring unit 201, for obtaining the state parameter of voice applications on mobile unit;
Generation unit 202, for generating the control parameter of vehicle-mounted atmosphere lamp according to the state parameter;
Control unit 203 controls the color and/or brightness of the vehicle-mounted atmosphere lamp for being based on the control parameter.
Further, the acquiring unit 201, is specifically used for:
Obtain the image information for the application interface that voice applications are currently shown on mobile unit;
The generation unit 202, is specifically used for:
According to described image information, color control parameter is determined;Wherein, the color control parameter, it is described for controllingThe color of vehicle-mounted atmosphere lamp.
Further, the generation unit 202, is also used to:
The number of pixels of various colors in described image is counted, and generates the face of characterization color and number of pixels corresponding relationshipColor Histogram;
Based on the color histogram, the color control parameter is determined.
Further, the generation unit 202, is also used to:
According to the corresponding color of the longest longitudinal stripe of length in the color histogram, the color control ginseng is determinedNumber.
Further, the generation unit 202, is also used to:
According to the color parameter value of color length and color of longitudinal stripe in the color histogram, determine selection according toAccording to parameter, wherein the color parameter value includes at least one of: hue value, intensity value and brightness value;
Based on the selection gist parameter, light color is selected;
According to the light color of selection, the color control parameter is generated.
Further, the generation unit 202, is also used to:
Described image is down-sampled, after acquisition is down-sampled image;
According to it is described it is down-sampled after image, determine the color control parameter.
Further, the generation unit 202, is also used to:
Obtain the audio frequency parameter of the currently playing audio of voice applications on the mobile unit;
According to the audio frequency parameter, the brightness control parameter of the vehicle-mounted range lamp is generated, wherein the brightness control ginsengCount the brightness for controlling the vehicle-mounted atmosphere lamp.
Further, the generation unit 202, is also used to:
Obtain the spectrum sequence of the currently playing audio of voice applications on the mobile unit;
It is described according to the audio frequency parameter, generate the brightness control parameter of the vehicle-mounted range lamp, comprising:
According to the spectrum sequence, the brightness control parameter of the vehicle-mounted range lamp is generated.
Further, the generation unit 202, is also used to:
By in the spectrum sequence, former and later two frequency spectrum datas successively subtract each other, and obtain one group of spectrum difference;
Based on the spectrum difference, the brightness control parameter of the vehicle-mounted range lamp is generated.
The present invention also provides a kind of computer storage mediums, which is characterized in that the computer storage medium is stored withComputer executable instructions;After the computer executable instructions are performed, above-described vehicle-mounted atmosphere lamp can be realizedControl method.
Fig. 3 is a kind of composed structure schematic diagram of vehicle-mounted atmosphere lamp provided in an embodiment of the present invention, comprising:
Atmosphere lamp 301;
The control equipment 302 of vehicle-mounted atmosphere lamp, for realizing the control method of above-described vehicle-mounted atmosphere lamp.
Fig. 4 is the flow diagram of the control method of the vehicle-mounted atmosphere lamp of another kind provided in an embodiment of the present invention, such as Fig. 4 instituteShow, the described method comprises the following steps:
Step 401: atmosphere lamp display color is obtained by obtained music album picture, the method is as follows:
When playing music, album cover picture is shown on vehicle device screen music card;
Cover picture is extracted, and picture is reduced, while guaranteeing that mass effect is constant, calculation amount can be reduced in this way and is subtractedThe use of few memory;
The picture of diminution all is converted to bitmap format, the pixel data on picture is being stored in an integer array;
There is small arrive to sort greatly the integer array for storing image data, is equivalent to pile up the same color of a pictureTogether, in the accounting numerical value for showing how many kinds of color and each color with color histogram;
The RGB color code of the color obtained in color histogram is converted into HSL color code, wherein it is corresponding that H represents colorHue value, S represents the corresponding saturation degree of color, and L represents the corresponding brightness value of color, according to above-mentioned hue value, saturation degree andBrightness value selects color most gorgeous in the highest color of picture accounting or picture.
Step 402: lamplight brightness regular movements is controlled by music rhythm, the method is as follows:
One in player group of group frequency spectrum data is obtained first to be put into array;
Frequency spectrum data in each group of frequency spectrum array is successively compared, is added and subtracted by one group of size of data comparisonObtain a numerical value;
The numerical value that comparison obtains is converted and is arranged according to the brightness degree waited, the brightness of such light will be with this musicMelody regular movements.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.