Atmosphere lamp control method and device and storage medium

文档序号:394850 发布日期:2021-12-14 浏览:2次 中文

阅读说明:本技术 一种氛围灯控制方法、装置以及存储介质 (Atmosphere lamp control method and device and storage medium ) 是由 许汉龙 肖兵 李春 黄昌松 于 2021-11-11 设计创作,主要内容包括:本申请公开了一种氛围灯控制方法、装置以及存储介质,用于对电视氛围灯进行控制。本申请方法包括:当所述显示器为显示状态后,通过采样相机采集所述显示器当前的画面变化区域范围;根据所述画面变化区域范围确定输出的屏幕区域;生成所述屏幕区域的RGB值,并根据所述RGB值对所述氛围灯进行控制。(The application discloses an atmosphere lamp control method, an atmosphere lamp control device and a storage medium, which are used for controlling a television atmosphere lamp. The method comprises the following steps: when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera; determining an output screen area according to the range of the picture change area; and generating an RGB value of the screen area, and controlling the atmosphere lamp according to the RGB value.)

1. An ambience lamp control method for controlling an ambience lamp, the ambience lamp being mounted on or outside a display, the method comprising:

when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

determining an output screen area according to the range of the picture change area;

and generating an RGB value of the screen area, and controlling the atmosphere lamp according to the RGB value.

2. The ambience lamp control method of claim 1, wherein the generating of the RGB values of the screen area includes:

acquiring a first HSV value of a target area in the screen area;

and generating an RGB value according to the first HSV value.

3. The ambient lamp control method of claim 2, wherein the generating RGB values from the first HSV values comprises:

adjusting the first HSV value to obtain a second HSV value, wherein the saturation of the second HSV value is higher than that of the second HSV value;

converting the second HSV value to an RGB value.

4. The ambience lamp control method of claim 2, wherein the ambience lamp includes at least two ambience lamp units, and the obtaining the first HSV value of the target one of the screen areas includes:

dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

and respectively acquiring first HSV values of the sub-regions.

5. The ambience lamp control method according to claim 4, wherein the length of the sub-areas matches the length of the ambience lamp unit.

6. The ambience lamp control method according to claim 1, wherein the determining the output screen area according to the picture variation area range includes:

generating a temporary mask according to the range of the current picture change region, wherein the temporary mask is a region in the range of the picture change region;

and determining the output screen area according to the temporary mask.

7. The ambience lamp control method of claim 6, wherein the determining the output screen area based on the temporary mask includes:

determining an effective area of the temporary mask;

and if the effective area of the temporary mask is larger than or equal to a preset first area threshold, determining an output screen area according to the temporary mask.

8. The ambience lamp control method according to claim 6, wherein before the capturing of the current picture change area range of the display by the sampling camera, the method further comprises:

and acquiring a rough screen area of the display through the sampling camera, and generating a rough mask according to the rough screen area, wherein the rough screen area is obtained by carrying out area division on a sampling image of the sampling camera.

9. The ambience lamp control method of claim 8, wherein the determining the output screen area based on the temporary mask includes:

and if the effective area of the temporary mask is smaller than a preset first area threshold, determining the rough mask as an output screen area.

10. The ambience lamp control method according to claim 8, wherein before the capturing of the current picture change area range of the display by the sampling camera, the method further comprises:

and judging whether the display is in a display state or not according to the color and/or the brightness of the pixel points in the rough mask, and if not, determining the rough mask as an output screen area.

11. The ambience lamp control method according to claim 8, wherein after the determining of the output screen area according to the temporary mask, the method further comprises:

acquiring the current picture change area range of the display through the sampling camera, and generating a temporary updating mask according to the current picture change area range;

determining an effective area of the temporary update mask;

determining a last output screen area;

when the last output screen area is obtained according to the rough mask, determining the output screen area according to the area of the effective area of the temporary updated mask;

and when the last output screen area is obtained according to the temporary mask, overlapping the temporary updating mask on the temporary mask, and determining the output screen area according to the overlapped temporary mask.

12. The ambience lamp control method of claim 11, wherein the determining the output screen area based on the area of the active area of the temporary update mask includes:

judging the area of the temporary updating mask;

if the area of the temporary updating mask is larger than or equal to a second area threshold, determining an output screen area according to the temporary updating mask;

and if the area of the temporary updated mask is smaller than the second area threshold, outputting the rough mask as a screen area.

13. The ambience lamp control method of claim 11, wherein the determining the active area of the temporary update mask includes:

binarizing the temporary updating mask;

and determining the area larger than the preset gray value as an effective area according to the temporary updated mask after binarization.

14. The ambience lamp control method according to any one of claims 6 to 13, wherein the generating of the temporary mask according to the current picture change area range includes:

and processing the images of two adjacent frames according to an inter-frame difference method to generate a temporary mask.

15. The ambience lamp control method according to claim 6, wherein before the capturing of the current picture change area range of the display by the sampling camera, the method further comprises:

collecting the flicker frequency of the atmosphere lamp through a sampling camera, and determining an invalid mask in a sampling picture of the sampling camera according to the flicker frequency;

the determining the output screen area according to the temporary mask includes:

and the temporary mask is different from the invalid mask, and the different temporary mask is determined as an output screen area.

16. The ambience lamp control method of claim 1, wherein the generating of the RGB values of the screen area includes:

and acquiring a YUV value of the screen area, and converting the YUV value into an RGB value.

17. The ambience lamp control method of claim 16, wherein the ambience lamp includes at least two ambience lamp units, and the acquiring YUV values of the screen area includes:

dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

and respectively acquiring YUV values of the sub-regions.

18. An ambience lamp control device for controlling an ambience lamp, the ambience lamp being mounted on or outside a display, the device comprising:

the first acquisition unit is used for acquiring the current picture change area range of the display through a sampling camera after the display is in a display state;

the determining unit is used for determining an output screen area according to the picture change area range;

and the generating unit is used for generating the RGB value of the screen area and controlling the atmosphere lamp according to the RGB value.

19. An ambience lamp control device, characterized in that the device comprises:

the device comprises a processor, a memory, an input and output unit and a bus;

the processor is connected with the memory, the input and output unit and the bus;

the memory holds a program that the processor calls to perform the method of any of claims 1 to 17.

20. A computer-readable storage medium having a program stored thereon, which when executed on a computer performs the method of any one of claims 1 to 17.

Technical Field

The present disclosure relates to electronic devices, and particularly to an ambience lamp control method, an ambience lamp control device, and a storage medium.

Background

Along with the updating iteration of electronic products and the continuous popularization of intelligent home furnishing, various intelligent televisions and television peripheral products are popular among people, particularly television atmosphere lamps for enhancing immersion and atmosphere, the television atmosphere lamps are generally installed around the television, and the periphery of the television is decorated by emitting light with the same color as that of partial areas of television pictures, so that the television and a wall surface are well integrated.

The lamp area of TV atmosphere lamp generally installs around the TV, thereby controls TV atmosphere lamp to send the light of corresponding colour through getting the look to the screen, and in the scheme that prior art provided, need the user to paste special sticky tape at TV screen edge, then the picture of control camera shooting carries out the screen area calibration, and in the calibration process, the user needs manually to drag the calibration point to the corresponding sticky tape position of picture to accomplish the screen and correct. However, the method is too dependent on manual operation of a user, the correction process is more complicated, and the efficiency is lower.

Disclosure of Invention

In order to solve the above technical problem, a first aspect of the present application provides an ambience lamp control method, device and storage medium.

The present application provides in a first aspect an ambience lamp control method for controlling an ambience lamp, the ambience lamp being mounted in the vicinity of a display, the method comprising:

when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

determining an output screen area according to the range of the picture change area;

and generating an RGB value of the screen area, and controlling the atmosphere lamp according to the RGB value.

Optionally, the generating the RGB values of the screen region includes:

acquiring a first HSV value of a target area in the screen area;

and generating an RGB value according to the first HSV value.

Optionally, the generating the RGB value according to the first HSV value includes:

adjusting the first HSV value to obtain a second HSV value, wherein the saturation of the second HSV value is higher than that of the second HSV value;

converting the second HSV value to an RGB value.

Optionally, the atmosphere lamp includes at least two atmosphere lamp units, and the acquiring a first HSV value of a target area in the screen area includes:

dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

and respectively acquiring first HSV values of the sub-regions.

Optionally, the length of the sub-region matches the length of the ambience light unit.

Optionally, the determining the output screen area according to the picture change area range includes:

generating a temporary mask according to the range of the current picture change region, wherein the temporary mask is a region in the range of the picture change region;

and determining the output screen area according to the temporary mask.

Optionally, the determining the output screen area according to the temporary mask includes:

determining an effective area of the temporary mask;

and if the effective area of the temporary mask is larger than or equal to a preset first area threshold, determining an output screen area according to the temporary mask.

Optionally, before the acquiring, by the sampling camera, the current picture change area range of the display, the method further includes:

and acquiring a rough screen area of the display through the sampling camera, and generating a rough mask according to the rough screen area, wherein the rough screen area is obtained by carrying out area division on a sampling image of the sampling camera.

Optionally, the determining the output screen area according to the temporary mask includes:

and if the effective area of the temporary mask is smaller than a preset first area threshold, determining the rough mask as an output screen area.

Optionally, before the acquiring, by the sampling camera, the current picture change area range of the display, the method further includes:

and judging whether the display is in a display state or not according to the color and/or the brightness of the pixel points in the rough mask, and if not, determining the rough mask as an output screen area.

Optionally, after the determining the output screen area according to the temporary mask, the method further includes:

acquiring the current picture change area range of the display through the sampling camera, and generating a temporary updating mask according to the current picture change area range;

determining an effective area of the temporary update mask;

determining a last output screen area;

when the last output screen area is obtained according to the rough mask, determining the output screen area according to the area of the effective area of the temporary updated mask;

and when the last output screen area is obtained according to the temporary mask, overlapping the temporary updating mask on the temporary mask, and determining the output screen area according to the overlapped temporary mask.

Optionally, the determining the output screen region according to the area of the effective region of the temporary update mask includes:

judging the area of the temporary updating mask;

if the area of the temporary updating mask is larger than or equal to a second area threshold, determining an output screen area according to the temporary updating mask;

and if the area of the temporary updated mask is smaller than the second area threshold, outputting the rough mask as a screen area.

Optionally, the determining the effective area of the temporary update mask includes:

binarizing the temporary updating mask;

and determining the area larger than the preset gray value as an effective area according to the temporary updated mask after binarization.

Optionally, the generating a temporary mask according to the current picture change region range includes:

and processing the images of two adjacent frames according to an inter-frame difference method to generate a temporary mask.

Optionally, before the acquiring, by the sampling camera, the current picture change area range of the display, the method further includes:

