CN117796152A - Lighting effect control method, electronic equipment and storage medium - Google Patents

Lighting effect control method, electronic equipment and storage medium Download PDF

Info

Publication number
CN117796152A
CN117796152A CN202380013120.2A CN202380013120A CN117796152A CN 117796152 A CN117796152 A CN 117796152A CN 202380013120 A CN202380013120 A CN 202380013120A CN 117796152 A CN117796152 A CN 117796152A
Authority
CN
China
Prior art keywords
target
color
image
light emitting
emitting units
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202380013120.2A
Other languages
Chinese (zh)
Inventor
明杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mango Technology Innovation Co ltd
Original Assignee
Shenzhen Mango Technology Innovation Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mango Technology Innovation Co ltd filed Critical Shenzhen Mango Technology Innovation Co ltd
Publication of CN117796152A publication Critical patent/CN117796152A/en
Pending legal-status Critical Current

Links

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

A light effect control method, an electronic device (10) and a storage medium, wherein the method is applied to the electronic device (10), and the method comprises the following steps: acquiring an image displayed on a user interaction interface of the electronic device (10) (S201); dividing the image to obtain a corresponding target image, wherein the target image comprises a plurality of grids, and determining at least one target grid from the grids (S202); calculating the color ratio of each type of color in each target grid, and determining the color corresponding to the maximum color ratio as the target color of the corresponding target grid (S203); based on the target color corresponding to each target mesh, a plurality of light emitting units (21) in the lighting device (20) are controlled to update the currently displayed color to the corresponding target color (S204). The display effect of the light emitting unit (21) of the lighting device (20) can be improved.

Description

