A method and system for generating a cyclic animation

Through the loop animation method of automatically generating static images, the combination of masked rasters and stitched frame images is used to solve the problem of automatic loop animation effects and low manual operation efficiency in the prior art, and fully automatic digital process and efficient artistic image generation are realized.

CN113888683BActive Publication Date: 2025-04-04SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111192764.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-13
Publication Date
2025-04-04
Estimated Expiration
2041-10-13

AI Technical Summary

Technical Problem

The prior art is difficult to automatically generate artistic images that can display loop animation effects, and in large-scale frames or scenes requiring a lot of experiments, manual operation efficiency is low, and traditional multimedia screen interaction is poor.

Method used

A method of generating loop animation is adopted to automatically generate static images with loop animation effects through programming, and a combination of masked rasters and stitched frame images is used to combine mathematical models and artistic processing to achieve a fully automatic digital process.

Benefits of technology

It realizes a fully automatic process from images or cartoon clips to art generation design, improves work efficiency, and the generated images are more symbolic, artistic and experimental, breaking through the limitations of conventional linear forms, and enhancing interactivity and ornamentality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113888683B_ABST
    Figure CN113888683B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for generating a cyclic animation, which belongs to the field of image generation. The method generates an artistic image by constructing a program model, observes the spliced ​​frame image of the inner layer through the mask grid image of the outer layer, and generates a moiré cyclic animation effect based on the principle of visual residue. The pre-processed mask image and frame sequence image are input, or the key frame image is automatically extracted from the video clip or the animated image; the image processing accuracy and viewing distance are determined according to the requirements of the presentation effect, and the calculation and construction of the program mathematical model are completed; the straight stripe mask grid image is automatically generated, and the extraction and interlaced splicing of the frame sequence image content are automatically completed to generate the spliced ​​frame image of the inner layer; the present invention realizes the automatic digitalization process from image or animation clip input, to art generation design, to effect simulation and image export, and gives full play to the experimentality, efficiency and artistic expression of the digital generation art method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a system for generating a cyclic animation, and belongs to the field of image generation. Background Art

[0002] The moiré effect is a phenomenon in physics. It is common to see an irregular striped interference pattern when the spatial frequency of the pixels of the photosensitive element is close to the spatial frequency of the stripes in the image. The visual effect of moiré is further combined with the art of frame animation to produce an interactive static image with a dynamic loop effect. That is, a set of frame sequence patterns are pieced together into an image in the form of stripes. When a set of evenly spaced black grid patterns are covered and continuously slid on the image, one frame will be displayed at a certain moment and the rest of the frames will be blocked. The content of each frame will be displayed in turn, and then based on the principle of "visual residual" of the human eye, people will have the illusion of animation.

[0003] The above technology has the conditions to be further expanded and applied to more scenes, such as large-scale art landscape installations, building facades or interior decoration interfaces, etc. Its fun, symbolism and watchability can greatly increase the attractiveness, memory points and symbolic meaning of the application objects, attract more viewers to appreciate the charm of visual art while feeling the cultural atmosphere and connotation, highlighting the creativity and publicity value; on the other hand, if it is necessary to deal with large-scale paintings, or scenes that require a lot of experiments and repeated applications, the method of manually drawing effect images is inefficient and difficult to meet the use requirements, and the simple striped grille will appear monotonous and rigid, lacking artistry and expressiveness; traditional multimedia screens, water curtains or light shows have poor interaction with people, no sense of participation, and are not easy to attract the attention of mobile people. The present invention discloses a method for generating a cyclic animation. When the viewer walks back and forth in front of the image or landscape device, it can be observed that the image content therein seems to be constantly moving and changing with the movement of footsteps. A cyclic animation effect is generated based on the principle of "visual residue", which makes the viewers impressed and rich in experience through interactive participation. Summary of the invention

