Line animation display method and device, equipment and medium

By acquiring graphic material data and using image generation models to generate line sketches and routing status frames, the problem of low efficiency and low quality in generating line patterns in traditional technologies has been solved, realizing efficient and automated line drawing animation display and improving user experience.

CN120726196BActive Publication Date: 2025-11-11SHENZHEN INTELLIROCKS TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511197425.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-11
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Traditional techniques are inefficient in generating line patterns, making it difficult to guarantee the artistic quality, continuity, and smoothness of the lines, and they cannot achieve high-quality visual effects when applied to real-world scenarios.

Method used

By acquiring map data, converting it into map control information, using an image generation model to generate line sketches, determining line paths, generating line status frames, and finally displaying the line drawing animation in ambient lighting fixtures.

Benefits of technology

It enables the efficient and automated generation of high-quality line patterns and their animations, simplifies the operation process, improves the user experience, and meets personalized and innovative visual needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726196B_ABST
    Figure CN120726196B_ABST
Patent Text Reader

Abstract

The application relates to a line drawing animation display method and device, equipment and medium. The method comprises the following steps: obtaining drawing material data, converting the drawing material data into drawing control information, and the drawing control information containing a natural language instruction for drawing a line pattern; inputting the drawing control information into a preset image generation model, generating a line sketch containing the line pattern according to the natural language instruction by the image generation model; determining a corresponding line path based on the line pattern in the line sketch; sequentially generating a line state frame of each line position in the line direction of the corresponding line path for playing and displaying the line drawing animation, and each line state frame containing a line drawn from the starting point of the corresponding line path to the corresponding line position. The application realizes efficient and high-quality line drawing animation generation and animation display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lighting effect control technology, and in particular to a method, apparatus, equipment and medium for displaying line drawing animation. Background Technology

[0002] Image generation technology plays an increasingly important role in many fields, especially in artistic creation, advertising design, multimedia presentations, and smart hardware interaction, where its applications are becoming more and more widespread. Traditionally, people typically rely on manual drawing or simple graphics software to create line patterns. This process is not only time-consuming and laborious, but also makes it difficult to guarantee the artistic quality and accuracy of the patterns. With the development of computer graphics and deep learning technologies, although some automated image generation methods have emerged, these methods still have many limitations when generating complex line patterns.

[0003] Traditional techniques for generating line drawings often require users to possess professional drawing skills and extensive design experience to manually create artistic line patterns. This method is not only inefficient but also rarely achieves satisfactory results for non-professional users. Furthermore, while some automated methods can generate simple line patterns, they often fail to guarantee the continuity and smoothness of lines when handling complex patterns, easily resulting in broken lines, jagged edges, and other artifacts that affect the overall aesthetic appeal of the design. At the same time, these methods also lack diversity in the generated patterns, failing to meet users' demands for personalization and innovation.

[0004] When applying the generated line patterns to real-world scenarios, such as displaying line-drawing animations on ambient lighting fixtures, traditional technologies face numerous challenges. Firstly, the low quality of the generated line patterns prevents accurate representation of the intended visual effect when mapped to the lamp's LED layout interface, impacting the overall display effect of the ambient lighting. Secondly, traditional technologies lack precise control over the line drawing process when generating animation frames, resulting in an unnatural and smooth line drawing process during animation playback, failing to provide a satisfactory visual experience for users.

[0005] In summary, traditional techniques for generating line patterns and their animations suffer from inefficiency, low line quality, insufficient pattern diversity, and unsatisfactory animation effects. These problems limit the further development and application of image generation technology in fields such as artistic creation, multimedia display, and smart hardware interaction. Therefore, there is an urgent need for a new method that can efficiently and effectively generate line patterns and their animations to meet the growing demands for personalization and innovation. Summary of the Invention

[0006] The primary objective of this application is to solve at least one of the above-mentioned problems by providing a method, apparatus, device, and medium for displaying line drawing animation.

[0007] To achieve the various objectives of this application, the following technical solution is adopted:

[0008] A method for displaying line drawing animation, provided for one of the purposes of this application, includes the following steps:

[0009] Acquire cartographic material data and convert the cartographic material data into cartographic control information, wherein the cartographic control information includes natural language instructions for drawing line patterns;

[0010] The mapping control information is input into a preset image generation model, which then generates a line sketch containing line patterns according to the natural language instructions.

[0011] Determine the corresponding line path based on the line pattern in the line sketch;

[0012] For multiple routing positions in the routing direction of the line path, a routing state frame for each routing position is generated sequentially for playing and displaying the line drawing animation. Each routing state frame contains the lines drawn from the starting point of the line path to the corresponding routing position.

[0013] A line drawing animation display device is provided for one of the purposes of this application, namely, a line drawing animation display method, comprising:

[0014] The control setting module is configured to acquire drawing material data and convert the drawing material data into drawing control information, wherein the drawing control information includes natural language instructions for drawing line patterns;

[0015] The sketch generation module is configured to input the drawing control information into a preset image generation model, and the image generation model generates a line sketch containing line patterns according to the natural language instructions.

[0016] The path determination module is configured to determine the corresponding line path based on the line pattern in the line sketch.

[0017] The status frame generation module is configured to generate a status frame for each line position in the direction of the line path, for playing and displaying the line drawing animation. Each status frame contains the lines drawn from the starting point of the line path to the corresponding line position.

[0018] In another aspect, a computer device provided for one of the purposes of this application includes a processor and a memory, wherein the processor invokes and runs a computer program in the memory to perform the steps of the line drawing animation display method.

[0019] On another aspect, a computer-readable storage medium is provided to suit another purpose of this application, which stores in the form of computer-readable instructions a computer program implemented according to the described line drawing animation display method, which, when called by a computer, executes the steps included in the corresponding method.

[0020] Compared to traditional technologies, this application effectively solves the problems of low efficiency, difficulty in ensuring artistic quality, and insufficient line continuity and smoothness when generating complex line patterns through innovative technical solutions. Furthermore, addressing the issues of applying line patterns to real-world scenarios using traditional technologies, this application provides a one-stop solution. Users only need to provide graphic material data to automatically generate high-quality line drawing animations, which can be directly used for display on playback devices. This greatly simplifies the operation process, lowers the barrier to entry, and meets users' needs for personalized and innovative visual experiences. Attached Figure Description

[0021] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0022] Figure 1 This is a schematic diagram of the structure of an exemplary ambient lighting fixture of this application;

[0023] Figure 2 This is a flowchart illustrating a typical embodiment of the line drawing animation display method of this application;

[0024] Figure 3 Line sketches generated for the image generation model of this application based on exemplary drafting control information;

[0025] Figure 4 This is a schematic diagram of the line drawing animation display device of this application;

[0026] Figure 5 This is a schematic diagram of the structure of a computer device used in this application. Detailed Implementation

[0027] The ambient lighting fixtures in this application, such as Figure 1 As shown, it includes a controller 1 and a lighting unit 2. The controller 1 and the lighting unit 2 can be directly connected by wire or wirelessly, as long as they can communicate with each other.

[0028] The number of lighting units 2 is unlimited, depending only on the support capability of controller 1. Lighting units 2 are responsible for controlling the large number of LEDs inside them to emit light in an orderly manner to display the corresponding lighting effects according to the lighting effect control commands sent by controller 1.

[0029] In this application, the lighting effect can be a line drawing animation used to demonstrate the effect of drawing a line in one stroke. This line drawing animation can be generated by user-provided graphic material data. According to the line drawing animation display method of this application, the various routing state frames required for displaying the line drawing animation can be generated in one step based on the graphic material data. By constructing the corresponding lighting effect playback instructions for the lighting unit according to these routing state frames and controlling the operation of the lighting unit, the corresponding line drawing animation can be presented.

[0030] In some embodiments, the ambient lighting fixture may include, in addition to the control chip that functions as controller 1, components such as control panels, communication components, and displays that can be configured as needed.

[0031] The control chip can be implemented using various embedded chips, such as Bluetooth SoC (System on Chip), WiFi SoC, MCU (Micro Controller Unit), DSP (Digital Signal Processing), and other types of chips. The control chip typically includes a central processing unit (CPU) and a memory. The memory and CPU are used to store and execute program instructions to achieve the corresponding functions, respectively. The control panel usually provides one or more buttons for controlling the controller 1, selecting various preset lighting effects, etc. A communication component is used to achieve wireless communication connections with each lighting unit 2. The display screen can be used to display various control information to cooperate with the buttons on the control panel, supporting human-machine interaction. The control panel and the display screen can also be integrated into the same touch screen.

[0032] The controller of the ambient lighting fixture can interact with the user through its display screen to obtain the drawing material data provided by the user, which is then converted into drawing control information. Based on the drawing control information, the controller drives the image generation model of this application to generate corresponding line sketches. The line sketches are then processed to obtain the various line state frames of the line drawing animation. Finally, the various line state frames are used to control the various lighting units of the ambient lighting fixture to display the corresponding line drawing animation, thereby presenting the corresponding lighting effects.

[0033] The lighting unit 2 can be a planar light 4, which includes multiple light strips 21, each light strip 21 connected with multiple LED beads 210. The light strips 21 are arranged regularly, thereby regularly arranging a large number of LED beads 210 on the plane. The arrangement of these LED beads 210 constitutes LED bead layout information. The LED bead layout information actually describes an LED bead layout interface. This LED bead layout interface can be positioned and corresponded to a planar image, such as the wiring state frame of this application, so that each pixel in the wiring image frame is mapped to the corresponding LED bead 210 of the lighting unit 2. The light emission control parameters corresponding to each LED bead 210 are determined, and the light emission control parameters corresponding to each LED bead 210 are constructed into a lighting effect playback command corresponding to the wiring image frame. The lighting effect playback command controls the color rendering of each LED bead 210 of the lighting unit 2 to display the corresponding image. Multiple orderly organized wiring state frames are played in the lighting unit 2 to form a line drawing animation effect.