Lighting effect control method, electronic equipment and storage medium
Technical Field
The application relates to the technical field of lighting, in particular to a light effect control method, electronic equipment and a storage medium.
Background
An atmosphere lamp is a lighting device which can play a role in decoration and can be installed on a vehicle, in a room or in other places where atmosphere needs to be created. There are many beads in the atmosphere lamp, each bead can show different colors, at present, the screen color that control equipment shows is usually gathered, through the red green blue (RedGreenBlue, RGB) value of all pixel points in the screen color of each frame, calculate the average value of colour, the bead in the control atmosphere lamp shows the average value of this colour, however, this kind of calculation mode can cause the colour that the atmosphere lamp shows to have great difference with the screen colour that shows, influence the light effect that the atmosphere lamp shows, because the average value of colour shows, can appear the unusual colour beyond the colour that the screen shows, do not belong to the user sees any of colour in the screen, lead to the distortion seriously, user experience feels poor.
Disclosure of Invention
The embodiment of the application discloses a light effect control method, electronic equipment and a storage medium, which solve the technical problem that the light color displayed by lighting equipment is inconsistent with the screen color of a user interaction interface.
The application provides a light effect control method, which is applied to electronic equipment, and comprises the following steps: acquiring an image displayed on a user interaction interface of the electronic equipment; dividing the image to obtain a corresponding target image, wherein the target image comprises a plurality of grids, and determining at least one target grid from the grids; calculating the color ratio of each type of color in each target grid, and determining the color corresponding to the maximum color ratio as the target color of the corresponding target grid; based on the target color corresponding to each target grid, a plurality of light emitting units in the lighting device are controlled to update the currently displayed color to the corresponding target color.
In some alternative embodiments, after the calculating the color duty cycle of each class of colors within each target grid, the method further comprises: and if the color ratio of at least two types of colors is the maximum and the same, arbitrarily selecting one color from the at least two types of colors to determine the target color.
In some alternative embodiments, the image is a red, green, blue, RGB, image, the method further comprising: and converting the RGB image into a preset image.
In some optional embodiments, a pixel coordinate system corresponding to the preset image is established; acquiring a pixel coordinate set of a target color corresponding to each target grid of the preset image; determining RGB values for the target color based on the set of pixel coordinates; and controlling a plurality of light emitting units in the lighting device to update the RGB value of the current color to the RGB value of the target color.
In some optional embodiments, the determining the RGB values of the target color based on the set of pixel coordinates includes: calculating an RGB three-channel average value of the pixel corresponding to the target color based on the pixel coordinate set; and determining the RGB three-channel average value as the RGB value.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of the at least one target grid is determined to be equal to the number of the plurality of light emitting units from the plurality of grids, controlling the plurality of light emitting units to dynamically display the target colors of the corresponding target grids in the target images corresponding to the multi-frame images.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of at least one target grid is determined to be greater than the number of the light emitting units from the multiple grids, controlling each light emitting unit to dynamically display the target color of the designated target grid in the target image corresponding to the multi-frame image according to the preset display sequence.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of at least one target grid is determined to be smaller than the number of the light-emitting units from the multiple grids, controlling the multiple light-emitting units to display target colors of the corresponding target grids in the target images corresponding to the multi-frame images according to a preset display rule.
The application also provides electronic equipment, which comprises a processor and a memory, wherein the processor is used for realizing the light effect control method when executing the computer program stored in the memory.
The application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the light effect control method when being executed by a processor.
In the lighting effect control method provided by the application, the image displayed on the user interaction interface is preprocessed, the image is divided into a target image comprising a plurality of grids, at least one target grid is determined from the grids, and the target color in each target grid is calculated so as to control each lighting unit of the lighting device to correspondingly display the target color of each target grid, wherein the target color is obtained by adopting a mode of calculating the color ratio in the process of extracting the color, the extracted color is the color actually displayed on the user interaction interface, the target color can be controlled to be displayed by the lighting device, and the display effect of the lighting device is ensured to a certain extent.
Drawings
Fig. 1 is an application environment architecture diagram of a light effect control method provided in an embodiment of the present application.
Fig. 2 is a flowchart of a light effect control method provided in an embodiment of the present application.
Fig. 3 is a flowchart of a light effect control method according to another embodiment of the present application.
Fig. 4 is a schematic diagram of light effect control provided in an embodiment of the present application.
Fig. 5 is a schematic diagram of light effect control according to another embodiment of the present application.
Fig. 6 is a schematic structural diagram of a light effect control device according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For ease of understanding, a description of some of the concepts related to the embodiments of the present application are given by way of example for reference.
It should be noted that "at least one" in this application means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
An atmosphere lamp is a lighting device which can play a role in decoration and can be installed on a vehicle, in a room or in other places where atmosphere needs to be created. There are many beads in the atmosphere lamp, each bead can show different colors, at present, the screen color that control device shows is usually collected, through the Red Green Blue (RGB) value of all pixel points in the screen color of each frame, calculate the average value of color, the bead in the control atmosphere lamp shows the average value of this color, however, this kind of calculation mode can cause the color that the atmosphere lamp shows to have great difference with the screen color that shows, influence the light effect that the atmosphere lamp shows, because the average value of color shows, the unusual color that can appear outside the color that the screen shows, do not belong to the user sees any of color in the screen, lead to the distortion seriously, user experience feels poor.
In order to better understand the light effect control method, the electronic device and the storage medium provided by the embodiment of the application, an application scenario of the light effect control method is first described below.
Fig. 1 is an application environment architecture diagram of a light effect control method provided in an embodiment of the present application. The light effect control method provided by the embodiment of the application is applied to the electronic device 10, the electronic device 10 can establish communication connection with a plurality of lighting devices 20, the communication connection mode can be a wired network or a wireless network, wherein the wired network can be any one of a local area network, a metropolitan area network and a wide area network, and the wireless network can be any one of a Bluetooth (Bluetooth Technology), a wireless local area network (Wireless Fidelity, wi-Fi), near field communication (Near Field Communication, NFC), an ad hoc network wireless communication (ZigBee Wireless Networks, zigBee) technology, an infrared data organization (Infrared Data Association, irDA) technology, an Ultra Wideband (UWB) technology, a wireless universal serial bus (Universal Serial Bus, USB) and the like.
The electronic device 10 may be any device having a user interaction interface, such as a computer device, a cell phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), etc. The electronic device 10 may include, but is not limited to, a display screen 11, the display screen 11 for displaying a user interaction interface that may be used to display various types of images.
The lighting device 20 may be a luminaire having a plurality of different display colors. The lighting device 20 may include, but is not limited to, a plurality of light emitting units 21, and the light emitting units 21 may be beads, and colors displayed by the plurality of light emitting units 21 are controlled by the electronic device 10.
The schematic diagram 1 is merely an example of the electronic device 10, and is not meant to limit the electronic device 10, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device 10 may also include input-output devices, network access devices, etc.
Referring to fig. 2, fig. 2 is a flowchart of a light effect control method according to an embodiment of the present application, which is applied to an electronic device (e.g., the electronic device 10 of fig. 1). The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
Step S201, an image displayed on a user interface of the electronic device is acquired.
In some embodiments of the present Application, the User Interface (UI) may be an Interface provided by an Application program (for example, application (APP)), or may be a main Interface of an electronic device (for example, a computer device, a mobile phone, a tablet, a remote control device, etc.), or may be an Interface accessed after clicking a desktop icon of the electronic device, which is not limited in practical Application. The information displayed by the user interaction interface can be displayed in the forms of images, characters, colors and the like, and the application is not limited.
For example, in an example, an electronic device is taken as an example of a mobile phone, an APP capable of controlling lighting colors of a lighting device (such as a luminaire) is installed on the mobile phone, and a user interaction interface is an interface provided by the APP for controlling the lighting device. The user lights the display screen of the mobile phone, and clicks the APP of the lighting equipment to enter the user interaction interface, so that the user interaction interface can display a static picture or a video, and the application is not limited to the static picture or the video.
For example, in another example, an electronic device is taken as an example of a computer, a desktop icon with a function of controlling a lighting device is installed on the computer, and an interface for controlling the desktop icon of the lighting device to enter is a user interaction interface by clicking, and similarly, the user interaction interface may display a still picture or a video.
In other embodiments of the present application, the user interaction interface may also be an interface that is arbitrarily displayed by the electronic device during an operation process, for example, after the electronic device establishes a communication connection with the lighting device, the main interface of the electronic device is used as the user interaction interface for controlling the color of the lighting device, or an interface that is displayed in real time by the electronic device during the operation process is used as the user interaction interface.
In some embodiments of the present application, the electronic device may collect an image displayed by the user interaction interface, where the image may be an image frame displayed by the user interaction interface at any time, and is used to extract and control a color of the lighting device, where the image displayed by the user interaction interface may be a RGB image, and the RGB image is a color image formed by three color channels of red, green and blue, and a change of the color channels and a superposition of the color channels may obtain different colors.
Step S202, dividing the image to obtain a corresponding target image, wherein the target image comprises a plurality of grids, and determining at least one target grid from the grids.
In some embodiments of the present application, the electronic device may divide the RGB image into the target image including a plurality of grids, and the number of the divided grids is not limited, and may be two or more.
In some embodiments of the present application, to obtain the color attribute of the RGB image, the RGB image may be converted into a preset image, where the preset image may be any one color model of hue saturation brightness HSV image, digital image HSI, chrominance image HSB, and color image CMY/CMYK.
In an example, taking a preset image as a Hue Saturation brightness HSV image as an example, the HSV image is a color model based on three channels of Hue (Hue), saturation (Saturation) and brightness (Value), which may also be referred to as a hexagonal pyramid model. In the HSV color model, hue channels represent the type or kind of color, saturation channels represent the purity or shade of color, and brightness channels represent the shade of color. The electronic device may divide the HSV image into target images including a plurality of meshes, the plurality of meshes may be at least two or more meshes, and at least one target mesh may be determined from the plurality of meshes for controlling the lighting device.
In step S203, the color ratio of each type of color in each target grid is calculated, and the color corresponding to the maximum color ratio is determined as the target color of the corresponding target grid.
In some embodiments of the present application, the electronic device may calculate the hue, saturation, and brightness of each pixel in each target grid in the preset image, and divide the colors in the target grids into corresponding color categories, where the color categories may include black, gray, white, red, orange, yellow, green, and cyan, and the practical application is not limited thereto.
In some embodiments of the present application, a preset image is described as an HSV image. Each color has a corresponding HSV range, the HSV range settings of each color are different to distinguish different color categories, and the HSV range settings of each color can be represented by a general formalized formula as follows:
H low ≤H≤H high
S low ≤S≤S high
V low ≤V≤V high
wherein H represents hue, H low Representing the minimum value of hue, H high Represents the maximum value of hue, S represents saturation, S low Representing the minimum value of saturation, S high Maximum value of saturation, V brightness, V low Representing the minimum value of brightness, V high Representing the maximum value of the brightness.
In another example, the HSV ranges of different color categories may be as shown in table 1, table 1 being the HSV range for each color, if a pixel is detected to satisfy the HSV range for the corresponding color, the pixel may be determined to be the corresponding color.
TABLE 1
In some embodiments of the present application, the electronic device may determine, using the HSV model, an HSV value corresponding to each pixel in each target mesh, and determine, according to the determined HSV values and the HSV ranges shown in table 1, a color class of the pixels in the target mesh, for example, in an example, if the HSV value is detected to be in the HSV range of blue, the pixel of the HSV value is determined to be blue. In other examples, if an HSV value is detected that does not belong to any HSV range, the pixel may be set to invalid data, or other custom blended colors, which is not limited in this application.
In some embodiments of the present application, after determining the color classes in the target grids, the color duty cycle of each class of color in each target grid may be calculated, where the color duty cycle represents the ratio of the number of pixels occupied by any class of color in any target grid to the total number of pixels occupied by all colors in the target grid, for example, in an example, red, blue, and orange are included in the grid, and traversing the entire target grid results in 30 pixels belonging to red, 20 pixels belonging to blue, and 50 pixels belonging to orange, thereby calculating a red duty cycle of 30%, a blue duty cycle of 20%, and an orange duty cycle of 50%.
In other embodiments, the preset image may be further converted into any one color model of the digital image HSI, the chrominance image HSB, and the color image CMY/CMYK, so as to calculate the color duty ratio, which will not be described herein.
In some embodiments of the present application, in order to propose a color actually displayed by an image from each target grid, a color with a maximum color ratio may be determined as a target color of the corresponding target grid, for example, in an example, a red color ratio of 30%, a blue color ratio of 20% and an orange color ratio of 50% exist in the target grid, and then an orange color is taken as the target color of the target grid. In some embodiments of the present application, if there are at least two types of colors having the same color ratio and the maximum color ratio, any color selected from the at least two types of colors is determined as the target color.
For example, in one example, there is a red color ratio of 40%, a blue color ratio of 40%, an orange color ratio of 10%, and a yellow color ratio of 10% in the target mesh, and the orange color and the yellow color ratio are the same, but the orange color and the yellow color ratio are smaller than the red color and the blue color ratio, so the red color and the blue color ratio are the colors with the largest mesh color ratio, and either one of the red color and the blue color can be selected as the target color, and the target color can be red or blue.
In another example, the target color may be determined according to the highest color intensity corresponding to the RGB value, for example, red RGB value is (200,0,0), highest color intensity is 200, blue RGB value is (0,0,210), and highest color intensity is 210, and then the target color determined according to the highest color of the RGB values is blue. In other embodiments, the target color may also be determined according to the lowest color intensity, which is not limited in this application.
Step S204, based on the target color corresponding to each target grid, controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color.
In some embodiments of the present application, based on the target color corresponding to each target grid, the RGB value of the target color corresponding to each target grid may be calculated, where the RGB value represents the brightness value of the color on the three red, green, and blue channels, specifically: based on the HSV image, a pixel coordinate system is established, a pixel coordinate set of a target color corresponding to each target grid in the HSV image is obtained, and the pixel coordinate set represents a coordinate set of a pixel with the target color in the target grid in the pixel coordinate system. The RGB values of the target color can be calculated according to the pixel coordinate set (such as HSV values in table 1), specifically: the method comprises the steps of calculating an average value of RGB three channels of pixels corresponding to a target color according to a pixel coordinate set, wherein the average value of RGB three channels of pixels corresponding to the target color is initialized to 0, traversing each pixel coordinate in the pixel coordinate set, obtaining RGB three channel values of each pixel coordinate, accumulating pixel values of each channel to obtain channel total values of each channel, for example, the R channel total value, the G channel total value and the B channel total value, obtaining the number of pixels combined into the pixel coordinate set, calculating the average value of RGB three channels based on the channel total value of each channel and the number of pixels, for example, R_avg=sum (Ri)/N, wherein R_avg represents the R channel average value, sum (Ri) represents the R channel total value, N represents the number of pixels, G_avg=sum (Gi)/N, G_avg represents the G channel average value, sum (Bi)/N, B_avg represents the B channel average value, sum (Bi) represents the B channel average value, and B_avg represents the number of pixels, and the average value of R_avg can represent the R_avg. In some embodiments of the present application, the electronic device is communicatively connected to the lighting device, and after the electronic device calculates the target color of each target grid, each light emitting unit in the lighting device may have a corresponding target grid, and based on the target color of the target grid, the plurality of light emitting units of the lighting device are controlled to update the currently displayed color to the corresponding target color. In another example, the RGB values of the current color of the plurality of light emitting units of the lighting device may be controlled to be updated to the RGB values of the target color based on the RGB values of the target color of the target grid.
For example, in an example, it is determined that 4 grids are target grids from a plurality of grids of a target image, the target color of the target grid 1 is red, the target color of the target grid 2 is blue, the target color of the target grid 3 is green, the target color of the target grid 4 is yellow, the light emitting unit 1 of the lighting apparatus is controlled to display red, the light emitting unit 2 is displayed blue, the light emitting unit 3 is displayed green, and the light emitting unit 4 is displayed yellow. The above is merely an example, and the display situation of the lighting device may be specifically set for different environments.
In other embodiments of the present application, the image of the target color calculated by the electronic device may be a video frame of a video, and the electronic device may calculate the target color corresponding to each grid of each video frame, so that the light color of the lighting device may dynamically change along with the change of the video.
In the related art, a weighted average of all pixels in a target grid is generally calculated as a target color of the target grid, for example, a target grid includes a green color of RGB (57,255,20) and an orange color of RGB (245,157,57), and RGB values of the green color and the orange color are calculated to obtain a yellow-green color of RGB (141,211,35), and obviously, the yellow-green color is not included in the color actually displayed by the target grid. In the embodiment of the application, if the target grid includes green with RGB (57,255,20) and orange with RGB (245,157,57) and the color ratio of green is greater than orange, the green is taken as the target color of the target grid, and the RGB average value of green is calculated (59,255,21). Compared with the related art, the target color calculated by the embodiment of the application is closer to the color displayed by the user interaction interface.
In the embodiment of the application, by determining the color of each pixel in the target image to obtain the color ratio of each type of color, the target color can be extracted from the colors actually displayed by the electronic device, wherein the target color of the target grid is the color with the largest color ratio in the grid. After the target color is obtained, the electronic device can control the lighting device to display a plurality of target colors of a plurality of target grids, and the color displayed by the lighting device can be ensured to be the color actually displayed by the image, so that the lighting effect displayed by the lighting device is enough and real.
Referring to fig. 3, fig. 3 is a flowchart of a light effect control method according to another embodiment of the present application. Since different lighting apparatuses may have different numbers of light emitting units, if the same electronic apparatus is used to control different lighting apparatuses, different display modes may be generated due to the number of light emitting units and the number of divided grids, based on this, an embodiment shown in fig. 3 is provided, and the embodiment shown in fig. 3 is an example of a specific implementation of step S205 shown in fig. 2, including the following steps:
step S301, determining the number of at least one target mesh from the plurality of meshes, and the number of light emitting units of the lighting device is acquired.
In some embodiments of the present application, the image may be divided into grids with different sizes according to different image sizes, and the image may be divided by presetting the size of the divided grids, which is not limited in the present application. After the image is gridded, at least one grid may be selected from among the plurality of gridded grids as a target grid. A plurality of light emitting units may be provided in the lighting device, for example, an atmosphere lamp, the number of light emitting units of different models of lighting devices may be different, and each light emitting unit may display a different color. When the electronic device establishes connection with the lighting device, the electronic device can receive the number of the light emitting units sent by the lighting device, and the electronic device can also receive the number of the light emitting units input by a user, so that the application is not limited.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating light effect control according to an embodiment of the present application.
For example, in an example, as shown in fig. 4, the target image may be divided into A, B, C, D four grids, while A, B, C, D four grids are determined as target grids, and the lighting device may be a light fixture, such as light fixture 1, light fixture 2, and light fixture 3 in fig. 4, wherein light fixture 1 includes 4 light emitting units, light fixture 2 includes 6 light emitting units, and light fixture 3 includes 2 light emitting units.
In step S302, it is determined whether the number of target grids is equal to the number of light emitting units.
In some embodiments of the present application, if the number of target grids is equal to the number of light emitting units, step S303 is performed, for example, as shown in fig. 4, the number of target grids is equal to 4, and the number of light emitting units of the luminaire 1 is equal to 4, then the number of target grids is equal to the number of light emitting units of the luminaire 1.
If the number of the target grids is not equal to the number of the light emitting units, step S304 is performed, for example, as shown in fig. 4, the number of the target grids is equal to 4, the number of the light emitting units of the lamp 2 is equal to 6, and the number of the light emitting units of the lamp 3 is equal to 2, the number of the grids is not equal to the number of the light emitting units of the lamp 2 and the lamp 3.
In step S303, if the number of the target grids is equal to the number of the light emitting units, the plurality of light emitting units are controlled to dynamically display the target colors of the corresponding target grids in the target images corresponding to the multi-frame images.
In some embodiments of the present application, if the number of the target grids is equal to the number of the light emitting units, the number of the light emitting units of the light fixture 1 may be the same as the number of the grids, as shown in fig. 4, so that the color of the first light emitting unit of the light fixture 1 may be controlled by using the target color corresponding to the target grid a, the color of the second light emitting unit of the light fixture 1 may be controlled by using the target color corresponding to the target grid B, the color of the third light emitting unit of the light fixture 1 may be controlled by using the target color corresponding to the target grid C, and the color of the fourth light emitting unit of the light fixture 1 may be controlled by using the target color corresponding to the target grid D. In other embodiments, the target grid and the light emitting unit may have other correspondence, which is not limited in the present application.
Step S304, it is determined whether the number of target grids is greater than the number of light emitting units.
In some embodiments of the present application, if the number of target grids is greater than the number of light emitting units, step S305 is performed, for example, as shown in fig. 4, the number of target grids is equal to 4, and the number of light emitting units of the luminaire 3 is equal to 2, and then the number of target grids is greater than the number of light emitting units of the luminaire 3.
If the number of the target grids is smaller than the number of the light emitting units, step S306 is performed, for example, as shown in fig. 4, the number of the target grids is equal to 4, and the number of the light emitting units of the luminaire 2 is equal to 6, the number of the target grids is smaller than the number of the light emitting units of the luminaire 2.
In step S305, if the number of target grids is greater than the number of light emitting units, each light emitting unit is controlled to dynamically display the target color of the designated target grid in the target image corresponding to the multi-frame image according to the preset display sequence.
In some embodiments of the present application, a display order may be set in the electronic device in advance, and the display order may be an order when the target mesh is divided.
For example, in some examples, when the number of target grids is greater than the number of light emitting units, the color of the lighting device may be controlled with a target color specifying the target grid. For example, in some examples, as shown in fig. 4, the luminaire 3 includes two light emitting units, 4 target grids, the target grid a and the target grid C may be designated target grids for controlling the color of the first light emitting unit of the luminaire 3, and the target grid B and the target grid D may be designated target grids for controlling the color of the second light emitting unit of the luminaire 3, which is just an example, and the designated target grids for controlling the color of the first light emitting unit of the luminaire 3 may be the target grid a and the target grid B, which is not limited in this application.
In other embodiments of the present application, the display order may also be set based on a preset priority, for example, the priority of the target grid located at the edge of the target image is higher than that of the target grid located in the middle of the target image.
For example, in some examples, referring to fig. 5, fig. 5 is a schematic diagram of controlling light effects according to another embodiment of the present application. When the number of the target grids is greater than the number of the light emitting units as shown in fig. 5, the target colors of the target grids at the edge of the target image are preferentially extracted, as shown in the target grids D1 to D10 in fig. 5, and the electronic device can control the colors of the lighting device by using the target colors of the target grids at the edge of the extracted target image, so as to improve the control efficiency of the electronic device.
In some embodiments of the present application, the designated target grid may be two target grids or a target grid formed by combining two or more target grids, so that the designated target grid may include at least two different target colors, and a color that is preferentially displayed may be determined according to a highest color intensity corresponding to the RGB values, for example, the target colors included in the designated target grid are red and blue, the RGB value of the red is (200,0,0), the highest color intensity is 200, the RGB value of the blue is (0,0,210), and the highest color intensity is 210, and then the corresponding light emitting unit is determined to preferentially display blue and then display red according to the highest color of the RGB values.
Step S306, if the number of the target grids is smaller than the number of the light emitting units, controlling the plurality of light emitting units to display the target colors of the corresponding target grids in the target images corresponding to the multi-frame images according to a preset display rule.
In some embodiments of the present application, as shown in fig. 4, the number of target grids is 4, the number of light emitting units of the luminaire 2 is 6, the number of target grids is smaller than the number of light emitting units, a display rule may be set in the electronic device in advance, where the display rule may be that the electronic device randomly selects the light emitting units according to the number of target grids to display, and in some examples, as shown in fig. 4, 4 target grids may select any 4 light emitting units in the luminaire 2 to display, which is not limited in this application.
In another example, assuming that the target grid is 1 and the light emitting units are 2, the target grid may control any one of the 2 light emitting units to display, or control the 2 light emitting units to display the target grid in turn, which is not limited in this application.
In other embodiments of the present application, the electronic device may control the lighting device to dynamically display the target color corresponding to each target grid through the form of a ticker, for example, in an example, as shown in fig. 4, the electronic device may control the light fixture 1 to display the target color in each light emitting unit sequentially at intervals of 10ms by using the color of the target grid a, and similarly, control by using the color of the target grid B, and so on. In another example, as shown in fig. 5, in the target image displayed at the first time, the electronic device may control 8 light emitting units in the light fixture 4 to simultaneously display the target colors of the target grids D1 to D8, and then, in the target image displayed at the second time, the electronic device further controls 8 light emitting units in the light fixture 4 to simultaneously display the target colors of the target grids D2 to D9, wherein the first time is earlier than the second time. The present application is not limited in this regard.
In the embodiment of the present application, when the electronic device controls the lighting device, the number of the target grids and the number of the light emitting units may be controlled, or the number of the target grids and the number of the light emitting units may not be controlled, that is, the light emitting units are controlled by specifying the target grids, which is not limited in this application. When the electronic devices are connected to different lighting devices at the same time, the control may be performed simultaneously based on different rules, as in the embodiment shown in fig. 3. The color that this application can let lighting apparatus show is unanimous with the color that shows in the image, has improved lighting apparatus's lighting effect.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a light effect control device according to an embodiment of the present disclosure. As shown in fig. 6, in the embodiment of the present application, the light effect control apparatus 600 may be divided into a plurality of functional modules according to the functions performed by the light effect control apparatus, and may include: the system comprises an acquisition module 610, a division module 620, a calculation module 630 and a control module 640.
And the acquisition module 610 is used for acquiring an image displayed by a user interaction interface of the electronic equipment.
The dividing module 620 is configured to divide the image to obtain a corresponding target image, where the target image includes a plurality of grids, and determine at least one target grid from the plurality of grids.
The calculating module 630 is configured to calculate a color duty ratio of each type of color in each target grid, and determine a color corresponding to the maximum color duty ratio as a target color of the corresponding target grid.
And a control module 640 for controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid.
In some alternative embodiments, after calculating the color ratio of each class of color in each target grid, the method further includes: and if the color ratio of at least two types of colors is the maximum and the same, arbitrarily selecting one color from the at least two types of colors to determine the target color.
In some alternative embodiments, the image is a red, green, blue, RGB, image, further comprising: and converting the RGB image into a preset image.
In some optional embodiments, a pixel coordinate system corresponding to the preset image is established; acquiring a pixel coordinate set of a target color corresponding to each target grid of the preset image; determining RGB values for the target color based on the set of pixel coordinates; and controlling a plurality of light emitting units in the lighting device to update the RGB value of the current color to the RGB value of the target color.
In some optional embodiments, the determining the RGB values of the target color based on the set of pixel coordinates includes: calculating an RGB three-channel average value of the pixel corresponding to the target color based on the pixel coordinate set; and determining the RGB three-channel average value as the RGB value.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of the at least one target grid is determined to be equal to the number of the plurality of light emitting units from the plurality of grids, controlling the plurality of light emitting units to dynamically display the target colors of the corresponding target grids in the target images corresponding to the multi-frame images.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of at least one target grid is determined to be greater than the number of the light emitting units from the multiple grids, controlling each light emitting unit to dynamically display the target color of the designated target grid in the target image corresponding to the multi-frame image according to the preset display sequence.
In some optional embodiments, the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid includes: and if the number of at least one target grid is determined to be smaller than the number of the light-emitting units from the multiple grids, controlling the multiple light-emitting units to display target colors of the corresponding target grids in the target images corresponding to the multi-frame images according to a preset display rule.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
In this embodiment, the electronic device 10 includes a display 11, a memory 12, and at least one processor 13. The memory 12 may be an internal memory of the electronic device 10, i.e., a memory built into the electronic device 10. In other embodiments, the memory 12 may also be an external memory of the electronic device 10, i.e. a memory external to the electronic device 10.
In some embodiments, the memory 12 is used to store program code and various data and to enable high-speed, automated access to programs or data during operation of the electronic device 10.
The memory 12 may include random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid state memory device.
In one embodiment, the processor 13 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any other conventional processor or the like.
The program code and various data in the memory 12 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, such as the light effect control method, and may also be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and where the computer program, when executed by a processor, may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), or the like.
It will be appreciated that the above-described division of modules into a logical function division may be implemented in other ways. In addition, each functional module in each embodiment of the present application may be integrated in the same processing unit, or each module may exist alone physically, or two or more modules may be integrated in the same unit. The integrated modules may be implemented in hardware or in hardware plus software functional modules.
Finally, it should be noted that the above embodiments are merely for illustrating the technical solution of the present application and not for limiting, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present application may be modified or substituted without departing from the spirit and scope of the technical solution of the present application.

Claims (10)

1. A light effect control method, characterized by being applied to an electronic device, the method comprising:
acquiring an image displayed on a user interaction interface of the electronic equipment;
dividing the image to obtain a corresponding target image, wherein the target image comprises a plurality of grids, and determining at least one target grid from the grids;
calculating the color ratio of each type of color in each target grid, and determining the color corresponding to the maximum color ratio as the target color of the corresponding target grid;
based on the target color corresponding to each target grid, a plurality of light emitting units in the lighting device are controlled to update the currently displayed color to the corresponding target color.
2. A light effect control method as recited in claim 1 wherein after said calculating the color duty cycle of each class of colors within each target grid, said method further comprises:
and if the color ratio of at least two types of colors is the maximum and the same, arbitrarily selecting one color from the at least two types of colors to determine the target color.
3. A light effect control method as recited in claim 1 wherein said image is a red, green and blue RGB image, said method further comprising: and converting the RGB image into a preset image.
4. A light effect control method according to claim 3, characterized in that the method further comprises:
establishing a pixel coordinate system corresponding to the preset image;
acquiring a pixel coordinate set of a target color corresponding to each target grid of the preset image;
determining RGB values for the target color based on the set of pixel coordinates;
and controlling a plurality of light emitting units in the lighting device to update the RGB value of the current color to the RGB value of the target color.
5. A light effect control method as recited in claim 4 wherein said determining RGB values for said target color based on said set of pixel coordinates comprises:
calculating an RGB three-channel average value of the pixel corresponding to the target color based on the pixel coordinate set;
and determining the RGB three-channel average value as the RGB value.
6. The method for controlling lighting effect of claim 1, wherein the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid comprises:
and if the number of the at least one target grid is determined to be equal to the number of the plurality of light emitting units from the plurality of grids, controlling the plurality of light emitting units to dynamically display the target colors of the corresponding target grids in the target images corresponding to the multi-frame images.
7. The method for controlling lighting effect of claim 1, wherein the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid comprises:
and if the number of at least one target grid is determined to be greater than the number of the light emitting units from the multiple grids, controlling each light emitting unit to dynamically display the target color of the designated target grid in the target image corresponding to the multi-frame image according to the preset display sequence.
8. The method for controlling lighting effect of claim 1, wherein the controlling the plurality of light emitting units in the lighting device to update the currently displayed color to the corresponding target color based on the target color corresponding to each target grid comprises:
and if the number of at least one target grid is determined to be smaller than the number of the light-emitting units from the multiple grids, controlling the multiple light-emitting units to display target colors of the corresponding target grids in the target images corresponding to the multi-frame images according to a preset display rule.
9. An electronic device comprising a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the light effect control method of any one of claims 1 to 8.
10. A computer readable storage medium storing at least one instruction which when executed by a processor implements a light effect control method as claimed in any one of claims 1 to 8.
CN202380013120.2A 2023-07-19 2023-07-19 Lighting effect control method, electronic equipment and storage medium Pending CN117796152A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2023108232 2023-07-19

Publications (1)

Publication Number Publication Date
CN117796152A true CN117796152A (en) 2024-03-29

Family

ID=90400358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202380013120.2A Pending CN117796152A (en) 2023-07-19 2023-07-19 Lighting effect control method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117796152A (en)

Similar Documents

Publication Publication Date Title
CN102693532B (en) The automatic local directed complete set of image shadow and highlight
CN107204034B (en) A kind of image processing method and terminal
CN117197261B (en) Atmosphere lamp equipment, color taking method thereof, corresponding device and medium
CN117202451B (en) Atmosphere lamp equipment, and light-emitting control method, device and medium thereof
CN110930917A (en) Display screen correction method and display screen correction system
US10438376B2 (en) Image processing apparatus replacing color of portion in image into single color, image processing method, and storage medium
CN104581103A (en) Image processing method and device
US8830251B2 (en) Method and system for creating an image
CN108337496A (en) White balancing treatment method, processing unit, processing equipment and storage medium
WO2020119454A1 (en) Method and apparatus for color reproduction of image
CN113299245A (en) Method and device for adjusting local backlight of display equipment, display equipment and storage medium
CN104935902A (en) Image color enhancement method and device, and electronic equipment
US20230074060A1 (en) Artificial-intelligence-based image processing method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN110335279A (en) Real-time green curtain is scratched as method, apparatus, equipment and storage medium
CN111164563A (en) Image color adjusting system and method of intelligent terminal
CN113316711A (en) Method and apparatus for estimating ambient light
KR101791603B1 (en) Detecting method for color object in image using noise and detecting system for light emitting apparatus using noise
CN114340102B (en) Lamp strip control method, device, display equipment, system and storage medium
WO2022120799A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN112200747B (en) Image processing method and device and computer readable storage medium
CN103325101B (en) The extracting method of color property and device
CN117796152A (en) Lighting effect control method, electronic equipment and storage medium
CN108053452B (en) Digital image color extraction method based on mixed model
CN104021579A (en) Method and device for changing colors of image
CN105991937A (en) Virtual exposure method and device based on Bayer format image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination