Light chain spiral model construction method and device as well as equipment and product
By constructing a cone model and expanding it into a sector-shaped reference area, the position of the lamp bead is accurately mapped, which solves the problem of identification efficiency and accuracy in the construction of the lamp chain circle model in traditional technology, realizes efficient and intuitive intelligent lighting design, and broadens the scope of intelligent lighting. The scope of application of the system.
Patent Information
- Application Number
- CN202410937072.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-12
AI Technical Summary
Traditional technology has low recognition efficiency and insufficient accuracy when constructing complex light chain circling models, and requires high computing resources, which increases user operation thresholds and limits the popularization and application of intelligent lighting technology.
By obtaining on-site images of the spiral circling light chain, construct a cone model and expand it into a sector-shaped reference area, accurately determine the positions of the lamp beads, and map these positions to the three-dimensional modeling space to generate an accurate circling model of the light chain.
It improves model construction speed and accuracy, reduces dependence on computing resources, simplifies user operations, lowers technical thresholds, supports personalized and dynamic lighting design, and enriches the application scenarios of intelligent lighting systems.
Smart Images

Figure CN118468615B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of lighting control, and in particular to a method and device for constructing a spiral light chain model, as well as equipment and products. Background Art
[0002] With the rapid development of smart home and smart lighting technologies, personalized and dynamic lighting solutions are becoming more and more popular in the market. Users expect to be able to quickly design and implement complex spiral light chain models based on their own creativity to meet different decoration and lighting needs. In this context, how to accurately capture and model the physical layout of light chains, especially for irregular or complex light chains, has become an important topic in the field of smart lighting.
[0003] In traditional technical means, building a spiral light chain model often relies on complex image processing and deep learning models. These methods not only have low recognition efficiency but also lack accuracy when dealing with large-scale or complex layout light chains. When designing lighting effects, users need to rely on model data that correctly corresponds to the placement of the light chain, but existing technologies are difficult to provide this data quickly and accurately, resulting in a cumbersome and time-consuming design process. In addition, the high demand for computing resources by deep learning models also makes the implementation cost high, limiting the popularization of smart lighting technology.
[0004] More specifically, traditional technologies lack recognition accuracy and robustness when dealing with occlusion, dense arrangement, or rapidly changing light patterns. This is particularly true in scenes such as stage lighting design and holiday decorations that require fast and flexible adjustment of lighting effects. In addition, traditional technologies often require users to have certain professional knowledge, perform complex operations, or learn professional programming skills, which undoubtedly increases the user's usage threshold and affects the user experience.
[0005] In response to these problems, although there have been some attempts to improve performance by improving algorithms or enhancing computing power, these improvements are often limited to technical tinkering and fail to fundamentally solve the problem of quickly and accurately modeling complex light chain hovering models. Summary of the invention
[0006] The purpose of the present application is to provide a method and device for constructing a spiral light chain model, as well as equipment and products.
[0007] According to one aspect of the present application, a method for constructing a spiral light chain model is provided, comprising:
[0008] Obtain a live image of the light chain spirally hovering on the external carrier, determine the planar spatial position of each front light bead of the light chain in the image view space under the image shooting angle, and determine a cone model of the external carrier adapted to the spiral shape;
[0009] Expanding the cone model into a fan-shaped reference area in the image view space, so that each front light bead is located on the surface of the fan-shaped reference area according to its plane space position;
[0010] According to the number of missing lamp beads on the back of each circle of the lamp chain outside the image shooting angle, the lamp beads on the back of each circle are arranged on the surface of the fan-shaped reference area to determine the fan-shaped spatial positions of all the lamp beads in the fan-shaped reference area;
[0011] The fan-shaped spatial position of the lamp beads on the surface of the fan-shaped reference area is mapped to the corresponding three-dimensional spatial position of the modeling space where the cone model is located, so as to obtain the spiral model of the lamp chain.
[0012] According to another aspect of the present application, a light chain spiral model construction device is provided, comprising:
[0013] An image analysis module is configured to obtain a live image of the light chain spirally hovering on the external carrier, determine the planar spatial position of each front light bead of the light chain in the image view space under the image shooting angle, and determine a cone model suitable for the spiral external carrier;
[0014] A model unfolding module, configured to unfold the cone model into a fan-shaped reference area in the image view space, so that each front lamp bead is located on the surface of the fan-shaped reference area according to its plane space position;
[0015] A back side inference module is configured to arrange the back side lamp beads of each circle on the surface of the fan-shaped reference area according to the number of missing back side lamp beads of each circle of the light chain outside the image shooting angle, and determine the fan-shaped spatial position of all the lamp beads in the fan-shaped reference area;
[0016] A construction module is described, which is configured to map the fan-shaped spatial position of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial position of the modeling space where the cone model is located, so as to obtain the spiral model of the lamp chain.
[0017] According to another aspect of the present application, a computer device is provided, including a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the light chain spiral model construction method.
[0018] According to another aspect of the present application, a computer program product is provided, including a computer program or computer instructions, which, when called and executed by a central processing unit, execute the steps of the light chain spiral model construction method.
[0019] Compared with traditional technologies, this application uses innovative spatial mapping technology to bring breakthrough benefits to the field of smart lighting, including but not limited to:
[0020] First, the application greatly simplifies the modeling process by directly identifying the external carrier of the light chain from the on-site image and building the corresponding cone model as a reference. This intuitive identification and modeling method not only improves the speed of model construction, but also enhances the adaptability to complex display forms.
[0021] Secondly, this application uses a unique unfolding technology to transform the cone model into a fan-shaped reference area, providing a clear mapping plane for each lamp bead in the light chain. In this fan-shaped reference area, the spatial positions of the front and back lamp beads can be accurately determined, whether it is the front lamp bead under the image shooting angle or the back lamp bead outside the shooting angle, its corresponding position can be found in the fan-shaped space.
[0022] Furthermore, the mapping process of this application does not only stay in the two-dimensional plane, but also further maps the fan-shaped spatial position to the three-dimensional modeling space where the cone model is located. By converting the two-dimensional fan-shaped layout into a three-dimensional spatial layout, not only the three-dimensional form of the light chain is retained, but also each lamp bead is given an accurate three-dimensional spatial position. This mapping from two-dimensional to three-dimensional makes the spiral model of the light chain more accurate and vivid, providing strong data support for subsequent lighting design and effect display.
[0023] In addition, through the innovative modeling method of this application, many limitations in traditional technologies, such as low recognition efficiency, insufficient precision, and high requirements for equipment performance, are effectively solved. Users can design light chain lighting more intuitively and conveniently without complex operations or professional programming skills. The implementation of this application not only improves design efficiency and lowers technical barriers, but also provides the possibility of achieving personalized and dynamic lighting effects through precise model construction, making it more convenient for users to customize lighting effects, greatly enriching the application scenarios and creative space of intelligent lighting systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 This is a schematic diagram of the electrical structure of an exemplary ambient light device of the present application;
[0026] Figure 2 It is a flowchart of a method for constructing a spiral light chain model in an embodiment of the present application;
[0027] Figure 3To show the fan-shaped reference area for laying the lamp beads and some of the front lamp beads located thereon;
[0028] Figure 4 To show Figure 3 Complete the diagram of the back lamp beads on the fan-shaped reference area;
[0029] Figure 5 A schematic diagram of a model image rendered based on a light chain hovering model;
[0030] Figure 6 A schematic diagram of the basic triangles required to construct a cone model corresponding to the front light beads in the image view space;
[0031] Figure 7 A schematic diagram of adding the missing number of lamp beads near the center of the fan-shaped reference area;
[0032] Figure 8 It is a structural schematic diagram of a device for constructing a spiral model of a light chain in an embodiment of the present application;
[0033] Fig. 9 It is a schematic diagram of the structure of the computer device in the embodiment of the present application. DETAILED DESCRIPTION
[0034] The method for constructing a spiral light chain model of the present application can be implemented as a computer program product, which is installed and run in a computer device. The computer device can be in various forms, including but not limited to various types of mobile terminals, desktop computers, and devices with other functions such as atmosphere light devices. The computer device carries a camera unit for obtaining a preview video so as to photograph the light chain to form a live image required for constructing a spiral light chain model. The mobile terminal mentioned here can be a personal device such as a smart phone or a tablet computer.
[0035] See also Figure 1 As can be seen from the structural schematic diagram of an atmosphere light device provided in an embodiment of the present application, the atmosphere light device includes a controller 1, a light chain 2, and an image acquisition interface. The light chain 2 is electrically connected to the controller 1 so as to accept the control of the computer program running in the controller 1 and work together to realize the lighting effect playback.
[0036] The controller 1 generally includes a control chip, a communication component, and a bus connector. In some embodiments, the controller 1 may also be configured with a power adapter, a control panel, a display screen, etc. as required.
[0037] The power adapter is mainly used to convert AC power into DC power to power the entire atmosphere light device. The control chip can be implemented using various embedded chips, such as Bluetooth SoC (System on Chip), WiFi SoC, MCU (Micro Controller Unit), DSP (Digital Signal Processing) and other types of chips. The control chip usually includes a central processing unit and a memory, which are used to store and execute program instructions respectively to achieve the corresponding functions. The above types of control chips can have their own communication components, or they can be configured with additional communication components as needed.
[0038] The communication component can be used to communicate with external devices, for example, it can communicate with mobile terminals such as personal computers or various smart phones, so that after the user issues various configuration instructions through his mobile terminal, the control chip of the controller 1 can receive the configuration instructions through the communication component and complete the basic configuration to control the light chain. In addition, the controller 1 can also obtain the interface image of the terminal device or the real-time preview image captured by the camera unit 3 through the communication component.
[0039] The bus connector is mainly used to connect the power supply to the light chain 2 connected to the bus and provide the lighting effect playing instruction, so the corresponding pins of the power bus and the signal bus are provided. Therefore, when the light chain 2 needs to be connected to the controller 1, it can be connected to the bus connector through the corresponding connector of the light chain 2. The control panel usually provides one or more buttons for implementing the on-off control of the controller 1, selecting various preset lighting effect control modes, etc.
[0040] The display screen can be used to display various control information so as to cooperate with the buttons in the control panel to support the realization of human-computer interaction functions. In some embodiments, the control panel and the display screen can be integrated into the same touch display screen.
[0041] The light chain 2 in the atmosphere light device can be in the form of a light strip or a light string, which is flexible and can be molded into any shape of display layout. Each light chain 2 includes a plurality of lamp beads 20 connected in series, each lamp bead 20 serves as a light-emitting unit, and the number of lamp beads 20 in each light chain 2 can be the same and arranged at equal intervals. The lamp beads 20 in the same light chain 2 transmit the working current through the same set of cables connected to the bus, and the lamp beads 20 in the same light chain 2 can be connected in parallel in terms of electrical connection.
[0042] The image acquisition interface can be either a hardware interface or a software interface implemented in the controller 1. When it is a hardware interface, the image acquisition interface can be implemented as a camera unit 3, and the controller 1 loads a corresponding driver to drive the camera unit 3 to work. In one application, the camera unit 3 can be used to shoot a light chain to obtain a live image required to determine the light chain hovering model. The camera unit 3 can be used to capture the interface image required to generate the lighting effect control data.
[0043] When the camera unit 3 is aimed at the target screen, such as the display desktop of the terminal device, or the camera unit 3 is aimed at the physical space environment, the image is captured at a certain frame rate, and the interface image can be captured. When it is a software interface, the image acquisition interface can be an image acquisition program implemented on the controller 1 side with the help of the graphics infrastructure technology provided by the operating system of the terminal device. The controller 1 is connected to the terminal device through various cables such as HDMI and Type-C cables, and the interface image of the terminal device can be continuously obtained with the support of the graphics infrastructure technology; of course, if the controller 1 and the terminal device pre-establish a wireless screen projection protocol, the controller 1 can also obtain the interface image of the terminal device through wireless communication. The graphics infrastructure technology of the operating system varies depending on the type of operating system. For example, the Windows operating system provides a corresponding technology, namely: Microsoft DirectX Graphics Infrastructure, referred to as DXGI, which can achieve this function.
[0044] It can be seen that when the image acquisition interface is responsible for collecting environmental reference images, the specific environment for collecting images can be flexibly set by the user. For example, when the image acquisition interface is a camera unit 3, the user can aim the camera unit 3 at the graphical user interface of the computer to shoot to collect the corresponding interface image as the target image for playing the lighting effect, so that the light chain 2 can generate corresponding lighting effect description data based on the interface image; the user can also aim the camera unit 3 at a physical space environment such as an outdoor environment, and record the real scene image as an environmental reference image, so that the light chain 2 can generate lighting effect description data corresponding to the real scene.
[0045] When the atmosphere lighting device wants to play the lighting effect according to the lighting effect description data, its controller 1 needs to provide the serial position and spatial position of each light-emitting unit in its light chain 2 with the help of the light chain spiral model, and parse the corresponding lighting effect description data into the control data of each light-emitting unit according to the spatial position of each light-emitting unit, and encapsulate the control data of each light-emitting unit into lighting effect control data in the order of serial position, and then send the lighting effect control data to the corresponding light chain, and the control chip of each light-emitting unit in the light chain extracts its own corresponding control data, and controls each light-emitting element therein to emit corresponding color light according to the control data, so as to realize the playback of the entire lighting effect under the synergistic effect of the color light emitted by each light-emitting unit.
[0046] It is not difficult to understand that the computer device of the present application is equipped with a camera unit and a graphical user interface, wherein the camera unit 3 can be used to record live images and generate a light chain spiral model based on this. The light chain spiral model describes the mapping relationship between the serial position of each lamp bead in the light chain and the spatial position of the light chain in the modeling space corresponding to the physical space. Based on this, the computer device can also generate a corresponding graphical light chain spiral model based on the spatial position of each lamp bead in the light chain spiral model and display it in the graphical user interface, so that the user can edit the control data of each lamp bead in the light chain spiral model to construct the corresponding lighting effect. Then, the computer device can convert the lamp beads in the light chain spiral model into the corresponding relationship between their spatial position and serial position according to the information provided by the light chain spiral model, and the light effect control data that can be parsed by the control chip of each lamp bead in the light chain is used to control the light chain to play the corresponding lighting effect.
[0047] See also Figure 2 In some embodiments, the method for constructing a spiral light chain model of the present application is described by taking the computer device used as a mobile terminal as an example for easy understanding. The method includes:
[0048] Step S5100, obtaining a live image of the light chain spirally hovering on the external carrier, determining the planar spatial position of each front lamp bead of the light chain in the image view space under the image shooting angle, and determining a cone model of the external carrier adapted to the spiral shape;
[0049] One of the typical application scenarios of light chains is to use them on Christmas trees to create a warm and cheerful holiday atmosphere. When users want these light chains to add more festive atmosphere through color changes and dynamic effects, users need to accurately control the light chains, which requires building a light chain spiral model that matches the actual light chain spiral shape. This light chain spiral model can be displayed on various display devices, allowing users to intuitively identify each lamp bead in the interface, and accurately set the luminous information for each lamp bead, thereby realizing personalized customization of the light chain's lighting effect.
[0050] Since the light chain is flexible, users usually wrap the light chain around the surface of the Christmas tree in a spiral manner, circling from the bottom of the tree to the top. Each light bead is like a decorative star on the tree, evenly dotted between the trunk and branches. However, due to the three-dimensional shape and irregular surface of the Christmas tree, the layout of the light chain visually presents a complex spiral arrangement. Users hope to control these light beads through the intelligent lighting system to achieve dynamic lighting effects such as gradient, flashing or chasing. Accurately representing the position of the light beads in the light chain in physical space becomes a key foundation.
[0051] Taking the Christmas tree decoration as an example, the Christmas tree is regarded as the external carrier around which the light chain is spirally wound. However, the external carrier can be a variety of physical objects, such as decorative lamp posts, chimneys, and various products that facilitate the spiral winding of the light chain.
[0052] The user first needs to use the camera unit of the mobile terminal to take a photo of the Christmas tree decorated with the light chain. When taking the photo, one or more image shooting angles are determined to ensure that the entire Christmas tree can be clearly recorded by the camera unit, including all areas from the bottom, middle to the top of the tree.
[0053] During the image capture process, in one embodiment, if the colors displayed by each lamp bead in the light chain are unique and can be accurately identified, a single on-site image corresponding to a single viewing angle can be used for processing. In another embodiment, the user is also allowed to adjust the viewing angle appropriately and shoot from different image shooting angles, so that by collecting multiple on-site images, all the front lamp beads corresponding to one of the image shooting angles can be determined as accurately as possible. In this embodiment, considering the reality that there are multiple image shooting angles, the image shooting angle corresponding to one of the clearest on-site images can be determined as a reference, and the other on-site images are subsequently aligned with this reference, and then the front lamp beads of the comprehensive on-site image are image aligned, thereby achieving the recognition of as many front lamp beads as possible. For spirally arranged light chains, in order to facilitate indexing, it can be prioritized to ensure that the starting point and end point of the light chain and the path of the lamp beads circling along the tree trunk can be clearly identified in the image.
[0054] The corresponding image view space can be created for the corresponding live image. The image view space is a two-dimensional virtual space used to map and represent the position of the lamp beads in the light chain in the image. This space usually uses the four corners of the image as a reference to establish a two-dimensional coordinate system, in which the position of each lamp bead is represented by an (x, y) coordinate pair, where the x coordinate represents the horizontal position of the lamp bead in the image, and the y coordinate represents the vertical position of the lamp bead in the image.
[0055] The planar spatial position of the lamp beads can be easily determined based on the image view space. To this end, in some embodiments, the on-site image can be preprocessed first, including adjusting the brightness and contrast of the on-site image, and removing noise and any one or more technical means, in order to improve the overall quality of the image and ensure that the lamp beads in the on-site image can be clearly identified. Subsequently, image recognition technology is applied to identify the lamp beads in the image, including the use of any algorithm such as edge detection, threshold segmentation or pattern recognition. These technologies help to distinguish the lamp beads from the background and clearly display them in the image.
[0056] Once the lamp beads are identified, they can be mapped to the two-dimensional coordinate system of the image view space, thereby determining the (x, y) coordinates of the center point of each lamp bead. To ensure the accuracy of these coordinates, position deviations that may be caused by shooting angles or equipment distortion can also be calibrated as needed. After calibration, the coordinates of each lamp bead are recorded in detail as a planar spatial position, which is the key basis for building a hovering model of the light chain.
[0057] In some embodiments, the light chain is pre-designed with an instruction table, which stores the serial position of each lamp bead and its unique time domain color display sequence, and the time domain color display sequence includes display colors under multiple time sequences. When the user starts the construction of the light chain spiral model at the terminal, the terminal constructs multiple color display playback instructions corresponding to each time sequence of the time domain color display sequence according to the instruction table, and sends these color display playback instructions to the light chain in order. The light chain displays the corresponding colors of each lamp bead according to these color display playback instructions at multiple time sequences. Based on this, through the multiple on-site images collected corresponding to each time sequence, the time domain color display sequence of each front lamp bead can be obtained from the multiple on-site images, and the serial position of each lamp bead can be determined by querying the instruction table, and the identity of each lamp bead is determined. The serial position of the front lamp bead obtained in this way can establish a mapping relationship with its planar spatial position, so as to provide assistance as needed in the process of constructing the light chain spiral model. These embodiments can obviously further improve the efficiency of identifying lamp beads and further improve the efficiency of constructing the light chain spiral model.
[0058] In order to determine the three-dimensional space where the light chain is entangled, we can further identify the area where the light chain is entangled based on image analysis of the on-site images, and construct a geometric model that can simulate the entangled shape of the light chain.
[0059] First, the image analysis is performed using the visual information of the distribution and shape of the light chain on the external carrier provided by the on-site image to identify the outline of the external carrier. This can be implemented with the help of edge detection technology or image segmentation model to separate the external carrier from its background, thereby determining its boundary. It is not difficult to understand that it is also possible to identify the overall outline of the light chain and identify the outline of the light chain. The outline of the light chain is basically similar to the outline of the external carrier and can be directly equivalent.
[0060] Then, based on the identified contour information, a preliminary geometric model is constructed, which can represent the spiral shape of the light chain on the external carrier. A variety of geometric shapes can be used to approximate the shape of the light chain, among which the cone model is preferred in this application due to its mathematical and physical simplicity.
[0061] To ensure that the cone model can accurately adapt to the actual form of the external carrier, the model can be adjusted and optimized, including adjusting the size, shape and orientation of the model to match the display of the light chain in the on-site image. In some cases, the cone model can also be deformed or adjusted accordingly to adapt to the irregularities of the external carrier, such as the forking of branches or uneven surfaces.
[0062] Finally, the obtained cone model can accurately reflect the distribution of the light chain in three-dimensional space, providing a reliable basis for the next step of lamp bead position mapping and the construction of the light chain spiral model. In this way, no matter what shape of external carrier the light chain is wrapped around, a suitable three-dimensional model can be constructed to achieve an accurate representation of the spiral shape of the light chain.
[0063] In some embodiments, if the contour information of the external carrier shows that it can be disassembled into multiple geometric models, for example, the external carrier presents a structure of multiple stacked pyramids under the image shooting perspective, it can also be processed in partitions, and a corresponding cone model is established for each tower, and then subsequent processing of this application is performed based on each cone model.
[0064] Step S5200, unfolding the cone model into a fan-shaped reference area in the image view space, so that each front lamp bead is located on the surface of the fan-shaped reference area according to its plane space position;
[0065] The cone model is only a temporary geometric structure representing the spiral shape of the light chain, and has not yet been associated with the specific position of the lamp beads. In order to correspond the plane spatial position of the lamp beads represented in the image view space to the cone model, the cone model needs to be unfolded into a fan shape. Specifically, the side of the cone can be unfolded along its generatrix to form a fan-shaped reference area with the cone vertex as the center and the length of the cone side as the radius.
[0066] After the cone model is expanded into a fan-shaped reference area, each point of the cone model is mapped to a corresponding point on the fan. This mapping process is based on the principle of geometric projection, ensuring that the plane spatial position of the lamp bead on the fan-shaped reference area can be accurately converted to the modeling space where the cone model is located to obtain the corresponding three-dimensional spatial position.
[0067] In specific implementation, different unfolding methods can be selected according to the actual spiral shape of the light chain and the specific shape of the external carrier. For example, if the light chain is wrapped around a Christmas tree, the unfolding of the cone model will take into account the inclination angle of the tree trunk and the winding direction of the light chain. If the external carrier is a spiral staircase, the unfolding of the cone model will reflect the spiral shape of the staircase.
[0068] In one embodiment, the generatrix of the cone model, i.e., a side of the sector-shaped reference area, can be made to correspond to a side of the external carrier in the image view space, and the sector-shaped reference area can be expanded in the image view space based on the side, so that all the identified front lamp beads can be located exactly on the surface of the sector-shaped reference area, such as Figure 3 In the example shown, after the fan-shaped reference area is placed in the image view space, each lamp bead is located on one side of the fan-shaped reference area. The size of the fan-shaped reference space can also be appropriately expanded or reduced to obtain a better display effect.
[0069] In some embodiments, the cone model can be appropriately adjusted according to actual needs during the expansion process to ensure that the fan-shaped reference area can accurately reflect the actual layout of the light chain. Optional adjustment methods include but are not limited to adjusting any one of the size, shape or direction of the cone model to match the actual spiral path of the light chain on the external carrier.
[0070] Step S5300: Arrange the back lamp beads of each circle on the surface of the fan-shaped reference area according to the number of missing back lamp beads of each circle of the light chain outside the image shooting angle, and determine the fan-shaped spatial positions of all the lamp beads in the fan-shaped reference area;
[0071] In the construction of the spiral model of the light chain, determining the position of the back light beads on the fan-shaped reference area is an important step to achieve model integrity. This process is based on the characteristics of the spiral path of the light chain in physical space, that is, from the perspective of image shooting, the front of the light chain appears as multiple circles (rows) of line segments, and between every two rows of front light beads, there are back light beads connecting them on the back of the perspective.
[0072] In the specific implementation, the front lamp beads with determined positions in the image view space are first identified. These lamp beads are arranged in serial positions to form multiple rows, and their serial positions have been associated in advance. The serial positions are usually represented by sequential coding to facilitate calculation. For every two rows of front lamp beads, the serial positions of the end lamp beads that are connected to a row of lamp beads on the back are known, and this information can be used to infer the number of back lamp beads missing between the two rows of front lamp beads in the middle. For example, if the serial position of the first row of front lamp beads is known to be Pm, and the serial position of the second row of front lamp beads is Pn, by calculating the difference between Pm and Pn, the number of missing lamp beads between the two rows of front lamp beads can be obtained, that is, the total number of lamp beads in a row of back lamp beads sandwiched between the two rows of front lamp beads.
[0073] Next, on the surface of the sector-shaped reference area, the missing back lamp beads are arranged according to the calculated number of missing back lamp beads in each row. This arrangement can be achieved by extending the boundary line of the two rows of front lamp beads, and placing the missing back lamp beads at equal intervals on the extension line. For example, if N lamp beads are missing between two rows of lamp beads, N back lamp beads are arranged on the extension line of the boundary of the two rows of lamp beads according to the uniform distribution rule of the lamp beads. The effect of completing the arrangement of the missing lamp beads is as follows Figure 4 As shown in the figure, it can be seen that in the fan-shaped reference space, the back light beads on the right side have been arranged, thereby determining their corresponding fan-shaped space positions.
[0074] In addition, the polar coordinate system can be used to assist in determining the position of the missing lamp beads. In the polar coordinate system, one side of the fan-shaped reference area is used as the polar axis, the straight-line distance from the lamp bead to the center of the fan-shaped reference area is used as the polar diameter, and the angle between the lamp bead and the polar axis is used as the polar angle. In this way, within the image view space, a fan-shaped space is created, which forms an independent reference system based on the polar coordinate system. Based on this reference system, the position of each lamp bead on the fan-shaped reference area can be determined more accurately, including the missing back lamp bead, thereby obtaining a representation of the fan-shaped space position of each lamp bead in the fan-shaped reference area.
[0075] In some embodiments, if the outer carrier around which the light chain is wound has multiple branches or irregular shapes, a sector-shaped reference area can be established for each branch or area, and the rear lamp beads can be arranged independently. In this way, no matter how complex the shape of the light chain is, the position of all lamp beads can be accurately determined by this method.
[0076] Step S5400: Map the fan-shaped spatial positions of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial positions in the modeling space where the cone model is located, so as to obtain the spiral model of the light chain.
[0077] After obtaining the fan-shaped spatial position of each lamp bead in the light chain, we can complete the accurate conversion from the two-dimensional plane to the three-dimensional space based on these data, and realize the mapping of the lamp beads from the image view space to the modeling space where the cone model is located to obtain the corresponding three-dimensional spatial position.
[0078] First, determine the mapping relationship between the sector reference area and the cone model. This mapping is based on the position of the lamp bead on the sector and the geometric characteristics of the cone model. Specifically, the position of each lamp bead on the sector is represented by its polar coordinates, namely the polar diameter and polar angle. The polar diameter is the straight-line distance from the center of the sector to the lamp bead, while the polar angle is the angle between the reference line of the sector, that is, one side of the sector as the polar axis, and the line connecting the lamp bead and the reference line.
[0079] Next, using these polar coordinates, the position of each lamp bead is mapped to the cone model through mathematical transformation. This transformation process involves converting two-dimensional polar coordinates into three-dimensional space coordinates. In specific implementation, the polar coordinates of the lamp bead in the fan-shaped reference area are first converted into corresponding Cartesian coordinates (x', y', z'). This conversion can be achieved through a standard mathematical formula, where x' and y' correspond to the plane coordinates (x, y) in the image view space after the fan is expanded, and z' can be determined based on the height of the lamp bead on the cone model. Then, the converted three-dimensional coordinates can be further adjusted as needed to ensure that they accurately represent the position of the lamp bead on the cone model. The possible adjustments include, but are not limited to, translation, rotation or other geometric transformations of the coordinates to match the direction and position of the cone model.
[0080] During the conversion process, the mapping relationship can also be optimized as needed to adapt to external carriers of different shapes and sizes. For example, if the light chain is wrapped around an irregularly shaped object, the mapping relationship can be adjusted to ensure that the position of the light beads accurately reflects their distribution in three-dimensional space.
[0081] After the mapping is completed, it is also possible to verify, based on actual needs, with the help of the user's confirmation operation, whether the position of the lamp beads in the three-dimensional space is consistent with the spiral shape of the actual light chain, thereby ensuring that the position of each lamp bead conforms to the expected layout.
[0082] The light chain spiral model is usually stored in a structured computer-readable format, such as XML, JSON, or a custom binary format. These formats can clearly express the serial position identifier corresponding to the serial position of the lamp beads and the spatial position coordinates corresponding to the three-dimensional spatial position.
[0083] In terms of data storage, the light chain spiral model can be stored in the built-in memory of the computer device or an external storage device. In order to improve access speed and efficiency, the model data is usually cached in RAM for instant access and processing.
[0084] When the spiral light chain model is displayed in a computer device, the model data of the spiral light chain model is converted into a visual image through a graphics rendering engine and expanded into a graphical user interface. Figure 5 As shown, the model image shows the hovering shape of the light chain in three-dimensional space. Users can observe the model from different angles by rotating, zooming and moving the view.
[0085] In order to play the role of customized lighting effects, the computer device can further provide editing tools, allowing users to directly select lamp beads on the model image and set their luminous characteristics, such as color, brightness, flashing frequency, etc. After editing, the lighting effect description data composed of these settings can be saved and sent to the actual light chain controller for parsing into the lighting effect playback instructions of the light chain, controlling the light chain to emit light and achieve customized lighting effects.
[0086] It can be seen that compared with traditional technologies, this application uses innovative spatial mapping technology to bring breakthrough beneficial effects to the field of intelligent lighting, including but not limited to:
[0087] First, the application greatly simplifies the modeling process by directly identifying the external carrier of the light chain from the on-site image and building the corresponding cone model as a reference. This intuitive identification and modeling method not only improves the speed of model construction, but also enhances the adaptability to complex display forms.
[0088] Secondly, this application uses a unique unfolding technology to transform the cone model into a fan-shaped reference area, providing a clear mapping plane for each lamp bead in the light chain. In this fan-shaped reference area, the spatial positions of the front and back lamp beads can be accurately determined, whether it is the front lamp bead under the image shooting angle or the back lamp bead outside the shooting angle, its corresponding position can be found in the fan-shaped space.
[0089] Furthermore, the mapping process of this application does not only stay in the two-dimensional plane, but also further maps the fan-shaped spatial position to the three-dimensional modeling space where the cone model is located. By converting the two-dimensional fan-shaped layout into a three-dimensional spatial layout, not only the three-dimensional form of the light chain is retained, but also each lamp bead is given an accurate three-dimensional spatial position. This mapping from two-dimensional to three-dimensional makes the spiral model of the light chain more accurate and vivid, providing strong data support for subsequent lighting design and effect display.
[0090] In addition, through the innovative modeling method of this application, many limitations in traditional technologies, such as low recognition efficiency, insufficient precision, and high requirements for equipment performance, are effectively solved. Users can design light chain lighting more intuitively and conveniently without complex operations or professional programming skills. The implementation of this application not only improves design efficiency and lowers technical barriers, but also provides the possibility of achieving personalized and dynamic lighting effects through precise model construction, making it more convenient for users to customize lighting effects, greatly enriching the application scenarios and creative space of intelligent lighting systems.
[0091] Based on any embodiment of the method of the present application, determining the planar spatial position of each front lamp bead of the light chain in the image view space under the image shooting angle includes:
[0092] Step S5131, constructing an image view space corresponding to the scene image;
[0093] In order to determine the plane spatial position of the front lamp bead, it is necessary to construct an image view space corresponding to the on-site image, which is a virtual two-dimensional space used to map the plane spatial position of each lamp bead in the light chain. This space uses the four corners of the image as reference points to establish a two-dimensional coordinate system so that the position of each lamp bead can be represented by an (x, y) coordinate pair.
[0094] Step S5132: using one or more on-site images, identifying the unique color features provided by each lamp bead and its planar spatial position in the image view space;
[0095] Using on-site images to identify the unique color characteristics of lamp beads and their planar spatial positions can be achieved in accordance with different implementation situations.
[0096] In one embodiment, only a single live image needs to be captured, and the light beads in the image are identified by image processing technology. These light beads are distinguished in the image by their unique color characteristics. For example, each light bead can be pre-programmed to display a specific color value, and these color values can be detected and identified by image analysis technology as their unique characteristics.
[0097] During the recognition process of a single on-site image, the terminal analyzes the luminous information of each lamp bead, uses a color recognition algorithm to determine the color of the lamp bead, and identifies the color that matches the pre-defined luminous point as the front lamp bead, thereby determining the planar spatial position of the front lamp bead in the image view space, expressed as the corresponding (x, y) coordinates. In a color recognition algorithm, a color cluster area with a specific color value within a preset definition range can be found in the on-site image. When such an area exists and its area exceeds a preset threshold, it can be confirmed that a front lamp bead exists. This preset definition range usually also corresponds to the serial position of the front lamp bead in order to determine the identity of the front lamp bead.
[0098] In another embodiment, recognition is performed based on multiple live images. In this case, the dynamic characteristics of the light chain are taken into account, that is, the color of the lamp beads can change over time to form a unique color change sequence. The terminal captures the live image of the light chain from multiple time-series images to obtain the lighting state of the light chain, and then analyzes the color changes of each lamp bead in each live image to obtain the time domain color sequence of each lamp bead.
[0099] By comparing images at different time points, the terminal can track the color changes of the lamp beads and identify the color change patterns of each lamp bead throughout the time sequence. These patterns are pre-associated with the serial position of the lamp bead as the unique color characteristics of the lamp bead to achieve the identity recognition of the lamp bead.
[0100] In the process of recognition based on multiple on-site images, the terminal can also use image alignment technology to ensure that the positions of the lamp beads in different images can accurately correspond. In addition, image fusion technology can be used to integrate data from multiple on-site images to improve the accuracy and robustness of recognition.
[0101] It can be seen that whether it is a single image or multiple images, the terminal can accurately identify the color characteristics and planar spatial position of the lamp beads, so as to subsequently associate this information with the serial position of the lamp beads, laying a solid foundation for building a spiral model of the light chain.
[0102] Step S5133, querying a preset color display instruction table, determining the serial position of the lamp bead corresponding to the unique color feature in the lamp chain, and mapping the plane space position with the serial position;
[0103] The color display instruction table is a predefined and stored data structure that maps the unique color characteristics of the lamp beads with their serial positions to facilitate the identification of the lamp beads.
[0104] For the embodiment based on a single live image, the color display instruction table contains the color value that the lamp bead should display at a specific time point, and this color value can be generalized as a specific color value range for representation. After the terminal recognizes the color of the lamp bead in the image through image processing technology, it uses the color display instruction table to find the serial position corresponding to these color value ranges. For example, if the color feature of a lamp bead matches an entry in the color display instruction table, the terminal can determine the serial position of the lamp bead, and then associate the plane spatial position (x, y) coordinates of the lamp bead in the image view space with its serial position.
[0105] In the embodiment based on multiple live images, the role of the color display instruction table is more complex. It contains not only the color information of the lamp beads, but also the sequence information of the color changes of the lamp beads over time. The terminal analyzes the time domain color display sequence of each lamp bead and compares it with the preset sequence in the color display instruction table to determine the serial position of each lamp bead. Naturally, the plane spatial position of this lamp bead is also mapped to the serial position.
[0106] It can be seen that in both embodiments, once the color characteristics of the lamp bead successfully match the entries in the color display instruction table, the terminal can map the planar spatial position of the lamp bead with the serial position, thereby associating a clear serial position identifier for each front lamp bead.
[0107] The color display instruction table is also used to control the light chain in advance. Specifically, in order to identify the unique color characteristics of each lamp bead, the corresponding color display playback instructions can be constructed and sent to the light chain according to the unique color characteristics corresponding to each serial position in the color display instruction table to control the lamp bead to emit light according to the preset color value or time domain color display sequence. These color display playback instructions are expressed according to the unique color characteristics of the lamp bead corresponding to the serial position, ensuring that each lamp bead can display the color according to the color characteristics predetermined in the color display instruction table. In this way, the terminal can obtain the color characteristics of the lamp bead from the on-site image and use the color display instruction table to determine the serial position of each lamp bead.
[0108] Step S5134, determine some lamp beads that are missing unique color features in the image view space, and determine the serial position and plane space position of these lamp beads based on the relative position relationship between these lamp beads and the mapped lamp beads, so as to obtain the serial position and plane space position of all the front lamp beads.
[0109] In some cases, some front-facing LEDs may not be directly visible in the image due to being blocked by external carriers, resulting in the loss of unique color features of some LEDs that should appear in the image view space. To prevent this problem, specific measures need to be taken to determine the serial position and plane space position of these missing LEDs.
[0110] In one embodiment, the missing front lamp beads can be inferred by analyzing the arrangement pattern of the identified lamp beads in the image view space. If the light chain is wrapped around a regular external carrier, such as a Christmas tree, its spiral path usually has a certain regularity. Therefore, the approximate position of the missing lamp beads can be inferred based on the distribution of the identified lamp beads and the winding pattern of the light chain. For example, if the light chain is wound in a uniform spiral and the spacing between adjacent lamp beads is known, the distance between two visible front lamp beads can be measured, and the expected position of the obscured front lamp bead can be inferred based on this spacing.
[0111] In another embodiment, the physical characteristics of the light chain, such as the equally spaced arrangement, can be used to determine the position of the missing lamp beads. By measuring the distance between the identified lamp beads and applying this rule, the approximate position of the missing lamp beads on the light chain can be calculated. For example, if the light chain is designed to have a lamp bead every 10 cm, and the distance between the two identified front lamp beads in the scene image is 30 cm, it can be inferred that there should be 2 missing lamp beads between the two lamp beads. Based on this, the plane position information of the two missing lamp beads can be determined on the line connecting the two identified front lamp beads. At the same time, according to the numerical value of the serial position of the two identified front lamp beads, the serial position of the two missing lamp beads can also be determined.
[0112] In another embodiment, if the winding path of the light chain is relatively complex or irregular, an interpolation algorithm in image processing technology can be used to estimate the position of the missing lamp beads. The interpolation algorithm can predict the planar spatial position of the missing lamp beads by calculating the spatial relationship between the identified lamp beads according to their spatial distribution.
[0113] In another embodiment, multiple perspectives of the scene images can be combined to reduce the impact of occlusion. By shooting the light chain from different angles and integrating the multiple images together using image fusion techniques such as panoramic stitching algorithms, the lamp beads can be more comprehensively identified, including those that may be occluded in a single perspective.
[0114] In the above embodiment, the process of determining the serial position and plane spatial position of the missing front lamp beads is essentially based on the relative position relationship between these lamp beads and the identified lamp beads. This relative position relationship is determined by analyzing the distribution of the identified lamp beads, determining their arrangement pattern in the image view space and the distance between them, and thus inferring the expected position of the missing lamp beads.
[0115] In the first embodiment, if the light chain is known to be wound in a uniform spiral and the spacing between the identified beads is consistent, then the expected position of the missing beads can be determined by simple linear interpolation. This method assumes that the arrangement of the light chain is continuous and uniform, so if the distance between two identified beads is twice the spacing between other adjacent beads, then it can be inferred that there should be a missing bead between the two beads.
[0116] In the second embodiment, the physical characteristics of the light chain, such as the equal spacing arrangement, can be used to determine the exact location of the missing lamp beads through mathematical calculation based on the position of the identified lamp beads and the preset lamp bead spacing. This method relies on the standardization of the light chain design, that is, the fixed distance between each lamp bead, allowing the missing data to be filled in through calculation.
[0117] In a third embodiment, when using an interpolation algorithm, the algorithm considers the spatial distribution of the identified lamp beads and estimates the position of the missing lamp beads by analyzing the relative distances and angles between these lamp beads. This algorithm can handle more complex winding paths and provide accurate predictions even when the distribution of the lamp beads is not completely regular.
[0118] Finally, in the fourth embodiment, by fusing images from multiple perspectives, it is possible to reveal lamp beads that are not visible from a single perspective. This method utilizes the information provided by different perspectives and integrates these images through techniques such as panoramic stitching algorithms to determine the relative positions of missing lamp beads.
[0119] In all these embodiments, the determination of relative position relationship is the key. By analyzing the distribution pattern of the identified lamp beads and the physical characteristics of the lamp chain, the serial position and plane spatial position of the missing lamp beads can be inferred to ensure the integrity and accuracy of the lamp chain circling model. This method based on relative position relationship not only improves the accuracy of lamp bead identification, but also optimizes the data processing process and enhances the adaptability and robustness of the system to complex environments.
[0120] Through the above method, even if some front lamp beads are invisible due to obstruction, their serial position and plane spatial position can be effectively inferred, thereby ensuring to the greatest extent that all front lamp beads within the image shooting angle are accurately identified.
[0121] The above embodiments further embody technical advantages in constructing a spiral light chain model, including:
[0122] First, through advanced image processing technology and color recognition algorithms, the front lamp beads are accurately captured and mapped, ensuring the accuracy of the model. Whether it is a single image or multiple time-series images, it can adapt to and accurately identify the color characteristics and plane spatial position of the lamp beads, and maintain a high recognition rate even in dynamic changes or occlusion.
[0123] Secondly, when faced with the challenge that some lamp beads may be invisible due to occlusion, the relative position relationship of the identified lamp beads can be used to effectively predict and fill in the position of the missing front lamp beads, enhancing robustness. At the same time, it also ensures real-time processing and updating to meet the rapidly changing lighting control needs.
[0124] In addition, the process of lamp bead identification is simplified, and the technical threshold is lowered, so that users can more conveniently and efficiently determine the corresponding light chain spiral model for the shape they display without relying on professional knowledge. The constructed light chain spiral model has good scalability and can be easily integrated into other intelligent lighting systems or control software, supporting a wider range of application scenarios and creative expressions.
[0125] Based on any embodiment of the method of the present application, determining a cone model of an external carrier adapted to a spiral shape comprises:
[0126] Step S5151, performing edge detection on the external carrier in the scene image to determine the outer contour of the quadrilateral corresponding to the fractal region where the light chain part is hovering;
[0127] In order to realize rapid modeling of the external carrier, it can be realized based on at least one scene image. Taking a single scene image as an example, firstly edge detection is performed on the external carrier in the scene image to obtain its approximate external contour.
[0128] The edge detection algorithm required for detecting the scene image can adopt various mature known algorithms, such as Canny or Sobel algorithm. By analyzing the scene image with the help of the edge detection algorithm, the edges of the external carrier can be accurately identified, and these edges can be connected to form an approximate quadrilateral external contour.
[0129] Please refer to Figure 6 As shown in the figure, the four vertices detected by the edge detection algorithm on the external carrier image, that is, the area defined by the four circles in the figure, are the outer contour of a corresponding quadrilateral of the Christmas tree image. This quadrilateral contour is not only a representation of the outer contour of the external carrier, but also an approximate representation of the contour covered by the spiral path of the light chain on the external carrier. It captures the basic geometric features of the layout of the light chain. In actual operation, the edge detection algorithm is used to first analyze the on-site image and identify areas with drastic brightness changes, which usually correspond to the physical boundaries of the external carrier. Subsequently, using this boundary information, a quadrilateral area is defined, providing a clear reference framework for the next step of model construction.
[0130] In some embodiments, some external carriers may contain multiple identical fractals. For example, if the Christmas tree is designed to be multi-layered, each layer has a quadrilateral outline that constitutes a fractal, and the light chain spirals along each fractal. In this case, after applying the edge detection algorithm for detection, the corresponding quadrilateral external outline can be constructed for each fractal according to the fractal relationship. Then, based on each quadrilateral external outline, the steps of the method of the present application can be executed to obtain the local light chain spiral model corresponding to each fractal. Finally, the data of each local light chain spiral model can be combined to obtain the complete light chain spiral model.
[0131] The determination of the quadrilateral outline not only provides the necessary geometric information for the light chain spiral model, but also serves as the basis for the triangle area construction and cone model space transformation in the subsequent steps. By recording the coordinates of the vertices of the quadrilateral outline, preparations are made for further refinement and spatial positioning of the model.
[0132] The implementation of the edge detection algorithm enables accurate identification of the hovering area of the light chain under various environmental conditions, including when the surface features of the external carrier are not obvious or the lighting conditions are not ideal. This robustness ensures the reliability of the modeling process and the accuracy of the model.
[0133] Step S5152: construct a corresponding triangular area in the image view space based on the external contour, and correct the triangular area;
[0134] Since the general external carrier, such as a Christmas tree or other decorated objects, is usually narrow at the top and wide at the bottom, of course, other decorated objects may also be narrow at the bottom and wide at the top, and so on, its external contour can generally be obtained as an approximate trapezoid. In this case, in order to facilitate the construction of a cone model in the modeling space, the two waists of the outer contour of this approximate trapezoid can be extended and intersected at the same point in the image view space, such as Figure 6 As shown, it becomes a triangular area as the basis for building a cone model.
[0135] Since the external contour of the external carrier may cause the obtained triangular area to be irregular due to its physical shape itself or due to shooting angle, image distortion, etc., and may not be an ideal isosceles triangle, it can be approximated to an isosceles triangle to achieve preliminary correction, and then, based on the triangular area determined based on the external contour, the triangular area is further corrected so as to construct a cone model based on the corrected triangular area. Correcting the triangular area helps to ensure the accuracy of subsequent spatial transformation and the adaptability of the cone model.
[0136] To achieve further correction, Figure 6 As shown, perpendicular lines to the opposite waists can be drawn at the two base angles of the triangle, which help determine the height of the triangle, and then adjust the shape and size of the triangle to more accurately reflect the actual form of the external carrier. In addition, a perpendicular midline can be drawn inside the triangle to divide the triangle into two smaller triangles, which helps to further analyze and adjust the geometric characteristics of the triangle.
[0137] Using these auxiliary lines, you can adjust the triangle area to ensure the correct position of its vertices and sides. For example, if you find that one side of the triangle is not completely aligned with the actual boundary of the external carrier, you can correct it by moving the vertex or adjusting the length of the side. Similarly, if the height of the triangle does not match the height of the external carrier, you can correct this by adjusting the position of the vertical line.
[0138] The corrected triangle area will become a reliable basis for building the cone model. Through these precise and low-cost geometric operations, we can provide a reliable and accurate starting point for building the spiral model of the light chain.
[0139] Step S5153: construct a cone model based on the spatial transformation of the triangular area.
[0140] According to the corrected triangle area, the corresponding relationship between it and the cone model to be constructed in space is determined. Specifically, the vertices of the triangle can be corresponded to the vertices of the cone model, and the base of the triangle can be corresponded to a diameter of the bottom surface of the cone. Through this corresponding relationship, each point of the triangle can be mapped to the corresponding position in the modeling space of the cone model.
[0141] Next, a spatial transformation is performed, which usually includes rotation and translation operations to form the side of the cone. Specifically, the side of the cone can be constructed by rotating the vertices of the triangle around the perpendicular bisector of the base of the triangle. The rotation angle is usually 360 degrees to ensure the continuity and integrity of the light chain spiral.
[0142] During the construction process, the vertices and sides of the triangle can still be adjusted appropriately according to actual needs to ensure that the geometric characteristics of the cone model match the actual spiral shape of the light chain. For example, if the external carrier is narrow at the top and wide at the bottom, the vertices of the triangle may need to be appropriately raised or lowered to simulate the inclination of the cone model.
[0143] In addition, in order to ensure the accuracy of the cone model, numerical methods can be used to accurately calculate each point in the spatial transformation process. This includes the use of mathematical tools such as vector operations and matrix transformations to achieve precise control of triangle vertices and edges.
[0144] The significant advantages of the technical effects of the above embodiments are its high efficiency and economical operation. In the process of determining the cone model adapted to the spiral external carrier, the steps of edge detection, triangle area correction and space transformation adopted all use methods with low computational cost. For example, edge detection algorithms such as Canny or Sobel algorithms are widely used in the field of image processing because of their maturity and stability. Their computational complexity is relatively low and they can quickly extract the required contour information from the scene image. Similarly, the correction process of the triangle area achieves precise adjustment of the model shape through simple geometric transformation and drawing of auxiliary lines without complex mathematical modeling or a large amount of computing resources. In the spatial transformation stage, by mapping two-dimensional triangles to three-dimensional space to construct a cone model, intuitive rotation operations are used, which are very efficient in computation and can quickly generate a three-dimensional representation of the light chain spiral model. In addition, combined with numerical methods and mathematical tools such as vector operations and matrix transformations, the method ensures precision and accuracy in the transformation process, and these tools and operations are usually highly optimized on modern computing devices, with fast execution speed and low resource consumption. When the method corresponding to this embodiment is deployed in an embedded chip for use, for example, directly deployed in a controller of an ambient light device, its efficiency advantage is more obvious.
[0145] On the basis of any embodiment of the method of the present application, the cone model is expanded into a fan-shaped reference area in the image view space, comprising:
[0146] Step S5210: for at least one fractal region of the external carrier where the light chain part is hovering, the cone model corresponding to each fractal region is respectively expanded to obtain a corresponding fan-shaped reference region;
[0147] As disclosed in the above embodiments, the external carrier may include a single or multiple fractal regions, and each fractal region can create a corresponding cone model in the modeling space. These fractal regions are part of the light chain layout, and they present slightly different geometric features due to the shape of the carrier, such as having different scaling scales, corresponding to different parts of the external carrier, etc. In order to accurately represent the relative position relationship between the lamp beads of the light chain and each part of the fractal region in the image view space, the cone model corresponding to each fractal region can be expanded into a fan-shaped reference area according to a unified processing flow.
[0148] Step S5220: Map a generatrix of each cone model to a side edge of its corresponding fractal region, and tile a fan-shaped reference region with the generatrix as a side edge into the image view space;
[0149] The cone model is expanded two-dimensionally in the image view space to facilitate the conversion of the three-dimensional shape of the light chain into a mapping position on a two-dimensional plane, so as to facilitate further analysis and processing in the image view space and further identification of the lamp beads in the light chain.
[0150] When performing 2D unfolding for each cone model, it is done according to the geometric characteristics of the cone model. Each cone model is defined by a generatrix and a base circumference. The generatrix is a straight line from the cone vertex to the base circumference, while the base circumference corresponds to the distribution of the light chain in the fractal area. In the image view space, the unfolding of the cone model is done by connecting the generatrix with a side edge of the fractal area of the light chain part (with Figure 6 For example, it can be seen as a waist of a triangle) by mapping. This mapping ensures that the shape of the light chain in three-dimensional space can be accurately represented on a two-dimensional plane. In the previous embodiments of this application, when constructing a cone model, this correspondence before and after the expansion has also been reflected.
[0151] In the expansion operation, the mother line of the cone model needs to be determined first, and then the mother line is mapped to the side of the fractal area of the corresponding light chain part, that is, the actual edge of the light chain is matched to the mother line of the cone model. In this way, the cone model can be expanded along the mother line into a fan-shaped reference area, one side of which is the mapped mother line, and the other two sides are determined by the distribution of the light chain.
[0152] Once the mapping relationship is determined, the fan-shaped reference area is actually tiled into the image view space. This means placing the unfolded fan-shaped area on a two-dimensional plane to ensure that it accurately reflects the position and shape of the light chain in three-dimensional space. The tiling operation allows for detailed analysis of the layout of the light chain in the image view space, including the relative position of the lamp beads and the bending shape of the light chain.
[0153] Step S5230, setting the correspondence between the busbar and the side, and determining the inclination state of each cone model in the same modeling space according to the correspondence, so as to construct the spiral model of the light chain.
[0154] After the cone model is unfolded in the two-dimensional plane, the correspondence between the generatrix of the cone model and the side of the sector-shaped reference area is determined, forming a benchmark that can be stored in the memory for setting and convenient for subsequent reference. This correspondence determines the tilt state of the cone model in the modeling space. Through this setting, it can be ensured that the tilt state of all cone models in the modeling space is basically synchronized with the tilt state of the sector-shaped reference area in the image view space, which is convenient for the subsequent construction of a coherent light chain spiral model that conforms to the actual physical space form.
[0155] The above embodiments, by mapping the fractal area of the light chain part into a cone model and expanding it into a fan-shaped reference area in the image view space, embody significant efficiency advantages, especially in adapting to the complexity of the external carrier structure. The present application allows each fractal area to be processed separately, and no matter how the shape of the carrier changes, it can ensure that the three-dimensional form of the light chain is accurately represented on the two-dimensional plane. Through a unified processing flow, a fan-shaped reference area can be efficiently generated for each part of the light chain, ensuring the continuity and integrity of the light chain layout. In addition, by setting the correspondence between the busbar and the side, not only the modeling process is simplified, but also the accuracy of the model is improved, making the construction of the light chain spiral model more direct and accurate. The universality and flexibility of this method enable it to adapt to carriers of various complex shapes, significantly improving the efficiency and accuracy of generating the light chain spiral model.
[0156] On the basis of any embodiment of the method of the present application, according to the number of missing back lamp beads in each circle of the lamp chain outside the image shooting angle, each circle of back lamp beads are arranged on the surface of the fan-shaped reference area, and the fan-shaped spatial positions of all lamp beads in the fan-shaped reference area are determined, including:
[0157] Step S5310, determining the number of missing back lamp beads in a corresponding circle according to the serial positions of the front lamp beads in each adjacent row of the lamp chain in the fan-shaped reference area relative to the two front lamp beads on the spiral path;
[0158] Since the on-site image only shows the luminous information provided by the front lamp beads, but not the luminous information of the back lamp beads, the identity and position of the back lamp beads need to be realized through technical analysis. By analyzing the identity and position of each back lamp bead, it can ensure that the complete physical layout of the light chain can be accurately represented in the image view space, even the part outside the image shooting angle can be properly handled.
[0159] Specifically, we first need to identify the positional relationship between each two adjacent rows of front lamp beads in the fan-shaped reference area of the light chain. Front lamp beads refer to the lamp beads that are directly visible in the image view space, while the back lamp beads may not be visible due to viewing angle limitations. By analyzing the relative position of the front lamp beads on the spiral path, we can infer the absence of the back lamp beads. The spiral path refers to the trajectory of the light chain wrapped around the external carrier. The serial position relationship between each two rows of front lamp beads is their corresponding positions on the spiral path.
[0160] In the specific implementation, the front lamp beads with determined positions in the image view space are first identified. These lamp beads are arranged in serial positions to form multiple rows, and the serial positions of each row of lamp beads have been identified by sequential coding. For every two rows of adjacent front lamp beads, the serial positions of their respective end lamp beads connected to a row of lamp beads on the back are known. Using this information, the number of back lamp beads missing between the two rows of front lamp beads can be inferred. For example, if the serial position of the first row of front lamp beads is marked as Pm, and the serial position of the second row of front lamp beads is marked as Pn, the number of back lamp beads missing between the two rows of front lamp beads can be obtained by calculating the difference between Pn and Pm.
[0161] Step S5320: according to the missing number, extend a reference line between the two opposite front lamp beads on the surface of the sector-shaped reference area, set a plurality of back lamp beads corresponding to the missing number on the reference line, and arrange them on the surface of the sector-shaped reference area;
[0162] After determining the number of missing lamp beads in each row of back lamp beads, the identity and position of each row of back lamp beads can be inferred based on the number of missing lamp beads. In specific implementation, on the surface of the fan-shaped reference area, the operation is performed along the reference line between the two adjacent rows of identified front lamp beads. The reference line is a virtual line connecting the end lamp beads of these two rows of front lamp beads. It is a corresponding line segment extended in the fan-shaped reference area. It can be extended based on the corresponding end of any row of front lamp beads to serve as the basis for arranging the back lamp beads. According to the previously calculated number of missing lamp beads, the corresponding number of missing back lamp beads are arranged at equal intervals at the reference line.
[0163] For example, if the calculation results show that N lamp beads are missing between the two rows of front lamp beads, N back lamp beads can be arranged at equal intervals on the spiral path shown by this reference line according to the physical characteristics and design rules of the light chain. By arranging the back lamp beads on this spiral path, it is ensured that the arrangement of the lamp beads in the fan-shaped reference area matches the actual winding shape of the light chain.
[0164] In some other embodiments, the spacing between every two adjacent front lamp beads in the serial position can be determined according to the planar spatial positions of all the front lamp beads, and then the average spacing of the lamp beads is calculated based on these spacings. The product of the average spacing of the lamp beads and the missing number plus 1 is combined to obtain the estimated length of the lamp chain segment corresponding to the missing number. If this length is greater than the length of the reference line determined in the above manner, and there are no other front lamp beads whose planar spatial positions are closer to the center of the fan-shaped reference area than the planar spatial positions of these two rows of front lamp beads, then the two rows of front lamp beads can be directly connected in the order of the serial positions without being restricted by whether the connection spans the entire fan-shaped reference area, and then the missing lamp beads can be arranged on this line. The effect is as follows: Figure 7As shown in the boxed part.
[0165] If the outer carrier around which the light chain is wound has multiple fractal regions, a separate fan-shaped reference region can be established for each fractal region, and the arrangement of the back light beads can be performed independently. In this way, no matter how complex the shape of the light chain is, the position of all light beads can be accurately determined by this method, ensuring the integrity and accuracy of the light chain spiral model.
[0166] Step S5330: determine the corresponding serial position of each back light bead according to the order of the light bead on the spiral path, and map it to the fan-shaped spatial position in the fan-shaped reference area.
[0167] It is not difficult to understand that since the serial position of the front lamp beads has been identified by sequential coding, the serial position of the back lamp beads on the spiral path between the two rows of front lamp beads can be inferred. For example, if it is known that Pn and Pm are the serial position identifiers of the terminal lamp beads facing each other in the two rows of front lamp beads, and their difference N represents the number of missing back lamp beads, then the serial positions of these back lamp beads can be sequentially increased from Pn+1 to Pn+N, thereby ensuring that each back lamp bead is set with its unique position code to correspond to the corresponding serial position in the light chain.
[0168] On the other hand, the spatial position of the back lamp beads can also be determined in the fan-shaped reference area. Since these back lamp beads have been arranged at appropriate positions in the fan-shaped reference area, the fan-shaped spatial position of each back lamp bead can be determined by the polar coordinate system.
[0169] It can be seen that by mapping the serial position of each back lamp bead with its fan-shaped spatial position, not only can their order on the light chain be determined, but also their spatial position can be accurately known.
[0170] The above embodiments significantly improve the efficiency and accuracy of inferring the positions of the back lamp beads. First, by using the known information provided by the front lamp beads, the number of missing back lamp beads is directly determined by calculating the difference in serial positions. This process avoids complex image analysis and simplifies the technical process. Then, in the fan-shaped reference area, the uniformity and consistency of the layout are ensured by extending the reference lines between the front lamp beads and arranging the missing back lamp beads at equal intervals. In addition, through the application of the polar coordinate system, an accurate fan-shaped spatial position is provided for each back lamp bead, further enhancing the spatial positioning capability of the model. Finally, the mapping relationship between the serial position and the spatial position is clearly established, which not only ensures the integrity of the light chain model, but also provides an effective means for quickly inferring all the back lamp beads outside the image shooting angle. The advantage of this method lies in its high level of systematicity and automation, which greatly reduces manual operations and potential errors, and improves the overall processing speed and efficiency. When it is deployed in an ambient light device using an embedded chip, its efficiency advantage is particularly obvious.
[0171] On the basis of any embodiment of the method of the present application, a plurality of back light beads corresponding to the missing number are set on the reference line and arranged on the surface of the fan-shaped reference area, including:
[0172] Step S5321: Create a polar coordinate system for describing the fan-shaped reference area, wherein a side edge of the fan-shaped reference area is used as a polar axis;
[0173] The purpose of creating a polar coordinate system is to convert the two-dimensional plane position of the lamp beads in the image view space into the fan-shaped space position in the fan-shaped reference area, so that through convenient and fast calculations, the plane space position of each lamp bead in the lamp chain can be finally mapped to the modeling space where the cone model is located, and the corresponding three-dimensional space position can be obtained, so as to realize the accurate and fast switching of the lamp bead position between two-dimensional representation and three-dimensional representation.
[0174] In the polar coordinate system, the polar axis is the reference line, and all position information will be measured based on it. By establishing a polar coordinate system, each point in the fan-shaped reference area can be converted into polar coordinate form, which includes two components: polar diameter and polar angle. The polar diameter is the straight-line distance from the polar axis to the point, that is, the lamp bead, and the polar angle is the angle between the straight line and the polar axis. These two components together define the exact position of the point in the fan-shaped reference area.
[0175] For example, if the sector reference area represents the layout area of the beads of a light chain wrapped around a Christmas tree, then the polar axis can be a side of the sector reference area, corresponding to a generatrix of the cone model corresponding to the Christmas tree. Based on this way of constructing the coordinate system, each bead on the light chain can be assigned a unique polar coordinate according to its position relative to the polar axis.
[0176] Step S5322: based on the polar coordinate system, convert the plane spatial position of the lamp bead in the image view space into the fan-shaped spatial position in the fan-shaped reference area, wherein the connecting line segment from the lamp bead to the center of the fan-shaped reference area is taken as the polar diameter, and the angle between the connecting line segment and the side is taken as the polar angle, so as to determine the fan-shaped spatial position of the lamp bead in the fan-shaped reference area;
[0177] Both the lamp bead and the fan-shaped reference area are in the image view space. Therefore, the lamp bead and the fan-shaped reference area itself have relevant representation information of their corresponding plane space positions in the same image view space. In order to express the fan-shaped space position of the lamp bead relative to the entire fan-shaped reference area, it is necessary to re-express it as a polar coordinate system based on the polar coordinate system corresponding to the fan-shaped reference area to obtain the corresponding fan-shaped space position, thereby realizing the conversion of the plane space position of the lamp bead into the fan-shaped space position of the lamp bead in the coordinate space provided by the fan-shaped reference area.
[0178] Take a specific example to illustrate the conversion process of the plane space position of the lamp bead to the fan-shaped space position. Suppose there is a light chain wrapped around a Christmas tree, and part of the light chain is visible in the image view space, forming a fan-shaped reference area. One side of this fan-shaped reference area is selected as the polar axis of the polar coordinate system.
[0179] For a specific lamp bead A, it is located within this fan-shaped reference area, but not directly on the polar axis. Lamp bead A has a two-dimensional plane position in the image view space, represented by a coordinate point (x, y) in the rectangular coordinate system. In order to convert this position to a fan-shaped space position within the fan-shaped reference area, the following steps can be performed:
[0180] First, draw a straight line from the center O of the sector reference area to the lamp bead A. The length of this line segment is the polar diameter. In the rectangular coordinate system, if the coordinates of the center O are , the coordinates of the plane space position of the lamp bead are Then the polar diameter r can be calculated by the Pythagorean theorem: .
[0181] Next, determine the angle θ between the line segment from the center of the circle O to the lamp bead A and the polar axis, that is, the polar angle. If the polar axis is horizontal, then the polar angle can be obtained by calculating the angle between the line segment OA and the horizontal direction. In the rectangular coordinate system, the polar angle can be calculated using the inverse tangent function: If x is negative, the final value of the polar angle is adjusted according to the orientation of the polar axis.
[0182] With the polar diameter r and polar angle θ, the position of the lamp bead A can be changed from point Convert to a point in polar coordinates At this point, this polar coordinate point Represents the fan-shaped spatial position of lamp bead A in the fan-shaped reference area.
[0183] It is not difficult to understand from the above conversion process that the independently added polar coordinate system can not only provide a precise spatial position for each lamp bead in the fan-shaped reference area, but also ensure that the complete physical layout of the light chain can be accurately digitally represented in the image view space.
[0184] Step S5323: Based on the polar coordinate system, the fan-shaped spatial positions and serial positions of the plurality of back light beads are evenly set in the same reference line according to the number of missing beads.
[0185] The missing back lamp beads are evenly divided on the reference line to ensure that they are arranged evenly and orderly on the surface of the fan-shaped reference area. The key is to use the polar angle of the polar coordinate system to evenly divide the lamp beads, so as to ensure that each lamp bead occupies the same spatial area, achieving visual consistency and uniformity in physical layout.
[0186] Continuing with the previous Christmas tree light chain example, assume that the front light beads A and B have been identified and are located at the two ends of the reference line. They have been assigned polar coordinates (rA, θA) and (rB, θB) using the polar coordinate system. Now, the N-1 missing back light beads need to be evenly divided between these two light beads.
[0187] First, calculate the difference between the polar angles θB and θA, which will give the polar angle span of the entire interval. Then, divide this angle into N equal parts, each of which represents the polar angle interval of a missing lamp bead. If θB>θA, then the polar angle interval of each part is (θB - θA) / N; if θA>θB, this indicates that the lamp beads are arranged in a counterclockwise direction, and the polar angle interval can be adjusted to (θA - θB + 360°) / N to ensure the correct arrangement of the lamp beads on the circumference.
[0188] Next, starting from the polar coordinates of lamp bead A, arrange each missing back lamp bead in sequence along the polar angle interval direction. For each new lamp bead, use the polar angle of the previous lamp bead plus the polar angle interval to determine its polar coordinates. At the same time, you can select a suitable polar diameter value for each lamp bead. For example, you can choose the average polar diameter of lamp beads A and B as the polar diameter of the missing lamp bead, or you can choose to increase (decrease) the polar diameter value of each back lamp bead from the polar diameter value of lamp bead A to the polar diameter value of lamp bead B.
[0189] By doing so, we ensured that all the backside lamp beads were evenly arranged along the reference line, which not only achieved a beautiful visual effect, but also achieved precise control in the physical layout. This equal division setting process, combined with the use of the polar coordinate system, provided an efficient method for quickly and accurately arranging the missing lamp beads, thus completing the construction of the spiral lamp chain model.
[0190] According to the principle of equal distribution, in some embodiments, the spacing of all the front lamp beads and all the back lamp beads in the fan-shaped reference area can be systematically fine-tuned, that is, the spacing between every two adjacent lamp beads in the fan-shaped reference area on the entire spiral path of the light chain can be fine-tuned, which is reflected in the polar angles of all the lamp beads being adjusted to be equal, so that the distribution of the lamp beads in the spiral model of the light chain is more uniform.
[0191] By introducing the polar coordinate system to optimize the generation process of the light chain spiral model, many technical advantages are demonstrated, such as:
[0192] First, the position of the lamp beads is calculated using a polar coordinate system independently constructed based on the fan-shaped reference area, which greatly improves the calculation efficiency. In the polar coordinate system, the position of the lamp beads is concisely expressed by two parameters: polar diameter and polar angle. Compared with the traditional rectangular coordinate system, it reduces the complexity of coordinate transformation and simplifies the calculation process.
[0193] Secondly, the use of polar coordinate system improves the layout accuracy. In the sector reference area, the lamp beads are evenly divided by equally dividing the polar angle, ensuring the visual and physical uniform distribution of the lamp beads. This method reduces the difference in lighting effects caused by uneven layout, ensuring the consistency of lighting design and the realization of expected effects.
[0194] Furthermore, the application of polar coordinate system reduces the equipment cost. Since polar coordinate system is more suitable for dealing with circumferential and radial distribution problems, it reduces the dependence on high-precision rotation or displacement sensors, thereby reducing the cost of the overall system. In addition, the simplified calculation process also reduces the requirements for computing hardware, making it more suitable for embedded chips, further reducing costs.
[0195] In addition, the above embodiments also demonstrate the flexibility and adaptability of the light chain layout. Whether it is a simple spiral light chain or a complex layout wrapped around an irregularly shaped carrier, the polar coordinate system can provide an effective solution. This flexibility allows the present application to be widely used in different lighting scenarios and design requirements.
[0196] Finally, the uniformity of the distribution of the lamp beads in the spiral light chain model was further improved by systematic spacing fine-tuning in the polar coordinate system. This fine-tuning not only optimizes the lighting effect, but also makes it possible to achieve more complex dynamic lighting, enhancing the controllability and expressiveness of the lighting system.
[0197] Based on any embodiment of the method of the present application, mapping the plane spatial position of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial position of the modeling space where the cone model is located includes:
[0198] Step S5410, obtaining a corresponding relationship between a polar coordinate system constructed according to the sector-shaped reference area and a modeling space where the cone model is located and performing spatial transformation;
[0199] In the above description of the embodiment of unfolding the cone model in the image view space, it has been disclosed that a generatrix of the cone model corresponds to a side edge of its corresponding sector reference area, and this correspondence can ensure accurate mapping between the sector reference area and the cone model. This correspondence has been created and stored in advance, and this step can directly call it.
[0200] Step S5420: converting the fan-shaped spatial position of the lamp bead in the fan-shaped reference area into the three-dimensional spatial position of the modeling space according to the corresponding relationship;
[0201] According to the aforementioned correspondence, a generatrix of the cone model has established a mapping relationship with a side of the sector reference area. This mapping relationship allows the two-dimensional position information represented by polar coordinates in the sector reference area to be converted into a three-dimensional spatial position on the cone model.
[0202] First, it is necessary to determine the fan-shaped spatial position of each lamp bead in the fan-shaped reference area. These positions have been given in the form of polar diameter and polar angle through the polar coordinate system. Then, using the determined correspondence, these two-dimensional polar coordinates are converted into three-dimensional spatial coordinates. This conversion process uses mathematical coordinate transformation methods, which can usually be achieved through coordinate transformation formulas or matrix operations.
[0203] For example, assume that the polar coordinates of lamp bead A in the fan-shaped reference area are (r, θ), where r is the straight-line distance from the lamp bead to the center of the fan-shaped reference area, i.e., the polar diameter, and θ is the angle between the straight line and the polar axis. Using the correspondence between the generatrix of the cone model and the side of the fan-shaped reference area, the position of lamp bead A on the cone model can be determined. Specifically, the polar coordinates (r, θ) can be converted into three-dimensional coordinates (x, y, z) in the modeling space where the cone model is located. The conversion process may be as follows:
[0204] First, use the polar diameter r and polar angle θ to calculate the position of the lamp bead on the side of the cone model according to the geometric characteristics of the cone model. Then, determine the height of the lamp bead on the z-axis based on the height of the cone model and the position of the lamp bead on the side of the cone. Considering that the modeling space is generated by directly expanding one dimension based on the image view space, the x-axis and y-axis coordinates of the lamp bead in the modeling space can be approximated by the corresponding values in the image view space. Based on this, the coordinates (x, y, z) of the lamp bead A in the three-dimensional space can be obtained, which represents the specific position of the lamp bead in the cone model.
[0205] Step S5430: construct the serial position and three-dimensional spatial position of each lamp bead in the lamp chain into a spiral model of the lamp chain for storage or display.
[0206] Through the above process, all the lamp beads in the fan-shaped reference area can be converted into the three-dimensional space of the cone model. Each lamp bead has a one-to-one mapping relationship between its serial position, plane space position, fan-shaped space position, and three-dimensional space position. This mapping relationship can be represented, stored, and displayed in the form of structured data. For example, it can be represented in any form such as relational tables, key-value pairs, etc. After data representation, it can be stored as a file or parsed and displayed in a graphical user interface such as Figure 5 As shown in the model image, in short, as long as the serial positions of the lamp beads of the lamp chain are associated with their corresponding three-dimensional spatial positions, the corresponding lamp chain hovering model on the external carrier can be obtained.
[0207] The technical advantages of this embodiment are mainly concentrated in improving modeling efficiency, enhancing model accuracy, and comprehensively improving user experience and application potential, for example:
[0208] First, in terms of improving modeling efficiency, this embodiment greatly simplifies the spatial positioning process of the lamp beads by expanding the cone model into a fan-shaped reference area and creating a polar coordinate system in this area. This method utilizes the natural adaptability of the polar coordinate system, so that the position of the lamp beads can be determined by simple polar diameters and polar angles, thereby reducing the complex calculations required for traditional three-dimensional space modeling. Moreover, through the pre-established correspondence, the spatial transformation from the fan-shaped reference area to the cone model can be completed quickly, significantly improving the conversion speed from a two-dimensional plane to a three-dimensional stereo model.
[0209] Secondly, in terms of enhancing the accuracy of the model, the polar coordinate system mapping method of this embodiment provides accurate spatial positioning for each lamp bead. In the polar coordinate system, the position of the lamp bead is accurately represented by the polar diameter and polar angle, which ensures that the position information of each lamp bead is accurate even when the lamp chain is wrapped around a complex or irregular carrier. Moreover, by mapping the two-dimensional position information of the fan-shaped reference area back to the three-dimensional cone model, this embodiment can ensure that the geometric shape of the lamp chain spiral model is highly consistent with the actual physical layout, thereby improving the accuracy and reliability of the model.
[0210] Finally, in terms of comprehensively improving user experience and application potential, the method of this embodiment simplifies the construction process of the light chain spiral model, allowing users to easily design personalized lighting effects without professional knowledge. The intuitiveness and ease of use of this method greatly reduce the threshold for using smart lighting systems, allowing more consumers to enjoy the fun of personalized lighting design. At the same time, the efficient and precise modeling capabilities of this embodiment also provide broad space for the application scope and innovation potential of smart lighting systems, and can play an important role in the fields of home decoration, commercial lighting, and artistic creation.
[0211] See also Figure 8 Another embodiment of the present application further provides a device for constructing a spiral model of a light chain, which includes an image analysis module 5100, a model development module 5200, a back inference module 5300, and a description construction module 5400, wherein the image analysis module 5100 is configured to obtain a live image of a light chain spirally spiraling on an external carrier, determine the planar spatial position of each front lamp bead of the light chain in the image view space under the image shooting angle, and determine a cone model of the external carrier adapted to the spiral shape; the model development module 5200 is configured to place the cone model in the image view space The back side inference module 5300 is configured to arrange the back side lamp beads of each circle on the surface of the fan-shaped reference area according to the number of missing back side lamp beads of each circle of the light chain outside the image shooting angle, and determine the fan-shaped spatial position of all the lamp beads in the fan-shaped reference area; the description construction module 5400 is configured to map the fan-shaped spatial position of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial position of the modeling space where the cone model is located, so as to obtain the spiral model of the light chain.
[0212] Based on any embodiment of the device of the present application, the image analysis module 5100 includes: a view space construction module, which is configured to construct an image view space corresponding to the on-site image; a view position recognition module, which is configured to use one or more on-site images to identify the unique color characteristics provided by each lamp bead and its plane space position in the image view space; a lamp bead identity recognition module, which is configured to query a preset color display instruction table, determine the serial position of the lamp bead corresponding to the unique color characteristic in the lamp chain, and map the plane space position with the serial position; a front missing completion module, which is configured to determine some lamp beads whose unique color characteristics are missing in the image view space, and determine the serial position and plane space position of the part of the lamp beads according to the relative position relationship between the part of the lamp beads and the mapped lamp beads, so as to obtain the serial position and plane space position of all the front lamp beads.
[0213] Based on any embodiment of the device of the present application, the image analysis module 5100 includes: a partition contour recognition module, which is configured to perform edge detection on the external carrier in the scene image to determine the quadrilateral external contour corresponding to the fractal area where the light chain part is hovering; a contour model correction module, which is configured to construct a corresponding triangular area in the image view space based on the external contour and correct the triangular area; and a cone model creation module, which is configured to perform spatial transformation based on the triangular area to construct a cone model.
[0214] Based on any embodiment of the device of the present application, the model expansion module 5200 includes: multiple area coordination modules, which are configured to expand the cone models corresponding to each fractal area to obtain corresponding fan-shaped reference areas for at least one fractal area where a light chain part is hovering on an external carrier; a spatial dimension alignment module, which is configured to map a main line of each cone model to a side edge of its corresponding fractal area, and to tile the fan-shaped reference area with the main line as the side edge into the image view space; an alignment relationship temporary storage module, which is configured to set the corresponding relationship between the main line and the side edge, so as to determine the inclination state of each cone model in the same modeling space according to the corresponding relationship, so as to construct the light chain hovering model.
[0215] Based on any embodiment of the device of the present application, the back side inference module 5300 includes: a missing quantity analysis module, configured to determine the missing quantity of a corresponding circle of back side lamp beads according to the serial positions corresponding to the two front side lamp beads of each adjacent rows of front side lamp beads in the light chain on the spiral path in the fan-shaped reference area; a back side lamp bead layout module, configured to extend a reference line between the two relative front side lamp beads on the surface of the fan-shaped reference area according to the missing quantity, set a plurality of back side lamp beads corresponding to the missing quantity on the reference line, and arrange them on the surface of the fan-shaped reference area; a back side lamp bead mapping module, configured to determine the corresponding serial position of each back side lamp bead according to the order of the back side lamp beads on the spiral path, and map it with the fan-shaped spatial position of the fan-shaped reference area.
[0216] Based on any embodiment of the device of the present application, the back lamp bead layout module includes: a polar coordinate system creation module, configured to create a polar coordinate system for describing the fan-shaped reference area, wherein a side edge of the fan-shaped reference area is used as the polar axis; a lamp bead position positioning module, configured to convert the plane spatial position of the lamp bead in the image view space into the fan-shaped spatial position in the fan-shaped reference area based on the polar coordinate system, wherein the connecting line segment from the lamp bead to the center of the fan-shaped reference area is used as the polar diameter, and the angle between the connecting line segment and the side edge is used as the polar angle to determine the fan-shaped spatial position of the lamp bead in the fan-shaped reference area; a fan-shaped position setting module, configured to evenly set the fan-shaped spatial position and serial position of multiple back lamp beads in the same reference line according to the missing number based on the polar coordinate system.
[0217] Based on any embodiment of the device of the present application, the description construction module 5400 includes: a mapping relationship acquisition module, which is configured to obtain the corresponding relationship between the polar coordinate system constructed according to the fan-shaped reference area and the spatial transformation of the modeling space where the cone model is located; a coordinate representation conversion module, which is configured to convert the fan-shaped space position of the lamp bead in the fan-shaped reference area into the three-dimensional space position of the modeling space according to the corresponding relationship; a model construction output module, which is configured to construct the serial position and the three-dimensional space position of each lamp bead in the lamp chain into a spiral model of the lamp chain for storage or display.
[0218] Based on any embodiment of this application, please refer to Fig. 9 Another embodiment of the present application further provides a computer device, which can be used as a controller in an atmosphere light device, such as Fig. 9 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and a computer program that encapsulates computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a method for building a spiral light chain model. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the method for building a spiral light chain model of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0219] In this embodiment, the processor is used to execute Figure 8 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the light chain spiral model construction device of the present application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0220] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the method for constructing a spiral light chain model described in any embodiment of the present application.
[0221] The present application also provides a computer program product, including a computer program / instruction, which, when executed by one or more processors, implements the steps of the method for constructing a spiral light chain model described in any embodiment of the present application.
[0222] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0223] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
[0224] In summary, this application greatly simplifies the modeling process and improves adaptability to complex furnishings by directly identifying the spiral shape of the light chain in the on-site image and constructing a corresponding cone model. The cone model is expanded into a fan shape using unique technology to accurately map the positions of the front and back lamp beads, and then these two-dimensional position information is mapped into three-dimensional space to generate an accurate spiral model of the light chain. Therefore, this application not only solves the problems of recognition efficiency and accuracy in traditional technologies and reduces dependence on computing resources, but also simplifies user operations, allowing personalized lighting effects to be designed without professional knowledge, significantly broadening the application scope and innovation potential of intelligent lighting systems.
Claims
1. A method for constructing a spiral light chain model, characterized in that: include: Obtain a live image of the light chain spirally hovering on the external carrier, determine the planar spatial position of each front light bead of the light chain in the image view space under the image shooting angle, and determine a cone model of the external carrier adapted to the spiral shape; Expanding the cone model into a fan-shaped reference area in the image view space, so that each front light bead is located on the surface of the fan-shaped reference area according to its plane space position; According to the number of missing back lamp beads in each circle of the lamp chain outside the image shooting angle, each circle of back lamp beads are arranged on the surface of the fan-shaped reference area, and the fan-shaped spatial positions of all lamp beads in the fan-shaped reference area are determined, which includes: using the known information provided by the front lamp beads within the image shooting angle, calculating the difference in the serial position of the front lamp beads to determine the number of missing back lamp beads; in the fan-shaped reference area, extending the reference connection line between the front lamp beads and arranging the missing back lamp beads at equal intervals; using the polar coordinate system to provide a corresponding fan-shaped spatial position for each back lamp bead; The fan-shaped spatial position of the lamp beads on the surface of the fan-shaped reference area is mapped to the corresponding three-dimensional spatial position of the modeling space where the cone model is located, so as to obtain the spiral model of the lamp chain.
2. The method for constructing a spiral light chain model according to claim 1, characterized in that: Determine the planar spatial position of each front lamp bead of the light chain in the image view space under the image shooting angle, including: Constructing an image view space corresponding to the scene image; Using one or more live images, identifying the unique color features provided by each lamp bead and its planar spatial position in the image view space; Query a preset color display instruction table to determine the serial position of the lamp bead corresponding to the unique color feature in the lamp chain, and map the plane space position to the serial position; Determine some lamp beads that are missing unique color features in the image view space, and determine the serial position and plane space position of these lamp beads based on the relative position relationship between these lamp beads and the lamp beads for which the mapping has been established, so as to obtain the serial position and plane space position of all the front lamp beads.
3. The method for constructing a spiral light chain model according to claim 1, characterized in that: Determine the cone model of the external carrier adapted to the spiral shape, including: Perform edge detection on the external carrier in the scene image to determine the quadrilateral outer contour corresponding to the fractal region where the light chain part is hovering; constructing a corresponding triangular area in the image view space based on the external contour, and correcting the triangular area; A cone model is constructed based on the spatial transformation of the triangular area.
4. The method for constructing a spiral light chain model according to claim 3, characterized in that: Expanding the cone model into a fan-shaped reference area in the image view space includes: For at least one fractal region of the external carrier where the light chain part is hovering, the cone model corresponding to each fractal region is respectively expanded to obtain the corresponding fan-shaped reference region; Mapping a main line of each cone model to a side edge of its corresponding fractal region, and tiling a fan-shaped reference region with the main line as a side edge into the image view space; The corresponding relationship between the busbar and the side is set to determine the inclination state of each cone model in the same modeling space according to the corresponding relationship, so as to construct the spiral model of the light chain.
5. The method for constructing a spiral light chain model according to claim 1, characterized in that: According to the number of missing lamp beads on the back of each circle of the lamp chain outside the image shooting angle, the back lamp beads of each circle are arranged on the surface of the fan-shaped reference area, and the fan-shaped spatial positions of all the lamp beads in the fan-shaped reference area are determined, including: Determine the number of missing back lamp beads in a corresponding circle according to the serial positions of the front lamp beads in each adjacent row of the lamp chain in the fan-shaped reference area relative to the two front lamp beads on the spiral path; According to the missing quantity, a reference line between the two opposite front lamp beads is extended on the surface of the fan-shaped reference area, and a plurality of back lamp beads corresponding to the missing quantity are set on the reference line and arranged on the surface of the fan-shaped reference area; The corresponding serial positions of the back light beads are determined according to the order of the back light beads on the spiral path, and are mapped to the fan-shaped spatial positions of the fan-shaped reference areas.
6. The method for constructing a spiral light chain model according to claim 5, characterized in that: A plurality of back light beads corresponding to the missing quantity are set on the reference line and arranged on the surface of the fan-shaped reference area, including: Creating a polar coordinate system for describing the fan-shaped reference area, wherein a side edge of the fan-shaped reference area is used as a polar axis; Based on the polar coordinate system, the plane spatial position of the lamp bead in the image view space is converted into the fan-shaped spatial position in the fan-shaped reference area, wherein the connecting line segment from the lamp bead to the center of the fan-shaped reference area is taken as the polar diameter, and the angle between the connecting line segment and the side is taken as the polar angle, so as to determine the fan-shaped spatial position of the lamp bead in the fan-shaped reference area; Based on the polar coordinate system, the fan-shaped spatial positions and serial positions of multiple back light beads are evenly set in the same reference line according to the missing number.
7. The method for constructing a spiral light chain model according to any one of claims 1 to 6, characterized in that: Mapping the plane spatial position of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial position of the modeling space where the cone model is located includes: Obtaining a corresponding relationship between a polar coordinate system constructed according to the sector-shaped reference area and a modeling space where the cone model is located and undergoing spatial transformation; According to the corresponding relationship, the fan-shaped spatial position of the lamp bead in the fan-shaped reference area is converted into a three-dimensional spatial position of the modeling space; The serial position and the three-dimensional spatial position of each lamp bead in the lamp chain are constructed into a lamp chain spiral model for storage or display.
8. A device for constructing a spiral light chain model, characterized in that: include: An image analysis module is configured to obtain a live image of the light chain spirally hovering on the external carrier, determine the planar spatial position of each front light bead of the light chain in the image view space under the image shooting angle, and determine a cone model suitable for the spiral external carrier; A model unfolding module, configured to unfold the cone model into a fan-shaped reference area in the image view space, so that each front lamp bead is located on the surface of the fan-shaped reference area according to its plane space position; The back inference module is configured to arrange each circle of back lamp beads on the surface of the fan-shaped reference area according to the number of missing back lamp beads in each circle of the lamp chain outside the image shooting angle, and determine the fan-shaped spatial position of all lamp beads in the fan-shaped reference area, including: using the known information provided by the front lamp beads within the image shooting angle, calculating the difference in the serial position of the front lamp beads to determine the number of missing back lamp beads; in the fan-shaped reference area, extending the reference connection line between the front lamp beads and arranging the missing back lamp beads at equal intervals; using the polar coordinate system to provide a corresponding fan-shaped spatial position for each back lamp bead; A construction module is described, which is configured to map the fan-shaped spatial position of the lamp beads on the surface of the fan-shaped reference area to the corresponding three-dimensional spatial position of the modeling space where the cone model is located, so as to obtain the spiral model of the lamp chain.
9. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or computer instruction is called and executed by a central processing unit, the steps of the method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Atmosphere lamp equipment, light-emitting partition layout generation method and device and computer equipment
CN117528873A
Method and device for determining positions of lamp beads of LED lamp string in three-dimensional layout
CN118115571A