collecting the flicker frequency of the atmosphere lamp through a sampling camera, and determining an invalid mask in a sampling picture of the sampling camera according to the flicker frequency;

the determining the output screen area according to the temporary mask includes:

and the temporary mask is different from the invalid mask, and the different temporary mask is determined as an output screen area.

Optionally, the generating the RGB values of the screen region includes:

and acquiring a YUV value of the screen area, and converting the YUV value into an RGB value.

Optionally, the atmosphere lamp includes at least two atmosphere lamp units, and the acquiring the YUV values of the screen region includes:

dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

and respectively acquiring YUV values of the sub-regions.

A second aspect of the present application provides an ambience lamp control device, the device comprising:

the first acquisition unit is used for acquiring the current picture change area range of the display through the sampling camera after the display is in a display state;

the determining unit is used for determining an output screen area according to the picture change area range;

and the generating unit is used for generating the RGB value of the screen area and controlling the atmosphere lamp according to the RGB value.

A third aspect of the present application provides an ambience lamp control device, the device comprising:

the device comprises a processor, a memory, an input and output unit and a bus;

the processor is connected with the memory, the input and output unit and the bus;

the memory holds a program that the processor calls to perform the method of any one of the first aspect and the optional first aspect.

A fourth aspect of the present application provides a computer-readable storage medium having a program stored thereon, the program, when executed on a computer, performing the method of any one of the first aspect and the alternatives of the first aspect.

According to the technical scheme, the method has the following advantages:

according to the method, after the display is in a display state, the current picture change area range of the display is collected through the sampling camera, and the output screen area is determined according to the picture change area range. When carrying out the control of atmosphere lamp, can realize that the automatic pick-up screen is regional to the completion gets the look, this is of value to the accurate collection of the regional colour of screen and to the accurate control of the luminous colour of atmosphere lamp, promotes user's impression.

Drawings

In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.

FIG. 1 is a schematic flow diagram of one embodiment of an atmosphere lamp control method provided herein;

FIG. 2 is a schematic flowchart of an embodiment of determining a screen area through a temporary mask in an atmosphere control method provided by the present application;

FIG. 3 is a schematic flowchart of an embodiment of determining a screen area by a null mask and a temporary mask in an atmosphere control method provided by the present application;

FIG. 4 is a flowchart illustrating an embodiment of determining a screen area according to an effective area of a temporary mask in an atmosphere control method provided by the present application;

FIG. 5 is a schematic flowchart of an embodiment of determining a screen area by updating a mask in an atmosphere control method provided by the present application;

fig. 6 is a schematic flowchart of an embodiment of obtaining a first HSV value of a sub-area in an atmosphere lamp control method provided in the present application;

FIG. 7 is a schematic diagram illustrating the structure of one embodiment of an ambience lamp control device provided herein;

FIG. 8 is a schematic diagram of another embodiment of an ambience lamp control device provided in the present application.

Detailed Description

The lamp area of TV atmosphere lamp is generally installed around the TV, thereby control TV atmosphere lamp to send the light of corresponding colour through getting the look to the screen, in the scheme that prior art provided, generally through the image of camera shooting TV screen when getting the look, directly acquire corresponding colour value from the image again, thereby control atmosphere lamp to send the light of corresponding colour, but this kind of method is when getting the look, the colour that obtains sometimes is good inadequately, thereby make atmosphere lamp's effect unsatisfactory, the user watches experience not high.

Based on this, the application provides an atmosphere lamp control method for control the atmosphere lamp, improve the atmosphere lamp effect, promote the user and feel.

It should be noted that the atmosphere lamp control method provided by the present application may be applied to a terminal, a system, or a server, for example, the terminal may be a fixed terminal such as a smart phone or a computer, a tablet computer, a smart television, a smart watch, a portable computer terminal, or a desktop computer. For convenience of explanation, the controller is taken as an execution subject for illustration in the present application.

The controller may be a separate external connection controller, or may be integrated in the camera, or in the ambience light device, or in other devices.

Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of an ambience lamp control method provided in the present application, where the ambience lamp control method includes:

101. when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

the method provided by the application can be used for screen detection equipment to detect the screen area of the display, the screen detection equipment is provided with the sampling camera, the sampling camera is used for shooting the screen area of the display, and the sampling camera can be installed on the display or not installed on the display. The atmosphere lamp is used for emitting light with corresponding colors to irradiate the background wall of the display, so that the display and the background are integrated. For example, when the atmosphere lamp is used, a sampling camera is required to collect the screen area of the display, and the method provided by the application can accurately collect the screen area of the display, so that the color sampling can be accurately performed on the display, and the atmosphere lamp can be better controlled to emit light with corresponding colors.

When the display is in a display state, the current picture change area range of the display is acquired through the sampling camera, wherein the picture change area range refers to an area where the picture of the display changes, and in practical application, the screen picture change speed is higher than the change speed of the environment outside the screen, so that the picture change area can be detected by utilizing an inter-frame difference method.

102. Determining an output screen area according to the range of the picture change area;

after the display is in the display state, when the display plays the video, the picture can constantly change, constantly gather the picture change regional scope of display through the sampling camera to note this picture change regional scope, through the stack of the picture change scope that constantly changes and obtains, determine the screen area of this display, realize the automatic pickup to the screen area of this display automatically.

103. And generating RGB values of the screen area, and controlling the atmosphere lamp according to the RGB values.

In practical applications, RGB is widely used in industry, and after a screen area is determined, RGB values of the screen area are generated, so as to control an atmosphere lamp. There are many implementations of generating RGB values, and the following embodiments will be described in detail.

According to the method, after the display is in a display state, the current picture change area range of the display is collected through the sampling camera, and the output screen area is determined according to the picture change area range. When carrying out the control of atmosphere lamp, can realize that the automatic pick-up screen is regional to the completion gets the look, this is of value to the accurate collection of the regional colour of screen and to the accurate control of the luminous colour of atmosphere lamp, promotes user's impression.

Referring to fig. 2, fig. 2 is a schematic flowchart of an embodiment of an ambience lamp control method provided in the present application, where the ambience lamp control method includes:

201. when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

the method provided by the application can be used for screen detection equipment to detect the screen area of the display, the screen detection equipment is provided with the sampling camera, the sampling camera is used for shooting the screen area of the display, and the sampling camera can be installed on the display or not installed on the display. For example, when the atmosphere lamp is used, a sampling camera is required to collect the screen area of the display, and the method provided by the application can accurately collect the screen area of the display, so that the color sampling can be accurately performed on the display, and the atmosphere lamp can be better controlled to emit light with corresponding colors.

When the display is in a display state, the current picture change area range of the display is acquired through the sampling camera, wherein the picture change area range refers to an area where the picture of the display changes, and in practical application, the screen picture change speed is higher than the change speed of the environment outside the screen, so that the picture change area can be detected by utilizing an inter-frame difference method.

202. Generating a temporary mask according to the range of the current picture change area;

the temporary mask is generated according to the current picture change area range, and can be generated specifically by picture superposition, for example, using the picture of the previous frame and the picture of the current frame to make inter-frame difference, calculating the number of pixel points whose brightness or color is greater than a certain threshold b, where the threshold b may be a preset value, if the number reaches a certain number threshold, superimposing the pixel points whose brightness or color is greater than the threshold b onto the previously generated temporary mask, if the number is less than the threshold, not superimposing the temporary mask, the value of the temporary mask in the initial state may be 0, and the specific superposition may be adding a fixed threshold x in the corresponding position of the temporary mask according to the pixel point position whose brightness or color is greater than the threshold b, and the fixed threshold x does not exceed 255, and by continuous picture superposition when the picture changes, thereby obtaining a final temporary mask. And obtaining a region with a numerical value of 0 and a region with a numerical value of non-0 on the temporary mask, wherein the region with the numerical value of 0 is a static region, and the region with the non-0 is a non-static region.

203. And determining the output screen area according to the temporary mask.

After the temporary mask is obtained, the output screen area may be updated according to the temporary mask, and the time for updating the output screen area may be a first update period after the display is in the display state, for example, the first screen detection time is T = T1+ T1, where T1 defines a period for updating the screen area by self, T1 is the power-on time of the display, where T is the current time. Namely, the screen area is updated when the first updating period after the display is started is reached.

The output screen area may be determined according to the temporary mask in various ways, for example, the temporary mask may be directly determined as the output screen area, and further, the final output screen area may be obtained by overlapping or phase difference with other masks. Or determining the output screen area according to the area of the effective area of the temporary mask, if the area of the effective area reaches a certain threshold value, outputting the temporary mask as the screen area or combining the temporary mask with other masks as the screen area, and if the area of the effective area is too small, not outputting the mask or outputting other masks.

According to the method, after the display is in a display state, the current picture change area range of the display is collected through the sampling camera, the temporary mask is generated according to the picture change area range, and the output screen area is determined according to the temporary mask. The screen area output through the temporary mask has better accuracy, and the screen area can be accurately detected through the output screen area, for example, when the screen area is used for a television atmosphere lamp, the screen area of a display can be better subjected to color sampling through the output screen area, so that the atmosphere lamp can be better controlled to emit light with corresponding colors. The method provides powerful support for detection and application of the screen area.

204. Acquiring a first HSV value of a target area in a screen area;

HSV (Hue, Saturation, Value), is a color model in which the parameters of the color are: hue (H), saturation (S), lightness (V), and RGB color patterns are a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing the three color channels on each other, and RGB is a color representing three channels of red, green, and blue.

The image of the screen area can be shot through the camera, and then the image is analyzed to obtain a first HSV value of the target area, wherein the target area is a specific area in the screen area and can correspond to the atmosphere lamp at the corresponding position.

205. Generating an RGB value according to the first HSV value, and controlling the atmosphere lamp according to the RGB value;

the generating of the RGB value according to the first HSV value may be directly converting the first HSV value into the RGB value, or may be adjusting the first HSV value according to a preset adjustment policy to obtain the second HSV value, for example, increasing the saturation H in the first HSV value by a preset adjustment range to obtain the second HSV value with higher saturation.

In practice, the color of the first HSV value directly acquired through the camera is not necessarily good, for example, if the color is dim or the color saturation is low, the light-emitting effect of the final atmosphere lamp is affected, so that the appearance is poor, and therefore the first HSV value can be adjusted.

Optionally, the adjustment strategy for the first HSV value may be various, for example, the adjustment strategy is increased or decreased according to a preset saturation amplitude, brightness amplitude and hue amplitude, or the adjustment strategy is to determine H, S and V values in the current first HSV value, and if the values are lower than or higher than a preset threshold, the adjustment strategy is performed according to the increased amplitudes, so that the first HSV value is maintained within a certain reasonable range, and a good look and feel is obtained.