[0034] In some embodiments, the controller 1 of the ambient lighting fixture of this application can be implemented in a separate computer device, as long as the computer device is equipped with a control chip that functions as the controller 1. When the controller 1 is implemented in a computer device, the various resources inherent in the computer device can be shared to save overall implementation costs. The computer device referred to herein can be any terminal device for user use, such as a smartphone, personal computer, laptop, tablet, etc.

[0035] In another embodiment, it can also be in Figure 1 Based on the structure of the ambient lighting fixture shown, an independent computer device is used to communicate with the controller 1 of the ambient lighting fixture and coordinate and cooperate according to the preset business logic. Each device is responsible for different tasks in this application and provides the controller with various data and instructions, including but not limited to wiring status frames, light emission control parameters, and lighting effect control instructions in this application.

[0036] Based on the above product architecture and working principle of ambient lighting fixtures, the line drawing animation display method of this application can be implemented as a computer program, stored in the storage medium of the computer device of this application or the controller 1 of the ambient lighting fixture, and called and run by the controller of the computer device or the controller 1 of the ambient lighting fixture from the storage medium in order to control each lighting unit 2 to play the corresponding lighting effects.

[0037] Please see Figure 2 In some embodiments, the line drawing animation display method of this application can be implemented as an application program, installed and run on a computer device or ambient lighting fixture, including:

[0038] Step S5100: Obtain map material data and convert the map material data into map control information, wherein the map control information includes natural language instructions for drawing line patterns;

[0039] Users can submit graphic design materials in various ways through the graphical user interface (GUI) of their computer devices, such as mobile terminals. Graphic design materials can be user-entered keywords, such as "mouse," user-provided images, such as a picture of a mouse, or both keywords and images. This flexibility ensures that users can provide creative materials in different ways according to their needs and preferences.

[0040] When a user submits keywords, these keywords can be converted into graphic control information containing natural language instructions, so that the image generation model of this application can understand and execute them. For example, if the user enters the keyword "mouse," it can be converted into the natural language instruction "Please create a one-stroke image of a mouse." Such an instruction explicitly tells the image generation model that the user wants to generate a line drawing of a mouse, presented in the form of a one-stroke drawing.

[0041] If the user submits an image, semantic analysis can be performed first. An image segmentation model can be used to extract the foreground pattern, and a corresponding natural language instruction can be generated based on this. For example, if the user uploads an image of a mouse, the natural language instruction could be generated: "Please refer to the shape of the foreground pattern in the image and create a one-stroke drawing of it." This instruction not only tells the image generation model to create a one-stroke drawing but also provides a specific reference pattern—the mouse pattern in the user-uploaded image—thus making the generated image more in line with the user's expectations.

[0042] When a user provides both keywords and an image, the system considers both to generate a more precise natural language instruction. For example, if a user provides the keyword "mouse" and an image of a mouse, the system can combine these two pieces of information to generate the instruction: "Please create a one-stroke drawing of a mouse. If the image contains a mouse image, you can refer to that image; otherwise, please create your own." This instruction considers both the user-provided keywords and the image, allowing the image generation model to fully utilize all the information provided by the user during the creation process, thus generating an image that better meets the user's needs.

[0043] After converting the map data, the obtained natural language instructions and user-submitted images (if any) can be combined to form map control information, which is then input into the corresponding image generation model for reasoning, so that the model can create a corresponding one-stroke image for use as the line sketch of this application.

[0044] Step S5200: Input the mapping control information into a preset image generation model, and the image generation model generates a line sketch containing line patterns according to the natural language instructions;

[0045] The mapping control information already includes natural language instructions converted from user-provided mapping material data, as well as user-submitted images (if any). This information is input into a pre-defined image generation model, which, through deep learning technology, can understand and execute natural language instructions to generate line patterns that meet the user's requirements. The image generation model can employ various architectures, such as Transformer-based models, Generative Adversarial Networks (GANs), or Variational Autoencoders (VAEs). In one embodiment, the image generation model of this application can be prepared by fine-tuning a pre-trained, mature, lightweight large language model using corresponding training samples. These models learn the generation rules of line patterns through a large amount of training data, enabling them to generate high-quality line sketches.

[0046] Taking drawing a line drawing of a "mouse" as an example, when a user inputs the keyword "mouse" and it is converted into a natural language instruction, "Please create a one-stroke drawing of a mouse," the image generation model will generate a line drawing of a mouse based on this instruction, such as... Figure 3 As shown. If the user also provides an image of a mouse, the model will refer to the mouse pattern in the image to generate a line sketch that better matches the user's expectations. This reference mechanism ensures that the generated line pattern not only conforms to the requirements of natural language instructions but also draws on the specific pattern provided by the user, improving the accuracy and artistic quality of the generated image.

[0047] In practical applications, image generation models can employ unimodal or multimodal processing methods depending on the input format. Unimodal models focus on processing text or image input, while multimodal models can process both text and image input simultaneously. For example, for users who only provide keywords, the model can use a unimodal text processing approach to directly generate a line sketch based on the keywords; while for users who provide both keywords and images, the model can use a multimodal processing approach, taking into account both text and image information to generate a more accurate line sketch.

[0048] The generated line sketches form the basis for subsequent steps, and their quality directly impacts the final line drawing animation. Therefore, prioritizing high-quality training data and advanced model architectures can generate smooth, continuous, and artistic line sketches, providing a solid foundation for subsequent line path determination and animation frame generation.

[0049] However, current deep learning-based models inherently suffer from the "machine illusion" problem. Even with high-quality training, the line sketches they generate may contain errors or flaws. For example, even if the model is instructed via natural language to generate a single-stroke drawing of a mouse, it might still produce a line sketch containing two separate single-stroke drawings of mice, or it might generate a single-stroke drawing of a mouse but with many messy lines. Alternatively, even if the model is specified to generate a single-stroke drawing with a solid-color background, it might add unnecessary image elements to the background. These issues render the generated line sketches unusable directly and require further comprehensive optimization.

[0050] In one embodiment, when using a relatively lightweight large language model as the image generation model, considering the relatively limited computing power of computer devices such as mobile terminals and embedded control chips in ambient lighting fixtures, it is necessary to prioritize the use of lightweight image generation models. Such models are not suitable for generating high-resolution line sketches. Therefore, in this case, the model can first generate line sketches at a relatively low resolution, and then a super-resolution model can be used to perform super-resolution processing on them, improving the resolution of the line sketches, enhancing their image quality, and providing a better image foundation for subsequent optimization processes.

[0051] Step S5300: Determine the corresponding line path based on the line pattern in the line sketch;

[0052] Since line sketches generated by image generation models may contain discontinuous lines, messy lines, or background noise, one embodiment can first optimize them using image processing techniques. For example, image segmentation techniques can be used to separate the foreground lines from the background in the line sketch to obtain the line pattern, ensuring line clarity. Furthermore, smoothing filters can be used to smooth the lines in the line sketch, reducing jaggedness and improving line quality.

[0053] If the line sketch meets the requirements, line paths can be extracted from the line patterns within it. In one embodiment, a contour detection algorithm can be used to find contours in the line sketch. These contours can be considered as candidate paths for the line path. Then, by analyzing the shape and position of these contours, the final line path is determined. For example, the longest contour can be selected as the primary line path, or multiple contours can be merged based on line connectivity to form a complete line path.

[0054] In one embodiment, the line contour can be further optimized during the determination of the line path. For example, curve fitting techniques, such as B-spline curve fitting, can be used to fit the contour to generate a smoother and more continuous line path. This method can effectively remove small imperfections and noise in the contour while maintaining the overall shape and characteristics of the line.

[0055] Furthermore, path optimization algorithms can be used to further optimize the line paths. For example, dynamic programming can be used to find the optimal line path that minimizes path length or energy while satisfying certain constraints (such as line continuity and smoothness). This method ensures that the generated line paths are not only smooth but also geometrically optimal.

[0056] In some embodiments, the line paths can also be segmented and integrated. For example, if the line pattern in the line sketch contains multiple parts or branches, these parts can be extracted separately, and a separate line path can be determined for each part. Then, based on the overall structure and semantic information of the line pattern, these segmented line paths are combined into a complete line path. This method can better handle complex line patterns and improve the accuracy and completeness of the line paths.

[0057] By flexibly employing the above-mentioned corresponding implementation methods to process line sketches in various situations as needed, clear and continuous line paths can be effectively extracted from line sketches, providing a data foundation for generating high-quality line drawing animations. This ensures the accuracy and optimization of line paths, thereby meeting users' needs for personalized and high-quality line drawing animations.

[0058] Step S5400: For multiple routing positions corresponding to the routing direction of the line path, sequentially generate routing status frames for each routing position to play and display the line drawing animation. Each routing status frame contains lines drawn from the starting point of the line path to the corresponding routing position.

[0059] By generating multiple line status frames at various line positions according to the line path sequence, a line drawing animation can be constructed for playback and display. When played, this line drawing animation can demonstrate the process of drawing a pattern specified by the user-provided drawing material data in one stroke.

[0060] Based on the line path, the starting point and direction of the line path can be determined first. The starting point can be any endpoint of the line path. In a preferred embodiment, the endpoint of the line path located at the top left, bottom left, left, or top side of the drawing can also be selected as the starting point, depending on its position in the line sketch. This selection method conforms to people's reading and observation habits from top to bottom and from left to right, making the generated line drawing animation more natural and smooth. For example, Figure 3 In the mouse pattern shown, you can start from the bottom left corner and then determine the direction of the line by following the outline of the mouse's body.

