Lamp bead position recognition method and apparatus, computer device, and program product
By grouping LED beads and assigning them dedicated color sets, combined with image processing and synchronous color display instructions, the problem of low LED bead recognition efficiency in traditional technologies is solved, achieving efficient and accurate LED bead position recognition, which is suitable for a variety of complex scenarios.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN INTELLIROCKS TECH CO LTD
- Filing Date
- 2025-11-19
- Publication Date
- 2026-07-30
AI Technical Summary
Traditional technologies suffer from low recognition efficiency, decreased image recognition accuracy, and high computational overhead when processing light chains with a large number of LEDs, which limits their widespread adoption in practical applications.
By grouping LED beads and assigning a unique dedicated color set to each group, the camera unit captures image sequences of the LED beads, identifies their spatial positions, constructs a synchronous color display command, and drives the LED beads to switch colors synchronously. By combining image processing and color sequence matching, the spatial position of the LED beads in the image plane is determined.
It significantly improves the efficiency and accuracy of LED bead recognition, reduces computing resource consumption, and enhances the real-time performance and interactivity of the system, making it suitable for complex scenarios such as stage lighting, holiday decorations, and smart homes.
Smart Images

Figure CN2025136082_30072026_PF_FP_ABST
Abstract
Description
LED bead position identification method and device, as well as computer equipment and software products Technical Field
[0001] This application relates to the field of lighting control, and more particularly to a method and apparatus for identifying the position of LED beads, as well as computer equipment and software products. Background Technology
[0002] A light chain is a lighting fixture composed of a large number of LEDs strung together. To easily control a target LED in the light chain to emit a specific color of light via program instructions, the position of the LEDs must first be identified. Traditional technologies typically rely on complex image analysis and color coding methods to identify and locate each LED in the light chain. However, when the number of LEDs in a light chain reaches hundreds or even thousands, traditional technologies face significant limitations.
[0003] Traditional technologies suffer from low recognition efficiency, decreased image recognition accuracy, and high computational overhead when processing light chains with a large number of LEDs. These problems limit the widespread adoption of traditional technologies in practical applications. Therefore, it is necessary to improve traditional technologies to overcome these shortcomings. Summary of the Invention
[0004] The purpose of this application is to provide a method and apparatus for identifying the position of LED beads, as well as computer equipment and software products.
[0005] According to one aspect of this application, a method for identifying the position of LED beads is provided, comprising: constructing a light chain data structure to represent the serial position of each LED bead in the light chain based on the total number of LED beads in the light chain; allocating each LED bead to at least two light groups according to the serial position; determining a dedicated color set corresponding to each light group; determining a unique color sequence for each LED bead in its light group based on the color codes in the dedicated color set; constructing a synchronous color display instruction and sending it to the light chain based on the color sequence corresponding to each LED bead in the light chain data structure; driving the LED beads in the light chain to synchronously switch light colors, so that each LED bead displays light colors according to its corresponding color sequence; using a camera unit to acquire image frames corresponding to each synchronous color switch of the light chain to form an image sequence; identifying the color display sequence formed by the sequential switching of light colors by the LED beads in the light chain based on the image sequence; and determining the spatial position of the corresponding LED bead in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence based on the correspondence between the color display sequence and the color sequence.
[0006] According to another aspect of this application, a lamp bead position identification device is provided, comprising: a lamp group allocation module, configured to construct a lamp chain data structure to represent the serial position of each lamp bead in the lamp chain based on the total number of lamp beads 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 its lamp group according to each color code in the dedicated color set; and a lamp chain color display module, configured to construct a synchronous color display command concurrently based on the color sequence corresponding to each lamp bead in the lamp chain data structure. The light chain is fed to drive the individual LEDs of the light chain to synchronously switch light colors, so that each LED displays light colors according to its corresponding color matching sequence; the color recognition module is configured to use a camera unit to collect image frames corresponding to each synchronous switch of light colors of the light chain to form an image sequence, and to identify the color sequence formed by the sequential switching of light colors of the LEDs of the light chain according to the image sequence; the position determination module is configured to determine the spatial position of the corresponding LED in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence, based on the correspondence between the color sequence and the color matching sequence.
[0007] According to another aspect of this application, a computer device is provided, including a central processing unit and a memory, wherein the central processing unit is configured to invoke and run a computer program stored in the memory to perform the steps of the LED position recognition method.
[0008] According to another aspect of this application, a computer program product is provided, including a computer program or computer instructions, which, when invoked by a central processing unit, execute the steps of the LED position recognition method.
[0009] Compared to traditional technologies, this application exhibits significant advantages in several aspects. First, by grouping LED beads and assigning unique dedicated color sets to each group, the image analysis process is greatly simplified, improving recognition efficiency. Simultaneously, it reduces user time and labor costs in image acquisition, lowers computational burden, reduces latency and errors, and enhances the system's real-time performance and interactivity. Second, different LED groups use independent dedicated color sets to construct unique color sequences for the LED beads, effectively avoiding color interference between adjacent LED beads. Even when LED beads are densely arranged, the color state of each LED bead can be accurately identified, significantly improving recognition accuracy and reliability. Furthermore, by optimizing the length of the dedicated color sets and color sequences, the required number of image frames and color change cycles are reduced while ensuring recognition accuracy. This shortens image acquisition time, lowers computational resource consumption, and improves overall performance and user experience. In addition, this application demonstrates greater scene adaptability when handling large-scale LED bead layouts, making it suitable for complex scenarios such as stage lighting, festival decorations, and smart homes. Attached Figure Description
[0010] Figure 1 is a schematic diagram of the electrical structure of an exemplary ambient lighting device of this application;
[0011] Figure 2 is a flowchart illustrating the LED position identification method in an embodiment of this application;
[0012] Figure 3 is a schematic diagram of the LED position identification device in an embodiment of this application;
[0013] Figure 4 is a schematic diagram of the structure of the computer device in the embodiment of this application. Detailed Implementation
[0014] Please refer to Figure 1, which is a schematic diagram of the structure of an ambient lighting device provided in one embodiment of this application. As can be seen, the ambient lighting 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 receive control from the computer program running in the controller 1 and work together to realize the lighting effect playback.
[0015] Controller 1 typically includes a control chip, communication components, and a bus connector. In some embodiments, controller 1 may also be configured with a power adapter, control panel, display screen, etc., as needed.
[0016] The power adapter is primarily used to convert AC power to DC power to power the entire ambient lighting system. 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 typically includes a central processing unit (CPU) and memory; the memory and CPU are used to store and execute program instructions, respectively, to achieve the corresponding functions. All of these types of control chips can have built-in communication components, or additional communication components can be configured as needed.
[0017] The communication component can be used to communicate with external devices, such as personal computers or mobile terminals like smartphones. This allows the controller 1's control chip to receive configuration commands after the user issues them via the mobile terminal, completing basic configuration to control the light chain. Furthermore, the controller 1 can also acquire interface images from terminal devices or real-time preview images captured by the camera unit 3 via the communication component.
[0018] The bus connector is mainly used to provide power to the light chain 2 connected to the bus and to provide lighting effect playback commands. Therefore, it provides corresponding pins for the power bus and signal bus. Thus, 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 controlling the controller 1 on and off, selecting various preset lighting effect control modes, etc.
[0019] The display screen can be used to show various control information to work in conjunction with the buttons on the control panel, supporting the implementation of human-computer interaction functions. In some embodiments, the control panel and the display screen can be integrated into the same touch display screen.
[0020] The light chain 2 in the ambient lighting device can be a light strip or a string of lights, possessing flexibility and capable of being molded into any shape for placement. Each light chain 2 includes multiple LED beads 20 connected in series, with each LED bead 20 serving as a light-emitting unit. The number of LED beads 20 within each light chain 2 can be the same, and they are arranged at equal intervals. The LED beads 20 within the same light chain 2 transmit operating current through the same set of cables connected to the bus. The LED beads 20 within the same light chain 2 can be connected in parallel for electrical connection.
[0021] The image acquisition interface can be either a hardware interface or a software interface implemented in controller 1. When it is a hardware interface, the image acquisition interface can be implemented as camera unit 3, with controller 1 loading the corresponding driver to drive camera unit 3 to work. In one application, camera unit 3 can be used to capture images of the light chain to obtain on-site images needed to determine the spatial layout of the light chain. Camera unit 3 can also be used to capture interface images needed to generate lighting effect control data.
[0022] When camera unit 3 is pointed at a target screen, such as the desktop of a terminal device, or at a physical environment, images can be captured at a certain frame rate to obtain the interface image. When it is a software interface, the image acquisition interface can be an image acquisition program implemented on the controller 1 side using the graphics infrastructure technology provided by the terminal device's operating system. Controller 1 connects to the terminal device via various cables, such as HDMI or Type-C cables, and can continuously obtain the interface image of the terminal device with the support of this graphics infrastructure technology. Of course, if a wireless projection protocol is pre-established between controller 1 and the terminal device, controller 1 can also obtain the interface image of the terminal device wirelessly. The graphics infrastructure technology of the operating system varies depending on the type of operating system. For example, the Windows operating system provides the corresponding technology, namely Microsoft DirectX Graphics Infrastructure (DXGI), which can achieve this function.
[0023] Therefore, when the image acquisition interface is responsible for collecting environmental reference images, the specific environment of the collected images can be flexibly set by the user. For example, when the image acquisition interface is camera unit 3, the user can point camera unit 3 at the computer's graphical user interface to capture the corresponding interface image as the target image for playing the lighting effects, so that the light chain 2 can generate corresponding lighting effect description data based on the interface image; the user can also point camera unit 3 at the physical space environment, such as the outdoor environment, to capture real-scene images as environmental reference images, so that the light chain 2 can generate lighting effect description data corresponding to the real scene.
[0024] When the ambient lighting device needs to play lighting effects according to the lighting effect description data, its controller 1 needs to use the spatial layout of the light chain to provide the serial position and spatial position of each light-emitting unit in its light chain 2. According to the spatial position of each light-emitting unit, the corresponding lighting effect description data is parsed into control data of each light-emitting unit, and the control data of each light-emitting unit is encapsulated into lighting effect control data according to the serial position sequence. Then, the lighting effect control data is sent to the corresponding light chain. The control chip of each light-emitting unit in the light chain extracts its own corresponding control data, and controls each light-emitting element to emit corresponding colored light according to the control data. Under the coordinated action of the colored light emitted by each light-emitting unit, the entire lighting effect is played.
[0025] It is easy to understand that the computer device of this application has a built-in camera unit and a graphical user interface. The camera unit 3 can be used to capture on-site images to obtain preview images, and based on these, generate a light chain spatial layout. The light chain spatial layout describes the mapping relationship between the serial positions of the LEDs in the light chain and the spatial positions of the light chain in the corresponding graphical space. Accordingly, the computer device can also generate a corresponding light chain model based on the spatial positions of each LED in the light chain spatial layout and display it in the graphical user interface, allowing the user to edit the control data of each LED in the light chain model to construct corresponding lighting effects. Then, based on the information provided by the light chain spatial layout, the computer device can convert the LEDs in the light chain model into lighting effect control data that can be parsed by the control chip of each LED in the light chain, according to the correspondence between their spatial positions and serial positions, to control the light chain to play corresponding lighting effects.
[0026] Please refer to Figure 2. In some embodiments, the LED position identification method of this application is illustrated using a mobile terminal as an example for ease of understanding. The method includes:
[0027] Step S5100: Construct a light chain data structure based on the total number of LEDs in the light chain to represent the serial position of each LED in the light chain, and assign each LED to at least two light groups according to the serial position.
[0028] The total number of LEDs in a light chain can be determined in several ways. One method is by manual input, such as the user entering the total number of LEDs through the software interface before using the light chain. Another method is to retrieve the number from a pre-set database based on the type of light chain. For example, for a specific model of light strip, the total number of LEDs is fixed, and this number can be obtained from the device's memory or a cloud database by reading the model information of the light strip. Besides manual input and retrieval from a pre-set database, automatic detection is also possible. For example, the number of LEDs can be automatically calculated using sensors on the light chain or by sending specific detection signals.
[0029] The light chain data structure is used to represent the serial and spatial positions of each LED in the light chain, as well as other possible intermediate data, such as color sequences. This data structure can be an array or a linked list, where each element corresponds to one LED, and the element's index indicates the LED's serial position. For example, if the light chain has 500 LEDs, the light chain data structure can be an array of length 500, with indices 0 to 499 corresponding to LEDs 1 to 500, respectively. After processing according to this application, the light chain data structure can form a light chain spatial layout, which serves as the basis for parsing and playing lighting effects. For example, based on the light chain spatial layout, the controller can parse the lighting effect description data into control data for each LED and send it to the light chain in serial position order.
[0030] To reduce the complexity of configuring color change sequences for all LEDs, all LEDs in the LED chain can be assigned to two or more LED groups based on their serial positions. Then, a unique color sequence can be configured for each LED group's LEDs. When assigning LEDs to LED groups, all LEDs can be sampled and evenly distributed across the groups according to the grouping interval, or a non-uniform distribution method can be used, assigning LEDs from multiple segments or local areas to the LED groups.
[0031] In embodiments where all LEDs are evenly distributed, the grouping interval is used to allocate the LEDs in the LED chain into multiple LED groups. The grouping interval can be preset; for example, if the total number of LEDs is 500, the grouping interval can be preset to 10, meaning that every 10 LEDs are grouped together. Alternatively, the maximum number of codes per group can be determined based on a preset maximum color scheme length and the maximum number of colors in the dedicated color scheme set. Then, the total number of LEDs is divided by the maximum number of codes per group, and the result is rounded up to obtain the total number of LED groups. This will be explained in detail later.
[0032] The first step is to construct a light chain data structure based on the total number of LEDs in the chain. This structure pre-allocates and records the serial position of each LED according to the total number of LEDs. Once the total number of LEDs is determined, the corresponding light chain data structure, such as an array or linked list, can be constructed. Each element not only represents the serial position of an LED but can also store other information related to that LED, such as its expected color change sequence and brightness settings.
[0033] Next, multiple light groups are set up according to the number of group intervals. As revealed earlier, the number of group intervals can be fixed or dynamically calculated. The number of group intervals is both the number of light groups and specifies the interval number at which each light group organizes its LEDs in the light chain.
[0034] The process of assigning LED beads to their respective groups is based on their serial position and the group sequence. This process can be achieved through simple mathematical operations, such as using modulo operations to determine which group each LED bead belongs to. Thus, each group contains LED beads arranged at intervals in a specific order on the LED chain, and these beads will be treated as a whole to receive subsequent color coding and control commands.
[0035] In an embodiment of non-uniform distribution of all LED beads, the number of image frames to be sampled (i.e., the number of samples) can be used as the exponent. Then, combined with multiple pre-selected color numbers, such as 5, 4, 3, 2, etc., a preliminary quantity is calculated with the number of colors as the base and the number of samples as the exponent. The preliminary quantities of different colors are arbitrarily combined to obtain a total combination. The minimum value among the total combinations that just reaches or exceeds the total number of LED beads is determined. The number of LED groups is set according to this minimum value. Then, the LED beads are sampled at intervals or randomly and distributed to each LED bead. This achieves non-uniform distribution, and each LED group can encode the color sequence of each LED bead with a relatively optimal number of colors. Furthermore, all LED groups can represent the unique color change of each LED bead through multiple image frames corresponding to the number of samples.
[0036] For example, if there are 800 LEDs in total, and only four colors are used without grouping or with uniform grouping, then 5 photos need to be taken, which is 4^5 = 1024, greater than 800. However, if a non-uniform grouping method is used, with one group containing 5 colors and the other containing 4 colors, then 5^4 = 625 and 4^4 = 256, which together are greater than 800. Therefore, only 4 image frames are needed to complete the recognition of the entire LED color change sequence. It is evident that non-uniform grouping can reduce the number of images required for recognition, thus improving recognition efficiency.
[0037] Step S5200: Determine the dedicated color set corresponding to each lamp group, and determine the unique color sequence of each lamp bead in its lamp group according to the color codes in the dedicated color set;
[0038] Each light group is independently equipped with a dedicated color set. This dedicated color set contains a specific set of colors used to define the color changes of the LEDs, enabling the camera unit to identify the LED positions in subsequent steps. A unique color sequence refers to the descriptive sequence of color changes for each LED according to the colors in the dedicated color set. This sequence is unique to the LEDs within the same light group, and in some embodiments, it can also be controlled to be unique throughout the entire light chain data structure. In some embodiments, the dedicated color sets for each light group can be constructed to be unique, making it easier to highlight the uniqueness of each LED's color sequence across the entire light chain, thereby ensuring that each LED can be accurately identified by its color changes.
[0039] There are several ways to determine a dedicated color scheme. In one implementation, a set of colors is predefined, and then these colors are assigned based on the number of light groups and the number of LEDs. For example, if the light chain is divided into 10 light groups, 10 different color combinations, i.e., dedicated color schemes, can be predefined, with each color combination containing several different colors. These color combinations are then assigned to each light group. As a preferred embodiment, this ensures that the color combination for each light group is unique.
[0040] Another approach is to dynamically generate a dedicated color set. This can be achieved through a pre-defined algorithm that selects colors from a large color library based on the number of LED groups and LEDs, generating unique color combinations. For example, a color space (such as the RGB color space) can be used to generate colors, ensuring that the generated colors are visually distinguishable. The algorithm can also consider the contrast between colors, making the differences between colors so subtle that the human eye is unlikely to confuse them, thus avoiding difficulties in recognition due to overly similar colors.
[0041] Different light groups correspond to different dedicated color sets, which may contain completely different colors or some of the same colors. To differentiate the colors between different dedicated color sets, in one embodiment, one dedicated color set may contain multiple primary colors, while another dedicated color set may contain complementary colors corresponding to the multiple primary colors. This allows the difference in light colors emitted by the LEDs in the corresponding two light groups to be clearer, improving recognizability and thus increasing the recognition rate.
[0042] Similarly, different dedicated color sets corresponding to different light groups can have the same or different numbers of colors. For example, one dedicated color set may have 3 colors, while another may have 4 colors. Obviously, the latter will result in more unique color sequences, making it more suitable for light groups with a larger number of LEDs, while the former will have fewer unique color sequences, resulting in faster recognition. The specific number of colors in the dedicated color set can be flexibly determined based on the number of LEDs in the light group.
[0043] Once the dedicated color set for each light group is determined, a unique color sequence for each LED can be determined based on these dedicated color sets. Specifically, this can be achieved by assigning colors from the dedicated color set to the LEDs in a specific order. For example, if a light group's dedicated color set contains red, green, and blue, then the LEDs in that group can change color sequentially in the order of red, green, and blue. This order can be predefined or dynamically generated by an algorithm to ensure that the color sequence for each LED is unique.
[0044] In practical applications, the length of the color matching sequence and the selection of colors can be flexibly adjusted. For example, if there are a large number of LEDs, a longer color matching sequence and more colors can be used to ensure the uniqueness of each LED. A dedicated color matching set has three colors: red, green, and blue. Each color position in the color matching sequence has A = 3 possibilities, represented as A... N Where N refers to the number of color positions in the color scheme sequence, i.e., the length of the color scheme sequence. Assuming the number of LEDs in the light group is M = 200, it is necessary to satisfy A. N >M, taking the logarithm of N gives 5, meaning the color sequence length is 5. Conversely, if the number of LEDs is small, a shorter color sequence and fewer colors can be used. Furthermore, environmental factors such as lighting conditions and camera unit performance can be considered to select the most suitable colors and color sequences.
[0045] Step S5300: Based on the color matching sequence corresponding to each LED bead in the light chain data structure, construct a synchronous color display instruction and send it to the light chain to drive the LED beads of the light chain to synchronously switch light colors, so that each LED bead displays light color according to its corresponding color matching sequence.
[0046] Synchronous color display instructions can be constructed based on the color sequence of each LED recorded in the LED chain data structure. These color sequences are generated according to a pre-determined dedicated color set for each LED group. For example, if the LED chain is divided into three groups, the LEDs in each group are selected every three LEDs in the chain. For instance, the LEDs in the first group might be in sequence positions 1, 4, 7…, the LEDs in the second group might be in sequence positions 2, 5, 8…, and so on. The color sequence for each group differs depending on the colors available in the dedicated color set used. For example, the first LED in the first group might have a color sequence of red, green, and blue; the first LED in the second group might have a color sequence of yellow and purple; and the first LED in the third group might have a color sequence of orange and cyan.
[0047] To construct synchronized color rendering instructions, the longest color sequence is used as the basis for selecting one color from each light group to form a synchronized color rendering instruction for a given time sequence. Corresponding to the previous example, for the first LED in each light group, the synchronized color rendering instructions for the first time sequence are red, yellow, and orange, respectively; for the second time sequence, they are green, purple, and cyan. For the third time sequence, since the second and third light groups do not have corresponding colors, these LEDs can remain black, i.e., blue-black-black. This synchronized color rendering instruction ensures that the LEDs in each light group display the correct color in each time sequence, thus forming a coordinated color change pattern across the entire light chain.
[0048] In practical applications, each synchronized color display command can be sent to the light chain in a preset time slot order to resolve and display the light colors one by one, or all synchronized color display commands can be merged into a single command and sent to the light chain, which will then play them in sequence.
[0049] There are several ways to implement synchronized color display instructions. One approach is to automatically generate these instructions using software algorithms. The algorithm determines the color that each LED should display in each timing sequence based on the color scheme of each LED group and the serial position of the LEDs. Another approach is to allow users to customize synchronized color display instructions through a user interface, enabling users to adjust the color change sequence of each LED group according to their design requirements.
[0050] When sending synchronized color display commands to the light chain, various communication protocols can be used, such as Bluetooth, Wi-Fi, or wired connections. These commands are received and parsed by the light chain's control unit, which then drives the corresponding LEDs to display the specified color according to the command. For example, if Bluetooth communication is used, an application on a mobile terminal can send Bluetooth signals to the light chain's controller. Upon receiving the signal, the controller will control the color change of the LEDs based on the signal content, causing the LEDs to display the corresponding light color.
[0051] Step S5400: Use the camera unit to collect image frames corresponding to the synchronous switching of light colors of the light chain each time to form an image sequence, and identify the color sequence formed by the sequential switching of light colors of the light beads of the light chain according to the image sequence;
[0052] After issuing the first synchronized color rendering command, the camera unit is responsible for capturing images of the light chain executing the command. These images are instantaneous records of the LEDs changing color according to a preset color sequence. To achieve this, the camera unit needs a sufficient frame rate to ensure that every detail of the LED color changes is captured. For example, if the LEDs change color rapidly, the camera unit's frame rate should be increased accordingly to ensure that no important color change moments are missed.
[0053] In practice, the camera unit can be a built-in camera on a mobile terminal or a dedicated image acquisition device. These devices need to work synchronously with the light chain's control unit to ensure accurate image capture at the moment the LED colors change. For example, software algorithms can be used to synchronize the camera unit's shooting timing with the light chain's color change commands. This ensures that the camera unit can capture the corresponding image frame promptly each time the LED color changes. In scenarios where the camera unit can automatically acquire preview images, the image frame can be extracted by automatically identifying the clearest frame from the preview image. Furthermore, for the same color state displayed by the light chain, the camera unit can automatically adjust its aperture to identify the clearest image frame that contains the most LEDs.
[0054] The acquired image frames are constructed into an image sequence containing the color states of the LEDs at different points in time. By analyzing this image sequence, the light color of the LED in each image frame can be identified. Arranging the identified light colors from each image frame in chronological order yields the color sequence of the LED, i.e., the sequence of color changes displayed by the LED in chronological order. This process can be implemented using image processing algorithms, such as color recognition algorithms, to determine the color of each LED in each image frame. These algorithms can accurately identify colors based on RGB values or other color models and compare them with a preset color matching sequence.
[0055] To improve recognition accuracy, various image processing techniques can be employed. For example, edge detection algorithms can be used to determine the position of the LED beads in the image, followed by color analysis of these positions. Furthermore, 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, machine learning algorithms can be used to train a model that can automatically identify and distinguish the color changes of different LED beads, thereby improving recognition efficiency and accuracy.
[0056] Step S5500: Based on the correspondence between the color rendering sequence and the color matching sequence, determine the spatial position of the corresponding LED in the graphic space constructed by the image plane corresponding to the image sequence in the LED chain data structure.
[0057] To determine the correspondence between the color rendering sequence and the color matching sequence, each image frame in the acquired image sequence has been analyzed to identify the color of each LED in that image frame, thus obtaining the color rendering sequence for each LED. Based on this, the color rendering sequence is matched with the color matching sequence of each LED recorded in the LED chain data structure. For example, if the color rendering sequence of a certain LED is completely consistent with the color matching sequence of the nth LED recorded in the LED chain data structure, then it can be determined that the spatial position of that LED in the image plane corresponds to the serial position of the nth LED.
[0058] In some embodiments, considering that two LEDs that are far apart in a long light chain will not interfere with each other even if they have the same color rendering sequence, the uniqueness of the color matching sequence is only reflected within the light group. Therefore, if the color matching sequence of an LED is unique only within its own light group and not at the light chain data structure level, the corresponding color matching sequence can be found in the light group containing the LED and matched with the color rendering sequence of the LED.
[0059] To improve matching accuracy, various algorithms can be employed. For example, a hash algorithm can be used to encode the color sequence and color matching sequence, and then the matching LED can be quickly determined by comparing the hash values. Alternatively, a fault-tolerant matching algorithm can be used, which considers potential color recognition errors or LED display anomalies in real-world environments, allowing for color differences within a certain range while still determining the approximate spatial location of the LED.
[0060] In practical applications, image processing techniques can be combined to assist in determining the spatial location of the LED beads. For example, image segmentation algorithms can be used to separate the LED bead regions in an image, and then color analysis and matching can be performed on each LED bead region. Simultaneously, geometric features of the image, such as the shape, size, and arrangement pattern of the LED beads, can be used to further verify and determine their spatial location. For instance, if the LED beads are arranged in a certain geometric pattern, such as a rectangular or circular array, their spatial location in the graphic space can be inferred based on their relative positions and arrangement patterns in the image.
[0061] Constructing the graphics space can be achieved by analyzing image frames captured by the camera unit. This graphics space can be two-dimensional or three-dimensional, depending on the application scenario and required precision. For two-dimensional space, it can be represented by a simple image coordinate system, where the position of each LED in the image frame is determined by its pixel coordinates (x, y). For three-dimensional space, additional depth information or images from multiple perspectives can be used to calculate the depth coordinates (x, y, z) of the LEDs. Once the coordinates of the LEDs in the image frame are determined, these coordinates can be mapped to the graphics space to obtain the coordinates of the LEDs in that space. These coordinates not only represent the position of the LEDs in the image but also indirectly reflect their relative positions in physical space. Labeling these spatial position information in the light chain data structure establishes a mapping relationship between the spatial position and serial position of the LEDs. This mapping relationship is key to constructing the spatial layout of the light chain, allowing the controller to parse and play lighting effects based on the physical positions of the LEDs, ensuring that the lighting effects are 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 precisely control the on / off state and color change of each LED, so that the light effect flows along a predetermined path on the light chain.
[0062] As can be seen from the above embodiments, this application has many beneficial effects compared with traditional technologies, including:
[0063] First, by grouping the LEDs and assigning a dedicated color scheme to each group, the number of LEDs within each group is significantly reduced, thereby lowering the complexity of image analysis. This not only improves recognition efficiency but also reduces the time and effort required by users during image acquisition. Because the number of LEDs per group is reduced, the computational burden of image analysis is also lessened, thus reducing latency and errors in the recognition process and improving real-time performance and interactivity.
[0064] Secondly, by assigning a different dedicated color set to each light group, the problem of color interference between adjacent LEDs is effectively solved. Because different light groups use different color codes, the colors of adjacent LEDs in different groups can be significantly different through these dedicated color sets. Even in densely packed LED layouts, the uniqueness of each color can accurately distinguish the color state of each LED, thereby improving the accuracy of LED identification. This not only improves the accuracy of image recognition but also reduces recognition errors caused by color mixing, further enhancing the reliability and stability of the recognition process.
[0065] Furthermore, by optimizing the number of colors and the length of color sequences in the dedicated color set, recognition efficiency is further improved. Through reasonable grouping and color encoding, the number of image frames and color change rounds required can be significantly reduced while ensuring recognition accuracy. This not only reduces image acquisition time but also lowers the consumption of computing resources, improving overall performance and user experience.
[0066] Furthermore, when dealing with large-scale LED layouts, the technical solution of this application can maintain high recognition efficiency and accuracy, thus making it more adaptable to various scenarios and more suitable for complex applications such as stage lighting, festival decorations, and smart home systems.
[0067] Based on any embodiment of the method in this application, the individual LEDs are assigned to at least two LED groups according to their serial positions, including:
[0068] Step S5110: Determine the maximum number of codes per group based on the preset maximum color matching length and the maximum number of colors in the dedicated color matching set;
[0069] Maximum color length refers to the maximum number of color bits that a single color sequence can display within the LED color sequence. Maximum number of colors in a dedicated color set refers to the maximum number of colors that can be included in a dedicated color set allocated to a single LED group. These two parameters can be preset or flexibly selected by the user. For example, a user can select which colors from dedicated color sets to determine the number of colors in each dedicated color set, thereby determining the maximum number of colors.
[0070] For example, if a single LED can display a maximum of 4 color bits, and a single dedicated color set has a maximum of 3 colors, then the maximum number of codes per group can be calculated, which is 3. 4 =81. In this example, the code number represents that in a light group with the most colors in a dedicated color set, there can be 81 unique color sequences that correspond to a maximum of 81 LEDs.
[0071] Step S5120: Divide the total number of LED beads in the light chain by the maximum number of codes in a single group and round up to determine the total number of light groups;
[0072] To determine the total number of light groups, divide the total number of LEDs in the light chain by the maximum number of codes per group, then round up to the nearest integer. For example, if the light chain has 500 LEDs and the maximum number of codes per group is 81, then 500 divided by 81 rounded up is 7, meaning the light chain needs to be divided into 7 light groups. The purpose of this is to ensure that the number of LEDs in each group does not exceed the maximum number of codes per group, thus guaranteeing that the LEDs in each group can be distinguished by a unique color code.
[0073] Step S5130: Use the total number of light groups as the grouping interval, set up a corresponding number of multiple light groups, and sequentially number each light group.
[0074] After determining the total number of light groups, this total number is used as the grouping interval. A corresponding number of light groups are then set up and sequentially numbered. This process forms the basis for LED grouping, defining the number of light groups to which LEDs on the light chain will be assigned and the identifier for each light group. For example, if there are 7 light groups, they can be numbered from 1 to 7. This numbering process not only facilitates referencing specific light groups in subsequent steps but also streamlines the management and control of the light groups. Each light group will receive LEDs according to its numbered sequence, ensuring that the allocation of LEDs is orderly.
[0075] Step S5140: Divide all LED beads into segments according to the grouping number, and add the LED beads in each segment that correspond to the order of the LED groups to the corresponding LED groups.
[0076] The LEDs are divided into segments according to the grouping intervals, and the LEDs in each segment, whose order corresponds to the order of the LED groups, are added to the corresponding LED groups. This step is the specific implementation of LED allocation. Taking a total of 7 LED groups as an example, if the total number of LEDs is 500, then every 7 LEDs form a segment. The LEDs in the first segment (1-7) will be allocated to LED groups numbered 1 to 7 respectively. The LEDs in the second segment (8-14) will also be allocated to LED groups numbered 1 to 7 in the same order, and so on, until all LEDs have been allocated. This allocation method ensures that the LEDs are evenly distributed on the light chain, and that the number of LEDs in each LED group is approximately equal.
[0077] After implementing the above embodiments, the significant technical advantages obtained by this application are mainly reflected in the following aspects:
[0078] First, by accurately calculating the maximum number of codes per group and determining the total number of light groups accordingly, a scientific and reasonable grouping strategy for the LED beads can be planned. This ensures that the number of LED beads in each group is moderate, avoiding both excessive LED beads leading to a significant increase in color coding complexity and recognition difficulty, and insufficient LED beads resulting in resource waste. This lays a solid foundation for subsequent color coding and recognition steps, enabling the entire LED bead position recognition system to effectively control complexity and cost while ensuring recognition accuracy.
[0079] Secondly, the total number of light groups is used as the grouping interval, and the light groups are sequentially numbered, providing a clear and orderly rule for the allocation of LED beads. This rule-based allocation method greatly simplifies the logic of LED bead allocation, enabling LED beads to be quickly and accurately allocated to the corresponding light groups in a predetermined order. This not only improves the efficiency of LED bead allocation but also facilitates the management and control of light groups in practical applications.
[0080] Secondly, all LED beads were sequentially segmented according to the grouping intervals, and the LED beads in each segment were added to the corresponding light groups, achieving a uniform distribution of LED beads on the light chain. This uniform distribution layout helps maintain the consistency and uniformity of the lighting effect, avoiding localized over-brightness or under-brightness caused by uneven LED bead distribution, thereby improving the overall visual effect. At the same time, the uniform distribution of LED beads also helps improve the accuracy and reliability of color recognition, because with a uniform distribution, the color interference between adjacent LED beads is relatively small, making them easier to identify accurately.
[0081] Finally, the synergistic effect of the above steps enables the LED position recognition method of this application to perform consistently and excellently when handling large-scale LED layouts. Whether dealing with light chains containing hundreds or thousands of LEDs, this application can efficiently and accurately complete the LED position recognition task, demonstrating good scalability and adaptability. This makes this application not only suitable for small decorative light chains, but also able to meet the needs of complex scenarios such as large-scale stage lighting and architectural lighting, possessing broad application prospects and practical application value.
[0082] Based on any embodiment of the method in this application, a dedicated color set corresponding to each lamp group is determined, and a unique color sequence for each LED in its lamp group is determined according to each color code in the dedicated color set, including:
[0083] Step S5210: Determine the minimum number of colors required for the dedicated color set of each light group based on the number of LEDs in each light group and the preset bit length of the color matching sequence of the LEDs.
[0084] In determining the dedicated color set for each light group, the first step is to determine the minimum number of colors required for each light group's dedicated color set, based on the number of LEDs in each group and the preset bit length of the LED color sequence. This process is crucial to ensuring that each LED in each group obtains a unique color sequence. Specifically, the preset bit length of the color sequence refers to the number of colors displayed by each LED during color changes, while the number of LEDs in the group directly determines how many different color combinations are needed to assign a unique color sequence to each LED.
[0085] To calculate the minimum number of colors X required for each light group, the principle of repeating permutations in mathematics can be used. For example, if a light group has N LEDs, and the preset bit length of the color sequence for each LED is M, then to ensure that each LED has a unique color sequence, the dedicated color set must contain at least a sufficient number of colors such that the total number of all possible permutations of these colors is greater than or equal to N. In this way, each LED can be assigned a non-repeating color sequence, thus enabling accurate differentiation in subsequent color recognition steps. Summarizing this principle, the following formula can be obtained:
[0086] X M ≥N
[0087] By solving the above formula, the minimum quantity X can be determined.
[0088] Step S5220: For different light groups, according to different target quantities not less than the minimum quantity of the light group, determine a corresponding number of different colors from the color space to form a special color set for the corresponding light group;
[0089] For different light groups, based on the previously calculated minimum number of required colors, a target number not less than that minimum number can be selected. Then, for each light group, multiple colors of the corresponding target number can be selected from the color space to form a dedicated color set to achieve color selection.
[0090] A color space refers to the set of all possible colors, which can be the RGB (red, green, blue) color space, the CMYK (cyan, magenta, yellow, black) color space, or any other model that can represent colors. In practical applications, the RGB color space is usually chosen because it offers a rich selection of colors, making it suitable for color control of lighting equipment.
[0091] To ensure that the colors in the dedicated color set for each light group provide a sufficiently unique color sequence for the LEDs, colors that meet the group's requirements need to be selected from the color space. This can be achieved in several ways. For example, color selection algorithms can be used to choose colors based on attributes such as brightness, saturation, or hue. Another approach is through a user interface, allowing users to select colors according to their preferences and design needs. Regardless of the method used, the goal is to ensure that the selected colors are visually clearly distinguishable, thereby improving the accuracy and reliability of subsequent color recognition.
[0092] When selecting colors, the actual display effect of the LEDs and the recognition capability of the camera unit must also be considered. For example, some colors may be difficult to accurately identify under certain lighting conditions, or the differences between some colors may not be sufficient for the camera unit to distinguish them. Therefore, colors that may cause recognition problems should be avoided as much as possible. In addition, to further improve color differentiation, colors that are far apart in the color space can be selected, as these colors are generally easier to distinguish visually.
[0093] Step S5230: For each light group, repeat the colors in the dedicated color set of the light group to determine the multiple color sequences required for each LED in the light group as its color sequence.
[0094] To ensure that each LED in the light group is associated with and assigned a color sequence as its color matching sequence, and to ensure that each LED can display a unique color combination during the color change process, so that it can be accurately distinguished in the subsequent color recognition steps, a repetitive arrangement method is used to determine the color matching sequence of the LEDs in the light group.
[0095] First, for each LED group, all colors from its dedicated color set are collected. These colors were previously determined based on the number of LEDs in the 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 group's dedicated color set includes red, green, and blue, then these three colors will be used to generate the color sequence for all LEDs in that group.
[0096] Next, these colors are repeated. This means that the color choice for each position is independent, and any color from 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 greatly increases the number of color sequences that can be generated, ensuring that each LED receives a unique color sequence.
[0097] Then, from all the generated color sequences, a unique color sequence is assigned to each LED in the light group. This can be achieved through simple sequential assignment, or optimized according to specific rules or algorithms to ensure a uniform distribution of color sequences with good visual effects. For example, color sequences with higher visual contrast or greater appeal can be prioritized to enhance the aesthetics of the lighting effect.
[0098] Finally, the color sequence assigned to each LED is recorded in the LED chain data structure. Each LED not only has a unique serial position identifier but also a unique color sequence associated with it. This color sequence will be used in subsequent lighting control and display to ensure that each LED can be displayed in a predetermined color order, thereby achieving complex lighting effects.
[0099] After implementing the above embodiments, the significant technical advantages achieved by this application are mainly reflected in ensuring that each LED in each light group obtains a unique color sequence, thereby enabling accurate differentiation in the color recognition step. By accurately calculating the minimum number of colors required for each light group and selecting colors that meet the requirements from the color space to form a dedicated color set, not only is the diversity and distinguishability of colors guaranteed, but the actual display effect of the LEDs and the recognition capability of the camera unit are also taken into account, avoiding recognition problems caused by improper color selection. Furthermore, by applying a repetitive arrangement method to assign a unique color sequence to each LED and associating these sequences with the light chain data structure, not only is the accuracy and reliability of color recognition improved, but it also facilitates querying and retrieval, providing a solid technical foundation for achieving efficient LED position recognition and precise lighting effect control. These technical effects work together to make this application perform excellently when dealing with large-scale LED layouts, meeting the diverse needs for lighting effects in different scenarios, and possessing broad application prospects and practical application value.
[0100] Based on any embodiment of the method in this application, for different light groups, according to different target quantities not less than the minimum number of light groups, multiple different colors are determined from the color space to form a dedicated color set for the corresponding light group, including:
[0101] Step S5221: Based on half of the total number of target lights required for all light groups, determine multiple primary colors belonging to different color systems from the color space, and determine the complementary color of each primary color;
[0102] In determining a dedicated color scheme for different light groups, the first step is to select multiple primary colors belonging to different color families from the color space and determine the complementary colors of these primary colors. This process is performed based on half of the total number of target colors required for all light groups. The purpose is to ensure that the selected colors have sufficient visual differentiation and can meet the color diversity requirements of all light groups. Determining the complementary colors of the primary colors is to increase color contrast and improve the accuracy and reliability of subsequent color recognition.
[0103] Step S5222: According to the rule that each dedicated color set contains at least one primary color and its complementary color, determine the corresponding target number of multiple colors for each light group to construct a dedicated color set.
[0104] Following the rule that each dedicated color set must contain at least one primary color and its complementary color, a dedicated color set is constructed by determining a corresponding target number of colors for each light group. This means that the dedicated color set for each light group not only includes the basic primary color, but also the complementary color that contrasts sharply with it, as well as other possible colors, to achieve the predetermined target number. Such a dedicated color set design helps the camera unit accurately identify the colors displayed by the LEDs, even in complex lighting environments. Furthermore, a dedicated color set including complementary colors enhances the visual effect, making the lighting effects more vivid and attractive.
[0105] After implementing the above embodiments, the significant technical advantage of this application lies in the fact 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 LED color recognition are greatly improved. This method not only ensures that the LEDs in each light group can be accurately distinguished when their colors change, but also enhances the visual performance of the entire light chain in different environments. Furthermore, because the construction of the dedicated color set considers the visual distinguishability and recognition ability of colors, this makes the LED position recognition method of this application more efficient and practical in real-world applications, capable of meeting the lighting control needs of various complex scenarios.
[0106] Based on any embodiment of the method in this application, the individual LEDs are assigned to at least two LED groups according to their serial positions, including:
[0107] Step S6100: Determine the distribution combination of the total number of LED beads in the light chain according to the preset sampling quantity and multiple color numbers. The distribution combination defines the element quantity of at least two light groups, and the sum of the element quantity of each light group is greater than or equal to the total number of LED beads.
[0108] The distribution of the total number of LEDs in the light chain is determined based on a preset sampling number and multiple color numbers. This distribution defines the number of elements in at least two light groups, and the sum of the number of elements in each light group is greater than or equal to the total number of LEDs. 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 4 image frames need to be captured.
[0109] To determine the distribution combination, we can combine multiple pre-selected color numbers (e.g., 5, 4, 3, 2, etc.) to calculate a tentative quantity with the number of colors as the base and the sample size as the exponent. By arbitrarily combining the tentative quantities of different color numbers, we obtain the total number of combinations and determine the minimum value among the total number of combinations that just reaches or exceeds the total number of LEDs. This minimum value will be used to set the number of LED groups.
[0110] For example, assuming a total of 800 LEDs and a sampling quantity of 4, if there are only four colors and the LEDs are not grouped or are evenly grouped, then 5 photos need to be taken, i.e., 4. 5=1024, greater than 800. If a non-uniform grouping method is used, with one group containing 5 colors and the other containing 4 colors, the calculation is as follows:
[0111] 5 4 =625
[0112] 4 4 =256
[0113] Adding these two calculated quantities, we get 625 + 256 = 881, which is greater than 800. Therefore, the LEDs can be distributed into two groups, one group using 5 colors and the other group using 4 colors.
[0114] Step S6200: Discretely distribute each LED bead to the at least two LED groups according to the serial position;
[0115] Based on the distribution combination determined in step S6100, the number of elements in each light group is clear. For example, if the total number of LED beads is 800, the sampling quantity is 4, and the distribution combination is determined to be one light group using 5 colors and another light group using 4 colors, then the LED beads can be allocated as follows:
[0116] The first method is to use interval sampling. In the previous example, the number of LEDs in the first group of lights is 625, and the number in the second group of lights is 256. The former is roughly twice that of the latter. Therefore, we can perform cyclic sampling every three LEDs. For every three LEDs, the first two are added to the first group of lights, and the last one is added to the first group of lights, and so on, so that each group of lights has the LEDs it should have.
[0117] The second method is partial sampling. For example, in the previous example, the first 625 LEDs can be added to the first LED group, and the remaining 255 LEDs can be added to the second LED group.
[0118] Step S6300: Based on the number of colors used in the distribution combination, determine the number of colors in the dedicated color set for the corresponding light group to determine all the colors selected for the dedicated color set.
[0119] Since the allocation of light groups is obtained by combining the number of samples with multiple color numbers to calculate the distribution combination and selecting the optimal distribution combination, the optimal distribution combination corresponds to the number of colors in each light group. This can be used to guide the selection of the number of colors in the dedicated color set for this light group. Subsequently, the corresponding number of colors can be selected for the corresponding light group according to the corresponding number of colors.
[0120] This embodiment determines the distribution of the total number of LEDs in the light chain by combining a preset sampling number and multiple color numbers, thereby allocating the LEDs to at least two light groups. This not only improves the efficiency of color sequence generation but also ensures that each LED in each light group obtains a unique color sequence, enabling accurate differentiation in subsequent color recognition steps. By selecting the optimal distribution combination, the number of shots required can be minimized, reducing computational resource consumption and improving the overall system performance. Furthermore, by using interval sampling or local sampling, LEDs can be flexibly allocated to different light groups, ensuring that the number of elements in each light group conforms to the preset distribution combination. This method not only improves the flexibility of LED allocation but also enhances the system's adaptability and robustness, enabling it to better handle light chain systems of different sizes and layouts. Finally, by determining the number of colors in a dedicated color set for each light group, it ensures that each light group has enough colors to generate a unique color sequence, thereby achieving precise lighting control and dynamic display effects, significantly improving the user experience.
[0121] Based on any embodiment of the method in this application, a synchronized color rendering instruction is constructed and sent to the light chain according to the color matching sequence corresponding to each LED bead in the light chain data structure, including:
[0122] Step S5310: According to the sequential correspondence, sort the same colors in the color matching sequence of the LED beads, and associate the serial position of each LED bead to construct a synchronous color display instruction corresponding to the sequence.
[0123] When constructing a synchronized color display instruction, the instruction corresponding to a specific timing is first created based on the color sequence of the LED beads and their serial positions. To this end, colors with the same order in the color sequence of all LED beads in the light chain are associated one-to-one to construct the synchronized color display instruction. Specifically, at a specific timing point, all LED beads in the light chain that should display a color determine the color of each LED bead according to its corresponding order in its color sequence to construct the same frame of color data and encapsulate it into a synchronized color display instruction. The order in the color sequence corresponds to the timing of the synchronized color display sequence; therefore, for the next timing, the next ordered color in the color sequence of each LED bead is selected to construct the synchronized color display instruction. In the synchronized color display instruction, to facilitate the light chain controller's understanding of each target LED bead, the serial position of each LED bead is associated with its color at that timing. After receiving the synchronized color display instruction and parsing it accordingly, the light chain can accurately control each LED bead to emit the corresponding light color. By sending corresponding synchronous color display commands at different times, the light chain can be controlled to continuously switch light colors, so that each light bead presents the color change process described by its color matching sequence.
[0124] Because different light groups may use different color sequence numbers, the color sequence lengths of the LEDs in these groups will vary. To address this, when constructing synchronized color rendering instructions, if some color sequences are too long and other color sequences lack corresponding colors, black can be used to fill the gaps. This ensures that each LED's color sequence in each synchronized color rendering instruction contains the same number of color bits. However, since black is interpreted as not emitting light, the light chain can control the corresponding LED to not emit light at the appropriate timing.
[0125] Therefore, this step ensures that all LEDs display the correct color at the correct time according to their preset color sequence. This requires not only accurately identifying the color order within the color sequence but also precisely matching these orders with the serial positions of the LEDs. In this way, it ensures that the LEDs throughout the entire light chain work together to produce the desired lighting effect.
[0126] Step S5320: The corresponding number of synchronous color display instructions determined by the maximum length color sequence are sent to the light chain in a loop according to a preset time interval.
[0127] After determining the color that each LED should display at a specific time sequence and obtaining the synchronized color display instruction, these instructions can then be sent to the light chain in a cyclical manner according to the preset time interval. This ensures that the light chain can change colors according to the predetermined pattern and rhythm, thereby achieving a dynamic lighting effect.
[0128] Specifically, the timing interval refers to the time difference between each synchronized color rendering instruction. This parameter can be set according to the actual application requirements. For example, in some scenarios that require rapid changes in lighting effects, the timing interval can be set to be shorter; while in some scenarios that pursue soft, slow changes, the timing interval can be appropriately extended.
[0129] There are several ways to send synchronized color display commands. A common method is to send the command from the control device to the controller of the light chain via wired or wireless communication protocols such as Bluetooth, Wi-Fi, or RS-485. Upon receiving the command, the controller parses the command content and, based on the serial position and color information of the LEDs contained in the command, controls the corresponding LEDs to emit the appropriate color at the specified timing. To achieve cyclical transmission, a timer or timer can be used to control the frequency of command transmission, ensuring that the next synchronized color display command is accurately sent at each timing interval.
[0130] In practical applications, to improve the reliability and stability of recognition, several technical measures can be employed to optimize the transmission process of synchronized color display commands. For example, data verification and retransmission mechanisms can be used to ensure accurate command transmission; if the controller does not receive the correct command within a predetermined time, it can automatically request a retransmission. Furthermore, command caching technology can be used to pre-cacherate multiple synchronized color display commands in the controller, which then plays them automatically according to the time intervals. This reduces the impact of communication delays on the lighting effects.
[0131] Step S5330: After the first synchronous color display command is issued, the camera unit is automatically invoked to acquire the preview image generated by shooting the light chain, so as to collect an image sequence containing the image frames corresponding to each synchronous color switch of the light chain.
[0132] After the first synchronized color rendering command is issued, the camera unit can be automatically activated, allowing the user to capture a preview image of the light chain. This process involves acquiring image frames corresponding to each synchronized color change of the light chain, thus forming an image sequence. The camera unit can be a camera built into a computing device such as a mobile terminal, or an external image acquisition device connected to a computer. The preview image is a real-time image captured by the camera unit when the light chain executes the synchronized color rendering command; it records the color state of the light chain at a specific time sequence. Through continuous shooting and image analysis, the camera unit can acquire a series of image frames, arranged chronologically to form a complete image sequence reflecting the entire process of the light chain switching from one color state to another.
[0133] The acquired image sequence will be used for subsequent image analysis and processing. By analyzing the color changes of the LEDs in the image sequence, it can be verified whether the light chain correctly executed the synchronous color display command according to the preset color matching sequence. At the same time, the image sequence also provides an important basis for identifying the position of the LEDs. Through image processing algorithms, the position information of each LED can be extracted from the image sequence, thereby constructing the spatial layout of the light chain.
[0134] After implementing the above embodiments, the significant technical advantages achieved by this application are reflected in several aspects. First, by constructing synchronous color display instructions and considering the differences in the length of color sequences of different light groups, this application can ensure that each LED on the light chain can display the correct color at the correct timing, thereby achieving precise lighting control and the expected dynamic lighting effect. Second, by using a preset timing interval to cyclically send synchronous color display instructions, the light chain can change colors according to a predetermined pattern and rhythm, enhancing the controllability and expressiveness of the lighting effect. In addition, automatically calling the camera unit to acquire preview images and selecting image frames as valid image frames not only improves the efficiency and quality of image acquisition but also provides reliable data support for subsequent LED position and color recognition. These steps work together to improve the reliability and stability of the entire recognition system, optimize the transmission process of synchronous color display instructions, reduce the impact of communication delays on the lighting effect, and also improve the accuracy of image analysis and processing, laying a solid foundation for constructing the spatial layout of the light chain and achieving precise LED position recognition.
[0135] Based on any embodiment of the method in this application, an image sequence is constructed by using a camera unit to capture image frames corresponding to each synchronous color switch of the light chain, and a color display sequence is identified based on the image sequence to determine the sequential color switching of the light beads in the light chain. This includes:
[0136] Step S5410: From the preview image obtained by the camera unit capturing the light chain, identify the image frames of the light chain under different light color display states, and add them to the image sequence in an orderly manner;
[0137] In the process of using a camera unit to capture image frames corresponding to each synchronous color change of the light chain and constructing 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 images captured by the camera unit, and then add these image frames to the image sequence in an orderly manner. The preview images are captured in real time by the camera unit when the light chain executes the synchronous color display command; they record the color state of the light chain at a specific time sequence. These image frames are captured continuously, so they are arranged in chronological order, forming a complete image stream that reflects the entire process of the light chain switching from one color state to another.
[0138] To ensure the integrity and accuracy of the image stream, the preview images captured by the camera unit need to be analyzed and filtered. In one embodiment, the clearest image frame displaying the most LEDs can be selected from the LED chain preview images corresponding to each synchronized color rendering command and added as a valid image frame to the image sequence, as follows:
[0139] First, the sharpness of each image frame is evaluated using an edge detection algorithm. Edge detection highlights the contours of objects in an image, and a sharp image frame typically has more distinct and richer edge information. For example, the Canny edge detection algorithm can be used, which identifies edges by calculating the gradient of pixels in the image, thus effectively distinguishing between sharp and blurry image regions. Image frames with more sharp edges generally indicate higher sharpness, so image frames with sharpness above a threshold can be prioritized as valid image frames.
[0140] Next, image binarization is used to identify and count the number of LEDs in the image frame. Binarization converts the image into a black and white image, making it easier to identify the on / off state of the LEDs. By setting an appropriate threshold, the lit LEDs can be separated from the background, and then methods such as connected component analysis are used to count the number of lit LEDs. Selecting the image frame displaying the most LEDs ensures that the acquired image data is as complete as possible, which is crucial for subsequent LED position and color recognition.
[0141] Furthermore, image contrast evaluation can be used to further filter effective image frames. Images with high contrast generally better showcase the color differences between LEDs, helping to improve the accuracy of color recognition. The overall contrast of an image can be evaluated by calculating its histogram distribution. Selecting image frames with moderate contrast ensures that the LEDs are clearly visible while avoiding color distortion or loss of detail caused by excessively high or low contrast.
[0142] Step S5420: Starting from the first image frame of the image sequence, call the preset image target recognition model to identify the location coordinates and display color of each candidate LED with light color in each image frame;
[0143] Starting with the first image frame of the image sequence, for each image frame in the sequence, a pre-defined image target recognition model is invoked to identify the LEDs. In one embodiment, this model is based on the YOLO series model architecture and is pre-trained with the goal of identifying LEDs. The model's function is to identify the emitting LEDs and provide selection boxes, which define the corresponding image regions. The center coordinates of these image regions serve as the position coordinates of the corresponding light source. Color calculations are performed on these image regions to obtain a numerical representation of the light color, which is used to represent the display color of the LED.
[0144] In practice, the image target recognition model analyzes each image frame to identify candidate LEDs. These candidate LEDs represent areas the model deems likely to emit light, and each area is assigned a selection box for subsequent processing. By performing color calculations on the image within the selection box, a numerical representation of the display color of each candidate LED can be obtained. This numerical representation is obtained through statistical analysis of the pixel colors within the region image; for example, the average color of all pixels in the region image can be calculated, or other more complex color analysis algorithms can be used to obtain a value that accurately represents the color of the region.
[0145] After identifying the position coordinates and display colors of each candidate LED in the first image frame of the image sequence, these coordinates serve as alignment references for the corresponding LED position coordinates in subsequent image frames. To achieve alignment, image processing techniques such as feature matching or template matching can be employed. Specifically, the LED position coordinates in the first image frame can be used as reference points, and then LED positions matching these reference points are searched in each subsequent image frame. This can be achieved by calculating the distance between the candidate LED position in each image frame and the corresponding LED position in the first image frame, selecting the candidate LED with the smallest distance as the matching point. Furthermore, the display color of the LED can be used as auxiliary information to further improve the accuracy of the matching. In this way, it is ensured that the same LED in the LED chain obtains consistent position coordinates in different image frames, avoiding coordinate drift caused by minor differences between image frames, thereby improving the accuracy and reliability of the entire image sequence analysis.
[0146] Step S5430: Construct a representation vector with the position coordinates and display color of each candidate LED, perform clustering based on the representation vectors of all candidate LEDs, and delete outlier candidate LEDs that deviate from the cluster centers.
[0147] After identifying the position coordinates and display color of each candidate LED in each image frame, a representation vector is constructed using the position coordinates and display color of each candidate LED for cluster analysis. The purpose is to identify and remove outlier candidate LEDs that deviate from the cluster center.
[0148] Specifically, the representation vector for each candidate LED contains its position coordinates (e.g., x and y coordinates) and a numerical representation of its display color. These vectors can be viewed as points in a multi-dimensional space, where each dimension represents an attribute of either the position coordinates or the color.
[0149] Clustering based on the representation vectors of all candidate LEDs can be performed using various clustering algorithms, such as K-means, DBSCAN, or hierarchical clustering. These algorithms group similar representation vectors (i.e., similar candidate LEDs) into the same cluster. For example, the K-means algorithm determines cluster centers by calculating the Euclidean distance between vectors and assigns each vector to the nearest cluster center. In this process, the algorithm iteratively updates the positions of the cluster centers until a convergence condition is met.
[0150] Outlier candidate LEDs that deviate significantly from their cluster centers are removed by setting a threshold. This threshold can be based on the distance from the cluster center to the vector or on the cluster density. Any candidate LED exceeding this threshold is considered an outlier because its difference from the cluster center is too large, potentially representing a misidentification or an anomaly in the data. For example, in K-means clustering, the distance from each vector to its cluster center can be calculated; if this distance exceeds a preset threshold, the corresponding candidate LED is marked as an outlier and removed.
[0151] In this way, abnormal candidate LEDs caused by noise, misidentification, or other atypical factors can be effectively removed, thereby improving the accuracy and reliability of LED identification. Finally, the remaining non-outlier candidate LEDs will be used for subsequent analysis and processing, such as calibrating their positions and constructing color development sequences.
[0152] Step S5440: Based on the position coordinates, mark the position of each non-outlier candidate LED in the preset graphic space corresponding to the image frame, and construct the display color of each candidate LED in different image frames into a color sequence.
[0153] The graphics space is a virtual coordinate system that matches the size and resolution of the image frame, used to accurately represent the position of the LEDs in the image. When calibrating the LED positions, the position coordinates of each non-outlier candidate LED can be directly mapped to this graphics space. For example, if the image frame resolution 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 LED can be accurately recorded and represented.
[0154] Constructing the color rendering sequence requires tracking the color changes of each LED in consecutive image frames. This can be achieved by comparing the displayed colors of the same LED in different image frames. Since each image frame records the color state of the LED at a specific time sequence, the color rendering sequence of each LED can be obtained by arranging these color states in chronological order. For example, if an LED displays red in the first image frame, green in the second image frame, and blue in the third image frame, then the color rendering sequence of this LED can be recorded as red-green-blue.
[0155] A step that can be incorporated into this embodiment or used to replace step S5430 verifies the validity of the LEDs in the graphics space through the following verification process:
[0156] First, by calculating the distance between all consecutive pairs of points in the serial position, the average distance and standard deviation are obtained. Then, a deviation threshold is set. Typically, 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 serves as the standard for determining whether an LED is a reliable point, used to identify LEDs with reasonable positions.
[0157] Next, all consecutive point pairs are traversed, and the distance between the point pairs is checked to see if it is within the reliability threshold. If the distance between a pair of consecutive points meets the condition that the distance is within the deviation threshold `max_allowed_deviation_reliable`, then the pair of points is marked as reliable points. For those points that are not directly marked as reliable, a point verification strategy is used for further verification. Specifically, for each point to be verified, if it is already in the reliable sequence, it does not need to be verified again and is directly retained. If it is not in the reliable sequence, the nearest reliable point is found, and the distance between the two is calculated. 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 this distance is reasonable. If the calculated distance exceeds the deviation threshold, then the LED to be verified is considered invalid and can be deleted from the graphics space to ensure the accuracy and reliability of the LED positions in the graphics space.
[0158] This rigorous verification and screening process effectively eliminates erroneous LED position information caused by identification errors or other anomalies, thereby improving the accuracy and robustness of LED position identification.
[0159] After implementing the above embodiments, the significant technical advantages achieved by this application are mainly reflected in ensuring high accuracy and reliability in identifying the position and color of LED beads in image sequences. By selecting the clearest image frames displaying the most LED beads from the preview images, and by accurately identifying the position coordinates and display colors of candidate LED beads in each image frame using an image target recognition model, this application can effectively improve the quality and efficiency of image analysis. Furthermore, by removing outlier candidate LED beads through cluster analysis, and by calibrating positions and constructing color sequences based on graphic space, this application can accurately track and analyze the color change process of each LED bead, providing strong data support for subsequent LED bead position identification and lighting effect control. In addition, by verifying the validity of LED beads in graphic space, this application can eliminate erroneous LED bead position information caused by identification errors or other anomalies, thereby improving the accuracy and robustness of LED bead position identification. These technical effects work together to make this application perform excellently when dealing with large-scale LED bead layouts, meeting the diverse needs for lighting effects in different scenarios, and possessing broad application prospects and practical application value.
[0160] Based on any embodiment of the method in this application, determining the spatial position of the corresponding LED in the LED chain data structure within the graphic space constructed by the image plane corresponding to the image sequence, according to the correspondence between the color rendering sequence and the color matching sequence, includes:
[0161] Step S5510: Compare the color rendering sequence of each candidate LED in the graphic space with the color matching sequence of each LED in the LED chain data structure, and confirm the candidate LEDs whose color rendering sequence matches the color matching sequence as valid LEDs in the LED chain data structure.
[0162] To identify which candidate LED colors match the preset color scheme, the color sequence of each candidate LED in the graphics space is first compared with the color scheme of each LED in the LED chain data structure. If the color sequence matches, the corresponding candidate LED is confirmed as a valid LED in the LED chain data structure. In practice, the color sequence of each candidate LED is checked one by one to see if it completely matches the color scheme of the corresponding LED in the LED chain data structure. If they match, the candidate LED is confirmed as a valid LED, its spatial position in the graphics space is confirmed, and it can be recorded in the LED chain data structure. This process requires not only accurate identification of the color sequence and color scheme but also accurate matching of these sequences with the serial positions of the LEDs to ensure that the position of each LED is accurately identified.
[0163] Step S5520: Remove candidate LEDs that have not been confirmed as valid LEDs from the graphic space;
[0164] Candidate LEDs that are not identified as valid need to be removed from the graphics space to clean it up and remove invalid LED information caused by identification errors or other reasons, thereby improving the accuracy and reliability of LED position identification. This way, only the position information of valid LEDs is retained in the graphics space, providing a clear and accurate data foundation for subsequent lighting effect control and LED management. This method ensures that each LED position in the graphics space corresponds to an actual, working LED, avoiding control errors or display anomalies caused by misidentification.
[0165] Step S5530: For other LEDs that are not identified as valid LEDs in the LED chain data structure, determine the spatial position of the other LEDs in the graphic space according to the serial position relationship between the other LEDs and the valid LEDs.
[0166] After the above process, it may be impossible to determine the spatial positions of all LEDs in the light chain. Therefore, this step can be used to further infer the spatial positions of other LEDs. When determining the spatial positions of other LEDs that have not been identified as valid LEDs in the light chain data structure, the known spatial positions of valid LEDs can be used to infer their positions by analyzing the serial positional relationship between these valid LEDs and the LED to be identified. Specifically, if the spatial positions of some LEDs are known, the spatial positions of other LEDs can be calculated based on their relative positions in the light chain.
[0167] For example, suppose there are 100 LEDs in a light chain. By matching the color rendering sequence with the color matching sequence, the spatial positions of 50 LEDs have been confirmed. For the remaining 50 unconfirmed LEDs, the spatial positions of the other LEDs can be inferred by using the known spatial positions of the 50 LEDs and their sequential arrangement in the light chain. If the spatial positions of the 1st and 3rd LEDs are known, then it can be inferred that the spatial position of the 2nd LED is likely to be between the spatial positions of the 1st and 3rd LEDs.
[0168] Furthermore, the geometric relationships between the LED beads can be used for more precise deductions. For example, if the spatial positions of three consecutive LED beads A, B, and C are known, and these three LED beads are arranged at equal intervals in the LED chain, then the spatial positions of A and C can be used to determine the spatial position of B. Specifically, the midpoint between the spatial positions of A and C is calculated, and this midpoint is very likely to be the spatial position of B.
[0169] In practical applications, various factors may need to be considered, such as variations in the spacing between LED beads and the degree of curvature of the LED chain, all of which can affect the accuracy of the inference. Therefore, it may be necessary to combine multiple methods and algorithms, such as interpolation algorithms and geometric modeling, to improve the accuracy of the inference. For example, linear interpolation algorithms can be used to estimate the spatial position of unknown LED beads between two known LED beads, or curve fitting algorithms can be used to handle the curvature of the LED chain.
[0170] In summary, by utilizing the known spatial location information of the valid LEDs, combined with their serial and geometric relationships within the light chain, the spatial locations of other unidentified LEDs can be effectively inferred, thus determining the spatial locations of all LEDs in the light chain data structure. This method not only improves the efficiency of LED location identification but also enhances its accuracy and reliability, providing a solid foundation for subsequent lighting effect control and LED management.
[0171] After implementing the above embodiments, the significant technical advantages achieved by this application are mainly reflected in the following aspects. First, by accurately comparing the color rendering sequence and the color matching sequence, valid LED beads can be accurately identified, ensuring the accuracy of LED bead position identification. This process not only improves identification efficiency but also reduces the possibility of misidentification, providing a reliable data foundation for subsequent lighting effect control and LED bead management. Second, deleting candidate LED beads that are not confirmed as valid effectively cleans up the graphic space, removes invalid information, and further improves the accuracy and reliability of identification. This step ensures that each LED bead position in the graphic space corresponds to an actual, valid working LED bead, avoiding control errors or display anomalies caused by misidentification. Furthermore, by utilizing the known spatial position information of valid LED beads, combined with the serial positional relationship and geometric relationship between LED beads, the spatial position of other unidentified LED beads can be effectively inferred. This method not only improves the efficiency of LED bead position identification but also improves the accuracy and reliability of identification, providing a solid foundation for subsequent lighting effect control and LED bead management. Furthermore, by combining various methods and algorithms, such as interpolation algorithms and geometric modeling, the accuracy of inference is further improved, and the ability to adapt to complex situations in the recognition process is enhanced.
[0172] Referring to Figure 3, another embodiment of this application also 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 recognition module 5400, and a position determination module 5500. The lamp group allocation module 5100 is configured to construct a lamp chain data structure based on 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 the unique color sequence of each lamp bead in its lamp group based on the color codes in the dedicated color set. The lamp chain color display module 5300 is configured to... The light chain data structure is configured to construct a synchronous color display command based on the color matching sequence corresponding to each LED bead, and send it to the light chain to drive the LED beads in the light chain to synchronously switch light colors, so that each LED bead displays light color according to its corresponding color matching sequence; the color display recognition module 5400 is configured to use a camera unit to collect image frames corresponding to each synchronous color switch of the light chain to form an image sequence, and identify the color display sequence formed by the sequential switching of light colors of the LED beads in the light chain based on the image sequence; the position determination module 5500 is configured to determine the spatial position of the corresponding LED bead in the light chain data structure in the graphic space constructed by the image plane corresponding to the image sequence based on the correspondence between the color display sequence and the color matching sequence.
[0173] Referring to Figure 4, another embodiment of this application provides a computer device that can be used as a controller in an ambient lighting device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable storage medium stores an operating system, a database, and a computer program encapsulating computer-readable instructions. The database may store a sequence of control information. When the computer-readable instructions are executed by the processor, the processor can implement a method for identifying the position of LED beads. The processor of the computer device provides 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 can execute the LED bead position identification method of this application. The network interface of the computer device is used for communication with a terminal. Those skilled in the art will understand that the structure shown in Figure 4 is merely a block diagram of a portion of the structure related to the solution of this application and does not constitute a limitation on the computer device to which the solution of this application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0174] The processor executes the specific functions of each module and its sub-modules in Figure 3, and the memory stores the program code and various types of data required to execute the above modules or sub-modules. The network interface is used for data transmission between the user terminal and the server. In this embodiment, the memory stores the program code and data required to execute all modules / sub-modules in the LED position identification device of this application, and the server can call the server's program code and data to execute the functions of all sub-modules.
[0175] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the LED position identification method described in any embodiment of this application.
[0176] This application also provides a computer program product, including a computer program / instructions that, when executed by one or more processors, implement the steps of the LED position recognition method described in any embodiment of this application.
[0177] In summary, this application, through innovative LED grouping and color coding technology, not only significantly improves the efficiency and accuracy of LED position recognition but also greatly enhances the system's stability and adaptability. In practical applications, these advantages translate into a smoother user experience and more reliable system performance. Users can quickly configure and adjust the LED layout, reducing waiting time caused by image acquisition and processing, while ensuring high-precision recognition results in various complex environments. This allows this application to not only improve work efficiency but also provide solid technical support for creating more creative and dynamic lighting effects, bringing new breakthroughs and development opportunities to the field of intelligent lighting.
Claims
1. A method for identifying the position of LED beads, characterized in that, include: A data structure for the light chain is constructed based on the total number of LEDs in the chain to represent the serial position of each LED in the chain. Each LED is then assigned to at least two light groups based on its serial position. Determine the dedicated color set corresponding to each light group, and determine the unique color sequence of each LED in its light group based on the color codes in the dedicated color set; Based on the color sequence corresponding to each LED bead in the light chain data structure, a synchronous color display instruction is constructed and sent to the light chain to drive the LED beads in the light chain to synchronously switch light colors, so that each LED bead displays light color according to its corresponding color sequence. The camera unit captures image frames corresponding to the synchronous switching of light colors of the light chain each time, forming an image sequence. Based on the image sequence, the color display sequence formed by the sequential switching of light colors of the light beads in the light chain is identified. Based on the correspondence between the color rendering sequence and the color matching sequence, the spatial position of the corresponding LED in the light chain data structure is determined in the graphic space constructed by the image plane corresponding to the image sequence.
2. The LED bead position identification method according to claim 1, characterized in that, Each LED is assigned to at least two LED groups based on its serial position, including: The maximum number of codes per group is determined based on the preset maximum color scheme length and the maximum number of colors in the dedicated color scheme set. The total number of lamp beads in the light chain is determined by dividing the total number of lamp beads by the maximum number of codes in a single group and then rounding up. The total number of light groups is used as the grouping interval. A corresponding number of light groups are set up, and each light group is sequentially numbered. Divide all LED beads into segments according to the grouping number, and add the LED beads in each segment that correspond to the order of the LED groups to the corresponding LED groups.
3. The LED bead position identification method according to claim 2, characterized in that, The maximum color length refers to the maximum number of color bits that a single LED color sequence can display, and the maximum number of colors in a dedicated color set refers to the maximum number of colors contained in a dedicated color set allocated to a single LED group.
4. The LED bead position identification method according to claim 1, characterized in that, Determine the dedicated color set corresponding to each light group, and determine the unique color sequence of each LED in its light group based on the color codes in the dedicated color set, including: Based on the number of LEDs in each LED group and the preset bit length of the color matching sequence of the LEDs, determine the minimum number of colors required for the dedicated color set of each LED group; For different light groups, according to different target quantities that are not less than the minimum number of light groups, a set of different colors is determined from the color space to form a special color scheme for the corresponding light group; For each light group, the colors in the dedicated color set of that light group are repeated to determine the multiple color sequences required for each LED in that light group as its color sequence.
5. The LED bead position identification method according to claim 4, characterized in that, Based on the number of LEDs in each LED group and the preset bit length of the LED color sequence, determine the minimum number of colors required for the dedicated color set of each LED group, including: If the light group comprises N LEDs, and the preset bit length of the color sequence for each LED is M, then the minimum number X of colors required for the dedicated color set satisfies the following formula: X M ≥N.
6. The LED bead position identification method according to claim 4, characterized in that, For different light groups, according to different target quantities not less than the minimum number specified for that light group, a dedicated color set is determined from the color space, comprising multiple different colors, including: Based on half of the total number of target lights required for all light groups, determine multiple primary colors belonging to different color systems from the color space, and determine the complementary color of each primary color. According to the rule that each dedicated color set contains at least one primary color and its complementary color, a dedicated color set is constructed by determining the corresponding target number of multiple colors for each light group.
7. The LED bead position identification method according to claim 1, characterized in that, Each LED is assigned to at least two LED groups based on its serial position, including: The distribution combination of the total number of LED beads in the light chain is determined based on the preset sampling quantity and multiple color numbers. This distribution combination defines the number of elements in at least two light groups, and the sum of the number of elements in each light group is greater than or equal to the total number of LED beads. Each LED is discretely assigned to one of the at least two LED groups according to its serial position; Based on the number of colors used in this distribution combination, determine the number of colors in the dedicated color set for the corresponding light group to determine all the colors selected for the dedicated color set.
8. The LED bead position identification method according to claim 7, characterized in that, The distribution combination of the total number of LED beads in the light chain is determined based on the preset sampling quantity and multiple color numbers, including: Calculate the approximate quantity with the number of colors as the base and the number of samples as the exponent; By arbitrarily combining the calculated quantities of different colors, a total combination is obtained, and the minimum value of the sampling number is determined when the total combination just reaches or exceeds the total number of LED beads. The minimum value is used to set the number of lamp groups.
9. The LED bead position identification method according to claim 1, characterized in that, Based on the color sequence corresponding to each LED in the light chain data structure, a synchronized color display command is constructed and sent to the light chain, including: According to the sequential correspondence, colors with the same order in the color matching sequence of LED beads are associated with the serial position of each LED bead to construct a synchronous color display instruction corresponding to the sequence. Multiple synchronized color display instructions, determined by the maximum length color sequence, are sent cyclically to the light chain according to a preset time interval. After the first synchronized color display command is issued, the camera unit is automatically invoked to acquire the preview image generated by shooting the light chain, so as to collect an image sequence containing the image frames corresponding to each synchronized color switch of the light chain.
10. The LED bead position identification method according to any one of claims 1 to 9, characterized in that, The image unit captures image frames corresponding to each synchronous color change of the light chain, forming an image sequence. Based on the image sequence, the color display sequence formed by the sequential switching of light colors by the light beads in the light chain is identified, including: From the preview image of the light chain captured by the camera unit, image frames of the light chain under different light color display states are identified and added to the image sequence in an orderly manner; Starting from the first image frame of the image sequence, a preset image target recognition model is invoked to identify the location coordinates and display color of each candidate LED with a light color in each image frame; Construct a representation vector for each candidate LED with its position coordinates and display color. Perform clustering based on the representation vectors of all candidate LEDs and remove outlier candidate LEDs that deviate from the cluster centers. Based on the position coordinates, the positions of each non-outlier candidate LED bead are marked in the preset graphic space of the corresponding image frame, and the display colors of each candidate LED bead in different image frames are ordered to form a color sequence.
11. The LED bead position identification method according to claim 10, characterized in that, From the preview image obtained by the camera unit capturing the light chain, image frames of the light chain under different light color display states are identified and added to the image sequence in an orderly manner, including any one of the following methods: The sharpness of each image frame is evaluated using an image edge detection algorithm, and image frames with a sharpness higher than a threshold are selected. Image binarization is used to identify and count the number of LEDs in an image frame, and the image frame with the most LEDs is selected for display. The overall contrast of an image is evaluated by calculating its histogram distribution, and image frames with moderate contrast are selected.
12. The LED bead position identification method according to claim 10, characterized in that, Based on the correspondence between the color rendering sequence and the color matching sequence, the spatial position of the corresponding LED in the LED chain data structure within the graphic space constructed by the image plane corresponding to the image sequence is determined, including: The color rendering sequence of each candidate LED in the graphics space is compared with the color matching sequence of each LED in the LED chain data structure. Candidate LEDs whose color rendering sequence matches the color matching sequence are confirmed as valid LEDs in the LED chain data structure. Candidate LEDs that were not identified as valid LEDs were removed from the graphic space; For other LEDs that are not identified as valid LEDs in the LED chain data structure, their spatial positions in the graphic space are determined based on the serial positional relationship between the other LEDs and the valid LEDs.
13. A lamp bead position identification device, characterized in that, include: The lamp group allocation module is configured to construct a lamp chain data structure based on 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 is configured to determine the dedicated color set corresponding to each light group, and determine the unique color sequence of each LED in its light group based on the color codes in the dedicated color set. The light chain color display module is configured to construct a synchronous color display instruction based on the color matching sequence corresponding to each light bead in the light chain data structure and send it to the light chain, thereby driving the light beads of the light chain to synchronously switch light colors, so that each light bead displays light color according to its corresponding color matching sequence. The color recognition module is configured to use a camera unit to capture image frames corresponding to the synchronous switching of light colors of the light chain each time to form an image sequence, and to identify the color sequence formed by the sequential switching of light colors of the light beads in the light chain based on the image sequence; The position determination module is configured to determine the spatial position of the corresponding LED in the LED chain data structure in the graphic space constructed by the image plane corresponding to the image sequence, based on the correspondence between the color rendering sequence and the color matching sequence.
14. A computer device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 12.
15. A computer program product, comprising a computer program or computer instructions, characterized in that, When the computer program or computer instructions are invoked and executed by the central processing unit, the steps of the method as described in any one of claims 1 to 12 are performed.