Lamp bead position identification method and device as well as equipment and product

Through lamp bead grouping and dedicated color matching set encoding, combined with synchronous color rendering instructions and image sequence analysis, the problems of low efficiency and accuracy of lamp bead recognition in traditional technology are solved, and efficient and accurate lamp bead position recognition and light control are achieved.

CN119545617BActive Publication Date: 2025-04-08SHENZHEN INTELLIROCKS TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510104584.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-08
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

Traditional technology has problems such as inefficiency, reduced accuracy and high computational overhead when identifying lamp chains of large numbers of lamp beads, especially in image analysis and color coding.

Method used

By grouping the lamp beads and assigning a unique dedicated color set to each lamp group, a synchronous color rendering command is constructed and sent to the lamp chain, and the lamp beads are driven to switch the light colors simultaneously, so that each lamp bead can display the light colors according to its color matching sequence. The image frame is collected by the imaging unit to form an image sequence, identify the color rendering sequence and correspond to the color matching sequence, and determine the spatial position of the lamp beads.

Benefits of technology

It significantly improves the efficiency and accuracy of lamp bead position recognition, reduces the user's collection time and calculation burden, enhances the real-time and interactiveness of the system, avoids color interference between adjacent lamp beads, and is suitable for complex scenes such as stage lighting and smart homes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119545617B_ABST
    Figure CN119545617B_ABST
Patent Text Reader

Abstract

The present application relates to a method and device for identifying lamp bead positions, as well as equipment and products. The method includes: constructing a lamp chain data structure according to the total number of lamp beads to represent the serial position of each lamp bead, and assigning each lamp bead to at least two lamp groups according to the serial position; determining a dedicated color set for each lamp group, and encoding the unique color sequence of each lamp bead in the lamp group to which it belongs according to each color in the dedicated color set; constructing a synchronous color display instruction according to the color sequence corresponding to each lamp bead and sending it to the lamp chain to drive the synchronous switching of light colors between each lamp bead; using a camera unit to collect image frames corresponding to each synchronous switching of light colors to form an image sequence, and identifying the color display sequence of the lamp bead according to the image sequence; and determining the spatial position of the lamp bead in the graphic space constructed by the image plane of the corresponding image sequence according to the correspondence between the color display sequence and the color matching sequence. The present application can improve the accuracy and efficiency of identifying lamp beads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of lighting control, and in particular to a method and device for identifying lamp bead positions, as well as equipment and products. Background Art

[0002] Light chains refer to lamps made up of a large number of lamp beads connected in series, which can be placed in various occasions to create an atmosphere. In order to conveniently control the target lamp beads in the light chain to emit lights of specified colors through program instructions, it is first necessary to identify the position of the lamp beads, and the precise position identification of the lamp beads is a key technical challenge. Traditional technologies usually rely on complex image analysis and color coding methods to identify and locate each lamp bead in the light chain. However, when the number of lamp beads in the light chain is as high as hundreds or even thousands, traditional technologies face significant limitations.

[0003] First, in order to ensure that a large number of lamp beads in the same lamp chain can be uniquely identified, traditional technology uses a large number of colors, a large color sequence length, and multiple colors for encoding to generate a unique color sequence for each lamp bead. This method has brought about significant efficiency and accuracy problems in practical applications. Users need to spend a long time to acquire images of the light chain in order to collect enough images for detailed image analysis to determine the position of each lamp bead. This process is not only time-consuming and affects efficiency, but also due to the limited stability of the user holding the shooting device, long-term shooting can easily lead to blurred or jittered images, which significantly reduces the accuracy of image recognition.

[0004] Secondly, since each lamp bead needs to change its light color multiple times to provide a unique feature, and the light colors presented by multiple lamp beads are more complex, the light colors of adjacent lamp beads are easily mixed and interfered with each other, resulting in the problem of affecting the accuracy of recognition. In a densely arranged lamp bead layout, the color changes of adjacent lamp beads may overlap with each other, making it difficult to accurately distinguish the color state of each lamp bead during image analysis, thereby reducing the accuracy of recognition and further reducing the accuracy of lamp bead recognition.

[0005] In addition, when dealing with large-scale lamp bead layouts, the color sequence length used is too long due to the large number of lamp beads, which often requires complex calculations and image processing algorithms, which not only increases the computational burden, but may also cause delays and errors in the recognition process. Such delays and errors will further affect the timely use of the light chain.

[0006] It can be seen that when traditional technology processes a large number of lamp chains, there are problems such as low recognition efficiency, reduced image recognition accuracy, and high computing overhead. These problems limit the widespread adoption of traditional technology in practical applications. Therefore, it is necessary to improve traditional technology to improve its various problems. Summary of the invention

[0007] The purpose of this application is to provide a method and device for identifying the position of a lamp bead, as well as equipment and products.

[0008] According to one aspect of the present application, a method for identifying lamp bead positions is provided, including: constructing a lamp chain data structure according to the total number of lamp beads in the lamp chain to represent the serial position of each lamp bead in the lamp chain, and allocating each lamp bead to at least two lamp groups according to the serial position; determining a dedicated color set corresponding to each lamp group, and determining a unique color sequence of each lamp bead in the lamp group to which it is located according to each color code in the dedicated color set; constructing a synchronous color display instruction according to the color sequence corresponding to each lamp bead in the lamp chain data structure and sending it to the lamp chain, driving the lamp beads in the lamp chain to synchronously switch light colors, so that each lamp bead displays the light color according to its corresponding color sequence; using a camera unit to collect image frames corresponding to each synchronous switching of light colors of the lamp chain to form an image sequence, and identifying a color display sequence formed by the lamp beads of the lamp chain switching to display light colors in succession according to the image sequence; and determining the spatial position of the corresponding lamp bead in the lamp chain data structure in the graphic space constructed by the image plane corresponding to the image sequence according to the correspondence between the color display sequence and the color sequence.

[0009] According to another aspect of the present application, a lamp bead position identification device is provided, including: a lamp group allocation module, configured to construct a lamp chain data structure according to the total number of lamp beads in the lamp chain to indicate the serial position of each lamp bead in the lamp chain, and to allocate each lamp bead to at least two lamp groups according to the serial position; a color coding module, configured to determine a dedicated color set corresponding to each lamp group, and to determine a unique color sequence of each lamp bead in the lamp group to which it belongs according to each color code in the dedicated color set; a lamp chain color display module, configured to construct a synchronous color display instruction and concurrently generate a color sequence corresponding to each lamp bead in the lamp chain data structure according to the color sequence corresponding to each lamp bead. The light chain is sent to drive the lamp beads of the light chain to synchronously switch the light colors, so that each lamp bead displays the light color according to its corresponding color sequence; the color recognition module is configured to use the camera unit to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and recognize the color sequence formed by the lamp beads of the light chain switching to display the light colors in turn according to the image sequence; the position determination module is configured to determine the spatial position of the corresponding lamp bead in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence according to the correspondence between the color sequence and the color sequence.

[0010] According to another aspect of the present application, a computer device is provided, including a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the lamp bead position identification method.

[0011] According to another aspect of the present application, a computer program product is provided, including a computer program or computer instructions, and when the computer program or computer instructions are called and executed by a central processing unit, the steps of the lamp bead position identification method are executed.

[0012] Compared with traditional technologies, this application shows significant advantages in many aspects. First, by grouping lamp beads and assigning unique dedicated color sets to each group, the image analysis process is greatly simplified, the recognition efficiency is improved, and the user's time and labor costs in image acquisition are reduced, the computing burden is reduced, delays and errors are reduced, and the real-time and interactivity of the system are enhanced. Secondly, different lamp groups use independent dedicated color sets to construct unique color sequences for lamp beads, which effectively avoids color interference between adjacent lamp beads. Even when the lamp beads are densely arranged, the color state of each lamp bead can be accurately identified, which significantly improves the recognition accuracy and reliability. Furthermore, by optimizing the dedicated color set and the length of the color sequence, while ensuring the recognition accuracy, the required number of image frames and the number of color change rounds are reduced, the image acquisition time is shortened, the computing resource consumption is reduced, and the overall performance and user experience are improved. In addition, when dealing with large-scale lamp bead layouts, this application shows higher scene adaptability, which is suitable for complex scenes such as stage lighting, holiday decorations and smart homes. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 This is a schematic diagram of the electrical structure of an exemplary ambient light device of the present application;

[0015] Figure 2 It is a flowchart of the lamp bead position identification method in the embodiment of the present application;

[0016] Figure 3 It is a structural schematic diagram of a lamp bead position identification device in an embodiment of the present application;

[0017] Figure 4 It is a schematic diagram of the structure of the computer device in the embodiment of the present application. DETAILED DESCRIPTION

[0018] The lamp bead position recognition method of the present application can be implemented as a computer program product, which is installed and run in a computer device. The computer device can be in various forms, including but not limited to various types of mobile terminals, desktop computers, and devices with other functions such as atmosphere lighting devices. The computer device carries a camera unit for obtaining a preview video so as to shoot the light chain to form a live image required for constructing the spatial layout of the light chain. The mobile terminal mentioned here can be a personal device such as a smart phone or a tablet computer.

[0019] See also Figure 1 As can be seen from the structural schematic diagram of an atmosphere light device provided in an embodiment of the present application, the atmosphere light device includes a controller 1, a light chain 2, and an image acquisition interface. The light chain 2 is electrically connected to the controller 1 so as to accept the control of the computer program running in the controller 1 and work together to realize the lighting effect playback.

[0020] The controller 1 generally includes a control chip, a communication component, and a bus connector. In some embodiments, the controller 1 may also be configured with a power adapter, a control panel, a display screen, etc. as required.

[0021] The power adapter is mainly used to convert AC power into DC power to power the entire atmosphere light device. The control chip can be implemented using various embedded chips, such as Bluetooth SoC (System on Chip), WiFi SoC, MCU (Micro Controller Unit), DSP (Digital Signal Processing) and other types of chips. The control chip usually includes a central processing unit and a memory, which are used to store and execute program instructions respectively to achieve the corresponding functions. The above types of control chips can have their own communication components, or they can be configured with additional communication components as needed.

[0022] The communication component can be used to communicate with external devices, for example, it can communicate with mobile terminals such as personal computers or various smart phones, so that after the user issues various configuration instructions through his mobile terminal, the control chip of the controller 1 can receive the configuration instructions through the communication component and complete the basic configuration to control the light chain. In addition, the controller 1 can also obtain the interface image of the terminal device or the real-time preview image captured by the camera unit 3 through the communication component.

[0023] The bus connector is mainly used to connect the power supply to the light chain 2 connected to the bus and provide the lighting effect playing instruction, so the corresponding pins of the power bus and the signal bus are provided. Therefore, when the light chain 2 needs to be connected to the controller 1, it can be connected to the bus connector through the corresponding connector of the light chain 2. The control panel usually provides one or more buttons for implementing the on-off control of the controller 1, selecting various preset lighting effect control modes, etc.

[0024] The display screen can be used to display various control information so as to cooperate with the buttons in the control panel to support the realization of human-computer interaction functions. In some embodiments, the control panel and the display screen can be integrated into the same touch display screen.

[0025] The light chain 2 in the atmosphere light device can be a light strip or a light string, which is flexible and can be molded into any shape of display layout. Each light chain 2 includes a plurality of lamp beads 20 connected in series, each lamp bead 20 serves as a light-emitting unit, and the number of lamp beads 20 in each light chain 2 can be the same and arranged at equal intervals. The lamp beads 20 in the same light chain 2 transmit the working current through the same set of cables connected to the bus, and the lamp beads 20 in the same light chain 2 can be connected in parallel in terms of electrical connection.

[0026] The image acquisition interface can be either a hardware interface or a software interface implemented in the controller 1. When it is a hardware interface, the image acquisition interface can be implemented as a camera unit 3, and the controller 1 loads a corresponding driver to drive the camera unit 3 to work. In one application, the camera unit 3 can be used to shoot a light chain to obtain a live image required to determine the spatial layout of the light chain. The camera unit 3 can be used to capture the interface image required to generate the lighting effect control data.

[0027] When the camera unit 3 is aimed at the target screen, such as the display desktop of the terminal device, or the camera unit 3 is aimed at the physical space environment, the image is captured at a certain frame rate, and the interface image can be captured. When it is a software interface, the image acquisition interface can be an image acquisition program implemented on the controller 1 side with the help of the graphics infrastructure technology provided by the operating system of the terminal device. The controller 1 is connected to the terminal device through various cables such as HDMI and Type-C cables, and the interface image of the terminal device can be continuously obtained with the support of the graphics infrastructure technology; of course, if the controller 1 and the terminal device pre-establish a wireless screen projection protocol, the controller 1 can also obtain the interface image of the terminal device through wireless communication. The graphics infrastructure technology of the operating system varies depending on the type of operating system. For example, the Windows operating system provides a corresponding technology, namely: Microsoft DirectX Graphics Infrastructure, referred to as DXGI, which can achieve this function.

[0028] It can be seen that when the image acquisition interface is responsible for collecting environmental reference images, the specific environment for collecting images can be flexibly set by the user. For example, when the image acquisition interface is a camera unit 3, the user can aim the camera unit 3 at the graphical user interface of the computer to shoot to collect the corresponding interface image as the target image for playing the lighting effect, so that the light chain 2 can generate corresponding lighting effect description data based on the interface image; the user can also aim the camera unit 3 at a physical space environment such as an outdoor environment, and record the real scene image as an environmental reference image, so that the light chain 2 can generate lighting effect description data corresponding to the real scene.

[0029] When the atmosphere lighting device wants to play the lighting effect according to the lighting effect description data, its controller 1 needs to provide the serial position and spatial position of each light-emitting unit in its light chain 2 with the help of the spatial layout of the light chain, and parse the corresponding lighting effect description data into the control data of each light-emitting unit according to the spatial position of each light-emitting unit, and encapsulate the control data of each light-emitting unit into lighting effect control data in the order of serial position, and then send the lighting effect control data to the corresponding light chain, and the control chip of each light-emitting unit in the light chain extracts its own corresponding control data, and controls each light-emitting element therein to emit corresponding color light according to the control data, so that the whole lighting effect can be played under the synergistic effect of the color light emitted by each light-emitting unit.

[0030] It is not difficult to understand that the computer device of the present application is equipped with a camera unit and a graphical user interface, wherein the camera unit 3 can be used to record the scene image to obtain a preview image, and generate the spatial layout of the light chain based on this. The spatial layout of the light chain describes the mapping relationship between the serial position of the lamp beads in the light chain and the spatial position of the light chain in the graphic space corresponding to the physical space in a preset light chain data structure. Based on this, the computer device can also generate a corresponding light chain model based on the spatial position of each lamp bead in the light chain spatial layout and display it in the graphical user interface, so that the user can edit the control data of each lamp bead in the light chain model to construct the corresponding lighting effect. Then, the computer device can convert the lamp beads in the light chain model into the corresponding relationship between their spatial position and serial position according to the information provided by the light chain spatial layout, and the light effect control data that can be parsed by the control chip of each lamp bead in the light chain is used to control the light chain to play the corresponding lighting effect.

[0031] See also Figure 2 In some embodiments, the lamp bead position recognition method of the present application is described by taking the computer device used as a mobile terminal as an example for easy understanding. The method includes:

[0032] Step S5100: construct a light chain data structure according to the total number of lamp beads in the light chain to represent the serial position of each lamp bead in the light chain, and distribute each lamp bead to at least two lamp groups according to the serial position;

[0033] The total number of lamp beads in a light chain can be determined in a variety of ways. One way is to manually set it. For example, the user enters the total number of lamp beads in the light chain through the software interface before using the light chain. Another way is to obtain it from a preset database based on the type of light chain. For example, for a specific model of light strip, the total number of lamp beads is fixed. By reading the model information of the light strip, the corresponding total number of lamp beads can be obtained from the device's memory or cloud database. In addition to the above-mentioned manual setting and obtaining from the preset database, it can also be determined by automatic detection. For example, the number of lamp beads can be automatically calculated using sensors on the light chain or by sending specific detection signals.

[0034] The light chain data structure is used to represent the serial position and spatial position of each lamp bead in the light chain and other possible intermediate data, such as color matching sequence. The data structure can be an array or a linked list, in which each element corresponds to a lamp bead, and the index of the element represents the serial position of the lamp bead. For example, if the light chain has 500 lamp beads, the light chain data structure can be an array of length 500, and the array indexes 0 to 499 correspond to lamp beads 1 to lamp beads 500, respectively. After being processed by the present application, the light chain data structure can form a light chain spatial layout, which is used as the basis for the light chain to parse and play lighting effects. For example, according to the light chain spatial layout, the controller can parse the lighting effect description data into control data for each lamp bead, and send it to the light chain in serial position order.

[0035] In order to reduce the complexity of configuring the color change sequence for all the lamp beads, all the lamp beads of the lamp chain can be allocated to two or more lamp groups based on their serial positions, and then the unique color matching sequence of the lamp beads of each lamp group can be specifically configured for each lamp group. When allocating the lamp beads to each lamp group, all the lamp beads can be evenly allocated to each lamp group according to the number of grouping intervals, or a non-uniform allocation method can be adopted to allocate lamp beads of multiple partial sections or multiple local areas to each lamp group.

[0036] In an embodiment in which all lamp beads are evenly distributed, the number of grouping intervals is used to distribute the lamp beads in the lamp chain into multiple lamp groups. The number of grouping intervals can be preset manually. For example, if the total number of lamp beads is 500, the number of grouping intervals can be preset to 10, which means that every 10 lamp beads are grouped together. Another way is to determine the maximum number of codes for a single group based on the preset maximum color length and the maximum number of colors in the dedicated color set, and then divide the total number of lamp beads by the maximum number of codes for a single group and round up to get the total number of lamp groups. This will be disclosed in detail later.

[0037] This step first requires building a light chain data structure based on the total number of lamp beads in the light chain. In this structure, the serial position of each lamp bead is pre-allocated and recorded in detail according to the total number of lamp beads in the light chain. Once the total number of lamp beads is determined, the corresponding light chain data structure can be built, such as an array or a linked list, in which each element not only represents the serial position of a lamp bead, but also can store other information related to the lamp bead, such as its expected color change sequence, brightness setting, etc.

[0038] Next, multiple light groups are set according to the grouping interval number. As disclosed above, the grouping interval number can be fixed or dynamically calculated. The grouping interval number is not only the number of light groups, but also indicates the interval number of each light group in the light chain.

[0039] The process of assigning the lamp beads to the corresponding lamp groups is based on the serial position of the lamp beads and the order of the lamp groups. This process can be achieved through simple mathematical operations, for example, by taking a modulo operation to determine which lamp group each lamp bead belongs to. In this way, each lamp group contains the lamp beads arranged in a certain order on the lamp chain, and these lamp beads will receive subsequent color coding and control instructions as a whole.

[0040] In an embodiment of non-uniform distribution of all lamp beads, the number of image frames to be sampled, that is, the sampling number, can be used as an index, and then, in combination with a plurality of pre-selected color numbers, such as 5, 4, 3, 2, etc., a simulated number can be calculated with the number of colors as the base and the sampling number as the index. The simulated numbers of different colors can be arbitrarily combined to obtain the combined sum, and the minimum value of the combined sum that just reaches or exceeds the total number of lamp beads is determined. The number of lamp groups is set according to this minimum value, and then, the lamp beads are sampled at intervals or randomly sampled and distributed to each lamp bead to achieve non-uniform distribution, and ultimately each lamp group can use a relatively optimal number of colors to encode the color sequence of each lamp bead, and all lamp groups can express the unique color changes of each lamp bead through a plurality of image frames corresponding to the sampling number.

[0041] For example, if there are 800 lamp beads in total and there are only four colors and they are not grouped or evenly grouped, then 5 photos need to be taken, that is, 4^5=1024, which is greater than 800. If non-uniform grouping is used, that is, one group is 5 colors and the other group is 4 colors, 5^4=625, 4^4=256, which add up to more than 800, then only 4 image frames are needed to complete the recognition of the color change sequence of all lamp beads. It can be seen that the non-uniform grouping method can also reduce the number of pictures required to be collected during the recognition process, which can improve the recognition efficiency.

[0042] Step S5200, determining a dedicated color set corresponding to each lamp group, and determining a unique color sequence of each lamp bead in the lamp group in which it is located according to each color code in the dedicated color set;

[0043] Each light group is independently equipped with a dedicated color set. The dedicated color set contains a set of specific colors, which will be used to define the color changes of the lamp beads so that the position of the lamp beads can be identified by the camera unit in the subsequent steps. The unique color sequence refers to the description sequence composed of the sequential color changes of each lamp bead according to the colors in the dedicated color set. This sequence is unique for the lamp beads in the same light group. In some embodiments, this color series can also be controlled to be unique in the entire light chain data structure. In some embodiments, the dedicated color set of each light group can be constructed to be unique, which makes it easier to highlight the uniqueness of the color sequence of each lamp bead at all levels of the light chain, thereby ensuring that each lamp bead can be accurately identified by its color change.

[0044] There are many implementations for determining a dedicated color set. In one implementation, a set of colors is predefined, and then these colors are allocated according to the number of lamp groups and the number of lamp beads. For example, if the light chain is divided into 10 lamp groups, 10 different color combinations, i.e., dedicated color sets, can be predefined, and each color combination contains several different colors. Then, these color combinations are allocated to each lamp group. As a preferred embodiment, it can be ensured that the color combination of each lamp group is unique.

[0045] Another implementation is to dynamically generate a dedicated color set. This can be achieved by a preset algorithm that selects colors from a large color library based on the number of lamp groups and the number of lamp beads to generate a unique color combination. For example, a color space (such as the RGB color space) can be used to generate colors to ensure that the generated colors are visually distinguishable. The algorithm can take into account the contrast between colors to make the difference between colors difficult for the human eye to confuse, so as to avoid colors that are too similar and difficult to identify.

