Method and device for synchronizing light effect and music signal, computer and medium thereof
The camera captures lighting video images and uses a deep learning model to identify real-time lighting parameters. Combined with music signal characteristics, lighting adjustment instructions are dynamically generated, which solves the problem of insufficient synchronization efficiency and accuracy between lighting effects and music signals in the existing technology, and achieves high efficiency. , Creative lighting control enhances the expressiveness of stage art.
Patent Information
- Application Number
- CN202410604010.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-08-27
AI Technical Summary
Existing lighting effects and music signal synchronization technology has deficiencies in efficiency, accuracy and creativity, and cannot meet the high efficiency and intuitive needs of modern entertainment and performing arts.
The camera captures lighting video images of lighting equipment, extracts key feature information, uses a deep learning model to identify real-time lighting parameters, and combines the timing feature information of music signals to dynamically generate lighting adjustment instructions to achieve synchronization of lighting effects and music signals.
It improves the synchronization efficiency and accuracy of lighting effects and music signals, can quickly make precise and creative adjustments, enhances the expressiveness and viewing experience of stage art, and has self-learning and adaptability.
Smart Images

Figure CN118552383A
Abstract
Description
Technical Field
[0001] The present application relates to the field of lighting technology, and in particular to a method and device for synchronizing lighting effects with music signals, a computer device, and a computer device storage medium. Background Art
[0002] In the field of stage and entertainment lighting, it is necessary to synchronize the stage lighting effects with the music signals during performances. By controlling the color, intensity and motion status of each light unit of the lighting equipment, the lighting effects can be synchronized with the music signals to present better performance lighting effects.
[0003] With the continuous development of the fast-paced modern entertainment and performing arts fields, stage lighting needs to change lighting effects quickly and dynamically to match the performance content and atmosphere. The existing lighting effects synchronized with music signals have poor flexibility in efficiency, accuracy and creativity, poor synchronization with music, and cannot adapt to the needs of high efficiency and intuitiveness of lighting control in the field of stage and entertainment lighting. Summary of the invention
[0004] In order to solve one of the above-mentioned defects, the present application provides a method and device for synchronizing lighting effects with music signals, a smart speaker, a computer device, and a computer device storage medium to improve the effect of synchronizing lighting effects with music signals.
[0005] A method for synchronizing lighting effects with music signals, comprising:
[0006] Use a camera to capture light video images of the lighting equipment when it is on;
[0007] Extracting key feature information representing the lighting state from the lighting video image, and identifying real-time lighting parameters of each lighting unit using a deep learning model;
[0008] Generate an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function;
[0009] The timing characteristic information of the music signal is obtained, and continuous lighting adjustment instructions are dynamically generated in combination with the real-time lighting parameters, the lighting adjustment strategy and the timing characteristic information, and the lighting effect of the lighting device is controlled to be synchronized with the music signal according to the lighting adjustment instructions.
[0010] In one embodiment, before extracting key feature information representing the lighting state from the lighting video image, the method further includes:
[0011] Use a Gaussian filter or a median filter to perform noise reduction on the light video image to remove high-frequency noise in the light video image;
[0012] Convert the light video image from RGB image to grayscale image;
[0013] The light video image is adjusted to a corresponding uniform size according to the image parameters recognized by the model.
[0014] In one embodiment, extracting key feature information representing the lighting state from the lighting video image and using a deep learning model to identify real-time lighting parameters of each lighting unit includes:
[0015] A pre-trained convolutional neural network is used to extract key feature information of the light video image; wherein the key feature information is a feature map pixel value obtained by a convolution operation based on the convolutional neural network;
[0016] The key feature information is input into a pre-trained deep learning model to identify the real-time brightness level and color category of each light unit; wherein the deep learning model has a built-in activation function to calculate the intensity probability distribution and brightness estimation value of each color channel.
[0017] In one embodiment, a pre-trained convolutional neural network is used to extract key feature information of a light video image, including:
[0018] Based on multiple convolutional layers, feature information of different dimensions of the light video image is extracted to obtain feature maps of multiple dimensions;
[0019] Use the pooling layer to downsample each feature map to obtain a key information feature map of reduced size;
[0020] Each key information feature map is normalized to obtain the feature map pixel value.
[0021] In one embodiment, before inputting the key feature information into a pre-trained deep learning model to identify the real-time brightness level and color category of each light unit, the method further includes:
[0022] Select a deep learning model, use a labeled light image dataset to learn the brightness level and color category of the light, and optimize the parameters of the deep learning model through the back-propagation algorithm;
[0023] Set the activation function of the deep learning model and set the Softmax layer to convert the model output into a probability distribution to identify the probability of each category.
[0024] In one embodiment, generating an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function includes:
[0025] Select a reinforcement learning algorithm for lighting effect adjustment and tune its parameters;
[0026] The objective function of the lighting adjustment is set according to the real-time demand parameters of the stage lighting; wherein the objective function includes: the evaluation index of the stage performance quality and the degree of interference to the audience caused by avoiding frequent changes in lighting adjustment;
[0027] An optimal lighting adjustment strategy is generated according to the reinforcement learning algorithm and the objective function.
[0028] In one embodiment, the decision-making process of the lighting adjustment strategy is:
[0029] A t = arg max a Q(S t ,a;θ - )
[0030] In the formula, A t is the lighting adjustment action taken at time step t, S t is the current state of the lighting device, Q is the Q function, a is the setting coefficient, θ - is the target network parameter of the reinforcement learning algorithm.
[0031] In one embodiment, the timing characteristic information of the music signal is obtained, and continuous lighting adjustment instructions are dynamically generated in combination with the real-time lighting parameters, the lighting adjustment strategy and the timing characteristic information, including:
[0032] Constructing a sequence model to learn the time series characteristic information of music rhythm and performance emotion, and training the sequence model using labeled music data and performance datasets;
[0033] Input the music signal into the sequence model to identify the time series characteristic information and extract useful time series feature information;
[0034] The current real-time lighting parameters, timing feature information, and lighting adjustment strategies are continuously input into the pre-trained recursive neural network model to output the lighting parameters for the next moment, and the corresponding lighting adjustment instructions are calculated accordingly.
[0035] In one embodiment, the output formula of the recursive neural network model is:
[0036] L t+1 =RNN(L t ,M t ,φ)
[0037] Among them, L t+1 is the lighting parameter at the next moment, L t is the lighting parameter at the current moment, M t is the time series feature information vector at the current moment, RNN represents the recursive neural network model, and φ is the parameter of the recursive neural network model.
[0038] In one embodiment, controlling the lighting effect of the lighting device to be synchronized with the music signal according to the lighting adjustment instruction further includes:
[0039] Continuously intercept the light video image data stream based on the sliding window;
[0040] Detecting real-time lighting parameters of each lighting unit of the lighting equipment according to the lighting video image data stream;
[0041] Compare the deviation difference between the current lighting effect and the expected lighting effect according to the real-time lighting parameters at the current moment;
[0042] The rate and amplitude of synchronizing the lighting effect of the lighting device with the music signal according to the lighting adjustment instruction are adjusted according to the deviation difference.
[0043] In one embodiment, detecting the real-time lighting parameters of each lighting unit according to the lighting video image data stream includes:
[0044] D processed =f(D widow )
[0045] Where D processed Indicates real-time lighting parameters, D widow Represents the data of the current sliding window, which is a processing function applied to the data for detecting real-time color values and real-time brightness values.
[0046] In one embodiment, calculating the parameter adjustment values corresponding to the color and brightness of each light unit according to the deviation difference includes:
[0047] Q adjusted =Q initial +a×(E expected -E observed )
[0048] In the formula, Q adjusted Indicates the adjusted lighting parameters, Q initial represents the initial lighting parameters, represents the expected lighting parameters, and E expected Represents the real-time light parameter detected, and a is the adjustment factor used to control the rate and amplitude of adjustment.
[0049] A device for synchronizing lighting effects with music signals, comprising:
[0050] A video shooting module is used to use a camera to shoot a light video image of the light equipment in a lighting state;
[0051] A parameter recognition module, used to extract key feature information representing the lighting state from the lighting video image, and identify the real-time lighting parameters of each lighting unit using a deep learning model;
[0052] A strategy generation module, used to generate an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function;
[0053] The synchronization control module is used to obtain the timing characteristic information of the music signal, dynamically generate continuous lighting adjustment instructions in combination with the real-time lighting parameters, lighting adjustment strategy and timing characteristic information, and control the lighting effect of the lighting device to be synchronized with the music signal according to the lighting adjustment instructions.
[0054] A computer device comprising:
[0055] one or more processors;
[0056] Memory;
[0057] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the above-mentioned method of synchronizing lighting effects with music signals.
[0058] A computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, wherein the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the above-mentioned method of synchronizing light effects with music signals.
[0059] The technical solution of the above-mentioned embodiment uses a camera to capture a lighting video image of the lighting equipment in the lighting state, extracts key feature information representing the lighting state from the lighting video image, and identifies the real-time lighting parameters of each lighting unit; then generates an optimal lighting adjustment strategy based on the real-time lighting parameters and a preset objective function; dynamically generates continuous lighting adjustment instructions based on the timing feature information of the music signal, the real-time lighting parameters, and the lighting adjustment strategy to control the lighting effects of the lighting equipment to be synchronized with the music signal; this technical solution has higher synchronization efficiency and accuracy, and can quickly make accurate and creative synchronization adjustments to the stage lighting effects, greatly enhancing the expressiveness and viewing experience of stage art. In addition, this technical solution also has self-learning and adaptability, and can continuously optimize its own performance according to actual application scenarios, bringing a more shocking audio-visual experience to the audience.
[0060] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0062] Figure 1 This is a schematic diagram of a hardware environment in which a lighting effect is synchronized with a music signal;
[0063] Figure 2 is a flow chart of a method for synchronizing lighting effects with music signals in one embodiment;
[0064] Figure 3 is a schematic diagram of a feedback mechanism of an embodiment;
[0065] Figure 4 is a schematic diagram of the principle of synchronous presentation of lighting parameters and music signals of an embodiment;
[0066] Figure 5 is a schematic diagram of a device structure for synchronizing lighting effects with music signals in one embodiment;
[0067] Figure 6 is a block diagram of an example computer device. DETAILED DESCRIPTION
[0068] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0069] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, but does not exclude the presence or addition of one or more other features, integers, steps, operations.
[0070] This application aims at the defect that the traditional lighting control system has poor effect in the technical solution of synchronizing lighting effects and music signals, and provides a solution for synchronizing lighting effects and music signals. Figure 1 As shown, Figure 1 This is an example of a hardware environment diagram for lighting parameter control. The camera is used to capture the lighting video image of the lighting equipment. The control system identifies the real-time lighting parameters of each lighting unit and generates the optimal lighting adjustment strategy. The real-time lighting parameters, lighting adjustment strategy and timing feature information are combined to dynamically generate continuous lighting adjustment instructions to control the lighting effects of the lighting equipment in synchronization with the music signal.
[0071] refer to Figure 2 As shown, Figure 2 The present invention is a flow chart of a method for synchronizing lighting effects with music signals according to an embodiment, comprising:
[0072] Step S10: Using a camera to capture a video image of the lighting device when the lighting device is in a turned-on state.
[0073] In this step, a camera may be used to capture the lighting effects of the lighting equipment. For example, a high-quality camera with sufficient resolution and dynamic range may be used to capture all details of each lighting unit of the lighting equipment to obtain a real-time lighting video image data stream.
[0074] In one embodiment, after capturing the light video image, the following may also be included:
[0075] (a) Using a Gaussian filter or a median filter to perform noise reduction processing on the light video image. Exemplarily, using a Gaussian filter or a median filter to perform noise reduction processing on the image to remove high-frequency noise in the light video image.
[0076] (b) Convert the light video image from RGB to grayscale, thereby reducing the dimension of the image data and speeding up feature extraction.
[0077] (c) adjusting the light video image to a corresponding uniform size according to the image parameters recognized by the model; specifically, adjusting the light video image to a uniform size required by the deep learning model to facilitate subsequent processing.
[0078] As in the above-mentioned embodiment, through the image preprocessing process, the goal of converting the input RGB image into a format suitable for the deep learning model input is achieved, and the noise in the image is removed to improve the accuracy of subsequent feature extraction. Image preprocessing is a key step that directly improves the accuracy and performance of the subsequent deep learning model.
[0079] Step S20, extracting key feature information representing the lighting state from the lighting video image, and using a deep learning model to identify real-time lighting parameters of each lighting unit.
[0080] In one embodiment, the process of step S20 may include the following:
[0081] S201, uses a pre-trained convolutional neural network to extract key feature information of the light video image.
[0082] Specifically, the convolution operation based on the convolutional neural network obtains the pixel value of the feature map as the key feature information of the light video image.
[0083] In one embodiment, the method of extracting key feature information of the light video image in step S201 may include the following steps:
[0084] (1) Based on multiple convolutional layers, the feature information of different dimensions of the light video image is extracted to obtain feature maps of multiple dimensions.
[0085] For example, feature extraction is performed on the light video image through a series of convolutional layers, each of which uses multiple filters to extract different features of the image, such as edges, textures, etc.
[0086] (2) Use the pooling layer to downsample each feature map to obtain a key information feature map of reduced size.
[0087] Specifically, after each convolutional layer, a pooling layer is used to downsample the feature map to reduce the size of the feature map while retaining key information.
[0088] (3) Each key information feature map is normalized to obtain the feature map pixel value.
[0089] Exemplarily, the extracted key information feature map is normalized to accelerate convergence and improve the stability of the model; during the feature extraction process, a convolution operation is used to calculate the feature map.
[0090] Assuming that the input light video image is I and the convolution kernel is K, the convolution operation can be expressed as:
[0091]
[0092] Among them, F(x,y) is the pixel value of the feature map after convolution, and a and b are the horizontal and vertical radii of the convolution kernel, respectively.
[0093] As in the above-mentioned embodiment, key features capable of characterizing the lighting state are extracted from the preprocessed lighting video image for use in the subsequent deep learning model. By using a convolutional neural network (CNN) to extract key feature information of the image, the pixel values of the feature map of the lighting video image can be accurately obtained, laying a solid foundation for subsequent lighting recognition and automatic adjustment.
[0094] S202, inputting the key feature information into a pre-trained deep learning model to identify the real-time brightness level and color category of each light unit; wherein the deep learning model has a built-in activation function to calculate the intensity probability distribution and brightness estimation value of each color channel.
[0095] Specifically, a deep learning model is pre-trained to accurately identify the real-time brightness level and color category of each light unit of the lighting equipment.
[0096] Exemplarily, a deep learning model with a structure such as ResNet or Inception can be used for training, and the activation function (such as ReLU) and Softmax layer contained in the deep learning model are used to calculate the intensity probability distribution of each channel (red, green, and blue) and the brightness estimation value.
[0097] Accordingly, in one embodiment, a method for training a deep learning model may include the following steps:
[0098] (1) Select a deep learning model, use a labeled light image dataset to learn the brightness level and color category of the light, and optimize the parameters of the deep learning model through the back-propagation algorithm.
[0099] Specifically, the selected deep learning model is trained to learn the brightness level and color category of lights. During the training process, a labeled light image dataset is used, and the model parameters are optimized through the back propagation algorithm so that the model can accurately classify different light features.
[0100] (2) Set the activation function of the deep learning model and set the Softmax layer to convert the model output into a probability distribution to identify the probability of each category.
[0101] In deep learning models, activation functions and Softmax layers are very important components. The activation function introduces nonlinear factors and enhances the expressiveness of the model. The Softmax layer is used to convert the model output into a probability distribution, so that the model can output the real-time brightness level of each light unit and the probability of the color category.
[0102] For example, the prediction process for light brightness can be as follows:
[0103] L = f θ (I RGB )
[0104] Where L represents the predicted light brightness of the light unit, I RGB is the RGB image pixel matrix corresponding to the input light video image, f θ is a trained deep learning model, and θ is the weight parameter of the deep learning model.
[0105] In one embodiment, the color and brightness of the light unit are identified and analyzed through the light video image. Since each frame of the light video image is composed of multiple pixels and each pixel corresponds to a color value, the color value and brightness value of the light unit can be calculated.
[0106] First, the corresponding image frames are acquired frame by frame; then, the stage lighting equipment can be identified through picture analysis of each image frame, including its various lighting units and their related attribute information, such as type, position, etc.; then, the color value and brightness value of the pixel points of the image frame can be used to finally calculate the lighting parameters such as the color value and brightness value of the lighting unit.
[0107] In this embodiment, the average color value and the average brightness value may be used to represent the light parameters of the light unit; illustratively, the calculation formula of the average color value may be as follows:
[0108]
[0109] In the formula, C avg is the average color value of the image frame, N is the total number of pixels in the image frame, C i is the color value of the i-th pixel; illustratively, the calculation formula of the average brightness value can be as follows:
[0110]
[0111] L i =0.299×R+0.587×G+0.1114×B
[0112] Where, L avg is the average brightness value of the image frame, N is the total number of pixels in the image frame, L i is the brightness value of the i-th pixel, and R, G, and B represent the red, green, and blue components of the pixel, respectively.
[0113] As in the scheme of the above-mentioned embodiment, by calculating the average color value and the average brightness value of the image frame, they can be directly used as the lighting parameters of the lighting unit. These lighting parameters can be used to control the color and brightness of the lighting unit, as well as other possible attributes (such as saturation, color temperature), etc., by extracting the lighting parameters of each lighting unit from the lighting video image captured by the camera in real time, and using them to control the lighting parameters of the lighting unit in real time or later, it has the advantages of real-time and high precision, and can be used in various application scenarios, such as stage lighting design, smart home lighting control, etc.
[0114] Step S30, generating an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function.
[0115] In one embodiment, the method for generating the optimal lighting adjustment strategy in step S30 may include the following steps:
[0116] S301, selecting a reinforcement learning algorithm for adjusting lighting effects and optimizing its parameters.
[0117] Specifically, based on the key feature information of the identified lighting video images, a reinforcement learning algorithm is used to generate the optimal lighting adjustment strategy to ensure that the lighting effects are seamlessly integrated with the performance context.
[0118] For example, a reinforcement learning algorithm such as Q-Learning or DQN can be selected, and its parameters can be tuned to improve the effect of the algorithm in lighting adjustment; the parameter tuning can include the selection of parameters such as learning rate, discount factor, and exploration strategy, as well as the use of experience replay and target network.
[0119] S302, setting an objective function for lighting adjustment according to real-time demand parameters of stage lighting.
[0120] In order to achieve the goal of matching lighting effects with performance situations, a suitable objective function (reward function) is defined according to the real-time demand parameters of stage lighting. The reward function can include evaluation indicators of performance quality, such as the uniformity of stage light, color harmony, etc., as well as the degree of interference to the audience caused by frequent changes in lighting adjustments.
[0121] The solution of the above embodiment fully considers the contribution of lighting adjustment to the performance effect and the adaptability to the performance situation when defining the objective function (reward function).
[0122] S303: Generate an optimal lighting adjustment strategy according to the reinforcement learning algorithm and the objective function.
[0123] In one embodiment, the decision process of a simplified lighting adjustment strategy can be expressed as follows:
[0124] A t = arg max a Q(S t ,a;θ - )
[0125] In the formula, A t is the lighting adjustment action taken at time step t, S t is the current state of the lighting device, Q is the Q function, a is the setting coefficient, θ - is the target network parameter of the reinforcement learning algorithm.
[0126] Specifically, according to the current state S t and Q function Q to select an action A t , this action maximizes the Q value by designing a suitable action space, including adjustment parameters such as light brightness, color and direction, to meet the needs of different performance scenes.
[0127] As in the solution of the above-mentioned embodiment, the model is trained according to the selected reinforcement learning algorithm, and the parameters are continuously optimized so that the lighting can be adjusted according to the feedback and rewards of the environment; during the training process, historical experience is used for experience playback to improve the stability and convergence speed of the model; at the same time, the target network is used to stabilize the training process and reduce the error accumulation during the training process, thereby generating the optimal lighting adjustment strategy to achieve seamless integration of lighting effects and performance situations.
[0128] Step S40, obtaining the timing characteristic information of the music signal, dynamically generating continuous lighting adjustment instructions in combination with the real-time lighting parameters, lighting adjustment strategy and timing characteristic information, and controlling the lighting effect of the lighting device to be synchronized with the music signal according to the lighting adjustment instructions.
[0129] In order to make the control system more adaptive, a recurrent neural network (RNN) or other sequence models can be introduced to learn the time series characteristics of music rhythm and performance emotions, and combined with real-time lighting parameters and lighting adjustment strategies to dynamically generate continuous lighting adjustment instructions.
[0130] In one embodiment, the method for dynamically generating continuous lighting adjustment instructions in step S40 may include the following:
[0131] S401, constructing a sequence model to learn the time series characteristic information of music rhythm and performance emotion, and using labeled music data and performance data set to train the sequence model.
[0132] Specifically, a recurrent neural network (RNN) or other sequence models is used to learn the rhythm information of music signals and the time series characteristics of performance emotions, and the timing information of music signals and performances is captured and useful features are extracted from them for adjusting lighting effects.
[0133] S402, inputting the music signal into the sequence model to identify the time series characteristic information and extracting useful time series feature information.
[0134] In one embodiment, when identifying the timing feature information of the music signal, the music frequency information of the music signal is also obtained, so that the lighting effect is subsequently synchronously controlled to match the frequency intensity of the music signal.
[0135] Specifically, the music signal can be first converted from the time domain to the frequency domain using Fourier transform, and then the energy information of each frequency band is calculated; then the music signal is envelope detected and the rhythm pattern of the music signal is extracted; and then the music frequency range and music frequency intensity of the music signal are determined based on the energy value and the rhythm pattern.
[0136] Exemplarily, the short-time energy of the music signal can be calculated as follows:
[0137]
[0138] Where E(n) is the short-time energy of the music signal at time n, which is used to determine the rhythm pattern of the music signal, M is the length of the window selected by envelope detection, and x is the music signal.
[0139] S403, continuously inputting the current real-time lighting parameters, timing feature information and lighting adjustment strategies into a pre-trained recurrent neural network (RNN) model to output the lighting parameters at the next moment, and calculate corresponding lighting adjustment instructions accordingly.
[0140] In one embodiment, the output formula of the recursive neural network model can be expressed as:
[0141] L t+1 =RNN(L t ,M t ,φ)
[0142] Among them, L t+1 is the lighting parameter at the next moment, L t is the lighting parameter at the current moment, M t is the time series feature information vector at the current moment, RNN represents the recursive neural network model, and φ is the parameter of the recursive neural network model.
[0143] As in the scheme of the above-mentioned embodiment, labeled music and performance data sets are used in the model training stage to train the sequence model to learn the timing characteristics of music and performances, and the lighting effects of the stage are dynamically adjusted in combination with the lighting recognition results and the output of the sequence model to respond to the rhythm of the music and the mood of the performance; when generating lighting adjustment instructions, the real-time lighting parameters and lighting adjustment strategies are combined to make accurate and creative adjustments to the stage lighting effects in a short period of time, thereby greatly enhancing the expressiveness and viewing experience of stage art; at the same time, the continuous training of the recursive neural network model is used to make the scheme have strong self-learning and adaptability, and can continuously optimize its own performance according to the actual application scenario, bringing a more shocking audio-visual experience to the audience.
[0144] In one embodiment, in order to further improve the synchronization effect of control, a real-time data processing and feedback processing mechanism can also be set; Figure 3 As shown, Figure 3 is a schematic diagram of a feedback mechanism of an embodiment; accordingly, after the lighting effect of the lighting device is controlled to be synchronized with the music signal in step S40, the following is further included:
[0145] (1) Continuously capture the light video image data stream based on the sliding window.
[0146] Specifically, a data stream interception algorithm based on a sliding window is used to continuously analyze the light video image data stream from the camera. In this process, the sliding window can be regularly changed to extract the most recent data segment for analysis.
[0147] (2) detecting the real-time lighting parameters of each lighting unit of the lighting equipment according to the lighting video image data stream; and comparing the deviation difference between the current lighting effect and the expected lighting effect according to the real-time lighting parameters at the current moment.
[0148] In one embodiment, detecting the real-time lighting parameters of each lighting unit according to the lighting video image data stream includes:
[0149] D processed =f(D widow )
[0150] Where D processed Indicates real-time lighting parameters, D widow Represents the data of the current sliding window, which is a processing function applied to the data for detecting real-time color values and real-time brightness values.
[0151] In one embodiment, calculating the parameter adjustment values corresponding to the color and brightness of each light unit according to the deviation difference includes:
[0152] Q adjusted =Q initial +a×(E expected -E observed )
[0153] In the formula, Q adjusted Indicates the adjusted lighting parameters, Q initial represents the initial lighting parameters, represents the expected lighting parameters, and E expected Represents the real-time light parameter detected, and a is the adjustment factor used to control the rate and amplitude of adjustment.
[0154] (3) adjusting the rate and amplitude of synchronizing the lighting effect of the lighting device with the music signal according to the lighting adjustment instruction based on the deviation difference.
[0155] As in the above-mentioned embodiment, by comparing the difference between the expected lighting effects and the actually observed lighting effects, a solution is designed to automatically adjust the lighting parameter output based on closed-loop feedback, thereby ensuring that the actual lighting effects are consistent with the expected lighting effects, further improving the accuracy of the synchronization between the lighting effects and the music signals, and achieving more precise control of the lighting unit.
[0156] In one embodiment, in order to accurately control each light unit of a lighting device, before control, relevant attribute information of each light unit of the lighting device, such as location, type and other attributes, can be obtained, and then the attribute information can be directly encoded using coding technology, so that a coding identifier can be configured for each light unit, thereby realizing coded control of each light unit without relying on a complex address code system.
[0157] Accordingly, when configuring a coding identifier for each lighting unit, the attribute information of each lighting unit is firstly encoded using a hash function to obtain a coding value.
[0158] Specifically, a hash function H(x) = (a×x+b) mod m may be used, where x is a numerical value based on the properties of the light unit, a, b and m are constants selected to ensure the generation of a consistent encoding identifier, and mod is a modulus operator. For example, in order to ensure the reversibility of the encoding, an inverse function x = H may be used. -1 (y), where y is the encoded value, used to recover the attribute information x of the light unit from the encoding.
[0159] Then, when a light unit is added or removed from the light device, the coded value is dynamically coded and updated. For example, when the coded value is dynamically updated, it can be H′(x)=(H(x)+△)mod m, where △ is the adjustment amount calculated according to the added or removed light unit.
[0160] Then check and correct the code value. Specifically, set up a redundant error mechanism and use the formula To detect and correct errors, where x i is a single encoded value and k is the number used for the modular operation.
[0161] As in the solution of the above-mentioned embodiment, a direct coding mechanism for light units is adopted, allowing each light unit to be assigned a unique direct coding identifier, utilizing a hash function as a coding allocation algorithm to ensure the reversibility of the coding, and designing a dynamic coding update and redundancy mechanism. By assigning a unique code to each light unit, the light control and editing process is simplified, thereby improving the efficiency of its use in editing the light spectrum.
[0162] In one embodiment, in the process of controlling the synchronization of the lighting effect and the music signal in step S40, the music frequency value can be controlled to correspond to the color frequency of the light unit and the music frequency intensity can be controlled to correspond to the brightness intensity of the light unit.
[0163] Exemplarily, the corresponding relationship between the music frequency value and the color frequency of the light unit can be as follows:
[0164]
[0165] Where C(f) is the color parameter of the light unit corresponding to the music frequency value f, c0(f) is the basic color parameter of the light unit corresponding to the music frequency value f, and f min and f max are the minimum and maximum values of the music frequency value range.
[0166] Exemplarily, the corresponding relationship between the music frequency intensity and the brightness intensity of the light unit can be as follows:
[0167] I=k×A n
[0168] Wherein, I is the brightness intensity of the light unit, A is the music frequency intensity (i.e., the amplitude or energy of the music signal), k is a calibration constant used to adjust the brightness intensity range of the light unit, and n is a positive number used to adjust the response relationship between the music frequency intensity and the brightness intensity of the light unit.
[0169] Exemplarily, when controlling the lighting parameters of each lighting unit, the music feature information of the digital signal processor is used to control the color of the lighting unit, and different frequency ranges are mapped to different colors based on the frequency information of the music.
[0170] For example, low-frequency music components can be mapped to warm colors (such as red or orange), while high-frequency components can be mapped to cool colors (such as blue or purple).
[0171] Correspondence between music frequency and lighting frequency: Music frequencies can be divided into different ranges or bandwidths. Each range represents a different musical element, such as bass, midrange and treble. These music frequencies can be mapped to the color frequencies of the lights to achieve a harmonious combination of music content and lighting effects, including:
[0172] Low frequencies (20Hz-250Hz): represent the bass or bass part; these frequencies can be mapped to warm colors, such as red and orange;
[0173] Mid-range (250Hz-2000Hz): represents the mid-range sounds, such as the human voice and most instruments. These frequencies can be mapped to neutral colors, such as yellow and green.
[0174] High frequencies (2000Hz-20000Hz): represent high notes, such as trumpets and flutes. These frequencies can be mapped to cool colors, such as blue and purple.
[0175] The frequency intensity of the music signal can be obtained by analyzing the amplitude or energy of the music signal, and the intensity of the lighting effect can be adjusted according to these amplitudes or energies; specifically including: low intensity: when the frequency intensity of the music is low, the brightness of the light can be adjusted to be darker, which can be achieved by adjusting the power or current of the light; medium intensity: when the frequency intensity of the music is medium, the brightness of the light can be adjusted to medium brightness; high intensity: when the frequency intensity of the music is high, the brightness of the light can be adjusted to be the brightest; the mapping relationship can be as follows: I = k × A; where L is the brightness of the light, A is the amplitude or energy of the music signal, and k is a constant representing the relationship between the brightness of the light and the amplitude of the music; the above mapping relationship ensures that the intensity of the music frequency has a direct and linear relationship with the brightness of the light unit; in actual applications, more complex adjustments may be required to meet specific needs or create specific effects.
[0176] For light mode control, you can choose the flashing or gradual mode of the light according to the rhythm pattern of the music signal.
[0177] For brightness control, the brightness of the light can be controlled based on the short-term energy of the music. The high energy part makes the light brighter, while the low energy part makes the light dimmer. In order to map the music frequency to the light color, the corresponding relationship between the music frequency and the light frequency can be as shown in the first corresponding relationship of the above embodiment. Based on the above corresponding relationship, the following mapping relationship can be obtained:
[0178] Low frequency (20Hz-250Hz): mapped to the red range;
[0179] Mid-frequency (250Hz-2000Hz): mapped to the green range;
[0180] High frequencies (2000Hz-20000Hz): mapped to the blue range.
[0181] In one embodiment, in order to achieve better synchronization between the music signal and the lighting effect, as Figure 4 As shown, Figure 4 The present invention is a schematic diagram of the principle of synchronous presentation of lighting parameters and music signals of an embodiment; the present application also provides a technical solution for synchronous presentation of music content and lighting effects.
[0182] Based on this, when controlling the synchronization of music signals and lighting effects, the music characteristic information of the music signal, such as music frequency, rhythm and energy, can also be analyzed; then the control parameters such as the color parameters and brightness parameters of each light unit are calculated to control the color value and brightness value of each light unit; and then the delay technology is used to coordinate the playback of the music signal with the lighting effects of each light unit.
[0183] Exemplarily, a digital signal processor (DSP) can be used to analyze the music signal to obtain music feature information; this process mainly includes two processes: image preprocessing and feature extraction. In the feature extraction process, Fourier transform can be used to calculate information such as music frequency, and convolutional neural networks (CNN) can be used to extract image features. The light controller is used to calculate the relevant color parameters and brightness parameters through the music feature information. In this process, a deep learning model can be used to identify the brightness value and color value of the light unit. By matching the processing speed of the digital signal processor and the light controller, the outputs of the two can be coordinated in combination with the delay processing method, so as to control the synchronization of playing the music signal and controlling the lighting effects such as the brightness, color, saturation and / or color temperature of each light unit.
[0184] As in the above-mentioned embodiment, the mapping relationship between music feature information and lighting effects is analyzed in combination with music signal analysis technology, so that the correspondence between music frequency and intensity and light frequency and intensity is achieved, thereby realizing accurate synchronization between music content and lighting effects; and combining camera capture technology with deep learning to construct a set of intelligent lighting parameter control solutions, which significantly improves the efficiency and accuracy of synchronization and regulation of lighting effects and music signals, thereby realizing seamless synchronization of lighting effects and music content.
[0185] In one embodiment, in order to further improve the efficiency of synchronization between lighting effects and music signals, the present application also provides a user-friendly control interface and its implementation scheme, which specifically includes the following:
[0186] Control panel design: Use a responsive grid layout to ensure that the control panel provides a good user experience on different devices, and integrate intuitive icons and labels to make the functions clear at a glance.
[0187] Drag-and-drop choreography tool: Develop a drag-and-drop interface based on HTML5 and JavaScript that allows users to intuitively arrange lighting effects on the virtual stage.
[0188] Color and brightness adjustment: Use HTML and CSS to create custom slider controls that interact with JavaScript to achieve real-time adjustment of light color and brightness.
[0189] Music Sync Editor: Use the audio processing library (Web Audio API) and the timeline view component to create music sync tools.
[0190] Real-time preview: Combined with WebGL technology to achieve 3D stage simulation and provide real-time visual preview of lighting effects.
[0191] As in the above-mentioned embodiment, a design scheme of a control panel, drag-and-drop editing tools, color and brightness adjustment, music synchronization editing and real-time preview is provided. Users can obtain a friendly light spectrum compilation interface, and can provide functions such as real-time preview, intuitive control panel and lighting effect editing tools, which greatly improves the processing efficiency of synchronization of lighting effects and music signals.
[0192] The following describes an embodiment of the device for synchronizing the lighting effect with the music signal of the present application, with reference to Figure 5 , Figure 5 The present invention is a schematic diagram of a device structure for synchronizing lighting effects with music signals according to an embodiment of the present invention, comprising:
[0193] The video shooting module 10 is used to shoot a light video image of the lighting device in a lighting state using a camera;
[0194] A parameter identification module 20, for extracting key feature information representing the lighting state from the lighting video image, and identifying the real-time lighting parameters of each lighting unit using a deep learning model;
[0195] A strategy generation module 30, for generating an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function;
[0196] The synchronization control module 40 is used to obtain the timing characteristic information of the music signal, dynamically generate continuous lighting adjustment instructions in combination with the real-time lighting parameters, lighting adjustment strategy and timing characteristic information, and control the lighting effect of the lighting device to be synchronized with the music signal according to the lighting adjustment instructions.
[0197] The device for synchronizing light effects with music signals of this embodiment can execute a method for synchronizing light effects with music signals provided in the embodiment of the present application, and the implementation principle is similar. The actions performed by each module in the device for synchronizing light effects with music signals in each embodiment of the present application correspond to the steps in the method for synchronizing light effects with music signals in each embodiment of the present application. For the detailed functional description of each module in the device for synchronizing light effects with music signals, please refer to the description in the corresponding method for synchronizing light effects with music signals shown in the previous text, which will not be repeated here.
[0198] Embodiments of a computer device and a computer-readable storage medium are described below.
[0199] The present application provides a technical solution for a computer device to implement functions related to a method for synchronizing light effects with music signals. The computer device of this embodiment includes one or more processors, a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by one or more processors, and the one or more program configurations are used for the steps of the method for synchronizing light effects with music signals in any embodiment.
[0200] like Figure 6 As shown, Figure 6 1 is a block diagram of an example computer device; the computer device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. The computer device 100 may include one or more of the following components: a processing component 102, a memory 104, a power component 106, a multimedia component 108, an audio component 109, an input / output (I / O) interface 112, a sensor component 114, and a communication component 116.
[0201] Processing component 102 generally controls the overall operation of computer device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
[0202] The memory 104 is configured to store various types of data to support operations in the computer device 100, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0203] The power supply component 106 provides power to various components of the computer device 100 .
[0204] The multimedia component 109 includes a screen that provides an output interface between the computer device 100 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). In some embodiments, the multimedia component 108 includes a front camera and / or a rear camera.
[0205] The audio component 109 is configured to output and / or input audio signals.
[0206] I / O interface 112 provides an interface between processing component 102 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0207] The sensor assembly 114 includes one or more sensors for providing various aspects of status assessment for the computer device 100. The sensor assembly 114 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact.
[0208] The communication component 116 is configured to facilitate wired or wireless communication between the computer device 100 and other devices. The computer device 100 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof.
[0209] The present application provides a technical solution of a computer-readable storage medium, which is used to implement functions related to the method for synchronizing light effects with music signals. The computer-readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executes the method for synchronizing light effects with music signals in any embodiment.
[0210] In an exemplary embodiment, the computer-readable storage medium may be a non-temporary computer-readable storage medium including instructions, such as a memory including instructions. For example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0211] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for synchronizing lighting effects with music signals, characterized in that: include: Use a camera to capture light video images of the lighting equipment when it is on; Extracting key feature information representing the lighting state from the lighting video image, and identifying real-time lighting parameters of each lighting unit using a deep learning model; Generate an optimal lighting adjustment strategy according to the real-time lighting parameters and a preset objective function; The timing characteristic information of the music signal is obtained, and continuous lighting adjustment instructions are dynamically generated in combination with the real-time lighting parameters, the lighting adjustment strategy and the timing characteristic information, and the lighting effect of the lighting device is controlled to be synchronized with the music signal according to the lighting adjustment instructions.
2. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Before extracting key feature information representing the lighting state from the lighting video image, the method further includes: Use a Gaussian filter or a median filter to perform noise reduction on the light video image to remove high-frequency noise in the light video image; Convert the light video image from RGB image to grayscale image; The light video image is adjusted to a corresponding uniform size according to the image parameters recognized by the model.
3. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Extract key feature information representing the lighting state from the lighting video image, and use a deep learning model to identify real-time lighting parameters of each lighting unit, including: A pre-trained convolutional neural network is used to extract key feature information of the light video image; wherein the key feature information is a feature map pixel value obtained by a convolution operation based on the convolutional neural network; The key feature information is input into a pre-trained deep learning model to identify the real-time brightness level and color category of each light unit; wherein the deep learning model has a built-in activation function to calculate the intensity probability distribution and brightness estimation value of each color channel.
4. The method for synchronizing lighting effects with music signals according to claim 3, characterized in that: A pre-trained convolutional neural network is used to extract key feature information of light video images, including: Based on multiple convolutional layers, feature information of different dimensions of the light video image is extracted to obtain feature maps of multiple dimensions; Use the pooling layer to downsample each feature map to obtain a key information feature map of reduced size; Each key information feature map is normalized to obtain the feature map pixel value.
5. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Before inputting the key feature information into a pre-trained deep learning model to identify the real-time brightness level and color category of each light unit, it also includes: Select a deep learning model, use a labeled light image dataset to learn the brightness level and color category of the light, and optimize the parameters of the deep learning model through the back-propagation algorithm; Set the activation function of the deep learning model and set the Softmax layer to convert the model output into a probability distribution to identify the probability of each category.
6. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Generate an optimal lighting adjustment strategy according to the real-time lighting parameters and the preset objective function, including: Select a reinforcement learning algorithm for lighting effect adjustment and tune its parameters; The objective function of the lighting adjustment is set according to the real-time demand parameters of the stage lighting; wherein the objective function includes: the evaluation index of the stage performance quality and the degree of interference to the audience caused by avoiding frequent changes in lighting adjustment; An optimal lighting adjustment strategy is generated according to the reinforcement learning algorithm and the objective function.
7. The method for synchronizing lighting effects with music signals according to claim 6, characterized in that: The decision-making process of the lighting adjustment strategy is: A t =argmax a Q(S t ,a;θ - ) In the formula, A t is the lighting adjustment action taken at time step t, S t is the current state of the lighting device, Q is the Q function, a is the setting coefficient, θ - is the target network parameter of the reinforcement learning algorithm.
8. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Acquiring the timing characteristic information of the music signal, and dynamically generating continuous lighting adjustment instructions in combination with the real-time lighting parameters, the lighting adjustment strategy and the timing characteristic information, including: Construct a sequence model to learn the time series characteristic information of music rhythm and performance emotion, and train the sequence model using labeled music data and performance datasets; Input the music signal into the sequence model to identify the time series characteristic information and extract useful time series feature information; Continuously input the current real-time lighting parameters, timing feature information, and lighting adjustment strategies into the pre-trained recursive neural network model to output the lighting parameters at the next moment, and calculate the corresponding lighting adjustment instructions accordingly; The output formula of the recurrent neural network model is: L t+1 =RNN(L t ,M t ,φ) Among them, L t+1 is the lighting parameter at the next moment, L t is the lighting parameter at the current moment, M t is the time series feature information vector at the current moment, RNN represents the recursive neural network model, and φ is the parameter of the recursive neural network model.
9. The method for synchronizing lighting effects with music signals according to claim 1, characterized in that: Controlling the lighting effect of the lighting device to be synchronized with the music signal according to the lighting adjustment instruction also includes: Continuously intercept the light video image data stream based on the sliding window; Detecting real-time lighting parameters of each lighting unit of the lighting equipment according to the lighting video image data stream; Compare the deviation difference between the current lighting effect and the expected lighting effect according to the real-time lighting parameters at the current moment; The rate and amplitude of synchronizing the lighting effect of the lighting device with the music signal according to the lighting adjustment instruction are adjusted according to the deviation difference.
10. A computer device, characterized in that: It includes: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the method for synchronizing lighting effects with music signals as described in any one of claims 1-9.