[0061] Next, based on the direction of the line path, multiple routing positions are evenly distributed along the path. These routing positions are key points for generating routing state frames, with each position corresponding to one state frame. The distribution of routing positions can be determined based on the length of the line path and the animation playback speed. For example, if the line path is long, more routing positions can be set to ensure smooth animation; if the animation playback speed is fast, the number of routing positions can be appropriately reduced.

[0062] For each routing position, a corresponding routing state frame is generated. The routing state frame contains the lines drawn from the starting point of the line path to the current routing position. When generating routing state frames, a point-by-point drawing method can be used, starting from the starting point and gradually drawing the line to the current routing position. In this way, each routing state frame reflects the drawing process of the line from the starting point to the current routing position, forming a series of continuous animation frames. For example, if the line path is the outline of a mouse, each routing state frame will show the process of gradually drawing the mouse outline from the starting point until the entire outline is drawn.

[0063] After drawing each routing state frame, all generated routing state frames are sequentially composited according to the routing direction to construct a complete line drawing animation. Specifically, this can be achieved by arranging each routing state frame in sequence and setting a predetermined playback time interval. Thus, when these routing state frames are played sequentially, a continuous line drawing animation is formed, demonstrating the drawing process of a line from its starting point to its ending point. For example, when playing these routing state frames, viewers can see the outline of a mouse gradually drawn in one stroke, forming a complete line drawing animation effect.

[0064] In one embodiment, this application further expands the application scenarios of line drawing animation by mapping it onto the lighting units of ambient lighting fixtures for display, bringing users a more immersive visual experience. Specifically, by obtaining the LED layout information of the ambient lighting fixture, an LED layout interface corresponding to the lighting unit can be created in a two-dimensional plane. Subsequently, each line drawing state frame is scaled and adapted to the LED layout interface, accurately determining the planar position mapping relationship between each pixel in the line drawing state frame and the LED in the LED layout interface. Based on this mapping relationship, the color value of the corresponding LED is determined according to the color value of each pixel in the line drawing state frame, thereby generating the light emission control parameters of the LED layout interface corresponding to the line drawing state frame. Finally, the light emission control parameters of each line drawing state frame are constructed into lighting effect playback instructions in the original order and sent to the ambient lighting fixture to control it to play the corresponding line drawing animation. This innovative application not only enriches the display form of line drawing animation but also adds a new dimension to the function of ambient lighting fixtures, enabling them to enhance the creation of spatial atmosphere with dynamic and personalized line drawing animation effects.

[0065] As can be seen from the above embodiments, this application, through its innovative technical solution, effectively solves many problems existing in traditional technologies, significantly improves the generation efficiency and quality of line drawing animations, and brings users a richer and more personalized visual experience. Specifically, the technical solution of this application achieves many beneficial effects, specifically solving the technical problems pointed out in the background art. These beneficial effects include, but are not limited to:

[0066] Firstly, addressing the issues of low efficiency and difficulty in ensuring artistic quality when manually drawing line patterns in traditional techniques, this application acquires drafting material data and converts it into drafting control information. Then, using a preset image generation model, it generates line sketches containing line patterns according to natural language instructions, achieving automated conversion from user input to pattern generation. This greatly improves the efficiency of pattern generation. At the same time, leveraging the powerful generation capabilities of deep learning models, it can generate line patterns with artistic quality and diversity, meeting the needs of different users.

[0067] Secondly, addressing the issue of traditional techniques struggling to guarantee line continuity and smoothness when generating complex line patterns, this application determines the corresponding line path based on the line pattern in the line sketch and samples it in its parameter space to determine the set of smooth pixels required to draw the line path. Through the construction and smoothing of parametric curves, breakpoints and jagged edges in the line pattern are effectively avoided, resulting in smoother and more natural lines and significantly improving the quality of the pattern.

[0068] Furthermore, addressing the problems of traditional technologies when applying line patterns to real-world scenarios, this application sequentially generates a line status frame for each line position along the corresponding line path to play and display the line drawing animation. This not only accurately maps the line pattern to the LED layout interface of the animation playback device, such as an ambient light fixture, achieving the desired visual effect, but also, through precise control of the line drawing process, makes the line drawing more natural and smooth during animation playback, providing users with a superior visual experience.

[0069] Furthermore, this application provides a one-stop solution that allows users to obtain line drawing animations that can be directly played on playback devices simply by providing graphic material data. Users do not need professional drawing skills or complex operations; they only need to provide graphic material data, and this application can automatically complete the entire process from pattern generation to animation display, greatly simplifying the user's workflow and improving the user experience. This innovative one-stop solution not only improves the efficiency of line drawing animation generation but also lowers the barrier to entry for users, enabling more users to easily create and display personalized line drawing animations.

[0070] Based on any embodiment of the method in this application, determining the corresponding line path based on the line pattern in the line sketch includes:

[0071] Step S5310: Convert the line sketch into a binary image to highlight the line outline of the line pattern;

[0072] Converting a line sketch into a binary image simplifies the pixel values ​​in the image to two states, typically black and white. This effectively highlights the outline of the line pattern, providing a clear visual basis for subsequent line path extraction.

[0073] Specifically, binarization can be implemented in several ways. One implementation uses a global thresholding method, where a global threshold is selected, and all pixel values ​​above this threshold are set to white, while pixel values ​​below this threshold are set to black. For example, if the line drawing exists as a grayscale image, a grayscale value between 40% and 60% of this range is selected as the threshold, where the lowest value represents black and the highest value represents white. For example, for the range [0, 255], 140 can be chosen as the threshold. All pixels with grayscale values ​​higher than 140 will be converted to white, while pixels with grayscale values ​​lower than 140 will be converted to black. This method is simple and computationally efficient, and is suitable for images with high background and foreground contrast.

[0074] Another implementation method is adaptive thresholding, which dynamically adjusts the threshold based on different regions of the image. This is particularly useful for images with uneven contrast between the background and foreground. For example, the background may be darker in some parts of the image and brighter in others. Adaptive thresholding can locally adjust the threshold to better separate lines from the background.

[0075] In practical applications, the choice of binarization method depends on the specific features and quality of the line sketch. If the background and foreground contrast of the line sketch are high, a global thresholding method may be sufficient. However, if the contrast is uneven, an adaptive thresholding method can more effectively highlight the line outline. Those skilled in the art can flexibly choose different implementation methods based on the above-described teachings of this application.

[0076] After binarization, the resulting binarized image clearly displays the outline of the line pattern. In this binarized image, lines are represented by black pixels, while the background is represented by white pixels. This clear representation makes subsequent line path extraction easier and more accurate.

[0077] Step S5320: Construct a parameterized curve based on the effective pixel set of the line contour in the binarized image to define the corresponding line path;

[0078] The purpose of constructing parametric curves is to extract clear, continuous line paths from a binary image. Based on the binary image of this application, by extracting the black pixels, a set of effective pixels for the line contour can be obtained, and these effective pixel sets can be used to construct parametric curves.

[0079] After obtaining the effective pixel set of the contour, a parametric curve can be constructed using curve fitting techniques. In one implementation, a B-spline curve fitting method is used. A B-spline curve is a piecewise polynomial curve whose shape can be defined by control points. By selecting key points in the contour pixel set as control points, a smooth B-spline curve can be constructed. For example, for the effective pixel set of a mouse contour, key points can be selected as control points for parameter configuration to construct a smooth mouse contour curve.

[0080] In addition, other curve fitting methods can be used, such as Bézier curve fitting. A Bézier curve is a parametric curve defined by a set of control points, and its shape can be changed by adjusting the position of the control points. By selecting key points in the set of contour pixels as control points, a smooth Bézier curve can be constructed.

[0081] In practical applications, the choice of curve fitting method depends on the specific characteristics and quality of the line profile. If the profile is relatively simple, B-spline curve fitting may be sufficient. However, if the profile is more complex, Bézier curve fitting can more effectively construct a smooth curve.

[0082] After constructing the parametric curve, the resulting curve will clearly define the line path. This curve is not only smooth but also accurately represents the shape of the line outline. For example, for the parametric curve of a mouse outline, it will clearly define the line path of the mouse outline, providing an accurate foundation for subsequent line path extraction and animation generation.

[0083] Step S5330: Based on the parameterized curve, sample in its parameter space to determine the set of smooth pixels required to draw the line corresponding to the line path.

[0084] Sampling of a parametric curve in the parameter space can be performed in several ways. One implementation is to use a uniform sampling method. In this method, the parameter space is divided into multiple equal intervals, each corresponding to a sampling point. For example, if the parametric curve is a B-spline curve, its parameter space is typically an interval from 0 to 1. This interval can be divided into several sub-intervals, such as 100, and then sampling can be performed at the midpoint of each sub-interval. This ensures that the sampling points are uniformly distributed in the parameter space, resulting in a smooth line path.

[0085] Another implementation method is to use a non-uniform sampling approach. In this method, the distribution of sampling points can be adjusted based on the curvature or other characteristics of the curve. For example, the density of sampling points can be increased in the curved parts of the curve and decreased in the straight parts. This method can capture the details of the curve more effectively while reducing unnecessary sampling points and improving computational efficiency. For example, for a parametric curve of a mouse silhouette, if the mouse's legs are more curved, the density of sampling points can be increased in that part to more accurately represent the shape of the tail.

[0086] In practical applications, the choice of sampling method depends on the specific characteristics of the line path and the quality requirements. If a very smooth line path is needed, uniform sampling is preferred. However, if more efficient capture of line details is required, non-uniform sampling can be used.

[0087] Depending on the actual needs, after obtaining the sampling points, further interpolation processing can be performed between the sampling points to make the lines corresponding to the smooth pixel set smoother.

[0088] After the above processing, the resulting smooth pixel set clearly defines the lines corresponding to the line paths. These pixels are not only smooth but also accurately represent the shape of the line outlines. For example, for the smooth pixel set of a mouse outline, it will clearly define the line paths of the mouse outline, providing an accurate foundation for subsequent animation generation. These smooth pixel sets can be directly used to generate line-tracing state frames, thereby constructing smooth line-drawing animations.

[0089] Through the above embodiments, this application can efficiently, quickly, and cost-effectively optimize line sketches generated by image generation models, accurately extracting the line paths and smooth pixel sets of the line patterns. Specifically, by converting the line sketch into a binary image, the outline of the line pattern is highlighted; then, a contour detection algorithm or edge detection algorithm is used to extract the effective pixel set, and a parametric curve is constructed using curve fitting technology to define a clear and continuous line path; finally, by sampling in the parameter space, the smooth pixel set required for drawing the line path is determined. Furthermore, interpolation processing can be performed as needed to further improve the smoothness of the lines, ensuring that the final smooth pixel set accurately represents the shape of the line pattern. Through the synergistic effect of multiple steps, not only is the efficiency and accuracy of line path extraction improved, but computational costs are also reduced, making the entire process more efficient and economical. Compared with other embodiments of this application, the above embodiments comprehensively consider the efficiency, accuracy, and cost-effectiveness of image processing, providing a solid foundation for generating high-quality line drawing animations.

[0090] Based on any embodiment of the method in this application, before constructing the parametric curve according to the effective pixel set of the line contour in the binarized image, the method includes:

[0091] Step S5311: Search for the longest line contour in the binarized image to determine its original pixel set;

[0092] Line contours in a binarized image can be detected and extracted using various methods. One implementation uses a contour detection algorithm, such as the `findContours` function in OpenCV. This function detects all contours in a binarized image and returns a list of contours, each consisting of a series of pixels. Among these contours, the longest contour typically corresponds to the main line pattern; therefore, by comparing the lengths of the various contours, the longest contour and its corresponding original set of pixels can be determined.

[0093] For example, if the user inputs the keyword "mouse," the binarized image might contain multiple contours corresponding to black lines, with the longest contour typically corresponding to the main outline of the mouse. Using the `findContours` function, all contours can be extracted, and the longest contour can be determined by calculating the length of each contour. This longest contour will contain a series of raw pixels from the binarized image, forming the raw pixel set of the mouse's main outline.

[0094] In practical applications, there are several variations of methods for determining the longest contour. For example, the area of ​​the contour can be used instead of its length to determine the primary contour. This method may be more effective in some cases, especially when the contour has a complex shape. Furthermore, combining shape features of the contour, such as perimeter and shape factor, can more accurately identify the primary contour.

[0095] After the longest contour search is completed, the resulting raw pixel set will serve as the basis for subsequent processing. This pixel set contains all the pixels that constitute the longest line contour, providing an accurate data foundation for subsequent line path extraction and optimization. For example, for the raw pixel set of a mouse contour, these pixels will be used for subsequent traversal processing and selection of effective pixels to ensure that the generated line path is both smooth and continuous.

[0096] Step S5312: Start the traversal process with the first pixel in the original pixel set as the effective pixel. For the current pixel that is traversed, search the original pixel set for the nearest pixel whose distance from the current pixel does not exceed a preset threshold and use it as the effective pixel.

[0097] To select valid pixels from the original pixel set for defining the line path, ensuring that the generated line path is both smooth and continuous while avoiding unnecessary backtracking and breakpoints, the individual pixels in the original pixel set can be traversed.

[0098] Specifically, the first pixel in the original pixel set is selected as the starting valid pixel. This starting point can be chosen based on the assumption that the starting point of the line pattern is usually located at a certain boundary position of the image, such as the top left corner or the left side. Alternatively, since the original pixels are usually represented as an array, the first element can be used as the starting point for traversal.

[0099] Starting from this point, the traversal process proceeds step-by-step along the line outline or array. For the currently traversed pixel, the nearest pixel is first searched in the original pixel set. Then, the distance between the nearest pixel and the current pixel is used to determine whether the nearest pixel constitutes a valid pixel. Specifically, this can be determined based on a preset distance threshold; a pixel is considered valid only when the distance between the nearest pixel and the current pixel is less than or equal to this threshold.

[0100] The selection of the preset threshold is determined based on the specific characteristics and quality requirements of the line pattern. For example, if the line pattern is complex and requires finer path extraction, a smaller threshold can be set. Conversely, if the line pattern is simple and the requirement for path fineness is not high, a larger threshold can be set. This flexible threshold setting allows the method to adapt to line patterns of varying complexity, improving its versatility and adaptability.

[0101] In practical applications, determining the nearest pixel can be achieved in several ways. One approach is to use Euclidean distance to calculate the distance between two pixels. Another approach is to use Manhattan distance, which may be more efficient in some cases, especially when dealing with line patterns where pixels are distributed relatively regularly.

[0102] It should be understood that for a single execution of searching for the nearest valid pixel based on the current pixel, only one nearest pixel whose distance does not exceed the corresponding threshold will be identified as a valid pixel. Once a valid pixel is identified, there is no need to search for other valid pixels based on the current pixel, because subsequent searches will be performed sequentially based on an iterative mechanism.

[0103] Step S5313: After determining the nearest pixel that can be used as a valid pixel, use the nearest pixel as the current pixel and continue traversing.

[0104] Once a nearest pixel within a preset threshold is successfully found in step S5312 and identified as a valid pixel, it becomes the new current pixel, and the process returns to step S5312 to continue iterating. This iterative mechanism allows the processing to gradually advance along the outline of a line. For example, if the current pixel is a point on the outline of a mouse, by finding its nearest valid pixel and updating it as the new current pixel, the processing can gradually move along the outline of the mouse, thus gradually constructing a complete outline path.

[0105] In practical applications, this iterative mechanism can be implemented in several ways. One implementation uses a loop structure, executing steps S5312 and S5313 in each iteration until no more valid pixels satisfying the conditions can be found. For example, a while loop can be used, with the condition that there is a nearest pixel that meets the distance threshold. In each iteration, step S5312 is executed first to find the nearest valid pixel, then step S5313 is executed to update that point as the new current pixel, and then the next iteration continues.

[0106] Another implementation is to use a recursive approach. In this method, each time a valid pixel is found, the processing is recursively called with that pixel as the new current pixel. This approach may be more intuitive in some cases, but care must be taken regarding the recursion depth to avoid potential stack overflow issues.

[0107] Regardless of the implementation method used, the purpose of step S5313 is to ensure that the processing can proceed continuously along the line contour until the effective pixel points of the entire contour are extracted. This process not only guarantees the continuity of the line path, but also adapts the processing to changes in the shape and direction of the line contour by iteratively updating the current pixel points, thereby generating a high-quality line path.

[0108] Step S5314: Terminate the traversal process when the nearest pixel that can be used as a valid pixel cannot be determined for the current pixel, and construct a set of valid pixels from all valid pixels.

[0109] During the iterations in steps S5312 and S5313, if the current pixel fails to find the nearest pixel within a preset threshold, it indicates that the end of the line contour has been reached or that a suitable next pixel cannot be found along the contour, and the traversal process terminates. This termination condition is based on the judgment of the continuity of the line contour. When a next pixel that meets the condition cannot be found, it means that the extraction of valid pixels for the current line contour has been completed.

[0110] After terminating the traversal process, all valid pixels identified during the iteration are collected to form a valid pixel set. This valid pixel set contains all valid pixels that constitute the contour of the longest line, and these pixels are the basic data for constructing the parametric curve.

[0111] In practical applications, the set of valid pixels can be constructed using a list or array to store all valid pixels. In each iteration, newly identified valid pixels are added to this list or array. When the termination condition is met, this list or array contains all valid pixels and can be directly used for subsequent processing.

[0112] After completing the above iterative process, the resulting set of valid pixels will completely represent the line outline, providing an accurate data foundation for subsequent parametric curve construction and animation generation. For example, for the valid set of pixels for the mouse outline, these points will be used to construct a smooth mouse outline curve, and then used to generate a line drawing animation of the mouse outline.

[0113] Through the above embodiments, this application effectively solves several technical problems encountered in extracting line paths from binarized images and achieves unique technical advantages. First, by searching for the longest line contour and determining its original pixel set, the problem of accurately identifying the main line patterns in complex binarized images is solved. This method ensures that subsequent processing can focus on the most important line contours, improving the accuracy and efficiency of line path extraction. Second, by using a traversal processing and iteration mechanism to filter out effective pixels and construct an effective pixel set, the discontinuity and backtracking problems that may occur during line path extraction are solved. This processing method not only ensures the smoothness and continuity of the line path but also adapts to line patterns of different complexities and shapes through flexible threshold settings and distance calculation methods, enhancing the versatility and adaptability of the method. Finally, the obtained effective pixel set provides a high-quality data foundation for subsequent parametric curve construction and animation generation, ensuring the efficiency and accuracy of the entire line drawing animation generation process. These steps work synergistically, not only improving the accuracy and efficiency of line path extraction but also reducing computational costs, making the entire process more efficient and economical, and providing a solid foundation for generating high-quality line drawing animations.

[0114] Based on any embodiment of the method in this application, the set of smooth pixels required to draw the line corresponding to the line path is determined by sampling the parameterized curve in its parameter space, including:

[0115] Step S5331: Determine whether the total number of pixels in the effective pixel set exceeds a preset number threshold. If it does not exceed the preset number threshold, continue iterative processing from the step of inputting the mapping control information into the preset image generation model.

[0116] The effective pixel set is the set of pixels extracted from the binarized image that can represent the outline of the line pattern. These pixels are the basic data for constructing smooth line paths. The preset number threshold is a parameter set according to specific application requirements, used to determine whether the effective pixel set is rich enough to meet the requirements for generating high-quality line paths.

[0117] In practice, the total number of pixels in the effective pixel set is first determined. If this number does not exceed a preset threshold, it indicates that the currently generated line sketch may be too simple, or important details may have been lost during the extraction process. In this case, to obtain richer and more accurate line paths, it is necessary to start from step S5200 again to regenerate the line sketch for iterative processing according to the method of this application. This re-execution of the step aims to increase the number of effective pixels by generating line sketches with more details and more complex structures by adjusting the model's input parameters or retraining the model.

[0118] For example, if the user inputs the keyword "mouse," the number of valid pixels in the resulting mouse outline after the previous steps is too small, failing to reach the preset threshold. This may mean that the generated mouse outline is too simple and cannot accurately represent the mouse's detailed features. In this case, we can return to step S5200 to regenerate a new line sketch. Alternatively, we can readjust the mapping control information, especially enriching the natural language instructions, such as adding detailed instructions describing mouse features, or adjust the parameters of the image generation model to regenerate the line sketch, hoping to obtain a richer and more accurate mouse outline.

[0119] Step S5332: When the preset quantity threshold is exceeded, determine whether the total number of pixels in the smooth pixel set obtained by sampling through the parameterized curve reaches the preset density threshold. If the preset density threshold is not reached, perform interpolation processing on the smooth pixel set according to the parameterized curve.

[0120] As revealed above, the smooth pixel set is a collection of pixels obtained through parametric curve sampling. These points are used to draw the lines corresponding to the line path and need to be dense enough to ensure the smoothness of the lines. The preset density threshold is a parameter set according to specific application requirements, used to determine whether the smooth pixel set is dense enough to meet the requirements for generating high-quality line paths.

[0121] In practice, when the total number of pixels in the effective pixel set exceeds a preset threshold, it indicates that the currently generated line sketch already possesses sufficient detail and complexity. At this point, it's necessary to further determine whether the total number of pixels in the smooth pixel set reaches a preset density threshold. If it doesn't, it means the current smooth pixel set may be too sparse to generate sufficiently smooth lines. To address this issue, interpolation processing of the smooth pixel set is required based on a parametric curve.

[0122] Interpolation can be implemented in several ways. One approach is to use linear interpolation. In linear interpolation, the pixels between two adjacent sampling points are generated through linear interpolation. For example, if there are two sampling points A and B, the pixels between A and B can be generated through linear interpolation. This method is simple, computationally efficient, and suitable for most situations.

[0123] Another approach is to use higher-order interpolation methods, such as B-spline interpolation or Bézier interpolation. These methods generate smoother line paths and capture the curve's features better. For example, for a parametric curve containing a mouse pattern, B-spline interpolation can be used to generate a smooth mouse outline curve. This method produces smoother line paths and captures the curve's features better.

[0124] In practical applications, the choice of interpolation method depends on the specific characteristics and quality requirements of the line path. If the line path is relatively simple, linear interpolation may be sufficient. However, if the line path is more complex, higher-order interpolation methods can more effectively generate smooth line paths.

[0125] After interpolation, the resulting set of smooth pixels will be denser, ensuring that the generated line paths are both smooth and continuous. These pixels are not only smooth but also accurately represent the shape of the line outline, providing an accurate foundation for subsequent animation generation.

[0126] Through the above embodiments, this application effectively solves the problem of insufficient pixel density when generating high-quality line paths, ensuring that the generated lines are both smooth and continuous. Specifically, it first determines whether the number of effective pixels exceeds a preset threshold, ensuring that the generated line sketch has sufficient detail and complexity. If the threshold is not met, the line sketch is regenerated to provide a technical solution and meet user needs. When the threshold is met, it further ensures that the density of the smooth pixel set meets the preset density threshold. If the threshold is not met, interpolation is used to increase the density of the smooth pixel set, thereby improving the smoothness and visual quality of the line path. This dual-check and adjustment mechanism not only improves the smoothness and continuity of the line path but also enhances the efficiency and reliability of the entire line drawing animation generation process, providing a solid foundation for generating high-quality line drawing animations.

[0127] Based on any embodiment of the method in this application, a routing state frame is generated for each routing position corresponding to multiple routing positions in the routing direction of the line path for playing and displaying the line drawing animation, including:

[0128] Step S5410: Determine the line scaling ratio based on the size range covered by the set of smooth pixels required to draw the line path corresponding to the canvas size specification.

[0129] Determining the line scaling ratio is crucial to ensure that the generated line drawing animation adapts to different display environments. The line scaling ratio can be determined based on the canvas size and the size range covered by the smooth pixel set used to draw the line path.

[0130] Specifically, the canvas size refers to the actual dimensions of the canvas used to display line art animation. This size can be a preset, fixed size or a size that dynamically adjusts based on the resolution of the display device. For example, if the line art animation will be displayed within a specific ambient lighting fixture, the canvas size will be determined based on the resolution of that fixture. This flexibility allows line art animation to adapt to a variety of display environments, from the small screens of mobile devices to large display screens.

[0131] The size range covered by the smoothed pixel set refers to the area occupied by all smoothed pixels according to their pixel coordinates determined by the reference binarized image and the line sketch when generating the line path. This size range reflects the actual size of the line pattern in the original generation environment.

[0132] In practical applications, a suitable scaling ratio can be calculated by comparing the canvas's dimensions with the size range of the smoothed pixel set. Specifically, the scaling ratios for width and height can be calculated separately, and the smaller ratio can be selected as the final line scaling ratio to ensure that the line pattern does not exceed the boundaries on the canvas. For example, if the canvas width is 1000 pixels and the height is 800 pixels, while the maximum width of the smoothed pixel set is 400*400 pixels, then the width scaling ratio is 2.5 (1000 / 500), and the height scaling ratio is 2 (800 / 400). In this case, 2 can be chosen as the line scaling ratio. That is, one pixel in the smoothed pixel set maps to 2*2, or 4 pixels, on the canvas. In this way, it can be ensured that the generated line pattern fits well on the canvas while maintaining the smoothness and visual quality of the lines.

[0133] Step S5420: Determine each step position in the preset animation playback range according to the preset step value, determine the line direction with any end of the line path as the starting point, and map each step position to the line path to determine multiple line positions accordingly.

[0134] The preset animation playback range refers to the total range of the line drawing animation from start to finish, usually expressed as a percentage, such as from 0% to 100%. The preset step value refers to the distance the line drawing animation advances with each step during playback. This value can be set based on the total length of the line drawing animation and the desired smoothness. For example, if the total length of the animation is 100% units, and you want the line drawing animation to have 50 frames, then the step value can be set to 2% units. This setting method can be adjusted according to different animation needs; for example, if a smoother animation effect is required, the number of frames can be increased, thereby decreasing the step value.

[0135] After determining the step value and animation playback range, you can start from any end of the line path and determine the direction of the line. The choice of the line direction can be determined based on the start and end points of the line path; typically, one end of the line path is chosen as the start point, and the other end as the end point. Then, determine the various step positions within the animation playback range based on the step value. For example, if the step value is 2% and the animation playback range is 100%, you can determine 50 step positions, each corresponding to 2% of the animation playback range.

[0136] Because the smoothed pixel set itself has coordinate positions derived from the image coordinate system of the line sketch and the binarized image, and is represented by a serialized structure such as an array or list, these step positions can be mapped to specific pixels in the smoothed pixel set. Taking array representation as an example, each of the 50 step positions corresponds to a specific element, and each element is a pixel, which can be considered the corresponding step position. For instance, if the smoothed pixel set is an array containing 1000 pixels with a step value of 2%, then each step position can correspond to a pixel in the array, thus determining the trace position.

[0137] In practical applications, there are several variations of methods for determining step positions. For example, an equal-interval method can be used, where the distance between each step position is equal. This method is simple, computationally efficient, and suitable for most situations. Another method is to dynamically adjust the step positions based on the curvature or other characteristics of the line path, such as increasing the density of step positions in the curved sections of a curve and decreasing the density in straight sections. This method can more effectively capture the details of the line path, allowing the line drawing animation to demonstrate the varying pressure and speed of the brushstrokes during a single line drawing, thereby improving the visual quality of the animation.

[0138] Step S5430: Create a routing state frame for each current step position, extract all pixels from the starting point to the current step position from the smooth pixel set, and map all pixels to the corresponding routing state frame of the current step position according to the drawing scaling ratio.

[0139] To generate line drawing animation, it is necessary to construct individual image frames, or line drawing state frames, within the animation. Each line drawing state frame reflects the line drawing state from the starting point of the line path to its corresponding step position. Accordingly, each step position can be used as the current step position, and a corresponding line drawing state frame can be created for each current step position.

[0140] To create each trace status frame, a blank image needs to be created according to a preset size specification. This blank image will serve as the canvas for drawing the lines, and its background is usually set to white or another color with high contrast to the line color in order to clearly show the line drawing process.

[0141] Next, all pixels from the starting point to the current step position corresponding to this line-drawing state frame are extracted from the smooth pixel set. These pixels are obtained by mapping the step position to the smooth pixel set. As revealed earlier, the smooth pixels are ordered by array or list. Therefore, the pixels closest to the starting point are directly selected according to the total step ratio corresponding to the step position, which is all the pixels needed to draw the line in the current line-drawing state frame. For example, if there are a total of 100 pixels, and the current step position corresponds to 20% of the total step ratio, then the top 20 pixels by index are extracted from the smooth pixel set. As the step position increases, the number of extracted pixels gradually increases, causing the line to gradually extend in the animation, creating a dynamic drawing effect.

[0142] After extracting the corresponding pixels, these pixels are mapped and drawn onto the corresponding trace state frame at the current step position according to the line scaling ratio. Specifically, since the pixels in the smooth pixel set are represented by the original coordinates of the associated line sketch and the binarized image, the corresponding pixels in the canvas can be determined based on the line scaling ratio and these original coordinates. Filling these pixels with the target color completes the drawing of a pixel from the smooth pixel set onto the canvas.

[0143] When drawing lines, it's typically set to not connect the beginning and end points, meaning the line's start and end points don't form a closed path. This more naturally simulates the process of drawing a single stroke. Lines are drawn based on a smooth pixel set, meaning lines are drawn on a blank image based on the coordinates of extracted pixels. As the stepping progress increases, the line gradually extends in the preceding and following line-drawing state frames until the complete path is displayed.

[0144] Step S5440: Synthesize each of the routing state frames in an orderly manner according to the routing direction to construct the line drawing animation.

[0145] The direction of the lines determines the order in which the lines extend in the animation. In the previous steps, corresponding line state frames have been created for each step position. These frames contain the line drawing state from the starting point of the line path to each current step position. To construct the line drawing animation, these line state frames need to be arranged and composited according to the order of the line direction.

[0146] Specifically, the various trace status frames are organized according to the time sequence of the lines, forming a continuous image sequence. For example, if the trace direction is from left to right, the trace status frames are arranged in a left-to-right order to create a continuous animation. This method is simple, computationally efficient, and suitable for most situations.

[0147] Once the compositing is complete, the resulting line drawing animation will showcase the dynamic drawing process of lines from their starting point to their ending point. This animation can be saved as a video file or played directly on a display device. For example, if the line drawing animation is displayed within an ambient light fixture, the composited animation can be sent to the fixture's controller, and the animation effect can be displayed through the fixture's LED layout.

[0148] Through the above embodiments, this application effectively solves the problem of adapting line drawing animations to different display environments and ensures the smoothness and visual quality of the animation. By determining the line scaling ratio, this application ensures that the generated line drawing animation can adapt to display environments of various sizes, thereby improving the versatility and flexibility of the animation. This considers not only the actual size of the canvas but also the size range of the smooth pixel set. By calculating an appropriate scaling ratio, it ensures that the line pattern maintains a good visual effect on canvases of different sizes. Furthermore, by determining the line position through preset step values ​​and animation playback range, the playback progress of the animation and the line drawing process can be precisely controlled, thereby improving the smoothness and visual coherence of the animation. This method allows the step value to be adjusted according to different animation needs, thereby achieving more refined animation control. Then, a line state frame is created for each step position, and pixels are mapped and drawn into the corresponding frame according to the line scaling ratio, further ensuring the visual quality of the animation. It not only considers the smoothness of the lines but also improves the visual clarity of the lines through an appropriate scaling ratio. Finally, by orderly synthesizing each trace state frame to construct the line drawing animation, the transformation from static image to dynamic animation is realized, providing users with a more vivid and intuitive visual experience. This not only improves the visual effect of the animation, but also adapts to different display needs through flexible synthesis methods.

[0149] As can be seen, the synergistic effect of the steps in the above embodiments not only improves the adaptability and visual quality of the line drawing animation, but also enhances the smoothness and coherence of the animation through precise control and synthesis methods, providing a solid foundation for generating high-quality line drawing animations.

[0150] Based on any embodiment of the method in this application, acquiring cartographic material data and converting the cartographic material data into cartographic control information includes:

[0151] Step S5110: Obtain the image description and / or image file input by the user based on the graphical user interface, as graphic material data;

[0152] The graphical user interface (GUI) acquires user-input image descriptions, image files, or a combination thereof to form cartographic material data, which can be used to generate cartographic control information. The data submitted by the user depends on the data modality that the image generation model used in this application can process.

[0153] Specifically, users can upload image files through a graphical user interface. These files can be in any common image format, such as JPEG or PNG. These image files can contain patterns or designs from which the user wants to generate line-drawing animations. For example, if a user wants to generate a line-drawing animation of a "mouse," they can upload an image of a mouse as the graphic source data. Furthermore, users can input image descriptions, which can be simple keywords such as "mouse" or more detailed descriptions such as "a running mouse." These descriptions will serve as the basis for subsequent generation of natural language instructions.

[0154] In practical applications, graphical user interfaces (GUIs) can be designed to be highly flexible to adapt to different user needs. For example, the interface can provide an upload button, allowing users to select image files from their local computers. It can also include a text box where users can enter a description of the image. To enhance the user experience, the GUI can also offer a real-time preview function, allowing users to see a preview of the image immediately after uploading.

[0155] In addition, the graphical user interface offers advanced features such as image editing tools, allowing users to crop, resize, or apply filters to images before uploading. These tools help users optimize graphic source data, thereby improving the quality of the final line drawing animation.

[0156] Step S5120: Obtain natural language instructions for drawing line patterns corresponding to the drawing material data;

[0157] Furthermore, it can adapt to the data processing capabilities of the image generation model used in this application, converting the user-input image description and / or image file into natural language instructions that can guide the image generation model to generate specific line patterns. These natural language instructions provide the image generation model with a clear generation goal.

[0158] Specifically, natural language commands can be acquired in several ways. One approach is to directly extract keywords or phrases from the image description entered by the user. For example, if the user enters "a running mouse," the word "mouse" can be extracted, and then pre-defined prefix or suffix text can be inserted to generate a more specific command, such as "generate a one-stroke line drawing of a mouse." This method is simple and direct, and suitable for situations where the user input is relatively clear and specific.

[0159] Another approach involves using image recognition technology, such as graph-to-text (Graph-to-Text) models, to extract key information from user-uploaded image files and convert it into natural language instructions. For example, if a user uploads a picture of a mouse, a graph-to-text model can identify the main object in the image, "mouse," and generate a corresponding natural language instruction, such as "generate a one-stroke line drawing of a mouse." This method can process user-uploaded image files even if the user does not provide a detailed image description.

[0160] In practical applications, more accurate natural language instructions can be generated by combining user-inputted image descriptions and image files. For example, if a user uploads both a picture of a mouse and the description "mouse," this information can be combined to generate a more specific instruction, such as "Referring to the style of the uploaded image, generate a one-stroke line drawing of a mouse." This comprehensive approach fully utilizes all the information provided by the user, improving the accuracy and artistic quality of the generated line drawings.

[0161] Step S5130: Integrate the mapping material data and the natural language instructions into mapping control information.

[0162] It is necessary to integrate cartographic material data and natural language instructions into a unified cartographic control information system. This can be achieved in several ways. One approach is to attach the natural language instructions as metadata to the cartographic material data. Another approach is to create a data structure that stores the cartographic material data and natural language instructions as separate fields. For example, a JSON object could be created containing the path to the image file, the description entered by the user, and the generated natural language instructions. This method offers greater flexibility and scalability, suitable for complex cartographic needs.

[0163] In practical applications, when integrating cartographic data and natural language commands, data format and compatibility must also be considered. For example, if the image generation model requires input data in a specific format, it is necessary to ensure that the cartographic control information conforms to that format requirement. Furthermore, data security and privacy must be considered, especially when processing user-uploaded image files.

[0164] After fusion, the resulting cartographic control information serves as input to the image generation model, used to generate specific line patterns. This process not only improves the accuracy and artistic quality of the generated line patterns but also ensures that the generated results meet the user's expectations by integrating all user-provided information. For example, if a user uploads a picture of a mouse and enters the description "mouse," the fused cartographic control information will guide the image generation model to generate a one-stroke line pattern of a mouse, while also referencing the style of the user-uploaded image.

[0165] Through the above embodiments, this application can effectively adapt to user needs, process data from different modalities, and integrate user-generated drawing materials and natural language commands from various modalities into drawing control information to guide the corresponding image generation model to output qualified line sketches. By integrating all user-provided information into a unified input, not only is the accuracy and artistic quality of the generated line patterns improved, but the generated results are also ensured to fully meet user expectations. This flexible processing and integration capability of data from different modalities enables this application to adapt to various user needs, enhance user experience, and, for application scenarios such as ambient lighting, better meet the actual needs of the target users of these ambient lighting fixtures.

[0166] Based on any embodiment of the method in this application, after generating a routing state frame for each routing position corresponding to multiple routing positions in the routing direction of the line path for playing and displaying the line drawing animation, the method includes:

[0167] Step S6100: Obtain the LED layout information of the ambient lighting fixture, and create a corresponding LED layout interface in a two-dimensional plane based on the LED layout information.

[0168] To achieve the goal of outputting the generated line drawing animation to the ambient lighting fixture for playback, it is first necessary to obtain the LED layout information of the ambient lighting fixture and create a corresponding LED layout interface in a two-dimensional plane based on this information, so as to ensure that the line drawing animation can be accurately mapped onto the physical structure of the ambient lighting fixture.

[0169] Specifically, LED layout information refers to the descriptive information about the arrangement and position of the LEDs inside the ambient lighting fixture. This information is usually provided by the lighting fixture manufacturer and pre-written into the fixture's memory, and can be obtained by communicating with the fixture's controller. The LED layout information can be represented as a two-dimensional coordinate array of the LEDs, or a more complex layout diagram. By obtaining this information, a two-dimensional interface model corresponding to the actual LED layout of the ambient lighting fixture can be created. This model will serve as the basis for subsequent wiring status frame mapping.

[0170] In practical applications, the interface can be constructed directly using a two-dimensional coordinate array of the LED beads. For example, if the LED beads are arranged in a matrix, these coordinate points can be drawn directly on a two-dimensional plane to form a grid-like layout interface.

[0171] After creating the LED layout interface, you can map the routing status frame onto this interface. This process involves mapping the position of each pixel in the routing status frame to the LED in the LED layout interface. In this way, you can ensure that each pixel in the line drawing animation accurately corresponds to one or more LEDs in the ambient lighting fixture, thereby achieving precise lighting control.

[0172] Step S6200: Scale each trace status frame to correspond to the LED layout interface, and determine the planar position mapping relationship between each pixel in the trace status frame and the LED in the LED layout interface.

[0173] The wiring status frame is an image frame describing the state of line drawing, while the LED layout interface is a two-dimensional model created based on the arrangement of LEDs in the ambient lighting fixture. To accurately map the line patterns from the wiring status frame onto the LED layout interface, appropriate scaling is required. The purpose of scaling is to match the size of the wiring status frame with the size of the LED layout interface, thereby ensuring that the line patterns fit the actual physical structure of the lighting fixture.

[0174] In practical applications, a simple scaling method can be used. This method scales the routing status frame according to the ratio between the size of the LED layout interface and the size of the routing status frame. For example, if the width of the LED layout interface is 100 LEDs and the height is 50 LEDs, while the width of the routing status frame is 200 pixels and the height is 100 pixels, then the width and height of the routing status frame can be reduced to half of their original size to fit the size of the LED layout interface.

[0175] After scaling, it's necessary to determine the planar position mapping between each pixel in the trace status frame and the LEDs in the LED layout interface. This can be achieved by matching the pixel coordinates in the scaled trace status frame with the LED coordinates in the LED layout interface. For example, if the LEDs in the LED layout interface are arranged in a matrix, the pixel coordinates in the trace status frame can be directly mapped to the corresponding LED coordinates. Thus, the planar position mapping relationship—which LEDs correspond to which pixel—is determined.

[0176] Step S6300: By referring to the planar position mapping relationship, determine the color value of the corresponding LED in the LED layout interface according to the color value of each pixel in the wiring status frame, and generate the light emission control parameters of the LED layout interface corresponding to the wiring status frame.

[0177] Each pixel in the trace status frame has a color value, such as black. These color values ​​need to be converted to the color values ​​of the LEDs, or modified to predetermined color values ​​to enrich the visual effect. This requires referring to the previously determined planar position mapping relationship. The planar position mapping relationship refers to the correspondence between the pixels in the trace status frame and the LEDs in the LED layout interface. Through this mapping relationship, the specific LED corresponding to each pixel can be determined, and the pixel's color value can be applied to the corresponding LED.

[0178] After determining the color value corresponding to each LED in each trace status frame, the corresponding light emission control parameters for each trace status frame can be generated. In practical applications, the generation of light emission control parameters can be achieved in several ways. One implementation method is to directly use the color value of the pixel as the color value of the LED. For example, if a pixel in a trace status frame is red, then the corresponding LED will also be set to red. This method is simple and direct and applicable to most cases.

[0179] Another approach is to adjust the color values ​​of the pixels, taking into account the actual light-emitting characteristics of the LEDs. For example, if the maximum brightness of the LEDs is limited, it may be necessary to adjust the brightness of the pixel color values ​​to ensure that the LEDs can accurately display the expected colors. This method can improve the accuracy and visual quality of the lighting effects.

[0180] Step S6400: Construct the light emission control parameters of each wiring status frame into a lighting effect playback command in the original order, and send it to the ambient light fixture to control it to play the corresponding line drawing animation.

[0181] The generated luminance control parameters are constructed into lighting effect playback instructions according to the original order of the line drawing direction, and then sent to the ambient lighting fixtures to control them to play the corresponding line drawing animation. Specifically, the line drawing direction refers to the direction in which the line path is drawn, which determines the extension order of the lines in the animation. In the previous steps, corresponding luminance control parameters have been generated for each line drawing state frame. These parameters contain the color value of each LED. To construct the lighting effect playback instructions, these luminance control parameters need to be arranged according to the order of the line drawing direction, that is, the luminance control parameters are organized according to the order of each line drawing state frame in its line drawing animation, forming a continuous instruction sequence, which constitutes the lighting effect playback instructions.

[0182] After constructing the lighting effect playback command, it is sent to the ambient lighting fixture. This can be done via wired or wireless communication technology. For example, Bluetooth, Wi-Fi, or a wired network can be used to send the command to the ambient lighting fixture's controller. Upon receiving the command, the controller will control the lamps of the fixture to emit light, thereby playing the corresponding line drawing animation.

[0183] During playback, the ambient lighting controller sequentially controls the color and brightness of each LED according to the corresponding illumination control parameters of each line state frame in the lighting effect playback command, thereby achieving a dynamic display of the line drawing animation. For example, if the line drawing animation is the outline of a mouse, the controller will control the LEDs to light up sequentially according to the command, forming a dynamic drawing effect of the mouse outline. This process not only improves the visual effect of the animation but also ensures the continuity and smoothness of the animation through precise lighting control.

[0184] Through the above embodiments, this application can effectively map the generated line drawing animation onto ambient lighting fixtures for playback, thereby achieving a dynamic lighting display effect. By acquiring the LED layout information of the ambient lighting fixtures and creating a corresponding LED layout interface, it ensures that the line drawing animation can accurately adapt to the physical structure of the lighting fixtures. Furthermore, by scaling the line drawing state frame to the LED layout interface and determining the mapping relationship between pixels and LEDs, a precise conversion from image frames to lighting control is achieved. In addition, by converting the color values ​​of pixels to LED color values ​​according to the planar position mapping relationship and generating luminous control parameters, the accuracy and visual quality of the lighting effect are further ensured. Finally, by constructing the luminous control parameters into a lighting effect playback command and sending it to the ambient lighting fixtures, the dynamic display of the line drawing animation is realized, providing users with a vivid and smooth visual experience. This series of steps not only improves the visual effect of the animation but also ensures the coherence and smoothness of the animation through precise lighting control, thus providing a solid foundation for generating high-quality line drawing animations.

[0185] Please see Figure 4 This invention provides a line drawing animation display device to meet one of the purposes of this application. It is a functional embodiment of the line drawing animation display method of this application. The device includes a control setting module 5100, a sketch generation module 5200, a path determination module 5300, and a status frame generation module 5400. The control setting module 5100 is configured to acquire drawing material data and convert the drawing material data into drawing control information, wherein the drawing control information includes natural language instructions to draw line patterns. The sketch generation module 5200 is configured to input the drawing control information into a preset image generation model, and the image generation model generates a line sketch containing line patterns according to the natural language instructions. The path determination module 5300 is configured to determine the corresponding line path based on the line patterns in the line sketch. The status frame generation module 5400 is configured to sequentially generate a line status frame for each line position corresponding to multiple line positions in the line path direction for playing and displaying the line drawing animation. Each line status frame includes lines drawn from the starting point of the line path to the corresponding line position.

[0186] Based on any embodiment of the apparatus in this application, the path determination module 5300 includes: an image conversion module configured to convert the line sketch into a binary image to highlight the line outline of the line pattern; a path definition module configured to construct a parametric curve based on the effective pixel set of the line outline in the binary image to define the corresponding line path; and a pixel sampling module configured to sample in its parameter space based on the parametric curve to determine the set of smooth pixels required to draw the line corresponding to the line path.

[0187] Based on any embodiment of the device in this application, prior to the path definition module, the path determination module 5300 further includes: a contour search module, configured to search for the longest line contour in the binarized image to determine its original pixel set; a pixel selection module, configured to start traversal processing with the first pixel in the original pixel set as the effective pixel, and for the current pixel being traversed, search for the nearest pixel in the original pixel set whose distance from the current pixel does not exceed a preset threshold as the effective pixel; an iterative traversal module, configured to, after the current pixel has determined the nearest pixel that can be used as the effective pixel, use the nearest pixel as the current pixel and continue traversal processing; and a termination processing module, configured to terminate the traversal processing when the current pixel has failed to determine the nearest pixel that can be used as the effective pixel, and construct all effective pixels into an effective pixel set.

[0188] Based on any embodiment of the device in this application, the pixel sampling module includes: an exception handling module, configured to determine whether the total number of pixels in the effective pixel set exceeds a preset number threshold, and if it does not exceed the preset number threshold, to rerun the blueprint generation module to continue iterative processing; and an interpolation processing module, configured to determine whether the total number of pixels in the smooth pixel set obtained by sampling through the parametric curve reaches a preset density threshold if the preset number threshold is exceeded, and if it does not reach the preset density threshold, to perform interpolation processing on the smooth pixel set according to the parametric curve.

[0189] Based on any embodiment of the device in this application, the state frame generation module 5400 is configured to include: a scale determination module, configured to determine the line scaling ratio according to the size specifications of the canvas and the size range covered by the set of smooth pixels required to draw the line path; a mapping and positioning module, configured to determine each step position in a preset animation playback range according to a preset step value, determine the line direction with any end of the line path as the starting point, and map each step position onto the line path to determine multiple line positions; a state frame drawing module, configured to create a line state frame for each current step position, extract all pixels from the smooth pixel set from the starting point to the current step position, and map all pixels to the corresponding line state frame of the current step position according to the line scaling ratio; and an animation construction module, configured to synthesize each line state frame in an orderly manner according to the line direction to construct a line drawing animation.

[0190] Based on any embodiment of the device in this application, the control setting module 5100 includes: a material acquisition module, configured to acquire image descriptions and / or image files input by the user based on a graphical user interface, as drawing material data; an instruction improvement module, configured to acquire natural language instructions for instructing the drawing of line patterns corresponding to the drawing material data; and an information fusion module, configured to fuse the drawing material data and the natural language instructions into drawing control information.