[0046] Different dedicated color sets corresponding to different lamp groups may contain completely different colors or some of the same colors. In order to distinguish the colors between different dedicated color sets, in one embodiment, one dedicated color set may contain multiple primary colors, and another dedicated color set may contain complementary colors corresponding to the multiple primary colors, so that the difference between the colors of the lights presented by the lamp beads of the two corresponding lamp groups is clearer through the effect of the two dedicated color sets, thereby improving the recognition and thus the recognition rate.

[0047] Similarly, different dedicated color sets corresponding to different lamp groups can have the same or different numbers of colors. For example, one dedicated color set has 3 colors and the other has 4 colors. Obviously, the latter has more unique color sequences encoded and is more suitable for lamp groups with a large number of lamp beads, while the former has fewer unique color sequences and is faster to identify. The number of colors in a dedicated color set can be flexibly determined according to the number of lamp beads in the lamp group.

[0048] After determining the dedicated color set for each light group, the unique color sequence of each lamp bead can be determined based on these dedicated color sets. This can be achieved by assigning the colors in the dedicated color set to the lamp beads in a certain order. For example, if a light group's dedicated color set contains red, green, and blue, then the lamp beads in the light group can change color in the order of red, green, and blue. This order can be pre-defined or dynamically generated by an algorithm to ensure that the color sequence of each lamp bead is unique.

[0049] In practical applications, the length of the color sequence and the choice of color can be flexibly adjusted. For example, if there are a large number of lamp beads, a longer color sequence and more colors can be used to ensure the uniqueness of each lamp bead. The dedicated color set has three colors: red, green, and blue. Each color position in the color sequence has A=3 possibilities, expressed as A N , where N refers to the number of color bits in the color sequence, that is, the length of the color sequence. Assuming that the number of lamp beads in the lamp group is M=200 lamp beads, A N >M, take the logarithm of N and get 5, that is, the length of the color sequence is 5. On the contrary, if the number of lamp beads is small, a shorter color sequence and fewer colors can be used. In addition, environmental factors such as light conditions and the performance of the camera unit can also be considered to select the most appropriate color and color sequence.

[0050] Step S5300: construct a synchronous color display instruction according to the color matching sequence corresponding to each lamp bead in the light chain data structure and send it to the light chain, drive the lamp beads of the light chain to synchronously switch the light color, so that each lamp bead displays the light color according to its corresponding color matching sequence;

[0051] The synchronous color display instruction can be constructed based on the color sequence of each lamp bead recorded in the light chain data structure. These color sequences are generated according to the special color set of each light group previously determined. For example, if the light chain is divided into three light groups, the lamp beads contained in each light group are selected every three lamp beads in the light chain, such as the serial positions of the lamp beads contained in the first light group are 1, 4, 7..., the serial positions of the lamp beads contained in the second light group are 2, 5, 8..., and so on. The color sequence of each light group is different due to the different colors of the special color set used. For example, the color sequence of the first lamp bead of the first light group is red, green and blue, the color sequence of the first lamp bead of the second light group is yellow and purple, and the color sequence of the first lamp bead of the third light group is orange and green.

[0052] In order to construct synchronous color display instructions, it is necessary to follow the alignment relationship of the color matching sequences, take the longest color matching sequence as the basis, and take one color from each light group in sequence to form a synchronous color display instruction for a timing. Corresponding to the previous example, for the first lamp bead of each light group, their corresponding synchronous color display instructions for the first timing are red, yellow, and orange, and the synchronous color display instructions for the second timing are green, purple, and cyan. For the synchronous color display instructions for the third timing, since the second and third light groups do not have corresponding colors, these lamp beads can remain black, that is, blue, black, and black. Such synchronous color display instructions ensure that the lamp beads of each light group can display the correct color in each timing, thereby forming a coordinated color change pattern on the entire light chain.

[0053] In actual applications, each synchronous color display instruction can be sent to the light chain according to the preset time slot sequence to analyze and display the light color one by one, or all synchronous color display instructions can be combined into the same instruction and sent to the light chain, which will play them in sequence by itself.

[0054] There are many ways to construct synchronous color display instructions. One way is to automatically generate these instructions through a software algorithm. The algorithm determines the color that each lamp bead should display in each sequence according to the color sequence of each lamp group and the serial position of the lamp bead. Another way is to allow users to customize synchronous color display instructions through a user interface. Users can adjust the color change order of each lamp group according to their own design requirements.

[0055] When sending synchronous color display instructions to the light chain, a variety of communication protocols can be used, such as Bluetooth, Wi-Fi or wired connection. These instructions will be received and parsed by the control unit of the light chain, and then the control unit will drive the corresponding lamp beads to display the specified color according to the instructions. For example, if Bluetooth communication is used, the application on the mobile terminal can send a Bluetooth signal to the controller of the light chain. After receiving the signal, the controller will control the color change of the lamp beads according to the signal content, so that the lamp beads will show the corresponding light color.

[0056] Step S5400, using a camera unit to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and identifying a color sequence formed by the lights of the light chain being switched in sequence according to the image sequence;

[0057] After the first synchronous color display command is issued, the camera unit is responsible for capturing images of the light chain when executing the synchronous color display command. These images are instant records of the lamp beads changing color according to the preset color sequence. In order to achieve this function, the camera unit needs to have a sufficient frame rate to ensure that every detail of the color change of the lamp beads can be captured. For example, if the color of the lamp beads changes quickly, the frame rate of the camera unit should be increased accordingly to ensure that no important color change moments are missed.

[0058] In actual operation, the camera unit can be a camera built into a mobile terminal or a dedicated image acquisition device. These devices need to work synchronously with the control unit of the light chain to ensure that the image can be accurately captured at the moment the color of the lamp beads changes. For example, the shooting timing of the camera unit can be controlled by a software algorithm to be synchronized with the color change instruction of the light chain. In this way, each time the color of the lamp beads changes, the camera unit can capture the corresponding image frame in time. For scenes where the camera unit can automatically obtain preview images, the image frame can be extracted by automatically identifying the clearest image frame from the preview image. For the same color state displayed by the light chain, the camera unit can also be controlled to automatically zoom the aperture to identify the clearest image frame that can contain the largest number of lamp beads.

[0059] The collected image frames will be constructed into an image sequence, which contains the color states of the lamp beads at different time points. By analyzing this image sequence, the light color of the lamp bead in each image frame can be identified. The light colors determined in each image frame are arranged in order, and the color display sequence of the lamp bead is obtained, that is, the color change sequence displayed by the lamp bead in chronological order. This process can be achieved through image processing algorithms, for example, using color recognition algorithms to determine the color of each lamp bead in each image frame. These algorithms can accurately identify colors based on the RGB value of the color or other color models, and compare them with the preset color matching sequence.

[0060] In order to improve the accuracy of recognition, a variety of image processing techniques can be used. For example, an edge detection algorithm can be used to determine the location of the lamp beads in the image, and then color analysis can be performed on these locations. In addition, filtering and noise reduction techniques can be used to reduce the impact of ambient light and other interference factors on color recognition. In some embodiments, a machine learning algorithm can be used to train a model that can automatically recognize and distinguish the color changes of different lamp beads, thereby improving the efficiency and accuracy of recognition.

[0061] Step S5500: According to the correspondence between the color display sequence and the color matching sequence, determine the spatial position of the corresponding lamp beads in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence.

[0062] In order to determine the correspondence between the color sequence and the color matching sequence, each image frame in the acquired image sequence has been analyzed in advance to identify the color of each lamp bead in the image frame, thereby obtaining the color sequence of each lamp bead. On this basis, the color sequence is matched with the color matching sequence of each lamp bead recorded in the light chain data structure. For example, if the color sequence of a certain lamp bead is exactly the same as the color matching sequence of the nth lamp bead recorded in the light chain data structure, then it can be determined that the spatial position of the lamp bead in the image plane corresponds to the serial position of the nth lamp bead.

[0063] In some embodiments, considering that in a longer light chain, two lamp beads that are far apart will not interfere with each other even if they have the same color display sequence, in this case, the uniqueness of the color sequence is only reflected within the light group. Therefore, if the color sequence of a lamp bead is unique only in the light group to which it is located, but not at the light chain data structure level, the corresponding color sequence corresponding to the color display sequence of the lamp bead can be searched in the light group where the lamp bead is located, taking the light group as a unit.

[0064] In order to improve the accuracy of matching, a variety of algorithms can be used. For example, a hash algorithm can be used to encode the color sequence and the color matching sequence, and then the matching lamp beads can be quickly determined by comparing the hash values. In addition, a fault-tolerant matching algorithm can be used. Considering that there may be color recognition errors or abnormal display of lamp beads in the actual environment, color differences are allowed within a certain range, but the approximate spatial position of the lamp beads can still be determined.

[0065] In practical applications, image processing technology can also be combined to assist in determining the spatial position of lamp beads. For example, the lamp bead area in the image is separated by an image segmentation algorithm, and then color analysis and matching are performed on each lamp bead area. At the same time, the geometric features of the image, such as the shape, size, and arrangement of the lamp beads, can be used to further verify and determine the spatial position of the lamp beads. For example, if the lamp beads are arranged according to a certain geometric pattern, such as a rectangular or circular array, then the spatial position of the lamp beads in the graphic space can be inferred based on their relative position and arrangement pattern in the image.

[0066] Constructing the graphic space can be achieved by analyzing the image frames captured by the camera unit. This graphic space can be two-dimensional or three-dimensional, depending on the application scenario and the required accuracy. For two-dimensional space, it can be represented by a simple image coordinate system, where the position of each lamp bead in the image frame is determined by its pixel coordinates (x, y). For three-dimensional space, the depth coordinates (x, y, z) of the lamp bead can be calculated using additional depth information or images from multiple perspectives. Once the coordinates of the lamp bead in the image frame are determined, these coordinates can be mapped into the graphic space to obtain the coordinates of the lamp bead in the space. These coordinates not only represent the position of the lamp bead in the image, but also indirectly reflect the relative position of the lamp bead in the physical space. By marking these spatial position information into the light chain data structure, a mapping relationship between the spatial position and serial position of the lamp bead is established. This mapping relationship is the key to constructing the spatial layout of the light chain. It allows the controller to parse and play the lighting effects according to the physical position of the lamp bead, ensuring that the lighting effects can be accurately displayed on the light chain according to the designed pattern. For example, if a dynamic light chasing effect is designed, the controller can use this mapping relationship to accurately control the on and off and color changes of each lamp bead, so that the lighting effect flows along the predetermined path on the light chain.

[0067] According to the above embodiments, the present invention has many beneficial effects compared with the traditional technology, including but not limited to:

[0068] First, by grouping the lamp beads and assigning a dedicated color set to each lamp group, the number of lamp beads in each lamp group is significantly reduced, thereby reducing the complexity of image analysis. This not only improves recognition efficiency, but also reduces the time and effort required by users during image acquisition. As the number of lamp beads in each lamp group is reduced, the computational burden of image analysis is also reduced, thereby reducing delays and errors in the recognition process and improving real-time and interactivity.

[0069] Secondly, by assigning different dedicated color sets to each light group, the problem of color interference between adjacent lamp beads is effectively solved. Since different light groups use different color codes, the light colors synchronously presented by adjacent lamp beads between each light group can be significantly different through different dedicated color sets. Even in a densely arranged lamp bead layout, the color state of each lamp bead can be accurately distinguished through the uniqueness of color, thereby improving the accuracy of lamp bead recognition. Not only does it improve the accuracy of image recognition, it also reduces recognition errors caused by color aliasing, and further improves the reliability and stability of recognition.

[0070] Furthermore, by optimizing the number of colors and the length of the color sequence in the dedicated color set, the recognition efficiency is further improved. Through reasonable grouping and color coding, the number of image frames and color change rounds required can be significantly reduced while ensuring recognition accuracy. This not only reduces the time for image acquisition, but also reduces the consumption of computing resources, improving overall performance and user experience.

[0071] In addition, when dealing with large-scale lamp bead layouts, since the technical solution of the present application can maintain high recognition efficiency and accuracy, it is more scene-adaptive and thus more suitable for various complex application scenarios, such as stage lighting, holiday decorations, and smart home systems.

[0072] Based on any embodiment of the method of the present application, each lamp bead is allocated to at least two lamp groups according to the serial position, including:

[0073] Step S5110, determining the maximum number of codes for a single group according to the preset maximum color matching length and the maximum number of colors in the dedicated color matching set;

[0074] The maximum color length refers to the maximum number of colors that can be displayed in a color sequence of the lamp beads. The maximum number of colors in a dedicated color set refers to the maximum number of colors in a dedicated color set assigned to a lamp group. These two parameters can be pre-set or flexibly open to users for selection. For example, users can select the colors in the dedicated color sets to determine the number of colors in each dedicated color set, thereby determining the maximum number of colors.

[0075] For example, if the maximum number of colors that a lamp bead can display is 4, and the maximum number of colors in a single dedicated color set is 3, then the maximum number of codes in a single group can be calculated, that is, 3 4 = 81. The code number in this example means that the lamp group with the most colors in the dedicated color set can have 81 unique color sequences corresponding to a maximum of 81 lamp beads.

[0076] Step S5120, dividing the total number of lamp beads in the lamp chain by the maximum number of codes for a single group and rounding up to determine the total number of lamp groups;

[0077] To determine the total number of groups, the total number of lamp beads in the light chain can be divided by the maximum number of codes per group, and then rounded up to determine the total number of groups. For example, if the light chain has 500 lamp beads and the maximum number of codes per group is 81, then the result of 500 divided by 81 is rounded up to 7, which means that the light chain needs to be divided into 7 groups. The purpose of this is to ensure that the number of lamp beads in each group does not exceed the range allowed by the maximum number of codes per group, so that the lamp beads in each group can be distinguished by unique color coding.

[0078] Step S5130, taking the total number of light groups as the number of grouping intervals, setting a corresponding number of light groups, and sequentially numbering each light group;

[0079] After determining the total number of light groups, use the total number of light groups as the number of grouping intervals, set up multiple light groups of the corresponding number, and number these light groups in sequence. This process is the basis for the grouping of lamp beads, which defines the number of light groups to which the lamp beads on the light chain will be assigned and the identification of each light group. For example, if there are 7 light groups, then these light groups can be numbered 1 to 7. This numbering process not only helps to reference specific light groups in subsequent steps, but also facilitates the management and control of light groups. Each light group will receive lamp beads according to its number sequence, ensuring that the allocation of lamp beads is orderly.

[0080] Step S5140, divide all the lamp beads into segments according to the grouping separation number, and add the lamp beads in each segment that correspond to the order of the lamp groups to the corresponding lamp group.

[0081] All the lamp beads are divided into segments according to the number of grouping intervals, and the lamp beads in each segment that correspond to the order of the lamp groups are added to the corresponding lamp groups. This step is the specific implementation of lamp bead allocation. Taking the total number of lamp groups as 7 as an example, if the total number of lamp beads is 500, then every 7 lamp beads are a segment, and the lamp beads (1-7) of the first segment will be allocated to the lamp groups numbered 1 to 7 respectively, and the lamp beads (8-14) of the second segment will also be allocated to the lamp groups numbered 1 to 7 in order, and so on, until all the lamp beads are allocated. This allocation method ensures that the lamp beads are evenly distributed on the light chain and the number of lamp beads in each lamp group is roughly equal.

[0082] After executing the above embodiments, the significant technical advantages achieved by this application are mainly reflected in the following aspects:

[0083] First, by accurately calculating the maximum number of codes in a single group and determining the total number of lamp groups accordingly, the grouping strategy of the lamp beads can be planned scientifically and rationally, ensuring that the number of lamp beads in each lamp group is moderate, and neither the complexity of color coding and the difficulty of identification will be greatly increased due to too many lamp beads, nor will resources be wasted due to too few lamp beads. This lays a solid foundation for the subsequent color coding and identification steps, allowing the entire lamp bead position identification system to effectively control complexity and cost while ensuring identification accuracy.

[0084] Secondly, the total number of light groups is used as the grouping interval number, and the light groups are numbered sequentially, which provides a clear and orderly rule for the allocation of lamp beads. This regular allocation method greatly simplifies the logic of lamp bead allocation, so that the lamp beads can be quickly and accurately allocated to the corresponding light groups according to the predetermined order. This not only improves the efficiency of lamp bead allocation, but also facilitates the management and control of light groups in practical applications.

[0085] Thirdly, all the lamp beads are segmented sequentially according to the number of grouping intervals, and the lamp beads in each segment are added to the corresponding lamp group, so as to achieve uniform distribution of the lamp beads on the light chain. This uniform distribution layout method is conducive to maintaining the consistency and uniformity of the lighting effect, avoiding the phenomenon of local over-brightness or over-darkness caused by uneven distribution of lamp beads, thereby improving the overall visual effect. At the same time, evenly distributed lamp beads also help to improve the accuracy and reliability of color recognition, because in the case of uniform distribution, the color interference between adjacent lamp beads is relatively small, and it is easier to be accurately identified.

[0086] Finally, the synergistic effect of the above steps makes the lamp bead position recognition method of the present application perform well and well when dealing with large-scale lamp bead layouts. Whether facing a lamp chain with hundreds or thousands of lamp beads, the present application can efficiently and accurately complete the lamp bead position recognition task, showing good scalability and adaptability. This makes the present application not only suitable for small decorative lamp chains, but also able to meet the needs of complex scenes such as large stage lighting and architectural lighting, and has broad application prospects and practical application value.

[0087] Based on any embodiment of the method of the present application, a dedicated color set corresponding to each lamp group is determined, and a unique color sequence of each lamp bead in the lamp group to which it belongs is determined according to each color code in the dedicated color set, including:

[0088] Step S5210: Determine the minimum number of colors required for the dedicated color set of each lamp group according to the number of lamp beads in each lamp group and the preset bit length of the color sequence of the lamp beads;

[0089] In the process of determining the dedicated color set corresponding to each light group, it is first necessary to determine the minimum number of colors required for the dedicated color set of each light group based on the number of lamp beads in each light group and the preset bit length of the color sequence of the lamp beads. This process is a key step to ensure that the lamp beads in each light group can obtain a unique color sequence. Specifically, the preset bit length of the color sequence refers to the number of colors displayed by each lamp bead during the color change process, and the number of lamp beads in the light group directly determines how many different color combinations are needed to assign a unique color sequence to each lamp bead.

[0090] In order to calculate the minimum number X of colors required for each lamp group, the mathematical principle of repeated arrangement can be used. For example, if a lamp group has N lamp beads, and the preset bit length of the color sequence of each lamp bead is M, then in order to ensure that each lamp bead has a unique color sequence, the dedicated color set must contain at least a sufficient number of colors so that the number of all possible permutations of these colors is greater than or equal to N. In this way, each lamp bead can be assigned a non-repeating color sequence, so that it can be accurately distinguished in the subsequent color recognition step. Summarizing this principle, the following formula can be obtained:

[0091]

[0092] By solving the above formula, the minimum quantity X can be determined.

[0093] Step S5220: for different lamp groups, according to different target quantities that are not less than the minimum quantity of the lamp group, determine from the color space a corresponding plurality of different colors to form a dedicated color set for the corresponding lamp group;

[0094] For different light groups, a target number not less than the minimum number of required colors calculated previously can be selected, and then a plurality of colors of the corresponding target number can be selected from the color space for each light group to form a dedicated color set to achieve color selection.

[0095] Color space refers to the collection of all possible colors, which can be RGB (red, green, blue) color space, CMYK (cyan, magenta, yellow, black) color space or any other model that can represent color. In practical applications, RGB color space is usually chosen because it can provide a rich selection of colors and is suitable for color control of lighting equipment.

[0096] In order to ensure that the colors in the dedicated color set of each lamp group can provide enough unique color sequences for the lamp beads, it is necessary to select colors from the color space that can meet the needs of the lamp group. This can be achieved in a variety of ways. For example, a color selection algorithm can be used to select colors based on properties such as color brightness, saturation, or hue. Another way is to allow users to select colors based on their preferences and design requirements through a user interface. Regardless of the method used, the goal is to ensure that the selected colors can be clearly distinguished visually, thereby improving the accuracy and reliability of subsequent color recognition.

[0097] When choosing colors, you also need to consider the actual display effect of the lamp beads and the recognition ability of the camera unit. For example, some colors may be difficult to accurately identify under certain lighting conditions, or the difference between some colors may not be enough to be distinguished by the camera unit. Therefore, when choosing colors, you should try to avoid these colors that may cause recognition problems. In addition, in order to further improve the color distinction, you can choose colors that are far apart in the color space, because these colors are usually easier to distinguish visually.

[0098] Step S5230: for each lamp group, repeatedly arrange the colors in the dedicated color set of the lamp group to determine a plurality of color sequences required by each lamp bead in the lamp group as its color sequence.

[0099] In order to associate a color sequence as the color matching sequence for each lamp bead in the lamp group and ensure that each lamp bead can display a unique color combination during the color change process, so that it can be accurately distinguished in the subsequent color recognition step, a repeated arrangement method is used to determine the color matching sequence for the lamp beads in the lamp group.

[0100] First, for each light group, collect all the colors in its dedicated color set. These colors are previously determined based on the number of lamp beads in the light group and the preset bit length of the color sequence, ensuring that there are enough colors to generate a unique color sequence. For example, if a light group's dedicated color set includes red, green, and blue, then these three colors will be used to generate the color sequence of all the lamp beads in the light group.

[0101] Next, the colors are permuted repeatedly. This means that the color choice at each position is independent, and any color in the dedicated color set can be reused. For example, for a four-digit color sequence, possible permutations include "red red red red", "red red red green", "red red green red", and so on, up to "blue blue blue blue". This repetitive permutation method greatly increases the number of color sequences that can be generated, ensuring that each lamp bead can obtain a unique color sequence.

[0102] Then, from all the generated color sequences, a unique color sequence is assigned to each lamp bead in the lamp group. This can be achieved through simple sequential assignment, or it can be optimized according to specific rules or algorithms to ensure that the color sequence is evenly distributed and has good visual effects. For example, those color sequences with higher visual contrast or more attractiveness can be assigned first to enhance the aesthetics of the lighting effect.