[0004] Technical problem: In order to automatically generate artistic images that can display looping animation effects, the present invention proposes a looping animation generation method and system. This method automatically generates static images with looping animation effects based on program design, so that the observer can move with the viewpoint while walking, and produce the illusion of animation based on the principle of "visual residual" of the human eye; it realizes a fully automatic digital process from image or animation clip input, to art generation design, to generation effect simulation and image export, eliminating a lot of manual operations; at the same time, through digital generation art methods, the image is made more symbolic, artistic and experimental, breaking through the limitations of conventional linear forms and giving full play to the potential advantages of digital technology.

[0005] Technical solution: To solve the technical problem of the present invention, the technical solution adopted by the present invention is: a method for generating a cyclic animation, the generated result is composed of an inner layer of spliced ​​frame images and an outer layer of mask grid images, comprising the following steps;

[0006] (1) Determine the mask image and frame sequence image to be processed. It supports automatically extracting key frame images from video clips or gifs, or storing the pre-processed images in a specified path for input into the program. The input file can be in the image format of jpg, png, etc., or it can be the original CAD or Rhino graphics with the pattern outline extracted. The set of N frame sequence images is recorded as P = {p1, p2, ..., p N}.

[0007] (2) Determine the image processing accuracy and viewing distance according to application requirements and presentation effects, and complete the calculation and construction of the mathematical model. The image tile length and width are denoted as l img ,w img , the unit width of the stripe grid is denoted as w barrier , then the spacing between the stripe grids is N*w barrier ; The observation distance of the human eye from the image is recorded as d view , the distance between the mask grid image and the spliced ​​frame image is recorded as d io ; The stripe width used to divide the frame content can be expressed as: w bar =(d view +d io ) / d view *w barrier , the distance required to move for one frame change can be expressed as: d step =d view / d io *w bar .

[0008] Therefore, the interval N*w is used to segment the frame sequence image and generate the spliced ​​frame image. bar , width is w bar The outer mask grid needs to expose one frame at a certain moment and block the remaining N-1 frames, so the interval should be N*w barrier , width is (N-1)*w barrier Striped grille.

[0009] (3) Based on the mathematical model described in step (2), a mask grid image is generated. Two types of mask grid generation methods are provided. The first is an application method to generate a basic straight stripe grid, and further integrates simple straight stripes into an artistic punching pattern of image interference to increase artistry and symbolism; the second is to generate a variety of mask grid patterns such as oblique, diamond, and irregular curves.

[0010] First, the application algorithm creates a flat black stripe grid image with each stripe spaced N*w apart. barrier , width is (N-1)*w barrier ; Further artistic processing is performed on the basic straight stripe grid, and the outer stripe grid is interrupted into rectangular holes (this form of hole is denoted as H bar ), integrated into the artistic punching pattern of image interference, where the background mask grayscale image used is denoted as p back The second layer of spliced ​​frame images uses the basic vertical grid segmentation and splicing mode. First, input the background image to obtain the width and height of the overall format, recorded as w back 、h back ; The spacing between the holes is equal to the distance between the stripes of the grid, that is, d hole =N*w barrier , from which the number of holes in the longitudinal direction is calculated to be l n The number of holes in the short direction is w n , the set of all holes is denoted as According to the position where the animation effect is designed, the mask grayscale image used to generate the punching image is made to present the corresponding area with a predetermined grayscale b bar , that is, at the gray value b bar A rectangular hole corresponding to the striped grid is generated at the position, and the rest of the image content interferes with the shape and size of the hole according to other grayscales to form an overall pattern effect, realizing the transition between the grid and the background image; the relationship between each hole position and its corresponding grayscale value is: ij ∈H, the index of the corresponding pixel is loc=i+j*w back , gray value is b loc , where hole type T hole With gray value b loc The mapping relationship between them can be expressed as a piecewise function. The specific functional relationship can be reset according to the generation creativity and needs in actual applications:

[0011]

[0012] The second method is to generate mask patterns in various forms, such as oblique, diamond, and irregular curves. Based on the above method, the straight stripes are replaced with other regular geometric patterns, or a stripe grid with irregular curves is generated using a noise algorithm.

[0013] (4) Corresponding to the mask grid image generated in step (3), further generate the inner frame sequence stitching image. Input the frame sequence image into the program; first update the size of each frame image according to the target generation size; then extract the interval N*w for each frame image. bar , width is w barThe image content in the stripes is staggered w between the 1st to Nth frame images. bar The images are stitched at different distances to obtain a stitched frame image that can produce a looping animation effect.

[0014] Depending on the input file format, two methods of data processing and image generation are used:

[0015] The first type is initially an image file format, such as jpg, png, etc. Create newImg to generate a stitched image; for any p x ∈P extracts the pixel values ​​in the above rectangular stripes respectively, and translates the distance (x-1)*w bar Displace and assign to newImg to generate a spliced ​​frame image.

[0016] The second type is a geometric file, such as a 3dm or dwg file. Generate a rectangular stripe outline polygon, each stripe width is w bar , the distance between them is (N-1)*w bar ; For any p x ∈P respectively performs Boolean operations with each stripe polygon, extracts the intersection as the graphic content that needs to be retained; shifts the operation results of each frame of graphics in sequence by (x-1)*w bar , arrange and generate spliced ​​frame graphics, and further Boolean operation can be performed to obtain the outer contour of the graphics, or pixels can be filled inside the graphics and converted into images for export.

[0017] (5) For the masked grid images and spliced ​​frame images generated in steps (3) and (4), the animation effects are simulated, exported, printed and displayed. After the images are exported, they are printed on materials such as film or transparent acrylic, and the dynamic effects produced by actually observing the static images are observed; the looping animation effects generated by the movement of the viewpoint when a person walks and observes are simulated in the program interface, or the dynamic effects are simulated in drawing and modeling software such as Photoshop and Sketchup. At the same time, the generated patterns are stored in polygon format and exported as graphic files, which are used for the design and construction of art installations, building facades, etc. through CNC processing methods such as laser cutting, in which the edges of the image are extracted with the help of edge detection methods to achieve the conversion from pixels to graphics.

[0018] (6) Specific implementation example: By using the above-mentioned loop animation generation method and system, a graphic file for making a landscape wall device is generated. When tourists move in front of the constructed landscape wall, they can observe the patterns of people, animals, water waves or machinery in the landscape wall constantly moving and changing. The specific steps are as follows:

[0019] ① File input: Based on application requirements and design creativity, determine the pattern elements that need to present animation effects (such as people, animals, water waves, light and shadow, etc.) and their overall background image (such as landscapes, cities or abstract patterns, etc.); input the number of frames and pre-processed mask images and frame sequence images, or automatically extract key frames from video clips or animated images.

[0020] ②Model construction: Based on the desired effect of the landscape wall installation, the expected pedestrian route location, and the precision limit of CNC machining of metal plates, the image processing accuracy and viewing distance are determined, and the mathematical model is calculated and constructed according to the contents described in step (2).

[0021] ③ Generate mask raster image and spliced ​​frame image:

[0022] Based on the mathematical model described in ②, a mask grid with straight vertical stripes is used, combined with the artistic punching pattern generation method of the first image interference in step (3), to generate a first layer of mask grid image and store it in polygon format; a mask grid interrupted in the form of rectangular holes is generated in a pre-specified area, and the content of the input mask image, such as landscape or pastoral scenery, is presented with a variety of holes corresponding to grayscale changes.

[0023] Corresponding to the mask grid of the straight vertical stripes mentioned above, the frame sequence image content is automatically extracted and interlaced, and the inner layer of the spliced ​​frame pattern is generated. The pattern outline is stored in a polygon format. The pattern content can be people or animals walking, running, dancing, farming, etc., and also includes flowing water, clouds, and some abstract patterns.

[0024] ④ Processing file output: The generated graphics are output to CNC processing equipment in the form of CAD or Rhino graphics files to produce a double-layer panel landscape wall; a hollow panel is obtained by laser cutting, and the spliced ​​frame image is sprayed on the inner side of the panel away from the observer. When people walk, they can observe the multi-frame splicing patterns on the inner side through the mask panel, and see the constantly moving and changing people, animals and environment in the background of the wall landscape or pastoral scenery.

[0025] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:

[0026] 1. The moiré loop animation effect is associated with the walking process of a person, and as the viewpoint moves, people have the illusion of animation based on the principle of "visual residual" of the human eye; a fully automatic digital process from image or animation clip input, to art generation design, to generation effect simulation and image export is realized, which saves a lot of manual operations and improves the work efficiency of image art processing;

[0027] 2. Use digital generative art methods to artistically process simple straight striped grilles, integrate them into artistic punching patterns of image interference and more expressive irregular curves, break through the limitations of conventional linear forms, and give full play to the potential flexibility, artistry and experimental nature of digital technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a flowchart of the moiré looping animation effect generative art;

[0029] Figure 2 Schematic diagram of the mathematical model of two-layer static images and observation principles;

[0030] Figure 3 Schematic diagram of the superposition effect of the punching pattern mask grid and the spliced ​​frame image;

[0031] Figure 4 Examples of outer mask raster images and inner stitched frame images;

[0032] Figure 5 Example of three frames through an irregular curved grid. DETAILED DESCRIPTION

[0033] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0034] In an embodiment of the present invention, a method for generating a loop animation is provided, such as Figure 1 As shown in Figure 1, the art generation process includes the following steps:

[0035] (1) Determine the mask image and frame sequence image to be processed. It supports automatically extracting key frame images from video clips or gifs, or storing the pre-processed images in a specified path for input into the program. The input file can be in the image format of jpg, png, etc., or it can be the original CAD or Rhino graphics with the pattern outline extracted. The set of N frame sequence images is recorded as P = {p1, p2, ..., p N}.

[0036] (2) Determine the image processing accuracy and viewing distance according to application requirements and presentation effects, and complete the calculation and construction of the mathematical model, such as Figure 2 As shown. The interval is N*w for segmenting the frame sequence image and generating the spliced ​​frame image. bar , width is w bar The outer mask grid needs to expose one frame at a certain moment and block the remaining N-1 frames, so the interval should be N*wbarrier , width is (N-1)*w barrier Striped grille.

[0037] (3) Based on the mathematical model described in step (2), a mask grid image is generated, such as Figure 3-5 Two types of mask grid generation methods are provided. The first is an application method to generate a basic straight stripe grid, and further integrates simple straight stripes into the artistic punching pattern of image interference to increase artistry and symbolism; the second is to generate rich forms of mask grid patterns such as oblique, diamond, and irregular curves.

[0038] (4) Corresponding to the mask grid image generated in step (3), further generate the inner frame sequence stitching image. Input the frame sequence image into the program; first update the size of each frame image according to the target generation size; then extract the interval N*w for each frame image. bar , width is w bar The image content in the stripes is staggered w between the 1st to Nth frame images. bar The images are stitched at different distances to obtain a stitched frame image that can produce a looping animation effect.

[0039] (5) For the masked raster image and spliced ​​frame image generated in steps (3) and (4), a looping animation effect of the generated image is simulated to complete the export, printing and display of the image.

[0040] Two layers of static images are generated in the above manner. The observer observes the spliced ​​frame image of the inner layer through the mask grid image of the outer layer while walking, and a moiré cyclic animation effect is produced based on the principle of "visual residual".

[0041] Furthermore, the relevant parameters involved in the mathematical model described in step (2) are: the image tile length and width are denoted as l img ,w img , the unit width of the stripe grid is denoted as w barrier , the spacing of the stripe grid is N*w barrier ; The observation distance of the human eye from the image is recorded as d view , the distance between the mask grid image and the spliced ​​frame image is recorded as d io ; Therefore, the stripe width used to divide the frame content can be expressed as: w bar =(d view +d io ) / d view *w barrier , the distance required to move for one frame change can be expressed as: d step =d view / d io *w bar .