In an alternative embodiment, the general atmosphere lamp uses RGB color standards, so that the second HSV value or the first HSV value needs to be converted into RGB values and finally output to the atmosphere lamp.

And finally, controlling the atmosphere lamp according to the RGB value, for example, controlling the atmosphere lamp corresponding to the target area to emit light with corresponding color.

According to the method, after the display is in a display state, the current picture change area range of the display is collected through the sampling camera, the temporary mask is generated according to the picture change area range, and the output screen area is determined according to the temporary mask. When carrying out the control of atmosphere lamp, can realize the automatic pickup screen region to accomplish and get the look, thereby it controls the atmosphere lamp again to generate the RGB value through gathering the first HSV value in screen region when getting the look, and HSV's color space can very audio-visual expression color light and shade, tone and vividness, and this is of value to the accurate collection of the regional colour of screen and to the accurate control of the luminous colour of atmosphere lamp, promotes user's impression.

In the optional embodiment of the method, the first HSV value is adjusted through a preset adjustment strategy, the sampled color value can be optimized, support is provided for color optimization, the adjusted second HSV value is converted into an RGB value which can be output to the atmosphere lamp, the color effect of light emitted by the atmosphere lamp can be better, the impression of a user is improved, the color space of the HSV can express the brightness, tone and vividness of color very intuitively, the HSV can be adjusted more easily and accurately, and the effect of the atmosphere lamp can be effectively improved.

In another optional embodiment, besides acquiring HSV values of the screen area, it is also possible to acquire YUV values of the screen area, and convert the YUV values into RGB values, thereby controlling the atmosphere lamp.

YUV is a kind of color space (color space), in which "Y" represents brightness (Luma) and gray scale value, and "U" and "V" represent Chroma (Chroma) for describing image color and saturation, and is used to specify the color of a pixel.

Because YUV is often used to encode analog signals for computer and television screens, the method of converting YUV into RGB by capturing it is effective when color acquisition is performed on some computer or television displays.

When the atmosphere lamp is controlled, the detection of the screen area may be affected by the light emission of the atmosphere lamp, an invalid mask may be generated by collecting the flicker frequency of the atmosphere lamp, and finally the temporary mask is different from the invalid mask to obtain the final output screen area. The following examples will be explained in detail.

Referring to fig. 3, fig. 3 is a schematic flow chart of another embodiment of an atmosphere lamp control method provided in the present application, where the embodiment includes:

301. collecting the flicker frequency of the atmosphere lamp through a sampling camera, and generating an invalid mask according to the flicker frequency;

the method provided by the application is used for detecting the screen area of the display, for example, when the atmosphere lamp is used, the screen area of the display needs to be collected through the camera, and the screen area of the display can be accurately collected through the method provided by the application, so that the color sampling can be accurately carried out on the display, and the atmosphere lamp can be better controlled to emit light with corresponding colors.

The atmosphere lamp is generally arranged in an outer edge area behind a display or a corresponding rear area, the atmosphere lamp emits light and shines when in work, and when a sampling camera detects a screen, the detection of the sampling camera is possibly influenced, so that the detected screen area is inaccurate.

The atmosphere lamp device is turned on, and after the sampling camera is turned on, the turning-on in the application means that the display is in a display state, the lamp strip of the atmosphere lamp flickers according to specified frequency, the region with the change frequency meeting the flicker frequency of the lamp strip in the picture is detected, and the region is stored as an invalid mask. Thus, the area of the atmosphere lamp is recorded, and phase difference of other masks is convenient to follow.

302. When the display is in a display state, acquiring the current picture change area range of the display through the sampling camera;

303. generating a temporary mask according to the range of the current picture change region, wherein the temporary mask is a region in the range of the picture change region;

steps 302 to 303 in this embodiment are similar to steps 201 to 202 in the previous embodiment, and are not described again here.

304. The temporary mask and the invalid mask are subjected to phase difference, and the temporary mask after phase difference is determined as an output screen area;

305. acquiring a first HSV value of a target area in the screen area;

306. and generating an RGB value according to the first HSV value, and controlling the atmosphere lamp according to the RGB value.

Steps 305 to 306 in this embodiment are similar to steps 204 to 205 in the above embodiment, and are not described again here.

And (3) the temporary mask is subjected to phase difference with the invalid mask, namely, a part of the area overlapped with the invalid mask is removed, other areas are reserved, and the temporary mask after phase difference is determined as the output screen area. The accuracy of the finally output screen area is improved, the interference of the change of the environment on the detection of the screen area can be effectively reduced, and the detection accuracy of the screen area is effectively improved. So as to better take colors of the screen, thereby better controlling the light of the corresponding color emitted by the atmosphere lamp.

In practical applications, after the display is turned on, the screen image may be changed, and if the display is not turned on, the temporary mask may not be obtained, and in order to satisfy more usage scenarios, before the display is turned on, the rough mask may be generated according to the rough screen region, so that even if the display is not turned on, the screen region may be output, and the sampling camera needs to determine whether the display is turned on, specifically, the following embodiments will be described in detail.

Referring to fig. 4, fig. 4 is a schematic flow chart of another embodiment of an atmosphere lamp control method provided in the present application, where the embodiment includes:

401. a coarse screen region of the display is acquired by a sampling camera and a coarse mask is generated from the coarse screen region.

The method includes the steps of acquiring a rough screen area of a display through a sampling camera, and generating a rough mask according to the rough screen area, wherein the rough screen area can be obtained by roughly dividing an image into areas, for example, according to a picture shot by the sampling camera, roughly dividing a horizontal line in the picture, marking the rough screen area as the rough mask when the horizontal line is below the horizontal line and the environment area is above the horizontal line, and roughly recording the screen area of the display through the rough mask.

402. Judging whether the display is in a display state or not according to the color and/or the brightness of the pixel points in the rough mask, and judging whether the display is in the display state or not;

judging whether the display is started or not according to the color or the brightness of the pixel points in the rough mask or according to the color and the brightness, specifically, calculating the number of the pixel points with the brightness or the color below the horizontal line larger than a threshold value a, wherein the threshold value a may refer to each value of an RGB channel when judged by the color, and the threshold value a may be an average value of RGB when judged by the brightness. If the number is less than a certain number threshold, the screen is considered to be unlit, and if the number threshold is reached, the display is considered to be in the display state. If the display is already in the display state, step 403 is performed.

If the display is not in the display state, step 407 is performed.

If the display is not in the display state, the coarse mask can be determined as the output screen area because the temporary mask cannot be obtained, which ensures that the sampling camera can complete the color sampling immediately after the display is turned on.

403. When the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

404. generating a temporary mask according to the range of the current picture change area;

steps 403 to 404 in this embodiment are similar to steps 201 to 202 in the previous embodiment, and are not described again here.

405. Determining an effective area of the temporary mask;

the determination of the output screen region by combining the temporary mask and the invalid mask may be performed according to an effective area of the temporary mask, and specifically may be, first, determining the effective region of the temporary mask, for example, performing binarization processing on the temporary mask, where in the binarization processing, the gray level of a pixel point whose gray value is greater than a certain threshold is set to 255, the gray level of a pixel point whose gray value is less than the threshold is set to 0, and then performing processing such as etching and expansion on the binarized temporary mask to eliminate noise and voids, so that the effective region is a region composed of pixel points whose gray value is 255.

And further judging the area of the effective area, if the area of the effective area reaches a preset first area threshold value, regarding the temporary mask as an effective mask, and comparing the temporary mask with the invalid mask, and determining the differential temporary mask as an output screen area, thus obtaining the screen area of the display.

406. And if the effective area of the temporary mask is larger than or equal to the preset first area threshold, determining the output screen area according to the temporary mask.

If the effective area of the temporary mask is smaller than the preset first area threshold, step 407 is executed.

If the area of the effective region of the temporary mask cannot reach the first area threshold, it is indicated that the area of the effective region is small, and the screen region may not be accurately represented, then the coarse mask may be used as the output screen region, and at this time, the area of the temporary mask is small, so the accuracy of the coarse mask is high.

407. If the effective area of the temporary mask is smaller than a preset first area threshold, determining the rough mask as an output screen area;

408. acquiring a first HSV value of a target area in the screen area;

409. and generating an RGB value according to the first HSV value, and controlling the atmosphere lamp according to the RGB value.

Steps 408 to 409 in this embodiment are similar to steps 204 to 205 in the above embodiment, and are not described again here.

The rough mask is used as the output screen area, so that the sampling of screen colors can be completed by the sampling camera when the temporary mask cannot be obtained or is inaccurate, the atmosphere lamp meets more application scenes, and the user experience is greatly improved.

In practical applications, the time for generating the temporary mask may be when a first update period is reached after the display is turned on, and further, if the current time exceeds the first update period, in order to further improve the accuracy of detecting the screen region, the screen region may be re-detected, and the mask may be re-generated to re-output the screen region. The following examples will be described in detail.

Referring to fig. 5, fig. 5 is a schematic flowchart of an embodiment of an atmosphere lamp control method provided in the present application, where the embodiment includes:

501. acquiring a rough screen area of a display through a sampling camera, and generating a rough mask according to the rough screen area;

502. judging whether the display is in a display state according to the color and/or the brightness of the pixel points in the rough mask, judging whether the display is in the display state, and if so, executing a step 503; if not, go to step 511;

503. when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

504. generating a temporary mask according to the range of the current picture change area;

steps 501 to 504 in this embodiment are similar to steps 401 to 404 in the previous embodiment, and are not described again here.

505. And determining the output screen area according to the temporary mask.

The output screen area may be determined according to the temporary mask in various ways, for example, the temporary mask may be directly determined as the output screen area, and further, the final output screen area may be obtained by overlapping or phase difference with other masks. Or determining the output screen area according to the area of the effective area of the temporary mask, if the area of the effective area reaches a certain threshold value, outputting the temporary mask as the screen area or combining the temporary mask with other masks as the screen area, and if the area of the effective area is too small, not outputting the mask or outputting other masks.

506. Acquiring the current picture change area range of the display through a sampling camera, and generating a temporary updating mask according to the current picture change area range;

the method comprises the steps of collecting a current picture change area range of a display through a sampling camera, generating a temporary updating mask according to the picture change area range, wherein the collection time can be that when the collection time exceeds a first period after the display is started, the temporary updating mask can be generated through picture superposition, for example, the number of pixel points with brightness or color larger than a certain threshold b is calculated by using the inter-frame difference between a picture of a previous frame and a picture of a current frame, the threshold b can be a preset value, if the number reaches a certain number threshold, the pixel points with brightness or color larger than the threshold b are superposed on the previously generated temporary updating mask, if the number is smaller than the threshold, the temporary updating mask is not superposed, the value of the temporary updating mask in an initial state can be 0, and the specific superposition can be according to the positions of the pixel points with brightness or color larger than the threshold b, and adding a fixed threshold value x at the corresponding position of the temporary updating mask, wherein the fixed threshold value x is not more than 255, and obtaining the final temporary updating mask through continuous image superposition when the images are changed. And temporarily updating the mask to obtain a region with a value of 0 and a region with a value of non-0, wherein the region with the value of 0 is a static region, and the region with the value of non-0 is a non-static region.

507. Determining an effective area of a temporary updating mask;

when the output screen area needs to be determined, the final output screen area can be determined according to the effective area of the temporary updating mask, the effective area of the temporary updating mask is determined firstly, the determination method of the effective area can be that the temporary updating mask is subjected to binarization processing, in the binarization processing, the gray level of the pixel point with the gray level value larger than a certain threshold value is set to be 255, the gray level of the pixel point with the gray level value smaller than the threshold value is set to be 0, then the temporary updating mask after binarization is subjected to corrosion, expansion and other processing to eliminate noise and holes, and then the effective area is the area formed by the pixel points with the gray level value of 255.

508. Determining a last output screen area;

according to the method, before the temporary updating mask is generated, the output screen area is an area obtained according to two types of masks, namely a rough mask and a temporary mask, after a display is in a display state, if the area of an effective area of the temporary mask is small, the rough mask is output, if the area of the effective area of the temporary mask reaches a first area threshold value, the output screen area is determined according to the temporary mask, for example, the difference between the temporary mask and an invalid mask is obtained, and therefore the output screen area is determined. At this time, it is determined whether the last output is a screen region obtained according to the coarse mask or the temporary mask, and if the output is the coarse mask, step 509 is executed; if it is a temporary mask, then step 510 is performed.

509. And determining the output screen area according to the area of the effective area of the temporary updating mask.

If the last output screen area is the rough mask, determining the output screen area according to the effective area of the temporary update mask, wherein the effective area of the temporary update mask may be smaller at the moment, specifically, judging the area of the temporary update mask; if the area of the temporary updating mask is larger than or equal to the second area threshold, the area of the effective area of the temporary updating mask is larger at the moment, and the screen area can be accurately represented, and the difference value between the temporary updating mask and the invalid mask is determined as the output screen area; if the area of the temporary updating mask is smaller than the second area threshold, the area of the temporary updating mask is smaller at the moment, and the screen area cannot be accurately represented, and the rough mask is output as the screen area.

510. And superposing the temporary updating mask on the temporary mask, and determining the output screen area according to the superposed temporary mask.

If the last output screen region is obtained according to the temporary mask, the output screen region is determined according to the superimposed temporary mask, and the specific method may refer to step 103, for example, the screen region obtained according to the difference between the temporary mask and the invalid mask indicates that the temporary mask has higher accuracy than the rough mask, and then the temporary update mask is superimposed on the temporary mask, and the superimposed temporary mask is used as the output screen region.

Specifically, the superposition method may be to traverse the pixel values on the temporary mask and retain the pixel values of 255 on the temporary mask. If a region having a pixel value of 0 is found on the temporary mask, but a region having a pixel value of 255 is found on the temporary update mask, the region on the temporary mask is updated to 255. If a region with a pixel value of 0 is found on the temporary mask and the pixel value of the corresponding region on the temporary update mask is also 0, the region on the temporary mask does not need to be updated, and if a region with a pixel value of 255 is found on the temporary mask and the pixel value of the corresponding region on the temporary update mask is 255, the region does not need to be updated.

Through overlapping the temporary mask and the temporary updating mask, a more accurate screen area can be output, so that the screen area is continuously updated in the use process of the display, the detected screen area is more and more accurate, the accuracy of the screen area detection is greatly improved, and the user experience is improved.

511. The coarse mask is determined as the screen area of the output.

The rough mask is used as the output screen area, so that the sampling of screen colors can be completed by the sampling camera when the temporary mask cannot be obtained or is inaccurate, the atmosphere lamp meets more application scenes, and the user experience is greatly improved.

512. Acquiring a first HSV value of a target area in the screen area;

513. and generating an RGB value according to the first HSV value, and controlling the atmosphere lamp according to the RGB value.

Steps 512 to 513 in this embodiment are similar to steps 204 to 205 in the above embodiment, and are not described again here.

In practical application, the atmosphere lamp may have a plurality of atmosphere lamp units, so that different atmosphere lamps may be controlled to emit light by collecting colors of different regions, and when the first HSV value of the target region in the screen region is collected, the collection may be performed according to the position, size, and the like of the atmosphere lamp, for example, the screen region is divided into a plurality of sub-regions, each of which has a corresponding atmosphere lamp unit, so that the corresponding atmosphere lamp unit is controlled according to the RGB value corresponding to the sub-region. The following examples will be explained in detail.

Referring to fig. 6, fig. 6 is a schematic flowchart of another embodiment of an atmosphere lamp control method provided in the present application, where the embodiment includes:

601. when the display is in a display state, acquiring the current picture change area range of the display through a sampling camera;

602. generating a temporary mask according to the range of the current picture change area, wherein the temporary mask is an area in the range of the picture change area;

603. determining an output screen area according to the temporary mask;

604. dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

the screen area is divided into a plurality of sub-areas according to a preset mapping relationship, the preset mapping relationship may be, for example, a binding relationship input in advance by a user, after the user installs the atmosphere lamp, codes of several key atmosphere lamp units may be input into the controller, and the controller may generate a complete mapping relationship between each sub-area and the atmosphere lamp unit. Then, after the screen area is determined, the screen area may be divided into sub-areas according to the mapping relationship.