[0103] Finally, the color sequence assigned to each lamp bead is recorded in the light chain data structure. In this way, each lamp bead not only has a unique serial position identifier, but also has a unique color sequence associated with it. This color sequence will be used in subsequent lighting control and display to ensure that each lamp bead can be displayed in the predetermined color sequence, thereby achieving complex lighting effects.

[0104] After executing the above embodiments, the significant technical advantages achieved by the present application are mainly reflected in ensuring that the lamp beads in each lamp group can obtain a unique color sequence, so that they can be accurately distinguished in the color recognition step. By accurately calculating the minimum number of colors required for each lamp group, and selecting colors that meet the requirements from the color space to form a dedicated color set, not only the diversity and distinction of the colors are guaranteed, but also the actual display effect of the lamp beads and the recognition ability of the camera unit are taken into account, avoiding the recognition problem caused by improper color selection. Furthermore, a repeated arrangement method is applied to assign a unique color sequence to each lamp bead, and these sequences are associated with the light chain data structure, which not only improves the accuracy and reliability of color recognition, but also facilitates query and call, and provides a solid technical foundation for realizing efficient lamp bead position recognition and precise lighting effect control. These technical effects work together to enable the present application to perform well in processing large-scale lamp bead layouts, and can meet the diverse needs for lighting effects in different scenarios, and has broad application prospects and practical application value.

[0105] On the basis of any embodiment of the method of the present application, for different lamp groups, according to different target quantities that are not less than the minimum quantity of the lamp group, a corresponding plurality of different colors are determined from the color space to form a dedicated color set for the corresponding lamp group, including:

[0106] Step S5221: determine multiple primary colors belonging to different color systems from the color space according to half of the total target number of light groups required by all light groups, and determine the complementary color of each primary color;

[0107] In the process of determining the dedicated color set for different light groups, multiple primary colors belonging to different color families are first selected from the color space, and the complementary colors of these primary colors are determined. This process is performed based on half of the total number of target colors required for all light groups, in order to ensure that the selected colors are visually distinguishable enough and can meet the color diversity requirements of all light groups. The complementary colors of the primary colors are determined to increase color contrast and improve the accuracy and reliability of subsequent color recognition.

[0108] Step S5222: According to the rule that each dedicated color set contains at least one primary color and its complementary color, a corresponding target number of colors are determined for each light group to form a dedicated color set.

[0109] According to the rule that each dedicated color set contains at least one primary color and its complementary color, a number of colors with a corresponding target number are determined for each light group to form a dedicated color set. This means that the dedicated color set of each light group contains not only the basic primary color, but also the complementary color that contrasts with it, as well as other possible colors to achieve the predetermined target number. Such a dedicated color set design helps the camera unit to accurately identify the color displayed by the lamp beads even in complex lighting environments. In addition, the dedicated color set containing complementary colors can also enhance the visual effect, making the lighting effect more vivid and attractive.

[0110] After executing the above embodiments, the significant technical advantage achieved by the present application is that by scientifically and rationally selecting the primary color and its complementary color, and constructing a dedicated color set containing these colors, the accuracy and reliability of lamp bead color recognition are greatly improved. This method not only ensures that the lamp beads of each lamp group can be accurately distinguished when the color changes, but also enhances the visual expression of the entire light chain in different environments. At the same time, because the construction of the dedicated color set takes into account the visual distinction and recognition ability of the color, this makes the lamp bead position recognition method of the present application more efficient and practical in actual applications, and can meet the lighting control requirements in various complex scenarios.

[0111] Based on any embodiment of the method of the present application, each lamp bead is allocated to at least two lamp groups according to the serial position, including:

[0112] Step S6100: determining a distribution combination of the total number of lamp beads of the lamp chain according to a preset sampling number and a plurality of color numbers, wherein the distribution combination defines the number of elements of at least two lamp groups, and the sum of the number of elements of each lamp group is greater than or equal to the total number of lamp beads;

[0113] The distribution combination of the total number of lamp beads in the light chain is determined according to the preset sampling number and multiple color numbers. This distribution combination defines the number of elements of at least two lamp groups, and the sum of the number of elements of each lamp group is greater than or equal to the total number of lamp beads. Specifically, the sampling number refers to the number of image frames that need to be captured during the recognition process. For example, if the sampling number is 4, then the length of the color sequence of each lamp group is 4.

[0114] In order to determine the distribution combination, you can combine the pre-selected multiple color numbers (such as 5, 4, 3, 2, etc.) to calculate the pseudo-number with the color number as the base and the sampling number as the exponent. By combining the pseudo-numbers of different color numbers at random, the sum of the combinations is obtained, and the minimum value of the sum of the combinations that just reaches or exceeds the total number of lamp beads is determined. This minimum value will be used to set the number of lamp groups.

[0115] For example, suppose the total number of lamp beads is 800 and the number of samples is 4. If there are only four colors and they are not grouped or evenly grouped, 5 photos need to be taken, that is, 4 5=1024, which is greater than 800. If non-uniform grouping is used, one group has 5 colors and the other group has 4 colors, the calculation is as follows:

[0116] 5 4 =625

[0117] 4 4 =256

[0118] Adding these two calculated numbers together, we get 625+256=881, which is greater than 800. Therefore, the lamp beads can be allocated to two lamp groups, one lamp group uses 5 colors and the other lamp group uses 4 colors.

[0119] Step S6200, discretely allocating each lamp bead to the at least two lamp groups according to the serial position;

[0120] According to the distribution combination determined in step S6100, the number of elements in each lamp group is already clear. For example, if the total number of lamp beads is 800, the number of samples is 4, and the distribution combination is determined as one lamp group using 5 colors and another lamp group using 4 colors, then the lamp beads can be allocated in the following way:

[0121] The first method can be the interval sampling method. In the previous example, the number of lamp beads in the first lamp group is 625, and the number of lamp beads in the second lamp group is 256. The former is roughly twice the latter. Therefore, cyclic sampling can be performed at intervals of three lamp beads. For every three lamp beads, the first two are added to the first lamp group, and the last one is added to the first lamp group, and so on, so that each lamp group has the lamp beads it deserves.

[0122] The second method may be a local sampling method. For example, in the previous example, the first 625 lamp beads may be added and distributed to the first lamp group, and the remaining 255 lamp beads may be added to the second lamp group.

[0123] Step S6300: Determine the number of colors of the dedicated color set of the corresponding lamp group based on the number of colors used in the distribution combination to determine all the selected colors of the dedicated color set.

[0124] Since the allocation of light groups is obtained by calculating the distribution combination based on the sampling quantity combined with multiple color numbers, and selecting the optimal distribution combination, the optimal distribution combination corresponds to the number of colors of each light group, which can be used to guide the selection of the number of colors in the dedicated color set of this light group. Subsequently, the corresponding number of colors can be selected for the corresponding light group according to the corresponding number of colors.

[0125] This embodiment determines the distribution combination of the total number of lamp beads in the light chain by combining a preset number of samples and a plurality of color numbers, thereby allocating the lamp beads to at least two light groups. This not only improves the efficiency of color sequence generation, but also ensures that the lamp beads in each light group can obtain a unique color sequence, so that they can be accurately distinguished in the subsequent color recognition step. By selecting the optimal distribution combination, the number of required shots can be minimized, the consumption of computing resources can be reduced, and the overall performance of the system can be improved. In addition, by means of interval sampling or local sampling, the lamp beads can be flexibly allocated to different light groups to ensure that the number of elements in each light group meets the preset distribution combination. This method not only improves the flexibility of lamp bead allocation, but also enhances the adaptability and robustness of the system, enabling it to better cope with light chain systems of different scales and layouts. Finally, by determining the number of colors in a dedicated color set for each light group, it is ensured that each light group has enough colors to generate a unique color sequence, thereby achieving precise lighting control and dynamic display effects, and significantly improving the user experience.

[0126] On the basis of any embodiment of the method of the present application, according to the color matching sequence corresponding to each lamp bead in the light chain data structure, constructing a synchronous color display instruction and sending it to the light chain, including:

[0127] Step S5310: Sort the same colors in the color matching sequence of the lamp beads according to the order correspondence, and associate the serial position of each lamp bead to construct a synchronous color display instruction of the timing corresponding to the order;

[0128] When constructing a synchronous color display instruction, first create an instruction corresponding to a specific timing according to the color matching sequence of the lamp beads and their serial positions. To this end, the colors with the same order in the color matching sequence of all the lamp beads in the light chain are associated one by one to construct a synchronous color display instruction. Specifically, at a certain timing point, all the lamp beads in the light chain that should display colors determine the color of each lamp bead according to the corresponding order in the color matching sequence of each lamp bead to construct the same frame of color data and encapsulate it as a synchronous color display instruction. The order in the color matching sequence corresponds to the timing to which the synchronous color display sequence belongs. Therefore, for the next timing, the color of the next order in the color matching sequence of each lamp bead is selected to construct the synchronous color display instruction. In the synchronous color display instruction, in order to facilitate the controller of the light chain to understand each target lamp bead, the serial position of each lamp bead can be associated with the color of the lamp bead at the timing. In this way, after the light chain receives the synchronous color display instruction and performs the corresponding analysis, it can accurately control each lamp bead to emit the corresponding light color. By sending corresponding synchronous color display instructions at different time sequences, the light chain can be controlled to continuously switch the light color, so that each lamp bead presents the color change process described by its color sequence.

[0129] Since the color sequence used by different lamp groups may have different color bits, the color sequence of the lamp beads in these lamp groups also shows different color sequence lengths. In view of this situation, when constructing the synchronous color display instruction, if part of the color sequence is long and the other part of the color sequence does not have the corresponding color in sequence, black can be used to supplement the color of the missing color sequence. In this way, in each synchronous color display instruction, the color sequence of each lamp bead contains the same number of color bits, but because black will be interpreted as no light, when the light chain controls the corresponding lamp bead, it can control the corresponding lamp bead not to emit light at the corresponding timing.

[0130] As can be seen, this step ensures that all lamp beads can display the correct color at the correct time according to their preset color sequence. This requires not only accurate identification of the color sequence in the color sequence, but also accurate matching of these sequences with the serial position of the lamp beads. In this way, it can be ensured that the lamp beads on the entire light chain can work together to produce the expected lighting effect.

[0131] Step S5320, sending a corresponding number of multiple synchronous color display instructions determined by the color matching sequence of the maximum length to the light chain in a cycle according to a preset timing interval;

[0132] After determining the color that each lamp bead should display at a specific timing and obtaining the synchronous color display instructions, these instructions can be sent to the light chain in a cycle at preset timing intervals, thereby ensuring that the light chain can change color according to the predetermined pattern and rhythm, thereby achieving dynamic lighting effects.

[0133] Specifically, the timing interval refers to the time difference between each synchronous color display instruction. This parameter can be set according to the actual application needs. For example, in some scenes that require fast-changing lighting effects, the timing interval can be set shorter; while in some scenes that pursue soft and slowly changing effects, the timing interval can be appropriately extended.

[0134] There are many ways to send synchronous color display instructions. A common method is to send instructions from the control device to the controller of the light chain through wired or wireless communication protocols such as Bluetooth, Wi-Fi, or RS-485. After receiving the instruction, the controller will parse the instruction content and control the corresponding lamp beads to emit the corresponding color at the specified timing according to the serial position and color information of the lamp beads contained in the instruction. In order to achieve cyclic sending, a timer or timer can be used to control the sending frequency of the instruction to ensure that the next synchronous color display instruction can be accurately sent at each timing interval.

[0135] In practical applications, in order to improve the reliability and stability of recognition, some technical means can be used to optimize the sending process of synchronous color display instructions. For example, data verification and retransmission mechanisms can be used to ensure the accurate transmission of instructions. If the controller does not receive the correct instruction within the predetermined time, it can automatically request retransmission. In addition, instruction caching technology can be used to pre-cache multiple synchronous color display instructions into the controller, and then the controller plays them automatically according to the timing interval, which can reduce the impact of communication delay on lighting effects.

[0136] Step S5330: after the first synchronous color display instruction is issued, the camera unit is automatically called to obtain a preview image generated by shooting at the light chain, so as to collect an image sequence containing image frames corresponding to each synchronous switching of the light color of the light chain.

[0137] After the first synchronous color display instruction is issued, the camera unit can be automatically called, and the user can aim at the light chain to shoot and generate a preview image. This operation is to collect image frames corresponding to each synchronous switching of the light color of the light chain, thereby forming an image sequence. The camera unit can be a camera built into a computing device such as a mobile terminal, or it can be an external image acquisition device connected to a computer device. The preview image is an image captured in real time by the camera unit when the light chain executes the synchronous color display instruction, which records the color state of the light chain at a specific time sequence. Through continuous shooting and image analysis, the camera unit can obtain a series of image frames, which are arranged in chronological order to form a complete image sequence, reflecting the entire process of the light chain switching from one color state to another.

[0138] The acquired image sequence will be used for subsequent image analysis and processing. By analyzing the color changes of the lamp beads in the image sequence, it can be verified whether the light chain correctly executes the synchronous color display instructions according to the preset color sequence. At the same time, the image sequence also provides an important basis for the identification of the position of the lamp beads. Through the image processing algorithm, the position information of each lamp bead can be extracted from the image sequence, and then the spatial layout of the light chain can be constructed.

[0139] After executing the above embodiments, the significant technical advantages achieved by the present application are reflected in many aspects. First, by constructing synchronous color display instructions and considering the differences in the lengths of color matching sequences of different light groups, the present application can ensure that each lamp bead on the light chain can display the correct color at the correct timing, thereby achieving precise lighting control and the expected dynamic lighting effects. Secondly, the synchronous color display instructions are sent cyclically at preset timing intervals, so that the light chain can change color according to a predetermined pattern and rhythm, enhancing the controllability and expressiveness of the lighting effect. In addition, the camera unit is automatically called to obtain the preview image and the image frames are selected as valid image frames, which not only improves the efficiency and quality of image acquisition, but also provides reliable data support for subsequent lamp bead position and color recognition. These steps work together to improve the reliability and stability of the entire recognition system, optimize the sending process of synchronous color display instructions, reduce the impact of communication delays on lighting effects, and also improve the accuracy of image analysis and processing, laying a solid foundation for constructing the spatial layout of the light chain and realizing accurate lamp bead position recognition.

[0140] On the basis of any embodiment of the method of the present application, a camera unit is used to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and a color sequence formed by the light beads of the light chain switching to display the light color in sequence is identified according to the image sequence, including:

[0141] Step S5410: Identify image frames of the light chain in different light color display states from the preview image obtained by the camera unit shooting the light chain, and add them to the image sequence in order;

[0142] In the process of using the camera unit to collect the image frames corresponding to each synchronous switching of the light color of the light chain and form an image sequence, it is first necessary to identify the image frames of the light chain in different light color display states from the preview image captured by the camera unit, and add these image frames to the image sequence in order. The preview image is captured in real time by the camera unit when the light chain executes the synchronous color display instruction, which records the color state of the light chain at a specific time sequence. These image frames are taken continuously, so they are arranged in chronological order to form a complete image stream, reflecting the entire process of the light chain switching from one color state to another.

[0143] In order to ensure the integrity and accuracy of the image stream, the preview images taken by the camera unit need to be analyzed and screened. In one embodiment, the clearest image frame showing the most lamp beads can be determined from the preview image of the light chain corresponding to each synchronous color display instruction and added to the image sequence as a valid image frame by the following method:

[0144] First, the clarity of each image frame is evaluated by the edge detection algorithm of the image. Edge detection can highlight the outline of objects in the image, and a clear image frame usually has more obvious and rich edge information. For example, the Canny edge detection algorithm can be used, which identifies edges by calculating the gradient of pixel points in the image, so that it can effectively distinguish between clear and blurred image areas. Image frames with more clear edges usually mean higher clarity, so they can be given priority as valid image frames.

[0145] Next, use the binarization of the image to identify and count the number of lamp beads in the image frame. Binarization converts the image into an image with only black and white colors, which makes it easier to identify the on and off status of the lamp beads. By setting a suitable threshold, the lit lamp beads can be separated from the background, and then methods such as connected domain analysis can be used to count the number of lit lamp beads. Selecting the image frame that displays the most lamp beads can ensure that the collected image data is as complete as possible, which is crucial for the subsequent identification of the lamp bead position and color.

[0146] In addition, the contrast evaluation of the image can be combined to further screen the effective image frames. Images with high contrast can usually better show the color differences between the lamp beads, which helps to improve the accuracy of color recognition. By calculating the histogram distribution of the image, the overall contrast of the image can be evaluated. Selecting an image frame with moderate contrast can ensure that the lamp beads are clearly visible while avoiding color distortion or loss of details caused by too high or too low contrast.

[0147] Step S5420: starting from the first image frame of the image sequence, calling a preset image target recognition model to identify the position coordinates and display colors of each candidate lamp bead with light color in each image frame;

[0148] Starting from the first image frame of the image sequence, for each image frame in the image sequence, the preset image target recognition model is called to identify the lamp beads. In one embodiment, the model is based on the Yolo series model and is pre-trained with the goal of identifying lamp beads. The function of the model is to determine the luminous lamp beads and provide selection boxes, through which the corresponding regional images can be determined. The center position coordinates of these regional images can be used as the position coordinates of the corresponding lights. Color calculations are performed on these regional images to obtain a numerical representation of the light color, which is used to represent the display color of the lamp beads.

[0149] In specific implementation, the image target recognition model will analyze each image frame and identify the candidate lamp beads in it. These candidate lamp beads are the areas that the model believes may emit light, and each area will be assigned a selection box for subsequent processing. By performing color calculations on the regional image within the selection box, a numerical representation of the display color of each candidate lamp bead can be obtained. This numerical representation is obtained by counting and analyzing the pixel colors in the regional image. For example, the average value of all pixel colors in the regional image can be calculated, or other more complex color analysis algorithms can be used to obtain a numerical value that can accurately represent the color of the region.

[0150] After identifying the position coordinates and display colors of each candidate lamp bead in the first image frame in the image sequence, these coordinates will be used as the alignment reference for the corresponding lamp bead position coordinates in subsequent image frames. In order to achieve alignment, image processing techniques such as feature matching or template matching can be used. Specifically, the lamp bead position coordinates in the first image frame can be used as reference points, and then the lamp bead positions that match these reference points can be found in each subsequent image frame. This can be achieved by calculating the distance between the candidate lamp bead position in each image frame and the corresponding lamp bead position in the first image frame, and selecting the candidate lamp bead with the smallest distance as the matching point. In addition, the display color of the lamp bead can be used as auxiliary information to further improve the accuracy of the matching. In this way, it can be ensured that the same lamp bead in the light chain obtains consistent position coordinates in different image frames, avoiding the problem of coordinate drift caused by slight differences between image frames, thereby improving the accuracy and reliability of the entire image sequence analysis.

[0151] Step S5430: construct a representation vector based on the position coordinates and display color of each candidate lamp bead, perform clustering based on the representation vectors of all candidate lamp beads, and delete outlier candidate lamp beads that deviate from the centers of each cluster;

[0152] After identifying the position coordinates and display colors of each candidate lamp bead in each image frame, a representation vector is constructed with the position coordinates and display colors of each candidate lamp bead for cluster analysis, in order to identify and delete outlier candidate lamp beads that deviate from the cluster center.

[0153] Specifically, the representation vector of each candidate lamp bead contains its position coordinates (e.g., x and y coordinates) and the numerical representation of the displayed color. These vectors can be viewed as points in a multidimensional space, where each dimension represents an attribute of the position coordinates or color.

[0154] Based on the representation vectors of all candidate lamp beads, clustering can be performed using a variety of clustering algorithms, such as K-means, DBSCAN, or hierarchical clustering. These algorithms can group similar representation vectors (i.e., similar candidate lamp beads) into the same cluster. For example, the K-means algorithm determines the cluster center by calculating the Euclidean distance between vectors and assigns each vector to the nearest cluster center. In this process, the algorithm iteratively updates the location of the cluster center until the convergence condition is reached.

[0155] Removing outlier candidates that deviate from the centers of each cluster is accomplished by setting a threshold. This threshold can be based on the distance from the center of the cluster to the vector, or based on the density of the cluster. Any candidate that exceeds this threshold is considered an outlier because they differ too much from the center of the cluster and may represent a misidentification or an abnormal data point. For example, in K-means clustering, the distance from each vector to the center of the cluster to which it belongs can be calculated. If this distance exceeds a preset threshold, the corresponding candidate is marked as an outlier and deleted.

[0156] In this way, abnormal candidate lamp beads caused by noise, misidentification or other atypical factors can be effectively removed, thereby improving the accuracy and reliability of lamp bead identification. Ultimately, the remaining non-outlier candidate lamp beads will be used for subsequent analysis and processing, such as calibrating positions and constructing color sequences.

[0157] Step S5440, calibrate the position of each non-outlier candidate lamp bead in a preset graphic space corresponding to the image frame according to the position coordinates, and orderly construct the display color of each candidate lamp bead in different image frames into a color sequence.

[0158] The graphics space is a virtual coordinate system that matches the size and resolution of the image frame and is used to accurately represent the position of the lamp beads in the image. When calibrating the position of the lamp beads, the position coordinates of each non-outlier candidate lamp bead can be directly mapped to this graphics space. For example, if the resolution of the image frame is 1920x1080 pixels, the graphics space can be defined as a two-dimensional coordinate system with the same pixel size, where each pixel corresponds to a unique coordinate value. In this way, the position of each lamp bead can be accurately recorded and represented.

[0159] For the construction of the color sequence, it is necessary to track the color changes of each lamp bead in consecutive image frames. This can be achieved by comparing the displayed colors of the same lamp bead in different image frames. Since each image frame records the color state of the lamp bead at a specific time sequence, the color sequence of each lamp bead can be obtained by arranging these color states in chronological order. For example, if a lamp bead displays red in the first image frame, green in the second image frame, and blue in the third image frame, then the color sequence of this lamp bead can be recorded as red-green-blue.

