Method, device and equipment for generating petal special effect image and storage medium
By generating petal models and processing images using random transformation matrices, the problem of high generation costs for petal effect images is solved, enabling flexible and diverse generation of petal effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
- Filing Date
- 2022-12-12
- Publication Date
- 2026-06-19
AI Technical Summary
The generation cost of petal effect images is high, and existing technologies require a large number of icon resources, resulting in insufficient flexibility.
The petal model is generated by detecting and generating instructions. After coloring, the image is transformed by random translation, rotation and scaling matrices to generate an image with random petal effects.
It reduces the cost of generating petal effect images, enables flexible and diverse petal effect effects, and avoids the need to pre-design a large number of icon resources.
Smart Images

Figure CN115937377B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and in particular to a method, apparatus, device, and storage medium for generating petal effect images. Background Technology
[0002] In this era of ubiquitous video, every app you open inevitably features live streams and short videos. For viewers, live streams are essentially videos as well. These videos often feature animated effects with added stickers, such as a flower-scattering effect on the screen or a hat-wearing effect. These sticker effects can generally be drawn, or pre-designed icons can be used directly. However, because the icon states are random, generating petal effects using pre-set icon resources requires sufficient icon resources when different states of the second petal model are needed. This method limits the flexibility of petal effects to the amount of second petal model resources available, while preparing sufficient icon resources increases the cost of generating petal effect images. Summary of the Invention
[0003] The main objective of this invention is to solve the technical problem of high generation cost of petal effect images.
[0004] The first aspect of this invention provides a method for generating a petal effect image, the method comprising:
[0005] When a generation instruction is detected, a first petal model is generated according to the function corresponding to the generation instruction;
[0006] Color the petal region of the first petal model to obtain the second petal model;
[0007] Generate a first image based on the second petal model and the preset image;
[0008] Upon obtaining the first image, a random translation matrix, a random rotation matrix, and a random scaling matrix are generated.
[0009] Multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix together to obtain the random transformation matrix;
[0010] The first image is transformed into a second image with random petal effects based on the random transformation matrix.
[0011] Optionally, in a first implementation of the first aspect of the present invention, the step of generating a random translation matrix, a random rotation matrix, and a random scaling matrix when obtaining the second petal model includes:
[0012] Upon obtaining the second petal model, random numbers are generated according to a preset formula;
[0013] The random translation matrix, the random rotation matrix, and the random scaling matrix are generated based on the random number.
[0014] Optionally, in a second implementation of the first aspect of the present invention, the step of generating the first image based on the second petal model and the preset image includes:
[0015] The first image is obtained by changing the RGB values of the target pixels in the preset image according to the preset color calculation formula, preset drawing coordinates, and the second petal model.
[0016] Optionally, in a third implementation of the first aspect of the present invention, the step of transforming the first image into a second image carrying random petal effects according to the random transformation matrix includes:
[0017] The coordinates of the RGB values of the target pixel in the first image are transformed according to the random transformation matrix to obtain the second image with random petal effects.
[0018] Optionally, in a fourth implementation of the first aspect of the present invention, the method of coloring the petal region of the first petal model to obtain the second petal model includes:
[0019] The petal region of the first petal model is gradient-processed according to preset RGB values to obtain the second petal model.
[0020] Optionally, in a fifth implementation of the first aspect of the present invention, the step of generating a first petal model according to the function corresponding to the generation instruction when the generation instruction is detected includes:
[0021] When the generation instruction is detected, the generation instruction is parsed and the function is obtained from the parsing result;
[0022] The first petal model is generated according to the function.
[0023] Optionally, in a sixth implementation of the first aspect of the present invention, the step of generating a first petal model according to the function corresponding to the generation instruction when the generation instruction is detected includes:
[0024] When the generation instruction is detected, the desired shape string carried by the generation instruction is determined;
[0025] Retrieve the function corresponding to the desired shape string from the preset function database;
[0026] The first petal model is generated according to the function.
[0027] A second aspect of the present invention provides an apparatus for generating petal effect images, comprising:
[0028] The detection module is used to generate a first petal model according to the function corresponding to the generation instruction when a generation instruction is detected.
[0029] A coloring module is used to color the petal regions of the first petal model to obtain the second petal model;
[0030] The first generation module is used to generate a first image based on the second petal model and a preset image;
[0031] The second generation module generates a random translation matrix, a random rotation matrix, and a random scaling matrix when it obtains the first image.
[0032] The calculation module is used to multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix;
[0033] The third generation module is used to transform the first image into a second image with random petal effects according to the random transformation matrix.
[0034] A third aspect of the present invention provides a device for generating petal effect images, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the device for generating petal effect images to perform the above-described method for generating petal effect images.
[0035] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described method for generating petal effect images.
[0036] In this embodiment of the invention, when the petal effect image generation device detects a generation command, it generates a first petal model according to the function corresponding to the generation command; colors the petal regions of the first petal model to obtain a second petal model; generates a first image based on the second petal model and a preset image; when obtaining the first image, it generates a random translation matrix, a random rotation matrix, and a random scaling matrix; multiplies the random translation matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix; and transforms the first image into a second image carrying random petal effects according to the random transformation matrix. Since the petal effect image generation device can generate a first petal model of a preset shape based on the generation command, color the first petal model to obtain a second petal model, and draw the second petal model onto an image, when the second petal model is transformed by the random transformation matrix, the first image will adjust the RGB values of the corresponding target pixels accordingly based on the transformation result of the second petal model, thereby obtaining a second image carrying random petal effects. Compared with existing technologies, it eliminates the need to pre-design a large number of chaotic petal icons as materials, resulting in petal effect images with sufficient detail and good effects while reducing the generation cost of petal effect images. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of an embodiment of the method for generating petal effect images according to the present invention;
[0038] Figure 2 This is a reference figure for an embodiment of the method for generating petal effect images in this invention;
[0039] Figure 3 This is a reference figure for an embodiment of the method for generating petal effect images in this invention;
[0040] Figure 4 This is a reference figure for an embodiment of the method for generating petal effect images in this invention;
[0041] Figure 5 This is a reference figure for an embodiment of the method for generating petal effect images in this invention;
[0042] Figure 6 This is a reference figure for an embodiment of the method for generating petal effect images in this invention;
[0043] Figure 7 This is a schematic diagram of one embodiment of the device for generating petal effect images according to an embodiment of the present invention;
[0044] Figure 8 This is a schematic diagram of an embodiment of the device for generating petal effect images in this invention. Detailed Implementation
[0045] This invention provides a method, apparatus, device, and storage medium for generating petal effect images.
[0046] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0047] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the method for generating petal effect images in this invention includes:
[0048] 101. When a generation instruction is detected, generate the first petal model according to the function corresponding to the generation instruction;
[0049] Specifically, the generation command can be triggered by the designer controlling the petal effect image generation device. When the petal effect image generation device detects the command, it will generate an initial petal model based on the function carried by the command as the first petal model mentioned above.
[0050] Optionally, when the generation instruction is detected, the generation instruction is parsed and the function is obtained from the parsing result; the first petal model is generated according to the function.
[0051] Optionally, when the generation instruction is detected, the desired shape string carried by the generation instruction is determined; the function corresponding to the desired shape string is obtained from a preset function database; and the first petal model is generated according to the function. The following example uses a single petal as the desired shape string:
[0052] First, design a first petal model: introduce the Bernoulli lemniscus, which resembles the infinity symbol "∞". Its curve equation is expressed as:
[0053] (x 2 +y 2 ) 2 -2a 2 (x 2 -y 2 ) = 0
[0054] Where 'a' is an adjustable constant. Let it be the point where it intersects the X-axis.
[0055] Adjusting the value of 'a' only increases or decreases the size of the curve proportionally. Therefore, to improve the petal effect, we adjust the equation of the Bernoulli lemniscus by adding an adjustable constant 'b', resulting in the following equation:
[0056] (x2 / b2+y 2 )2-2a2(x2 / b2-y 2 ) = 0
[0057] Adjusting the constant 'b' can stretch or shorten the curve along the X-axis. Adjusting a=1 and b=2 yields a suitable effect. The resulting curve is a reference. Figure 2 .
[0058] The constant 'b' is open and can be adjusted to achieve a more stretched effect. Since it's a petal effect, only the curves with the x-axis greater than 0 are taken, i.e., half of the effect. Then, by setting the equation less than or equal to 0, the interior of the curve can be included, thus obtaining the first petal model of a single petal.
[0059] 102. Color the petal region of the first petal model to obtain the second petal model;
[0060] Specifically, the generated first petal model is colored.
[0061] Optionally, the petal region of the first petal model is gradient-processed according to preset RGB values to obtain the second petal model. Specifically, continuing the analysis using a single petal as an example, according to the equation in step 1, setting y = 0, the x-coordinate of the position farthest from the origin can be obtained, that is:
[0062]
[0063] Viewed along the x-axis, this point is the furthest from the origin.
[0064] Since colors are composed of three components (red, green, and blue), i.e., RGB values, we can observe that the RGB values of pink are (1.0, 0.3, 0.3). It should be noted that the range of RGB values is (0 to 1.0).
[0065] Based on the maximum x value obtained above, a gradient from pink (1.0, 0.3, 0.3) to white (1.0, 1.0, 1.0) is made based on the x value on the petal. That is, for any point S(sx, sy) on the petal, its color RGB value (sr, sg, sb) is: sr = 1.0, which does not need to be processed. This creates a gradient effect from pink to white. See the example image for reference. Figure 3 .
[0066] Optionally, a first petal model of a preset shape is generated based on a preset function carried by the generation instruction. This could be a circular or heart-shaped shape, with different functions corresponding to different shapes, which are not limited here. Then, the step of coloring the first petal model to obtain the corresponding second petal model is performed. The second petal model involved in this embodiment can be referenced but is not limited to. Figure 4 , Figure 5 or Figure 6 .
[0067] 103. Generate a first image based on the second petal model and the preset image;
[0068] Specifically, the obtained second petal model is drawn onto a preset image to obtain a first image carrying the petal model.
[0069] Optionally, the second petal model is drawn onto the preset image according to the target drawing coordinates of the preset image to obtain the first image.
[0070] Optionally, the first image is obtained by changing the RGB values of the target pixels in the preset image according to the preset color calculation formula, preset drawing coordinates, and the second petal model. Specifically, the pixel size of the preset image is set to (clos, rows), the pixel coordinates (target drawing coordinates) are set to (clo, row), the maximum length of the second petal model to be drawn is set to L, the farthest distance is determined according to the x-coordinate of the farthest position from the origin obtained above, and Xmax = L. According to the ratio relationship between a and b set in the above steps, the relationship between L and a and b can be obtained, that is, L is known, a and b are also known, and a and b are known quantities. Then, for any pixel (rx, rv) on the preset image, a coordinate system is established with the pixel coordinates of the position to be drawn as the origin. As long as the coordinates (rx-clo, ry-row) of the point in the established coordinate system are within the range of the petal curve, the RGB value of the pixel can be replaced. To determine whether a coordinate point is within the petal curve range, the x-value set in step 1 must first be greater than 0, i.e., rx-clo>0. If rx-clo>0 is true, then substitute (rx-clo, rv-row) into the equation. If the value of the equation is less than or equal to 0, then the point is within the petal curve. Then, by replacing the color of the point using the color calculation method described above, the special effect image, i.e., the first image carrying the petal model, can be obtained.
[0071] 104. Upon obtaining the first image, generate a random translation matrix, a random rotation matrix, and a random scaling matrix;
[0072] Specifically, continuing with the example of a single petal, and building upon the above, any shape can take on different appearances through different matrix transformations, and any matrix can be composed of translation, rotation, and scaling matrices. To generate a random petal model, this embodiment uses random matrix transformations and random parameters to construct the matrix.
[0073] In computer graphics, assuming a point is (x, y, 1), then let ofx and ofy be its offsets in the x and y directions, respectively. The translation matrix can be written as:
[0074]
[0075] Let θ be the rotation angle, the rotation matrix can be:
[0076]
[0077] Let Sx and Sy be the scaling ratios in the x and y directions, respectively. The scaling matrix can be written as follows:
[0078]
[0079] Optionally, random numbers are generated according to a preset formula; the random translation matrix, the random rotation matrix, and the random scaling matrix are then generated based on the random numbers. Specifically, there are many methods for generating random numbers in a computer; random numbers can be designed based on pre-set conditions, and the principles are largely the same. This embodiment uses one method for generating random numbers as an example:
[0080] f(n)=fract(sin(n)*43758.545312)
[0081] In the formula, fract is a computer function that extracts the decimal part, and its value is always less than 1.
[0082] By passing in different irregular parameters n, different random numbers can be obtained. Assuming the petal ordinal number is m, we can let:
[0083] ofx = clos / 2.0 * f(1.72643 * m)
[0084] ofy = rows / 2.0 * f(1.37543 * m)
[0085] In this embodiment, the random range is controlled within half the image size range, which can be adjusted as needed, and then a random translation matrix is obtained.
[0086] Similarly, let 0 = 2.0 * PI * f(2.13427 * m), where PI is pi, to obtain a random rotation matrix. Let:
[0087] Sx = 1.0 + f(2.13427*m)
[0088] Sy = 1.0 + f(2.43517 * m)
[0089] A random scaling matrix is obtained.
[0090] 105. Multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix together to obtain the random transformation matrix;
[0091] Specifically, the three random matrices obtained in the above steps are multiplied together to form a random transformation matrix.
[0092] 106. Transform the first image into a second image with random petal effects according to the random transformation matrix.
[0093] Specifically, the device for generating petal effect images transforms the second petal model in the first image according to a random transformation matrix. During the transformation of the second petal model, the RGB values of the corresponding target pixels in the first image are transformed accordingly, thereby obtaining a second image carrying petal effects. It is easy to understand that the state of the petal effects carried in the second image is random.
[0094] Optionally, the coordinates of the RGB values of the target pixel in the first image are transformed according to the random transformation matrix to obtain the second image carrying random petal effects.
[0095] Optionally, the obtained random transformation matrix can be used to transform the pixel coordinates within the petal curves that meet the conditions in the first image obtained in the previous steps to obtain the randomly transformed petals. The random transformation matrix may also be constructed through several random translations, rotations, and scalings; this embodiment only focuses on illustrating this method but is not limited to it. This method uses matrix transformations to obtain different graphic effects, conforming to the laws of computer graphics, and the effects are realistic. For example, it can... Figure 6 The state changes randomly as Figure 5 The state of the petals. Furthermore, this embodiment requires less computation and has more controllable parameters when creating different petal effects, allowing for different transformations and applications as needed.
[0096] In this embodiment of the invention, when the petal effect image generation device detects a generation command, it generates a first petal model according to the function corresponding to the generation command; colors the petal regions of the first petal model to obtain a second petal model; generates a first image based on the second petal model and a preset image; when obtaining the first image, it generates a random translation matrix, a random rotation matrix, and a random scaling matrix; multiplies the random translation matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix; and transforms the first image into a second image carrying random petal effects according to the random transformation matrix. Since the petal effect image generation device can generate a first petal model of a preset shape based on the generation command, color the first petal model to obtain a second petal model, and draw the second petal model onto an image, when the second petal model is transformed by the random transformation matrix, the first image will adjust the RGB values of the corresponding target pixels accordingly based on the transformation result of the second petal model, thereby obtaining a second image carrying random petal effects. Compared with existing technologies, it eliminates the need to pre-design a large number of chaotic petal icons as materials, resulting in petal effect images with sufficient detail and good effects while reducing the generation cost of petal effect images.
[0097] The method for generating petal effect images in embodiments of the present invention has been described above. The apparatus for generating petal effect images in embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 4 One embodiment of the petal effect image generation device in this invention includes:
[0098] The detection module 301 is used to generate a first petal model according to the function corresponding to the generation instruction when a generation instruction is detected.
[0099] The coloring module 302 is used to color the petal region of the first petal model to obtain the second petal model;
[0100] The first generation module 303 is used to generate a first image based on the second petal model and a preset image;
[0101] The second generation module 304 generates a random translation matrix, a random rotation matrix, and a random scaling matrix when it obtains the first image.
[0102] Calculation module 305 is used to multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix;
[0103] The third generation module 306 is used to transform the first image into a second image carrying random petal effects according to the random transformation matrix.
[0104] Optionally, the second generation module 304 can also be specifically used for:
[0105] Upon obtaining the second petal model, random numbers are generated according to a preset formula;
[0106] The random translation matrix, the random rotation matrix, and the random scaling matrix are generated based on the random number.
[0107] Optionally, the first generation module 303 can also be specifically used for:
[0108] The first image is obtained by changing the RGB values of the target pixels in the preset image according to the preset color calculation formula, preset drawing coordinates, and the second petal model.
[0109] Optionally, the third generation module 306 can also be specifically used for:
[0110] The coordinates of the RGB values of the target pixel in the first image are transformed according to the random transformation matrix to obtain the second image with random petal effects.
[0111] Optionally, the coloring module 302 can also be specifically used for:
[0112] The petal region of the first petal model is gradient-processed according to preset RGB values to obtain the second petal model.
[0113] Optionally, the detection module 301 can also be specifically used for:
[0114] When the generation instruction is detected, the generation instruction is parsed and the function is obtained from the parsing result;
[0115] The first petal model is generated according to the function.
[0116] Optionally, the detection module 301 can also be specifically used for:
[0117] When the generation instruction is detected, the desired shape string carried by the generation instruction is determined;
[0118] Retrieve the function corresponding to the desired shape string from the preset function database;
[0119] The first petal model is generated according to the function.
[0120] In this embodiment of the invention, when the petal effect image generation device detects a generation command, it generates a first petal model according to the function corresponding to the generation command; colors the petal regions of the first petal model to obtain a second petal model; generates a first image based on the second petal model and a preset image; when obtaining the first image, it generates a random translation matrix, a random rotation matrix, and a random scaling matrix; multiplies the random translation matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix; and transforms the first image into a second image carrying random petal effects according to the random transformation matrix. Since the petal effect image generation device can generate a first petal model of a preset shape based on the generation command, color the first petal model to obtain a second petal model, and draw the second petal model onto an image, when the second petal model is transformed by the random transformation matrix, the first image will adjust the RGB values of the corresponding target pixels accordingly based on the transformation result of the second petal model, thereby obtaining a second image carrying random petal effects. Compared with existing technologies, it eliminates the need to pre-design a large number of chaotic petal icons as materials, resulting in petal effect images with sufficient detail and good effects while reducing the generation cost of petal effect images.
[0121] above Figure 7 The petal effect image generation device in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The petal effect image generation device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0122] Figure 8 This is a schematic diagram of a petal effect image generation device 500 provided in an embodiment of the present invention. The petal effect image generation device 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the petal effect image generation device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the petal effect image generation device 500.
[0123] The image generation device 500 based on petal effects may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 8 The illustrated device structure for generating petal effect images does not constitute a limitation on the device for generating petal effect images. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0124] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the method for generating the petal effect image.
[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0126] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0127] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a petal special effect image, characterized by, The method for generating the petal effect image includes: When a generation instruction is detected, a first petal model is generated according to the function corresponding to the generation instruction; Color the petal region of the first petal model to obtain the second petal model; Generate a first image based on the second petal model and the preset image; Upon obtaining the first image, a random translation matrix, a random rotation matrix, and a random scaling matrix are generated. Multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix together to obtain the random transformation matrix; The first image is transformed into a second image with random petal effects based on the random transformation matrix.
2. The method of claim 1, wherein, The steps of generating a random translation matrix, a random rotation matrix, and a random scaling matrix when obtaining the second petal model include: Upon obtaining the second petal model, random numbers are generated according to a preset formula; The random translation matrix, the random rotation matrix, and the random scaling matrix are generated based on the random number.
3. The method for generating petal effect images according to claim 1, characterized in that, The step of generating the first image based on the second petal model and the preset image includes: The first image is obtained by changing the RGB values of the target pixels in the preset image according to the preset color calculation formula, preset drawing coordinates, and the second petal model.
4. The method for generating petal effect images according to claim 3, characterized in that, The step of transforming the first image into a second image with random petal effects according to the random transformation matrix includes: The coordinates of the RGB values of the target pixel in the first image are transformed according to the random transformation matrix to obtain the second image with random petal effects.
5. The method for generating petal effect images according to claim 1, characterized in that, The method for coloring the petal regions of the first petal model to obtain the second petal model includes: The petal region of the first petal model is gradient-processed according to preset RGB values to obtain the second petal model.
6. The method for generating petal effect images according to claim 1, characterized in that, When a generation instruction is detected, the step of generating the first petal model according to the function corresponding to the generation instruction includes: When the generation instruction is detected, the generation instruction is parsed and the function is obtained from the parsing result; The first petal model is generated according to the function.
7. The method for generating petal effect images according to claim 1, characterized in that, When a generation instruction is detected, the step of generating the first petal model according to the function corresponding to the generation instruction includes: When the generation instruction is detected, the desired shape string carried by the generation instruction is determined; Retrieve the function corresponding to the desired shape string from the preset function database; The first petal model is generated according to the function.
8. A device for generating petal effect images, characterized in that, The device for generating the petal effect image includes: The detection module is used to generate a first petal model according to the function corresponding to the generation instruction when a generation instruction is detected. A coloring module is used to color the petal regions of the first petal model to obtain the second petal model; The first generation module is used to generate a first image based on the second petal model and a preset image; The second generation module generates a random translation matrix, a random rotation matrix, and a random scaling matrix when it obtains the first image. The calculation module is used to multiply the random parallel matrix, the random rotation matrix, and the random scaling matrix to obtain a random transformation matrix; The third generation module is used to transform the first image into a second image with random petal effects according to the random transformation matrix.
9. A device for generating petal effect images, characterized in that, The device for generating the petal effect image includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the petal effect image generation device to perform the petal effect image generation method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the method for generating petal effect images as described in any one of claims 1-7.