[0042] Furthermore, the two types of mask grid generation methods described in step (3) are respectively:

[0043] First, the application algorithm creates a flat black stripe grid image with each stripe spaced N*w apart. barrier , width is (N-1)*w barrier ; Further artistic processing is performed on the basic straight stripe grid, and the outer stripe grid is interrupted into rectangular holes (this type of hole is denoted as H bar ), integrated into the artistic punching pattern of image interference, where the background mask grayscale image used is denoted as p back The second layer of spliced ​​frame images uses the basic vertical grid segmentation and splicing mode. First, input the background image to obtain the width and height of the overall format, recorded as w back 、h back ; According to the hole size limit, the minimum hole spacing dist can be obtained min , and the spacing d between the holes is obtained hole , the number of holes in the longitudinal direction is l n The number of holes in the short direction is w n , the set of all holes is denoted as Then for any h ij ∈H, the index of the corresponding pixel is loc=i+j*w back , gray value is b loc , generate holes of different sizes and shapes according to the grayscale value; the grayscale constant b corresponding to the generated grid holes is set bar , fill the area in the mask image where the grid needs to be generated with this grayscale, that is, generate a grid in the specified area and realize the transition between the grid and the background image. hole With gray value b loc The mapping relationship between them can be expressed as a piecewise function. The specific functional relationship can be reset according to the generation creativity and needs in actual applications:

[0044]

[0045] The second method is to generate mask patterns in various forms, such as oblique, diamond, and irregular curves. Based on the above method, the straight stripes are replaced with other regular geometric patterns, or a stripe grid with irregular curves is generated using a noise algorithm.

[0046] Furthermore, the frame sequence stitching image generation process described in step (4) adopts two data processing and image generation methods according to the input file format:

[0047] The first type is initially an image file format, such as jpg, png, etc. Create newImg to generate a stitched image; for any px ∈P extracts the pixel values ​​in the above rectangular stripes respectively, and translates the distance (x-1)*w bar Displace and assign to newImg to generate a spliced ​​frame image.

[0048] The second type is a geometric file, such as a 3dm or dwg file. Generate a rectangular stripe outline polygon, each stripe width is w bar , the distance between them is (N-1)*w bar ; For any p x ∈P respectively performs Boolean operations with each stripe polygon, extracts the intersection as the graphic content that needs to be retained; shifts the operation results of each frame of graphics in sequence by (x-1)*w bar , arrange and generate spliced ​​frame graphics, and further Boolean operation can be performed to obtain the outer contour of the graphics, or pixels can be filled inside the graphics and converted into images for export.

[0049] Furthermore, the display, export and printing of the generated image described in step (5) are to print the exported image on a film or transparent acrylic material to produce a dynamic effect produced by actually observing a static image; to simulate the cyclic animation effect generated by the movement of the viewpoint when a person walks in the program interface, or to simulate the dynamic effect in drawing and modeling software such as Photoshop and Sketchup. The generated pattern can be stored in polygon format and exported as a graphic file, which can be used for the design and construction of art installations, building facades, etc. through CNC processing methods such as laser cutting, wherein the edge of the image is extracted by edge detection method to realize the conversion from pixel to graphic.

[0050] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0051] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for generating a cyclic animation, characterized in that: The method partially blocks the spliced ​​frame image by a mask image to display a part of the spliced ​​frame image, wherein the spliced ​​frame image is composed of a plurality of frame sequence images that can form an animation effect, and the mask image blocks the spliced ​​frame image by visual changes to display part of the content of each frame image in the spliced ​​frame image one by one, thereby generating a visual effect of frame-by-frame animation; The method comprises the following steps: Step 1: Determine the mask image and frame sequence image to be processed. The set of N frame sequence images is denoted as P = {p1, p2, ..., p N }; Step 2: Determine the image processing accuracy and viewing distance according to the application requirements and presentation effects, complete the calculation and construction of the mathematical model; split the frame sequence image and generate the spliced ​​frame image, with an interval of N*w bar , width is w bar The outer mask grid needs to expose one frame at a certain moment and block the remaining N-1 frames, with an interval of N*w barrier , width is (N-1)*w barrier The striped grille, where w barrier Indicates the cell width of the stripe grid; Step 3: Based on the mathematical model described in step 2, generate a mask grid image; Step 4: Based on the mask grid image generated in step 3, further generate the inner frame sequence stitching image.

2. The method for generating a cyclic animation according to claim 1, characterized in that: The relevant parameters involved in the mathematical model described in step 2 are: the image tile length and width are denoted as l img ,w img , the spacing of the stripe grid is N*w barrier ; The observation distance of the human eye from the image is recorded as d view , the distance between the mask grid image and the spliced ​​frame image is recorded as d io ; Therefore, the stripe width used to divide the frame content is expressed as: w bar =(d view +d io ) / d view *w barrier , the distance required to move for one frame change is expressed as: d step =d view / d io *w bar .

3. The method for generating a cyclic animation according to claim 1, characterized in that: The mask grid is composed of straight striped grids, and holes are arranged on the grids.

4. The method for generating a cyclic animation according to claim 1, characterized in that: The mask grid is formed by combining oblique, rhombus and irregular curves.

5. The method for generating a cyclic animation according to claim 3, characterized in that: The mask image in the form of an artistic punching image is composed of two types of holes, the rectangular holes that interrupt the striped grid and the holes generated by image interference. The spacing between the holes is equal to the distance between the striped grids. hole =N*w barrier , the number of holes in the longitudinal direction is l n The number of holes in the short direction is w n , the set of all holes is denoted as According to the position where the animation effect is designed, the mask grayscale image used to generate the punching image is used to make the corresponding area present a predetermined grayscale value b bar , that is, at the gray value b bar A rectangular hole corresponding to the striped grid is generated at the position, and the rest of the image content interferes with the shape and size of the hole according to other grayscale values ​​to form an overall pattern effect; the relationship between each hole position and its corresponding grayscale value is: ij ∈H, i and j represent the position index of the hole in the row and column, and the index of the corresponding pixel point is loc=i+j*w back , w back is the width of the whole picture, and the gray value is b loc , if b loc bar , generating a larger square hole, if b loc >b bar , generate a smaller rectangular hole, if b loc = 255, a circular hole of the smallest size is generated, and the gray value is related to the hole type T hole The mapping relationship is adjusted and changed in the application according to the generated ideas and needs.​ 6. A method for generating a cyclic animation according to claim 4, characterized in that: The irregular curve is generated by using a noise algorithm.

7. The method for generating a cyclic animation according to claim 2, characterized in that: If the input frame sequence image is initially in electronic picture format, newImg is created to generate a stitched image; for any p x ∈P extracts the pixel values ​​in the rectangular stripes respectively, and translates the distance (x-1)*w bar Displace and assign to newImg to generate a spliced ​​frame image.

8. The method for generating a cyclic animation according to claim 1, characterized in that: If the input frame sequence content is initially an electronic drawing, the splicing frame graphics are generated through Boolean operations of geometric graphics; the outline polygons of each stripe grid are generated, and the width of each stripe is w bar , the distance between them is (N-1)*w bar ; For any p x ∈P respectively performs Boolean operations with each stripe polygon, extracts the intersection as the graphic content that needs to be retained; shifts the operation results of each frame of graphics in sequence by (x-1)*w bar , arrange and generate spliced ​​frame graphics, further perform Boolean operations to obtain the outer contour of the graphics, or fill pixels inside the graphics and convert them into images for export.

9. A system for generating a cyclic animation effect image with a moiré optical illusion, characterized in that: The system is used to execute the method for generating a loop animation according to claim 1, and the system includes the following modules: Input module: input observation distance, image frame number, frame sequence image, mask image; Calculation module: according to the input module: executing the method of claim 1, calculating and generating a mask grid image and a spliced ​​frame image according to the input data; Output module: output animation effects and processed files for the generated results of the calculation module.