[0160] A step that can be combined with this embodiment or can be used to replace step S5430 is to verify the validity of the lamp beads in the graphic space through the following verification process, and the verification process is as follows:

[0161] First, by calculating the distance between all serial position continuous point pairs, we get the average distance and standard deviation, and then set the deviation threshold. Usually, this threshold can be set as the average distance avg plus twice the standard deviation std_dev. The deviation threshold formula is max_allowed_deviation_reliable = avg + 2std_dev. This threshold is used as a standard to determine whether the lamp bead is a reliable point and is used to identify lamp beads with reasonable positions.

[0162] Next, all consecutive point pairs are traversed to check whether the distance between the point pairs is within the reliable threshold range. If the distance between a pair of consecutive points meets the condition, that is, the distance is within the deviation threshold max_allowed_deviation_reliable, the pair of points is marked as reliable points. For those points that are not directly marked as reliable, the point verification strategy is used for further verification. Specifically, for each point to be verified, if it is already in the trusted sequence, it does not need to be verified again and is directly retained. If it is not in the trusted sequence, find the nearest reliable point and calculate the distance between the two. At the same time, an expected distance is calculated based on the serial position difference between the point to be verified and the reliable point, and then the deviation threshold is used to determine whether the distance is reasonable. If the calculated distance exceeds the deviation threshold, the lamp bead to be verified is considered invalid and can be deleted from the graphic space to ensure the accuracy and reliability of the lamp bead position in the graphic space.

[0163] Through this rigorous verification and screening process, erroneous lamp bead position information caused by recognition errors or other abnormal situations can be effectively eliminated, thereby improving the accuracy and robustness of lamp bead position recognition.

[0164] After executing the above embodiments, the significant technical advantages achieved by the present application are mainly reflected in ensuring the high accuracy and reliability of the lamp bead position and color recognition in the image sequence. By selecting the clearest image frames that display the most lamp beads from the preview image, and using the image target recognition model to accurately identify the position coordinates and display colors of the candidate lamp beads in each image frame, the present application can effectively improve the quality and efficiency of image analysis. Further, by removing outlier candidate lamp beads through cluster analysis, and based on the calibration position and construction of color sequence in the graphic space, the present application can accurately track and analyze the color change process of each lamp bead, and provide strong data support for subsequent lamp bead position recognition and lighting effect control. In addition, by verifying the validity of the lamp beads in the graphic space, the present application can eliminate the erroneous lamp bead position information caused by recognition errors or other abnormal situations, thereby improving the accuracy and robustness of lamp bead position recognition. These technical effects work together to enable the present application to perform well in processing large-scale lamp bead layouts, meet the diverse needs for lighting effects in different scenarios, and have broad application prospects and practical application value.

[0165] On the basis of any embodiment of the method of the present application, according to the correspondence between the color development sequence and the color matching sequence, determining the spatial position of the corresponding lamp beads in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence includes:

[0166] Step S5510, comparing the color sequence of each candidate lamp bead in the graphic space with the color matching sequence of each lamp bead in the light chain data structure, and confirming the candidate lamp bead whose color sequence is consistent with the color matching sequence as a valid lamp bead in the light chain data structure;

[0167] In order to identify which candidate lamp beads have color display sequences that match the preset color matching sequence, it is first necessary to compare the color display sequences of each candidate lamp bead in the graphic space with the color matching sequences of each lamp bead in the light chain data structure, so that when the color display sequence is consistent with the color matching sequence, the corresponding candidate lamp bead is confirmed as a valid lamp bead in the light chain data structure. In specific implementation, the color display sequence of each candidate lamp bead can be checked one by one to see if it is completely consistent with the color matching sequence of the corresponding lamp bead in the light chain data structure. If consistent, the candidate lamp bead is confirmed as a valid lamp bead, and its spatial position in the graphic space is confirmed and can be recorded in the light chain data structure. This process requires not only accurate identification of the color display sequence and the color matching sequence, but also accurate matching of these sequences with the serial positions of the lamp beads to ensure that the position of each lamp bead can be accurately identified.

[0168] Step S5520, deleting the candidate lamp beads that are not confirmed as valid lamp beads from the graphic space;

[0169] For those candidate lamp beads that are not confirmed as valid lamp beads, they need to be deleted from the graphic space in order to clean up the graphic space and remove invalid lamp bead information caused by recognition errors or other reasons, thereby improving the accuracy and reliability of lamp bead position recognition. In this way, only the position information of valid lamp beads is retained in the graphic space, providing a clear and accurate data basis for subsequent lighting effect control and lamp bead management. In this way, it can be ensured that each lamp bead position in the graphic space corresponds to an actual, effectively working lamp bead, avoiding control errors or display abnormalities caused by incorrect recognition.

[0170] Step S5530: for other lamp beads that have not been confirmed as valid lamp beads in the light chain data structure, determine the spatial positions of the other lamp beads in the graphic space according to the serial position relationship between the other lamp beads and the valid lamp beads.

[0171] After the above process, it may not be possible to determine the spatial positions of all the lamp beads in the light chain. For this reason, the spatial positions of other lamp beads can be further inferred in combination with this step. When determining the spatial positions of other lamp beads that are not confirmed as valid lamp beads in the light chain data structure, the spatial position information of known valid lamp beads can be used to infer by analyzing the serial position relationship between these valid lamp beads and the lamp beads to be identified. Specifically, if the spatial positions of some lamp beads are known, the spatial positions of other lamp beads can be inferred based on the relative positions of these lamp beads in the light chain.

[0172] For example, suppose there are 100 lamp beads in the light chain, and the spatial positions of 50 of them have been confirmed by matching the color sequence with the color matching sequence. For the remaining 50 unconfirmed lamp beads, the spatial positions of the 50 known lamp beads can be used in combination with the serial arrangement order of the lamp beads in the light chain to infer the spatial positions of the other lamp beads. If the spatial positions of the first and third lamp beads are known, it can be inferred that the spatial position of the second lamp bead is likely to be between the spatial positions of the first and third lamp beads.

[0173] In addition, the geometric relationship between lamp beads can be used for more accurate inference. For example, if the spatial positions of three consecutive lamp beads A, B, and C are known, and these three lamp beads are arranged at equal intervals in the light chain, then the spatial position of B can be determined by using the spatial positions of A and C. The specific method is to calculate the midpoint of the spatial positions of A and C, and this midpoint is likely to be the spatial position of B.

[0174] In practical applications, you may need to consider a variety of factors, such as the change in the spacing between lamp beads, the degree of curvature of the lamp chain, etc., which may affect the accuracy of the inference. Therefore, you may need to combine multiple methods and algorithms, such as interpolation algorithms, geometric modeling, etc., to improve the accuracy of the inference. For example, you can use a linear interpolation algorithm to estimate the spatial position of an unknown lamp bead between two known lamp beads, or use a curve fitting algorithm to handle the curvature of the lamp chain.

[0175] In short, by using the known spatial position information of valid lamp beads, combined with the serial position relationship and geometric relationship of the lamp beads in the light chain, the spatial position of other unidentified lamp beads can be effectively inferred, thereby completing the determination of the spatial position of all lamp beads in the light chain data structure. This method not only improves the efficiency of lamp bead position recognition, but also improves the accuracy and reliability of recognition, providing a solid foundation for subsequent lighting effect control and lamp bead management.

[0176] After executing the above embodiments, the significant technical advantages achieved by the present application are mainly reflected in the following aspects. First, by accurately comparing the color sequence with the color matching sequence, the effective lamp beads can be accurately identified, ensuring the accuracy of the lamp bead position identification. This process not only improves the recognition efficiency, but also reduces the possibility of misidentification, and provides a reliable data basis for subsequent lighting effect control and lamp bead management. Secondly, the candidate lamp beads that are not confirmed as valid lamp beads are deleted, the graphic space is effectively cleaned up, invalid information is removed, and the accuracy and reliability of identification are further improved. This step ensures that each lamp bead position in the graphic space corresponds to an actual, effectively working lamp bead, avoiding control errors or display anomalies caused by misidentification. Furthermore, by using the known spatial position information of valid lamp beads, combined with the serial position relationship and geometric relationship between the lamp beads, the spatial position of other unidentified lamp beads can be effectively inferred. This method not only improves the efficiency of lamp bead position identification, but also improves the accuracy and reliability of identification, providing a solid foundation for subsequent lighting effect control and lamp bead management. In addition, the combination of multiple methods and algorithms, such as interpolation algorithms and geometric modeling, further improves the accuracy of inference and enhances the adaptability to complex situations in the recognition process.

[0177] See also Figure 3Another embodiment of the present application further provides a lamp bead position identification device, which includes a lamp group allocation module 5100, a color coding module 5200, a lamp chain color display module 5300, a color display identification module 5400, and a position determination module 5500, wherein the lamp group allocation module 5100 is configured to construct a lamp chain data structure according to the total number of lamp beads in the lamp chain to represent the serial position of each lamp bead in the lamp chain, and allocate each lamp bead to at least two lamp groups according to the serial position; the color coding module 5200 is configured to determine a dedicated color set corresponding to each lamp group, and determine a unique color sequence of each lamp bead in the lamp group to which it is located according to each color code in the dedicated color set; the lamp chain color display module 5300 is configured to According to the color sequence corresponding to each lamp bead in the light chain data structure, a synchronous color display instruction is constructed and sent to the light chain, so as to drive the lamp beads of the light chain to synchronously switch the light colors, so that each lamp bead displays the light color according to its corresponding color sequence; the color display recognition module 5400 is configured to use a camera unit to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and recognize the color display sequence formed by the lamp beads of the light chain switching to display the light color in succession according to the image sequence; the position determination module 5500 is configured to determine the spatial position of the corresponding lamp bead in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence according to the correspondence between the color display sequence and the color matching sequence.

[0178] Based on any embodiment of the device of the present application, the light group allocation module 5100 includes: a coding quantity determination module, which is configured to determine the maximum coding number of a single group according to a preset maximum color matching length and a maximum number of colors in a special color matching set; a light group total number determination module, which is configured to determine the total number of light groups by dividing the total number of lamp beads in the light chain by the maximum coding number of a single group and then rounding up; a group number processing module, which is configured to use the total number of light groups as the group interval number, set a corresponding number of light groups, and sequentially number each light group; a lamp bead grouping collection module, which is configured to segment all lamp beads in sequence according to the group separation number, and add the lamp beads in each segment that are arranged corresponding to the order of the light groups to the corresponding light group.

[0179] Based on any embodiment of the device of the present application, the color coding module 5200 includes: a minimum number determination module, which is configured to determine the minimum number of colors required for the special color set of each lamp group according to the number of lamp beads in each lamp group and the preset bit length of the color sequence of the lamp beads; a lamp group distinguishing color selection module, which is configured to determine, for different lamp groups, according to different target quantities that are not less than the minimum number of the lamp group, from the color space to form a corresponding plurality of different colors to constitute the special color set of the corresponding lamp group; a lamp bead color association module, which is configured to repeatedly arrange the respective colors in the special color set of each lamp group for each lamp group, so as to determine the plurality of color sequences required by the respective lamp beads in the lamp group as its color sequence.