[0191] Based on any embodiment of the device in this application, following the state frame generation module 5400, the device further includes: a layout creation module, configured to acquire the LED layout information of the ambient lighting fixture, and create a corresponding LED layout interface in a two-dimensional plane according to the LED layout information; a position mapping module, configured to scale each routing state frame to correspond to the LED layout interface, and determine the planar position mapping relationship between each pixel in the routing state frame and the LEDs in the LED layout interface; a parameter generation module, configured to determine the color value of the corresponding LED in the LED layout interface according to the color value of each pixel in the routing state frame by referring to the planar position mapping relationship, and generate the light emission control parameters of the LED layout interface corresponding to the routing state frame; and a playback control module, configured to construct the light emission control parameters of each routing state frame into a lighting effect playback command in the original order, send it to the ambient lighting fixture, and control it to play the corresponding line drawing animation.

[0192] To address the aforementioned technical problems, embodiments of this application also provide computer equipment. For example... Figure 5The diagram shows 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. The computer-readable storage medium stores an operating system, a database, and computer-readable instructions. The database may store a sequence of control information. When the computer-readable instructions are executed by the processor, the processor can implement a line-drawing animation display method. The processor of the computer device provides computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the line-drawing animation display method of this application. The network interface of the computer device is used for communication with a terminal. Those skilled in the art will understand that… Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0193] In this embodiment, the processor is used to execute... Figure 4 The system contains the specific functions of each module and its sub-modules, and the memory stores the program code and various data required to execute these modules or sub-modules. The network interface is used for data transmission between the user terminal and the server. In this embodiment, the memory stores the program code and data required to execute all modules / sub-modules in the line drawing animation display device of this application, and the server can call the server's program code and data to execute the functions of all sub-modules.

[0194] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the line drawing animation display method of any embodiment of this application.

[0195] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0196] Those skilled in the art will understand that the steps, measures, and solutions in the various operations, methods, and processes discussed in this application can be alternated, modified, combined, or deleted. Furthermore, other steps, measures, and solutions in the various operations, methods, and processes discussed in this application can also be alternated, modified, rearranged, decomposed, combined, or deleted. Furthermore, steps, measures, and solutions in the prior art that are similar to those in the open-source operations, methods, and processes of this application can also be alternated, modified, rearranged, decomposed, combined, or deleted.

[0197] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

[0198] In summary, this application automates the entire process from acquiring graphic material data to generating line drawing animations, achieving efficient and high-quality line pattern generation and animation display. It effectively solves the problems existing in traditional technologies and provides a new solution for the application of image generation technology in fields such as artistic creation, multimedia display, and smart hardware interaction.

Claims

1. A method for displaying line drawing animation, characterized in that, include: Acquire cartographic material data and convert the cartographic material data into cartographic control information, wherein the cartographic control information includes natural language instructions for drawing line patterns; The mapping control information is input into a preset image generation model, which then generates a line sketch containing line patterns according to the natural language instructions. Determining the corresponding line path based on the line pattern in the line sketch includes: converting the line sketch into a binary image to highlight the line outline of the line pattern; constructing a parametric curve based on the effective pixel set of the line outline in the binary image to define the corresponding line path; and sampling the parametric curve in its parameter space to determine the set of smooth pixels required to draw the line corresponding to the line path. For multiple line positions along the line path, a line state frame is sequentially generated for each line position to play and display the line drawing animation. Each line state frame contains lines drawn from the starting point of the line path to the corresponding line position. This includes: determining the line scaling ratio based on the canvas size and the size range covered by the smooth pixel set required to draw the lines corresponding to the line path; determining each step position in the preset animation playback range based on a preset step value, determining the line direction with any end of the line path as the starting point, and mapping each step position onto the line path to determine multiple line positions; creating a line state frame for each current step position, extracting all pixels from the smooth pixel set from the starting point to the current step position, and mapping all pixels to the corresponding line state frame for the current step position according to the line scaling ratio; and synthesizing each line state frame in an orderly manner according to the line direction to construct the line drawing animation.

2. The line drawing animation display method according to claim 1, characterized in that, Before constructing the parametric curve based on the effective pixel set of the line contour in the binarized image, the following steps are included: The longest line contour is searched from the binarized image to determine its original pixel set; The traversal process begins with the first pixel in the original pixel set as the valid pixel. For the current pixel that has been traversed, the nearest pixel in the original pixel set whose distance from the current pixel does not exceed a preset threshold is searched and selected as the valid pixel. After determining the nearest valid pixel for the current pixel, use that nearest pixel as the current pixel and continue traversing and processing. The traversal process terminates when the nearest valid pixel cannot be determined for the current pixel, and all valid pixels are constructed into a set of valid pixels.

3. The line drawing animation display method according to claim 1, characterized in that, Based on sampling the parametric curve in its parameter space, the set of smooth pixels required to draw the line corresponding to the line path is determined, including: Determine whether the total number of pixels in the effective pixel set exceeds a preset threshold. If it does not exceed the preset threshold, continue iterative processing from the step of inputting the mapping control information into the preset image generation model. When the preset number threshold is exceeded, it is determined whether the total number of pixels in the smooth pixel set obtained by sampling through the parameterized curve reaches the preset density threshold. If the preset density threshold is not reached, the smooth pixel set is interpolated according to the parameterized curve.

4. The line drawing animation display method according to any one of claims 1 to 3, characterized in that, Acquire cartographic material data and convert the cartographic material data into cartographic control information, including: Based on the graphical user interface, image descriptions and / or image files input by the user are obtained as graphic material data; The corresponding graphic material data is used to obtain natural language instructions for drawing line patterns; The mapping material data and the natural language instructions are integrated into mapping control information.

5. The line drawing animation display method according to any one of claims 1 to 3, characterized in that, For multiple routing positions corresponding to the routing direction of the line path, a routing state frame is generated for each routing position to be played and displayed after the line drawing animation is shown, including: Obtain the LED layout information of the ambient lighting fixture, and create the corresponding LED layout interface in a two-dimensional plane based on the LED layout information; Each trace status frame is scaled and mapped to the LED layout interface to determine the planar position mapping relationship between each pixel in the trace status frame and the LED in the LED layout interface. Based on the planar position mapping relationship, the color value of the corresponding LED in the LED layout interface is determined according to the color value of each pixel in the wiring status frame, and the light emission control parameters of the LED layout interface corresponding to the wiring status frame are generated. The illumination control parameters of each trace status frame are constructed into lighting effect playback instructions in the original order and sent to the ambient light fixture to control it to play the corresponding line drawing animation.

6. A line drawing animation display device, characterized in that, include: The control setting module is configured to acquire drawing material data and convert the drawing material data into drawing control information, wherein the drawing control information includes natural language instructions for drawing line patterns; The sketch generation module is configured to input the drawing control information into a preset image generation model, and the image generation model generates a line sketch containing line patterns according to the natural language instructions. The path determination module is configured to determine the corresponding line path based on the line pattern in the line sketch, including: converting the line sketch into a binary image to highlight the line outline of the line pattern; constructing a parametric curve based on the effective pixel set of the line outline in the binary image to define the corresponding line path; and sampling in its parameter space based on the parametric curve to determine the set of smooth pixels required to draw the line corresponding to the line path. The state frame generation module is configured to generate multiple line positions corresponding to the line path along the line direction. It sequentially generates a line state frame for each line position to display the line drawing animation. Each line state frame contains lines drawn from the starting point of the line path to the corresponding line position. This includes: determining the line scaling ratio based on the canvas size and the size range covered by the smooth pixel set required to draw the lines corresponding to the line path; determining each step position within a preset animation playback range based on a preset step value; determining the line direction with any end of the line path as the starting point; mapping each step position onto the line path to determine multiple corresponding line positions; creating a line state frame for each current step position; extracting all pixels from the smooth pixel set from the starting point to the current step position; mapping all pixels onto the corresponding line state frame for the current step position according to the line scaling ratio; and sequentially synthesizing the line state frames according to the line direction to construct the line drawing animation.

7. The line drawing animation display device according to claim 6, characterized in that, The path determination module also includes: The contour search module is configured to search for the longest line contour in the binarized image and determine its original pixel set. The pixel selection module is configured to start traversing the original pixel set as the first effective pixel. For the current pixel that is traversed, the nearest pixel in the original pixel set whose distance from the current pixel does not exceed a preset threshold is searched as the effective pixel. The iterative traversal module is configured to, after determining the nearest valid pixel for the current pixel, use that nearest pixel as the current pixel and continue traversing. The end processing module is set to terminate the traversal process when the nearest pixel that can be used as a valid pixel cannot be determined for the current pixel, and construct a set of valid pixels from all valid pixels.

8. The line drawing animation display device according to claim 6 or 7, characterized in that, The control setting module includes: The material acquisition module is configured to acquire image descriptions and / or image files input by the user based on the graphical user interface, as graphic material data; The instruction improvement module is configured to obtain natural language instructions for drawing line patterns based on the corresponding graphic material data; The information fusion module is configured to integrate the cartographic material data and the natural language instructions into cartographic control information.

9. A computer device comprising a processor and a memory, characterized in that, The processor invokes and runs a computer program in the memory to perform the steps of the line drawing animation display method as described in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 5, which, when invoked by a computer, executes the steps included in the corresponding method.

Citation Information

Patent Citations

  • Sketch character animation generation method and device, electronic equipment and storage medium

    CN116630496A

  • Atmosphere lamp equipment, lamp effect playing control method thereof, corresponding device and medium

    CN117412449A