605. Respectively acquiring first HSV values of the subregions;

after the screen area is divided, the first HSV value of each sub-area is respectively obtained.

606. And generating corresponding RGB values according to the first HSV values of the sub-regions, and controlling the corresponding atmosphere lamp units according to the RGB values.

And controlling the corresponding atmosphere lamp units according to the RGB values corresponding to the sub-regions and the mapping relation.

In practice, each atmosphere lamp unit emits light independently, and the light emission color of each atmosphere lamp unit is matched with the color of the corresponding sub-area, so that in order to obtain good impression effect, when area division is carried out, the length of each sub-area can be matched with the length of the atmosphere lamp unit, and the matching comprises the same length or close to the same length.

In the embodiment, the screen area is divided through the pre-established mapping relation, so that the independent atmosphere lamp units can be controlled to emit light, the appearance can be further improved, meanwhile, the atmosphere lamp units can be accurately controlled, and a good actual effect is achieved.

The above embodiments describe the ambience lamp control method provided in the present application in detail, and the ambience lamp control device and the storage medium provided in the present application are described below.

Referring to FIG. 7, the present application provides an ambience lamp control device, including:

the first acquisition unit 701 is used for acquiring the current picture change area range of the display through the sampling camera after the display is in a display state;

a determining unit 702, configured to determine an output screen area according to the picture change area range;

the generating unit 703 is configured to generate RGB values of the screen region, and control the ambience lamp according to the RGB values.

Optionally, the generating unit 703 is specifically configured to:

acquiring a first HSV value of a target area in the screen area;

and generating an RGB value according to the first HSV value.

Optionally, the generating unit 703 is specifically configured to:

adjusting the first HSV value to obtain a second HSV value, wherein the saturation of the second HSV value is higher than that of the second HSV value;

converting the second HSV value to an RGB value.

Optionally, the atmosphere lamp includes at least two atmosphere lamp units, and the generating unit 703 is specifically configured to:

dividing the screen area into at least two sub-areas according to a preset mapping relation, wherein the mapping relation is the mapping relation between the sub-areas and the atmosphere lamp unit;

and respectively acquiring first HSV values of the sub-regions.

Optionally, the length of the sub-region matches the length of the ambience light unit.

Optionally, the determining unit 702 is specifically configured to:

generating a temporary mask according to the range of the current picture change region, wherein the temporary mask is a region in the range of the picture change region;

and determining the output screen area according to the temporary mask.

Optionally, the determining unit 702 is specifically configured to:

determining an effective area of the temporary mask;

and if the effective area of the temporary mask is larger than or equal to a preset first area threshold, determining an output screen area according to the temporary mask.

Optionally, the apparatus further comprises:

a second acquisition unit 704 for:

and acquiring a rough screen area of the display through the sampling camera, and generating a rough mask according to the rough screen area, wherein the rough screen area is obtained by carrying out area division on a sampling image of the sampling camera.

Optionally, the determining unit 702 is specifically configured to:

and if the effective area of the temporary mask is smaller than a preset first area threshold, determining the rough mask as an output screen area.

Optionally, the apparatus further comprises:

a determining unit 705, configured to:

and judging whether the display is in a display state or not according to the color and/or the brightness of the pixel points in the rough mask, and if not, determining the rough mask as an output screen area.

Optionally, the apparatus further comprises:

an updating unit 706 configured to:

acquiring the current picture change area range of the display through the sampling camera, and generating a temporary updating mask according to the current picture change area range;

determining an effective area of the temporary update mask;

determining a last output screen area;

when the last output screen area is obtained according to the rough mask, determining the output screen area according to the area of the effective area of the temporary updated mask;

and when the last output screen area is obtained according to the temporary mask, overlapping the temporary updating mask on the temporary mask, and determining the output screen area according to the overlapped temporary mask.

Optionally, the updating unit 706 is specifically configured to:

judging the area of the temporary updating mask;

if the area of the temporary updating mask is larger than or equal to a second area threshold, determining an output screen area according to the temporary updating mask;

and if the area of the temporary updated mask is smaller than the second area threshold, outputting the rough mask as a screen area.

Optionally, the updating unit 706 is specifically configured to:

binarizing the temporary updating mask;

and determining the area larger than the preset gray value as an effective area according to the temporary updated mask after binarization.

Optionally, the determining unit 702 is specifically configured to:

and processing the images of two adjacent frames according to an inter-frame difference method to generate a temporary mask.

Optionally, the apparatus further comprises:

third acquisition unit 707

Collecting the flicker frequency of the atmosphere lamp through a sampling camera, and determining an invalid mask in a sampling picture of the sampling camera according to the flicker frequency;

the determining the output screen area according to the temporary mask includes:

and the temporary mask is different from the invalid mask, and the different temporary mask is determined as an output screen area.

The application also provides an atmosphere lamp control device, includes:

a processor 801, a memory 802, an input/output unit 803, a bus 804;

the processor 801 is connected to a memory 802, an input/output unit 803, and a bus 804;

memory 802 holds a program that processor 801 invokes to perform any of the atmosphere control methods described above.

The present application also relates to a computer-readable storage medium having a program stored thereon, characterized in that the program, when run on a computer, causes the computer to perform any of the above atmosphere light control methods.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图书馆智慧照明系统及其控制方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!