[0180] Based on any embodiment of the device of the present application, the light group color association module includes: a color unified acquisition module, which is configured to determine multiple primary colors belonging to different color systems from the color space according to half of the sum of the target quantities required for all light groups, and determine the complementary colors of each primary color; a light group set color matching module, which is configured to determine the corresponding target quantity of multiple colors for each light group to construct a dedicated color matching set according to the rule that each dedicated color matching set contains at least one primary color and its complementary color.

[0181] Based on any embodiment of the device of the present application, the light group allocation module includes:

[0182] A combination simulation module is configured to determine a distribution combination of the total number of lamp beads in a lamp chain according to a preset sampling number and a plurality of color numbers, wherein the distribution combination defines the number of elements of at least two lamp groups, and the sum of the number of elements of each lamp group is greater than or equal to the total number of lamp beads; a discrete allocation module is configured to discretely allocate each lamp bead to the at least two lamp groups according to the serial position; a color constraint module is configured to determine the number of colors of a dedicated color set of a corresponding lamp group using the number of colors adopted by the distribution combination so as to determine all the selected colors of the dedicated color set.

[0183] Based on any embodiment of the device of the present application, the light chain color display module 5300 includes: a color display instruction construction module, which is configured to sort the same colors in the color matching sequence of the lamp beads according to a sequential correspondence, and associate the serial position of each lamp bead to construct a synchronous color display instruction of the timing corresponding to the sequence; a color display instruction transmission module, which is configured to send a corresponding number of synchronous color display instructions determined by the maximum length of the color matching sequence to the light chain in a loop according to a preset timing interval; an image acquisition control module, which is configured to automatically call the camera unit to obtain a preview image generated by shooting at the light chain after the first synchronous color display instruction is issued, so as to acquire an image sequence containing image frames corresponding to each synchronous switching of the light color of the light chain.

[0184] Based on any embodiment of the device of the present application, the color recognition module 5400 includes: an image sequence construction module, which is configured to identify image frames of the light chain in different light color display states from the preview image obtained by taking the light chain by the camera unit, and add them to the image sequence in order; an image lamp bead recognition module, which is configured to call a preset image target recognition model starting from the first image frame of the image sequence, and identify the position coordinates and display colors of each candidate lamp bead with light color in each image frame; a candidate lamp bead verification module, which is configured to construct a representation vector with the position coordinates and display color of each candidate lamp bead, cluster based on the representation vectors of all candidate lamp beads, and delete outlier candidate lamp beads that deviate from each cluster center; a color sequence extraction module, which is configured to calibrate the position of each non-outlier candidate lamp bead in the preset graphic space corresponding to the image frame according to the position coordinates, and orderly construct the display color of each candidate lamp bead in different image frames into a color sequence.

[0185] Based on any embodiment of this application, please refer to Figure 4 Another embodiment of the present application further provides a computer device, which can be used as a controller in an atmosphere light device, such as Figure 4 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and a computer program encapsulating computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a lamp bead position identification method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the lamp bead position identification method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0186] In this embodiment, the processor is used to execute Figure 3The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the lamp bead position identification device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.

[0187] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the lamp bead position identification method described in any embodiment of the present application.

[0188] The present application also provides a computer program product, including a computer program / instruction, which, when executed by one or more processors, implements the steps of the lamp bead position identification method described in any embodiment of the present application.

[0189] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0190] The above 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.

[0191] In summary, this application not only significantly improves the efficiency and accuracy of lamp bead position identification through innovative lamp bead grouping and color coding technology, but also greatly enhances the stability and adaptability of the system. In practical applications, these advantages translate into a smoother user experience and more reliable system performance. Users can complete the configuration and adjustment of the lamp bead layout more quickly, reduce waiting time caused by image acquisition and processing, and ensure high-precision recognition results in various complex environments. This allows this application to improve work efficiency while also providing solid technical support for creating more creative and dynamic lighting effects, bringing new breakthroughs and development opportunities to the field of smart lighting.

Claims

1. A method for identifying the position of a lamp bead, characterized in that: include: Constructing a light chain data structure according to the total number of light beads in the light chain to represent the serial position of each light bead in the light chain, and allocating each light bead to at least two light groups according to the serial position; Determine a dedicated color set corresponding to each lamp group, and determine a unique color sequence of each lamp bead in the lamp group according to each color code in the dedicated color set; According to the color matching sequence corresponding to each lamp bead in the light chain data structure, a synchronous color display instruction is constructed and sent to the light chain, so as to drive the lamp beads of the light chain to synchronously switch the light color, so that each lamp bead displays the light color according to its corresponding color matching sequence; The camera unit is used to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and the color sequence formed by the light beads of the light chain switching to display the light color in sequence is identified according to the image sequence; According to the correspondence between the color development sequence and the color matching sequence, the spatial position of the corresponding lamp beads in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence is determined.

2. The lamp bead position identification method according to claim 1, characterized in that: Allocate each lamp bead into at least two lamp groups according to the serial position, including: Determine the maximum number of codes for a single group according to the preset maximum color matching length and the maximum number of colors in the dedicated color matching set; The total number of lamp beads in the lamp chain is divided by the maximum number of codes in a single group and then rounded up to determine the total number of lamp groups; Taking the total number of light groups as the number of grouping intervals, setting a corresponding number of light groups, and sequentially numbering each light group; All lamp beads are divided into segments according to the number of grouping separations, and the lamp beads in each segment that correspond to the order of the lamp groups are added to the corresponding lamp group.

3. The lamp bead position identification method according to claim 1, characterized in that: Determine the dedicated color set corresponding to each lamp group, and determine the unique color sequence of each lamp bead in the lamp group according to each color code in the dedicated color set, including: Determine the minimum number of colors required for the dedicated color set of each lamp group according to the number of lamp beads in each lamp group and the preset bit length of the color sequence of the lamp beads; For different lamp groups, according to different target quantities that are not less than the minimum quantity of the lamp group, determining corresponding multiple different colors from the color space to form a dedicated color set for the corresponding lamp group; For each lamp group, the colors in the dedicated color set of the lamp group are repeatedly arranged to determine a plurality of color sequences required by each lamp bead in the lamp group as its color sequence.

4. The lamp bead position identification method according to claim 3, characterized in that: For different lamp groups, according to different target quantities that are not less than the minimum quantity of the lamp group, a corresponding plurality of different colors are determined from the color space to form a dedicated color set for the corresponding lamp group, including: According to half of the total target number required by all lamp groups, multiple primary colors belonging to different color systems are determined from the color space, and the complementary color of each primary color is determined; According to the rule that each dedicated color set contains at least one main color and its complementary color, a corresponding target number of colors is determined for each light group to construct the dedicated color set.

5. The lamp bead position identification method according to claim 1, characterized in that: Allocate each lamp bead into at least two lamp groups according to the serial position, including: Determine a distribution combination of the total number of lamp beads of the lamp chain according to a preset sampling number and a plurality of color numbers, wherein the distribution combination defines the number of elements of at least two lamp groups, and the sum of the number of elements of each lamp group is greater than or equal to the total number of lamp beads; Discretely allocating each lamp bead to the at least two lamp groups according to the serial position; The number of colors used in the distribution combination is used to determine the number of colors in the dedicated color set of the corresponding lamp group to determine all the selected colors of the dedicated color set.

6. The lamp bead position identification method according to claim 1, characterized in that: According to the color matching sequence corresponding to each lamp bead in the light chain data structure, a synchronous color display instruction is constructed and sent to the light chain, including: According to the sequential correspondence, the same colors are sorted in the color matching sequence of the lamp beads, and the serial position of each lamp bead is associated to construct a synchronous color display instruction of the timing corresponding to the sequence; cyclically sending a corresponding number of multiple synchronous color display instructions determined by the maximum length of the color matching sequence to the light chain according to a preset timing interval; After the first synchronous color display instruction is issued, the camera unit is automatically called to obtain a preview image generated by shooting at the light chain, so as to collect an image sequence including image frames corresponding to each synchronous switching of the light color of the light chain.

7. The lamp bead position identification method according to any one of claims 1 to 6, characterized in that: The camera unit is used to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and the color sequence formed by the light beads of the light chain switching to display the light color in sequence is identified according to the image sequence, including: From the preview image obtained by the camera unit shooting the light chain, image frames of the light chain in different light color display states are identified and added to the image sequence in order; Starting from the first image frame of the image sequence, a preset image target recognition model is called to identify the position coordinates and display colors of each candidate lamp bead with light color in each image frame; Construct a representation vector based on the position coordinates and display color of each candidate lamp bead, perform clustering based on the representation vectors of all candidate lamp beads, and delete outlier candidate lamp beads that deviate from the center of each cluster; The position of each non-outlier candidate lamp bead is calibrated in a preset graphic space corresponding to the image frame according to the position coordinates, and the display color of each candidate lamp bead in different image frames is orderly constructed into a color sequence.

8. The lamp bead position identification method according to claim 7, characterized in that: According to the correspondence between the color development sequence and the color matching sequence, determining the spatial position of the corresponding lamp beads in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence includes: Compare the color display sequence of each candidate lamp bead in the graphic space with the color matching sequence of each lamp bead in the light chain data structure, and confirm the candidate lamp bead whose color display sequence is consistent with the color matching sequence as a valid lamp bead in the light chain data structure; Deleting candidate lamp beads that are not confirmed as valid lamp beads from the graphic space; For other lamp beads that are not confirmed as valid lamp beads in the light chain data structure, the spatial positions of the other lamp beads in the graphic space are determined according to the serial position relationship between the other lamp beads and the valid lamp beads.

9. A lamp bead position identification device, characterized in that: include: A lamp group allocation module, configured to construct a lamp chain data structure according to the total number of lamp beads in the lamp chain to indicate the serial position of each lamp bead in the lamp chain, and allocate each lamp bead to at least two lamp groups according to the serial position; A color coding module, configured to determine a dedicated color set corresponding to each lamp group, and determine a unique color sequence of each lamp bead in the lamp group in which it is located according to each color code in the dedicated color set; The light chain color display module is configured to construct a synchronous color display instruction according to the color matching sequence corresponding to each lamp bead in the light chain data structure and send it to the light chain, so as to drive the lamp beads of the light chain to synchronously switch the light color, so that each lamp bead displays the light color according to its corresponding color matching sequence; A color recognition module is configured to use a camera unit to collect image frames corresponding to each synchronous switching of the light color of the light chain to form an image sequence, and recognize a color sequence formed by the light beads of the light chain switching to display the light color in sequence according to the image sequence; The position determination module is configured to determine the spatial position of the corresponding lamp beads in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence according to the correspondence between the color development sequence and the color matching sequence.

10. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 8.

11. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or computer instruction is called and executed by a central processing unit, the steps of the method according to any one of claims 1 to 8 are executed.

Citation Information

Patent Citations

  • Colored lamp position recognition method, system and device and storage medium

    CN111612839A

  • Random Algorithmic Color Selection for Lighting

    US20100264852A1