CN118172433A - Image generation method, device, nonvolatile storage medium and computer equipment - Google Patents

Image generation method, device, nonvolatile storage medium and computer equipment Download PDF

Info

Publication number
CN118172433A
CN118172433A CN202410379937.8A CN202410379937A CN118172433A CN 118172433 A CN118172433 A CN 118172433A CN 202410379937 A CN202410379937 A CN 202410379937A CN 118172433 A CN118172433 A CN 118172433A
Authority
CN
China
Prior art keywords
image
vortex
pixel points
color noise
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410379937.8A
Other languages
Chinese (zh)
Inventor
金尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Electronic Commerce Co Ltd
Original Assignee
Tianyi Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Electronic Commerce Co Ltd filed Critical Tianyi Electronic Commerce Co Ltd
Priority to CN202410379937.8A priority Critical patent/CN118172433A/en
Publication of CN118172433A publication Critical patent/CN118172433A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses an image generation method, an image generation device, a nonvolatile storage medium and computer equipment. Wherein the method comprises the following steps: acquiring an initial image and a color noise image; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; and generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image. The invention solves the technical problem that the image generation efficiency is low because a great deal of calculation time is required for style learning by adopting a neural network to generate the image with the color swirl effect in the related technology.

Description

Image generation method, device, nonvolatile storage medium and computer equipment
Technical Field
The present invention relates to the field of image processing, and in particular, to an image generating method, an image generating device, a nonvolatile storage medium, and a computer device.
Background
At present, the color noise swirl image generation has wide application prospect in the fields of art and computer graphics, and can be used for simulating a Sanskyscraper style graphics. However, the generation of such style graphics in the related art requires a neural network to perform style migration, and requires a large amount of computing resources and computing time, resulting in low image generation efficiency.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides an image generation method, an image generation device, a nonvolatile storage medium and computer equipment, which at least solve the technical problem that a large amount of calculation time is required for style learning by adopting a neural network to generate an image with a color vortex effect in the related art, so that the image generation efficiency is low.
According to an aspect of an embodiment of the present invention, there is provided an image generation method including: acquiring an initial image and a color noise image; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; and generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image.
Optionally, generating movement tracks for a plurality of pixels of the color noise image respectively includes: determining a swirl region in the color noise image; determining a vortex center of the vortex region; and generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Optionally, generating a corresponding movement track for the pixel point in the vortex area based on the vortex center includes: generating a movement function corresponding to the vortex region based on the vortex center; randomly generating a time value for the pixel points in the swirling area; substituting a time value corresponding to the pixel point in the vortex area into a movement function to obtain a movement result corresponding to the pixel point in the vortex area; and determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Optionally, adjusting colors of the plurality of pixels of the color noise image based on movement tracks of the plurality of pixels of the color noise image to obtain a vortex image includes: selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point; determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points; and adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain a vortex image.
Optionally, generating the target image from the initial image and the vortex image includes: selecting a target area matched with the size of the initial image from the vortex image; and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
Optionally, generating the target image from the initial image and the vortex image is implemented using a Web graphic library.
According to another aspect of the embodiment of the present invention, there is also provided an image generating apparatus including: the acquisition module is used for acquiring an initial image and a color noise image; the first generation module is used for respectively generating movement tracks for a plurality of pixel points of the color noise image, wherein the movement tracks are used for simulating vortex effects; the adjusting module is used for adjusting the colors of the plurality of pixel points of the color noise image based on the moving tracks of the plurality of pixel points of the color noise image to obtain a vortex image; and the second generation module is used for generating a target image according to the initial image and the vortex image, wherein the target image is a color noise vortex effect diagram of the initial image.
According to still another aspect of the embodiments of the present invention, there is also provided a nonvolatile storage medium including a stored program, wherein a device in which the nonvolatile storage medium is controlled to execute any one of the image generating methods described above when the program runs.
According to still another aspect of the embodiments of the present invention, there is further provided a computer device, including a processor for executing a program, where the program executes any one of the image generating methods described above.
According to still another aspect of the embodiments of the present invention, there is also provided a computer program product including a computer program which, when executed by a processor, implements any one of the above image generation methods.
In the embodiment of the invention, an image generation method is adopted, and an initial image and a color noise image are obtained; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; according to the initial image and the swirl image, a target image is generated, wherein the target image is a color noise swirl effect image of the initial image, the purpose of reducing calculation resources and calculation time occupied in the image generation process is achieved, the technical effect of improving the image generation efficiency is achieved, and the technical problem that a large amount of calculation time is required for style learning of the image generating the color swirl effect in the related art is generally adopted to lead to lower image generation efficiency is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
Fig. 1 shows a hardware block diagram of a computer terminal for implementing an image generation method;
Fig. 2 is a flowchart of an image generating method according to an embodiment of the present invention;
FIG. 3 is a color noise plot in an image generation method provided in accordance with an alternative embodiment of the present invention;
FIG. 4 is a target image in an image generation method provided in accordance with an alternative embodiment of the present invention;
FIG. 5 is a gray scale image of a cobble in an image generation method provided in accordance with an alternative embodiment of the present invention;
Fig. 6 is a block diagram of an image generating apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present invention, there is provided a method embodiment of an image generation method, it being noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
The method according to the first embodiment of the present application may be implemented in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 shows a block diagram of a hardware structure of a computer terminal for implementing an image generation method. As shown in fig. 1, the computer terminal 10 may include one or more (shown as 102a, 102b, … …,102 n) processors (which may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In addition, the method may further include: a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS), a network interface, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors and/or other data processing circuits described above may be referred to herein generally as "data processing circuits. The data processing circuit may be embodied in whole or in part in software, hardware, firmware, or any other combination. Furthermore, the data processing circuitry may be a single stand-alone processing module or incorporated, in whole or in part, into any of the other elements in the computer terminal 10. As referred to in embodiments of the application, the data processing circuit acts as a processor control (e.g., selection of the path of the variable resistor termination connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the image generation method in the embodiments of the present invention, and the processor executes the software programs and modules stored in the memory 104, thereby executing various functional applications and data processing, that is, implementing the image generation method of the application program described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10.
At present, the color noise swirl image generation has wide application prospect in the fields of art and computer graphics, and can be used for simulating a Sanskyscraper style image. However, the generation of such a style image in the related art requires a neural network to perform style migration, and requires a large amount of computing resources and computing time, resulting in low image generation efficiency. In order to solve the technical problem, the present invention proposes an image generating method, and fig. 2 is a schematic flow chart of the image generating method according to an embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S202, an initial image and a color noise image are acquired.
In this step, the initial image obtained is an image in which a color noise swirl effect needs to be generated. Fig. 3 is a color noise diagram in an image generating method according to an alternative embodiment of the present invention, where, as shown in fig. 3, the color noise image is a color scattered-dot image with noise texture, and may be used to generate a color noise effect in a color noise vortex effect, where the noise texture refers to a pattern generated by a noise function, and includes random, irregular details and variations therein. The generation of the noise texture may be based on a noise function, which may include various types of noise, such as Perlin noise, simplex noise, and the like. By adjusting parameters of the noise function, the appearance, density, color and other attributes of the noise texture can be controlled, so that the noise texture is suitable for different application requirements. Specifically, different color noise images can be selected and generated according to the requirements of users, because the number and the dispersion degree of the color scattering points in the color noise images are different, the finally generated color noise vortex effect images are different.
In step S204, a movement track is generated for each of the plurality of pixels of the color noise image, wherein the movement track is used for simulating the vortex effect.
In this step, the movement tracks corresponding to the plurality of pixel points in the color noise image may be used to simulate the vortex effect. All pixel points can be selected for movement, and part of the pixel points can be selected for movement. The length and the moving direction of the moving track of the pixel point can influence the vortex effect in the finally generated color noise vortex effect. Specifically, since the swirl effect may be constituted by a plurality of curves around a certain point, a curve generation function may be employed to generate a movement locus corresponding to a pixel point. The method can also generate a plurality of vortexes in the image according to the requirements of the user, and the movement tracks of the corresponding pixel points are different and can be curves respectively surrounding a plurality of centers.
Step S206, based on the movement track of each of the plurality of pixels of the color noise image, the color of the plurality of pixels of the color noise image is adjusted to obtain a vortex image.
In this step, the color of the pixel point in the color noise image is adjusted based on the movement track of each of the plurality of pixel points in the color noise image, so that the movement track of the pixel point can be displayed on the color noise image, thereby forming a swirl effect. Specifically, the color of the pixel point on the corresponding moving track can be adjusted according to the color of the pixel point, so that a track stub is formed. Therefore, the moving track of the pixel points in the color noise image after moving on the image can be simulated, and the visual effect of vortex is presented.
Step S208, generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image.
In this step, fig. 4 is a view showing a color noise swirl effect diagram of a target image, that is, an initial image, which is generated by superimposing the initial image and the swirl image as shown in fig. 4 in the image generation method according to the alternative embodiment of the present invention. The color of the pixel point in the swirl image can be overlapped on the pixel point corresponding to the initial image, and a color noise swirl effect diagram is obtained. The brightness of different pixel points in the target image can be adjusted, so that the vortex presents a deep and shallow effect. The brightness of the pixel points of the vortex area is improved, so that the vortex area is more prominent. The color noise swirl effect graph can be used for simulating a Sanskyscraper night style graph. Since the Van-Gao-Ye style is representative of the Van-Gao art style of the painter, the bright stars and night sky in the work "Star-Ye" are presented in a swirl-like stroke. In the related art, to generate such a image of the style of the Sanskyscraper, it is necessary to perform style learning using a neural network and then transfer the style to another image. This requires a significant amount of computing resources and computing time. According to the invention, the color noise image is adopted to generate the vortex image, and then the color noise vortex effect image, namely the image in the Sanskyscraper night style, can be obtained according to the combination of the vortex image and the initial image, so that the generation efficiency of the image can be improved.
Through the steps, the purpose of reducing the calculation resources and calculation time occupied in the image generation process is achieved, so that the technical effect of improving the image generation efficiency is achieved, and the technical problem that a large amount of calculation time is required for style learning by adopting a neural network to generate the image with the color swirl effect in the related art, so that the image generation efficiency is low is solved.
As an alternative embodiment, generating movement tracks for a plurality of pixels of a color noise image, respectively, includes: determining a swirl region in the color noise image; determining a vortex center of the vortex region; and generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Alternatively, generating the movement trajectory may first determine a swirl region in the color noise image, wherein the swirl region is used to determine the position of the swirl. In general, the swirl area has a circular or elliptic curve shape, a swirl center exists in the swirl, surrounding gas or liquid is influenced to rotate around the swirl center, the area where the rotating part is located is the swirl area, that is, pixels in the swirl area in the color noise image all move around the swirl center of the corresponding swirl area, and the generated movement track is a curve curved towards the swirl center of the corresponding swirl area. Specifically, a plurality of circular or elliptical areas can be randomly generated in the color noise image to serve as vortex areas, the vortex areas can be set according to the requirements of users, and the number and the size of the vortex areas can be determined according to the requirements of the users. The number, the size and the shape of the vortex areas can influence the finally generated color noise vortex effect diagram, so that the vortex areas are determined according to the requirements of users, the color noise vortex effect diagram can be generated in a personalized mode, and the requirements of the users are better met. The cobble image may also be selected as a division standard of the vortex area, and fig. 5 is a gray scale chart of cobbles in the image generating method according to an alternative embodiment of the present invention, as shown in fig. 5, it may be seen that the cobble image is composed of a plurality of irregular circles or ellipses, where. Each cobble (i.e. the lighter areas in fig. 5) may act as a swirl area. The gray level image of the cobble image and the color noise image can be overlapped, and then a vortex area is divided in the color noise image. Specifically, the brightness values of a plurality of pixel points in the cobble image can be obtained, as shown in fig. 5, the color of the cobble part is brighter, the background color is darker, the brightness values of the pixel points in the cobble image are superimposed on the corresponding pixel points in the color noise image, and the position of the vortex area can be presented in the color noise image. The cobble image is adopted to determine the vortex area in the color noise image more quickly, so that the image generation efficiency is improved. In addition, the vortex centers of the vortex areas can be randomly determined, each vortex area has a corresponding vortex center, and the vortex centers are used for limiting the orientation of the movement tracks corresponding to the pixels in the vortex areas. Because the peripheral gas or liquid in one vortex region rotates around the center of the vortex, the corresponding movement track of the pixel points in the vortex region is a curve bent towards the corresponding vortex center. The movement track can be generated for the pixel points outside the vortex area, and the movement track can be linear movement or curve movement. And generating a moving track for the pixel points outside the vortex area, so that the finally generated image frame is richer.
As an alternative embodiment, generating a corresponding movement track for the pixel points in the vortex area based on the vortex center includes: generating a movement function corresponding to the vortex region based on the vortex center; randomly generating a time value for the pixel points in the swirling area; substituting a time value corresponding to the pixel point in the vortex area into a movement function to obtain a movement result corresponding to the pixel point in the vortex area; and determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Alternatively, the movement track may be generated by first generating a movement function corresponding to the vortex region from the vortex center, and since the curve in the vortex should be curved toward the vortex center, the corresponding movement function needs to be generated from the position of the vortex center in the vortex region. Wherein the movement function is related to a time value, and the larger the time value is, the longer the obtained movement track is. The movement function is used for representing the time-varying relation of the movement parameter, wherein the movement parameter can comprise various types of angles and distances for the movement of the pixel points in the vortex area or coordinates of the pixel points, when the movement parameter is the angles and the movement distances for the rotation of the pixel points, the angles and the movement distances are changed along with the time variation, the movement result of the movement function is that the positions of the pixel points after the movement are determined according to the angles and the distances, and in particular, the angles and the movement distances for the rotation of the pixel points in the vortex area can be described through a polar coordinate equation so as to determine the movement track. When the movement parameter is the coordinate of the pixel point, the abscissa and the ordinate of the pixel point are changed along with the change of time, the movement result of the movement function is to determine the position of the pixel point after movement according to the coordinate, specifically, the x-axis coordinate and the y-axis coordinate of the pixel point in the vortex area can be described by a parameter equation to be changed along with the change of time, and then the movement track is determined. For example, a coordinate system may be established on the color noise image, and the center of the vortex in each vortex region is set as the origin, and then the coordinates of the center of the vortex are (0, 0). Assuming that the coordinates of the pixel point are (0, r), the angular velocity of the pixel point in the vortex region is ω. The movement function of the pixel point may be set as x (t) =r×cos (ωt), y (t) =r×sin (ωt), where t is time, and x (t) and y (t) represent coordinates of the pixel point on the x axis and the y axis during movement, respectively, and based on the parameter function, the movement track generated by the pixel point is a circular arc with the center of the vortex as a center of the circle. The time value can be randomly generated for the pixel points in the vortex area, so that movement tracks with different lengths can be formed, and the finally generated vortex effect is more natural. Substituting the time value of the corresponding pixel point in the vortex area into the corresponding movement function to obtain the movement result corresponding to the pixel point, and obtaining the movement track corresponding to the pixel point according to the movement result. Specifically, when the time value randomly generated for a certain pixel point is 5 seconds, the position to which the pixel point moves in 1 second, 2 seconds, 3 seconds, 4 seconds and 5 seconds can be obtained, and the movement track corresponding to the pixel point can be determined according to the positions.
As an alternative embodiment, adjusting colors of a plurality of pixels of a color noise image based on movement trajectories of the plurality of pixels of the color noise image to obtain a vortex image includes: selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point; determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points; and adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain a vortex image.
Alternatively, a pixel satisfying a preset condition is selected from a plurality of pixels of the color noise image as the moving pixel, where the preset condition may be that the color value is a certain color or a certain colors. Since there are a plurality of colors in the color noise image, a part of the pixels may be selected as the moving pixels, for example, pixels of black, blue, and green exist in the color noise image, and the preset condition may be set to be blue or green, and then the pixels of blue and green are selected as the moving pixels. And taking the pixel point through which the moving track corresponding to the moving pixel point passes as a track pixel point, and then adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain the vortex image. Specifically, the color of the track pixel point can be adjusted to the color of the corresponding moving pixel point, so that the track pixel point becomes a curve, and a plurality of curves can form a vortex. When the moving tracks corresponding to the plurality of moving pixel points pass through the same pixel point, namely one track pixel point corresponds to the plurality of moving pixel points. The color of the trace pixel may be selected to be set to the color of any one of the corresponding moving pixels. By changing the color of the trace pixel points, the image shows the vortex effect.
As an alternative embodiment, generating the target image from the initial image and the vortex image includes: selecting a target area matched with the size of the initial image from the vortex image; and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
Alternatively, since the swirl image may be larger than the initial image, the same area as the initial image may be selected in the swirl image first as the color noise swirl image of the initial image. And then, the colors of the plurality of pixel points in the target area are overlapped on the corresponding pixel points in the initial image, so that the target image can be obtained. The color of the pixel point in the target area can be multiplied by a coefficient and then superimposed on the pixel point of the initial image, and the finally generated target image can meet the requirement of a user by continuously adjusting the coefficient.
As an alternative embodiment, a Web graphic library is used to generate a target image from the initial image and the swirl image.
Alternatively, a Web graphic library may be employed to enable the generation of a target image from the initial image and the swirl image. Wherein a Web graphic library is a collection of tools for creating and processing graphics in Web page development. It includes various graphic processing functions such as drawing graphics, adding animation effects, processing images, etc., which can help developers quickly create attractive and interactive web page graphics. Through the Web graphics library, developers can directly access the GPU of a computer or mobile device to render various visual effects with high performance. Here, by using WebGL technology, pixel computation tasks are migrated to a GPU that can compute in parallel for processing. The generation efficiency and the generation speed of the final color noise vortex image are greatly improved, and particularly for complex image processing tasks, the rendering time of image generation can be remarkably reduced. And based on a Web graphic library, the method can run on various platforms supporting the WebGL by adopting the WebGL technology, so that the image generation is more convenient.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
From the above description of the embodiments, it will be clear to a person skilled in the art that the image generation method according to the above embodiments may be implemented by means of software plus a necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
In the related art, the generation of the image with the color noise swirl effect requires the neural network to perform style migration, and a great deal of calculation resources and calculation time are required, so that the generation efficiency of the image is low. To solve this technical problem, a specific embodiment is provided below:
1. An initial image, a color noise image, and a cobble image are acquired.
2. And acquiring a gray level image of the cobble image, and superposing brightness values of pixel points in the gray level image into the color noise image to obtain the color noise image with the well-determined vortex area.
3. The center of the vortex for each vortex region is determined.
4. And determining a movement function corresponding to the pixel point in each vortex area according to the vortex center.
5. And randomly generating a time value for the pixel points in the swirling area, and substituting the time value into a corresponding movement function to obtain a movement result corresponding to the pixel points in the swirling area.
6. And according to the movement result, obtaining a movement track corresponding to the pixel points in the vortex area.
7. And adjusting the color value of the pixel point on the corresponding moving track according to the color of the pixel point in the vortex area to obtain a vortex image.
8. And overlapping the color values of the pixel points in the vortex image on the corresponding pixel points in the initial image to obtain a target image, namely a color noise vortex effect diagram.
According to an embodiment of the present invention, there is also provided an image generating apparatus for implementing the above-described image generating method, fig. 6 is a block diagram of a structure of the image generating apparatus provided according to an embodiment of the present invention, as shown in fig. 6, the image generating apparatus including: the image generating apparatus will be described below as the acquisition module 62, the first generation module 64, the adjustment module 66, and the second generation module 68.
An acquisition module 62 is used for acquiring the initial image and the color noise image.
The first generation module 64 is connected to the acquisition module 62, and is configured to generate movement tracks for a plurality of pixels of the color noise image, where the movement tracks are used to simulate a vortex effect.
The adjustment module 66 is connected to the first generation module 64, and is configured to adjust colors of the plurality of pixels of the color noise image based on movement trajectories of the plurality of pixels of the color noise image, so as to obtain a vortex image.
The second generation module 68 is connected to the adjustment module 66, and is configured to generate a target image according to the initial image and the swirl image, where the target image is a color noise swirl effect map of the initial image.
Optionally, the first generating module is configured to generate movement tracks for a plurality of pixels of the color noise image, respectively, including: a first determination unit configured to determine a swirl region in the color noise image; a second determining unit configured to determine a vortex center of the vortex region; the first generation unit is used for generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Optionally, the generating unit is configured to generate, for the pixel points in the vortex area, a corresponding movement track based on the vortex center, including: a first generation subunit for generating a movement function corresponding to the vortex region based on the vortex center; the second generation subunit is used for randomly generating a time value for the pixel points in the vortex area; the calculating subunit is used for substituting the time value corresponding to the pixel point in the swirling area into the moving function to obtain a moving result corresponding to the pixel point in the swirling area; and the first determination subunit is used for determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Optionally, the adjusting module is configured to adjust colors of a plurality of pixels of the color noise image based on movement tracks of the plurality of pixels of the color noise image, to obtain a vortex image, including: a selection unit for selecting a pixel point satisfying a preset condition as a moving pixel point from a plurality of pixel points of the color noise image; a third determining unit, configured to determine a pixel point forming a movement track corresponding to the movement pixel point as a track pixel point; and the adjusting unit is used for adjusting the colors of the corresponding track pixel points according to the colors of the moving pixel points to obtain a vortex image.
Optionally, the second generating module is configured to generate a target image according to the initial image and the vortex image, including: a selecting unit, configured to select a target area matching with the size of the initial image from the vortex image; and the superposition unit is used for superposing the colors of the plurality of pixel points in the target area on the colors of the corresponding pixel points in the initial image to obtain the target image.
Optionally, the second generating unit is configured to generate the target image according to the initial image and the vortex image by using a Web graphic library.
It should be noted that, the above-mentioned obtaining module 62, the first generating module 64, the adjusting module 66 and the second generating module 68 correspond to steps S202 to S208 in the embodiment, and the plurality of modules are the same as the corresponding steps in terms of implementation and application, but are not limited to the disclosure of the above-mentioned embodiment. It should be noted that the above-described module may be operated as a part of the apparatus in the computer terminal 10 provided in the embodiment.
Embodiments of the present invention may provide a computer device, optionally in this embodiment, the computer device may be located in at least one network device of a plurality of network devices of a computer network. The computer device includes a memory and a processor.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the image generating method and apparatus in the embodiments of the present invention, and the processor executes the software programs and modules stored in the memory, thereby executing various functional applications and data processing, that is, implementing the image generating method described above. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located relative to the processor, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor may call the information and the application program stored in the memory through the transmission device to perform the following steps: acquiring an initial image and a color noise image; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; and generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image.
Optionally, the above processor may further execute program code for: generating a movement track for each of a plurality of pixels of a color noise image includes: determining a swirl region in the color noise image; determining a vortex center of the vortex region; and generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Optionally, the above processor may further execute program code for: based on the vortex center, generating a corresponding movement track for the pixel points in the vortex area comprises the following steps: generating a movement function corresponding to the vortex region based on the vortex center; randomly generating a time value for the pixel points in the swirling area; substituting a time value corresponding to the pixel point in the vortex area into a movement function to obtain a movement result corresponding to the pixel point in the vortex area; and determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Optionally, the above processor may further execute program code for: based on the movement track of each of a plurality of pixels of the color noise image, adjusting the colors of the plurality of pixels of the color noise image to obtain a vortex image, comprising: selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point; determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points; and adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain a vortex image.
Optionally, the above processor may further execute program code for: generating a target image from the initial image and the vortex image, comprising: selecting a target area matched with the size of the initial image from the vortex image; and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
Optionally, the above processor may further execute program code for: and generating a target image according to the initial image and the vortex image by adopting a Web graphic library.
By adopting the embodiment of the invention, an image generation method is provided, and an initial image and a color noise image are acquired; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; according to the initial image and the swirl image, a target image is generated, wherein the target image is a color noise swirl effect image of the initial image, the purpose of reducing calculation resources and calculation time occupied in the image generation process is achieved, the technical effect of improving the image generation efficiency is achieved, and the technical problem that a large amount of calculation time is required for style learning of the image generating the color swirl effect in the related art is generally adopted to lead to lower image generation efficiency is solved.
Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute on associated hardware, the program may be stored in a non-volatile storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
Embodiments of the present invention also provide a nonvolatile storage medium. Alternatively, in the present embodiment, the above-described nonvolatile storage medium may be used to store the program code executed by the image generation method provided in the above-described embodiment.
Alternatively, in this embodiment, the above-mentioned nonvolatile storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: acquiring an initial image and a color noise image; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; and generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: generating a movement track for each of a plurality of pixels of a color noise image includes: determining a swirl region in the color noise image; determining a vortex center of the vortex region; and generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: based on the vortex center, generating a corresponding movement track for the pixel points in the vortex area comprises the following steps: generating a movement function corresponding to the vortex region based on the vortex center; randomly generating a time value for the pixel points in the swirling area; substituting a time value corresponding to the pixel point in the vortex area into a movement function to obtain a movement result corresponding to the pixel point in the vortex area; and determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: based on the movement track of each of a plurality of pixels of the color noise image, adjusting the colors of the plurality of pixels of the color noise image to obtain a vortex image, comprising: selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point; determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points; and adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain a vortex image.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: generating a target image from the initial image and the vortex image, comprising: selecting a target area matched with the size of the initial image from the vortex image; and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
Optionally, in the present embodiment, the non-volatile storage medium is arranged to store program code for performing the steps of: and generating a target image according to the initial image and the vortex image by adopting a Web graphic library.
Embodiments of the present invention also provide a computer program product comprising a computer program, optionally in this embodiment, the computer program when executed by a processor may implement: acquiring an initial image and a color noise image; respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect; based on the movement track of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image; and generating a target image according to the initial image and the swirl image, wherein the target image is a color noise swirl effect diagram of the initial image.
Alternatively, in the present embodiment, the computer program may be implemented when executed by a processor: generating a movement track for each of a plurality of pixels of a color noise image includes: determining a swirl region in the color noise image; determining a vortex center of the vortex region; and generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
Alternatively, in the present embodiment, the computer program may be implemented when executed by a processor: based on the vortex center, generating a corresponding movement track for the pixel points in the vortex area comprises the following steps: generating a movement function corresponding to the vortex region based on the vortex center; randomly generating a time value for the pixel points in the swirling area; substituting a time value corresponding to the pixel point in the vortex area into a movement function to obtain a movement result corresponding to the pixel point in the vortex area; and determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces towards the vortex center.
Alternatively, in the present embodiment, the computer program may be implemented when executed by a processor: based on the movement track of each of a plurality of pixels of the color noise image, adjusting the colors of the plurality of pixels of the color noise image to obtain a vortex image, comprising: selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point; determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points; and adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain a vortex image.
Alternatively, in the present embodiment, the computer program may be implemented when executed by a processor: generating a target image from the initial image and the vortex image, comprising: selecting a target area matched with the size of the initial image from the vortex image; and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
Alternatively, in the present embodiment, the computer program may be implemented when executed by a processor: and generating a target image according to the initial image and the vortex image by adopting a Web graphic library.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a non-volatile storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. An image generation method, comprising:
acquiring an initial image and a color noise image;
Respectively generating a moving track for a plurality of pixel points of the color noise image, wherein the moving track is used for simulating a vortex effect;
Based on the movement tracks of each of a plurality of pixel points of the color noise image, adjusting the colors of the plurality of pixel points of the color noise image to obtain a vortex image;
And generating a target image according to the initial image and the vortex image, wherein the target image is a color noise vortex effect diagram of the initial image.
2. The method of claim 1, wherein generating a movement track for each of the plurality of pixels of the color noise image comprises:
determining a swirl region in the color noise image;
Determining a vortex center of the vortex region;
And generating a corresponding movement track for the pixel points in the vortex area based on the vortex center.
3. The method of claim 2, wherein the generating a corresponding movement trajectory for the pixel points within the vortex region based on the vortex center comprises:
generating a movement function corresponding to the vortex region based on the vortex center;
randomly generating a time value for the pixel points in the vortex area;
substituting a time value corresponding to the pixel point in the vortex area into the movement function to obtain a movement result corresponding to the pixel point in the vortex area;
And determining a movement track corresponding to the pixel points in the vortex area according to the movement result corresponding to the pixel points in the vortex area, wherein the bending direction of the movement track corresponding to the pixel points in the vortex area faces the vortex center.
4. The method of claim 1, wherein adjusting the colors of the plurality of pixels of the color noise image based on the movement trajectories of the plurality of pixels of the color noise image to obtain the swirl image comprises:
selecting a pixel point meeting a preset condition from a plurality of pixel points of the color noise image as a moving pixel point;
Determining the pixel points forming the moving track corresponding to the moving pixel points as track pixel points;
And adjusting the color of the corresponding track pixel point according to the color of the moving pixel point to obtain the vortex image.
5. The method of claim 1, wherein generating a target image from the initial image and the vortex image comprises:
selecting a target area matched with the size of the initial image from the vortex image;
and overlapping the colors of the plurality of pixel points in the target area to the colors of the corresponding pixel points in the initial image to obtain the target image.
6. The method of any one of claims 1 to 5, wherein generating the target image from the initial image and the swirl image is accomplished using a Web graphic library.
7. An image generating apparatus, comprising:
The acquisition module is used for acquiring an initial image and a color noise image;
The first generation module is used for respectively generating movement tracks for a plurality of pixel points of the color noise image, wherein the movement tracks are used for simulating vortex effects;
the adjusting module is used for adjusting the colors of the plurality of pixel points of the color noise image based on the moving tracks of the plurality of pixel points of the color noise image to obtain a vortex image;
And the second generation module is used for generating a target image according to the initial image and the vortex image, wherein the target image is a color noise vortex effect diagram of the initial image.
8. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform the image generation method of any one of claims 1 to 6.
9. A computer device, comprising: a memory and a processor, wherein the memory is configured to store,
The memory stores a computer program;
the processor configured to execute a computer program stored in the memory, the computer program when executed causing the processor to perform the image generation method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the image generation method of any of claims 1 to 6.
CN202410379937.8A 2024-03-29 2024-03-29 Image generation method, device, nonvolatile storage medium and computer equipment Pending CN118172433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410379937.8A CN118172433A (en) 2024-03-29 2024-03-29 Image generation method, device, nonvolatile storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410379937.8A CN118172433A (en) 2024-03-29 2024-03-29 Image generation method, device, nonvolatile storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN118172433A true CN118172433A (en) 2024-06-11

Family

ID=91350138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410379937.8A Pending CN118172433A (en) 2024-03-29 2024-03-29 Image generation method, device, nonvolatile storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN118172433A (en)

Similar Documents

Publication Publication Date Title
CN111145326B (en) Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device
US5903270A (en) Method and apparatus for mapping a two-dimensional texture onto a three-dimensional surface
US20070139408A1 (en) Reflective image objects
CN108765520B (en) Text information rendering method and device, storage medium and electronic device
CN112316420A (en) Model rendering method, device, equipment and storage medium
US8629868B1 (en) Systems and methods for simulating depth of field on a computer generated display
CN106898040A (en) Virtual resource object rendering intent and device
Feng et al. Magictoon: A 2d-to-3d creative cartoon modeling system with mobile ar
CN112184873A (en) Fractal graph creating method and device, electronic equipment and storage medium
CN113888398B (en) Hair rendering method and device and electronic equipment
US7133052B1 (en) Morph map based simulated real-time rendering
CN104657097A (en) Method and device for displaying wave-shaped dynamic image
CN110025953B (en) Game interface display method and device, storage medium and electronic device
CN118172433A (en) Image generation method, device, nonvolatile storage medium and computer equipment
US20180005432A1 (en) Shading Using Multiple Texture Maps
CN115272628A (en) Rendering method and device of three-dimensional model, computer equipment and storage medium
CN114949863A (en) Virtual character eye rendering method and device, electronic equipment and storage medium
CN115131489A (en) Cloud layer rendering method and device, storage medium and electronic device
CN114299203A (en) Processing method and device of virtual model
de Lima et al. A model for real time ocean breaking waves animation
CN117689756A (en) Image processing method, device, nonvolatile storage medium and computer equipment
WO1997045782A8 (en) Method and apparatus for mapping a two-dimensional texture onto a three-dimensional surface
WO1997045782A2 (en) Method and apparatus for mapping a two-dimensional texture onto a three-dimensional surface
CN117689786A (en) Image generation method, device, nonvolatile storage medium and computer equipment
CN118052900A (en) Image generation method, device, nonvolatile storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination