CN112767236A - Image distortion effect rendering method and device - Google Patents

Image distortion effect rendering method and device Download PDF

Info

Publication number
CN112767236A
CN112767236A CN202011610573.8A CN202011610573A CN112767236A CN 112767236 A CN112767236 A CN 112767236A CN 202011610573 A CN202011610573 A CN 202011610573A CN 112767236 A CN112767236 A CN 112767236A
Authority
CN
China
Prior art keywords
waveform
wave
image
coordinate value
pixel
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.)
Granted
Application number
CN202011610573.8A
Other languages
Chinese (zh)
Other versions
CN112767236B (en
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.)
Gaoding Xiamen Technology Co Ltd
Original Assignee
Gaoding Xiamen Technology 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 Gaoding Xiamen Technology Co Ltd filed Critical Gaoding Xiamen Technology Co Ltd
Priority to CN202011610573.8A priority Critical patent/CN112767236B/en
Publication of CN112767236A publication Critical patent/CN112767236A/en
Priority to PCT/CN2021/106954 priority patent/WO2022142274A1/en
Application granted granted Critical
Publication of CN112767236B publication Critical patent/CN112767236B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses an image distortion effect rendering method, medium, equipment and device, wherein the method comprises the following steps: acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating a waveform radian according to the wave direction, and calculating a variation phase according to the phase and the wave speed; and calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all the pixels are sampled. The image can be rendered with an automatic distortion effect according to the image and parameters input by a user, so that the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.

Description

Image distortion effect rendering method and device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image warping effect rendering method, a computer-readable storage medium, a computer device, and an image warping effect rendering apparatus.
Background
Due to the design requirement, a designer is in the process of designing the image; it is often desirable to distort the image to make the final design aesthetically pleasing.
In the related art, a designer mostly needs to perform complicated debugging through professional drawing software in the process of performing distortion processing on an image, and then the distortion effect of the image can be realized; also, the result of distortion is often undesirable.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide an image warping effect rendering method, which can perform automatic warping effect rendering on an image according to an image and parameters input by a user, thereby greatly saving the time for a designer to make image warping; meanwhile, the rendering stability of the distortion effect is improved.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the invention is to propose a computer device.
The fourth objective of the present invention is to provide an image warping effect rendering apparatus.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides an image warping effect rendering method, including: acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating waveform radian according to the wave direction, and calculating a variation phase according to the phase and the wave speed; and calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all pixels are sampled.
According to the image distortion effect rendering method provided by the embodiment of the invention, firstly, an original image, and image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; then, calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction, and calculating the variation phase according to the phase and the wave speed; then, calculating a change coordinate value corresponding to any pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of the pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all the pixels are sampled; therefore, the rendering of the automatic distortion effect of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
In addition, the image warping effect rendering method proposed according to the above embodiment of the present invention may further have the following additional technical features:
alternatively, if the waveform shape is a sine wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
Alternatively, if the waveform shape is a square wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
Alternatively, if the waveform shape is a triangular wave, the change coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, coord.x represents the X-value in the variation coordinate value, coord.y represents the Y-value in the variation coordinate value, amp.x represents the X-value of the amplitude of the waveform, and amp.y represents the Y-value of the amplitude of the waveform.
Alternatively, if the waveform shape is an elliptical wave, the change coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-sqrt(1-amp.x2)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, amp.x represents the X-value of the amplitude of the waveform, amp.y represents the Y-value of the amplitude of the waveform, coord.x represents the X-value in the variation coordinate values, and coord.y represents the Y-value in the variation coordinate values.
Optionally, the method further comprises: and acquiring edge fixing information sent by a user, and determining the waveform change position according to the edge fixing information to determine a final distorted image.
To achieve the above object, a second aspect of the present invention provides a computer-readable storage medium, on which an image warping effect rendering program is stored, which when executed by a processor implements the image warping effect rendering method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the image distortion effect rendering program is stored, so that the processor realizes the image distortion effect rendering method when executing the image distortion effect rendering program, thereby realizing automatic distortion effect rendering on the image according to the image and the parameters input by the user, and greatly saving the manufacturing time of image distortion by a designer; meanwhile, the rendering stability of the distortion effect is improved.
In order to achieve the above object, a third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the image warping effect rendering method as described above.
According to the computer equipment provided by the embodiment of the invention, the image distortion effect rendering program is stored through the memory, so that the processor realizes the image distortion effect rendering method when executing the image distortion effect rendering program, the automatic distortion effect rendering of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
In order to achieve the above object, a fourth aspect of the present invention provides an image warping effect rendering apparatus, including: the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; the calculating module is used for calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating a waveform radian according to the wave direction and calculating a variation phase according to the phase and the wave speed; and the rendering module is used for calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the rendering of the distortion effect of the original image after all pixels are sampled.
According to the image distortion effect rendering device provided by the embodiment of the invention, the acquisition module is arranged for acquiring the original image, and the image parameters and the waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; the calculation module is used for calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction and calculating the variation phase according to the phase and the wave speed; the rendering module is used for calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and a coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the rendering of the distortion effect of the original image after all pixels are sampled; therefore, the rendering of the automatic distortion effect of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
Drawings
FIG. 1 is a flowchart illustrating an image warping effect rendering method according to an embodiment of the present invention;
FIG. 2 is a block diagram illustrating an image warping effect rendering apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the related art, the steps required by the designer in the process of warping the image are complicated, and the warping result is unstable. According to the image distortion effect rendering method provided by the embodiment of the invention, firstly, an original image, and image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed; then, calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction, and calculating the variation phase according to the phase and the wave speed; then, calculating a change coordinate value corresponding to any pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of the pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all the pixels are sampled; therefore, the rendering of the automatic distortion effect of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a schematic flowchart of an image warping effect rendering method according to an embodiment of the present invention, and as shown in fig. 1, the image warping effect rendering method includes the following steps:
s101, acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed.
That is, an original image sent by a user, image parameters (for example, height, width, resolution, etc. of the image) corresponding to the original image, and waveform parameters sent by the user are obtained, where the waveform parameters may include waveform shape, wave height, wave width, wave direction, phase, and wave velocity (it should be noted that, multiple templates may also be preset; and then the corresponding waveform parameters are determined by the selection of the template by the user).
S102, calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating a waveform radian according to the wave direction, and calculating a variation phase according to the phase and the wave speed.
S103, calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all pixels are sampled.
That is, the change coordinate value corresponding to the pixel is calculated according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value corresponding to the pixel; then, sampling the pixel to obtain a pixel value of the pixel; and then filling the change coordinate values according to the pixel values, and traversing all the pixels to obtain an image with a rendered distortion effect.
In some embodiments, if the waveform shape is a sine wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
In some embodiments, if the waveform shape is a square wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
In some embodiments, if the waveform shape is a triangular wave, the change coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, coord.x represents the X-value in the variation coordinate value, coord.y represents the Y-value in the variation coordinate value, amp.x represents the X-value of the amplitude of the waveform, and amp.y represents the Y-value of the amplitude of the waveform.
In some embodiments, if the waveform shape is an elliptical wave, the change coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-sqrt(1-amp.x2)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, amp.x represents the X-value of the amplitude of the waveform, amp.y represents the Y-value of the amplitude of the waveform, coord.x represents the X-value in the variation coordinate values, and coord.y represents the Y-value in the variation coordinate values.
In some embodiments, the image warping effect rendering method provided by the embodiments of the present invention further includes: further comprising: and acquiring edge fixing information sent by a user, and determining a waveform change position according to the edge fixing information to determine a final distorted image.
That is, the user can set the start position and the end position of the waveform change by himself; for example, when the waveform direction is the width direction of the image; the user may limit the location of the waveform change to one third of the image width to two thirds of the image width without changing the head and tail portions.
In summary, according to the image warping effect rendering method of the embodiment of the present invention, first, an original image, and image parameters and waveform parameters corresponding to the original image are obtained, where the waveform parameters include a waveform shape, a wave height, a wave width, a wave direction, a phase, and a wave velocity; then, calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction, and calculating the variation phase according to the phase and the wave speed; then, calculating a change coordinate value corresponding to any pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of the pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all the pixels are sampled; therefore, the rendering of the automatic distortion effect of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
In order to achieve the above embodiments, an embodiment of the present invention proposes a computer-readable storage medium on which an image warping effect rendering program is stored, which, when executed by a processor, implements the image warping effect rendering method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the image distortion effect rendering program is stored, so that the processor realizes the image distortion effect rendering method when executing the image distortion effect rendering program, thereby realizing automatic distortion effect rendering on the image according to the image and the parameters input by the user, and greatly saving the manufacturing time of image distortion by a designer; meanwhile, the rendering stability of the distortion effect is improved.
In order to implement the foregoing embodiments, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the image warping effect rendering method as described above.
According to the computer equipment provided by the embodiment of the invention, the image distortion effect rendering program is stored through the memory, so that the processor realizes the image distortion effect rendering method when executing the image distortion effect rendering program, the automatic distortion effect rendering of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
In order to implement the foregoing embodiments, an embodiment of the present invention provides an image warping effect rendering apparatus, as shown in fig. 2, the image warping effect rendering apparatus includes: an acquisition module 10, a calculation module 20 and a rendering module 30.
The obtaining module 10 is configured to obtain an original image, and image parameters and waveform parameters corresponding to the original image, where the waveform parameters include a waveform shape, a wave height, a wave width, a wave direction, a phase, and a wave velocity.
The calculation module 20 is used for calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction, and calculating the variation phase according to the phase and the wave speed.
The rendering module 30 is configured to calculate a change coordinate value corresponding to a pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and a coordinate value of any pixel, and sample the pixel according to the change coordinate value, so as to complete the rendering of the distortion effect of the original image after all pixels are sampled.
It should be noted that the above description about the image warping effect rendering method in fig. 1 is also applicable to the image warping effect rendering apparatus, and is not repeated herein.
In summary, according to the image warping effect rendering apparatus in the embodiment of the present invention, the obtaining module is configured to obtain the original image, and the image parameter and the waveform parameter corresponding to the original image, where the waveform parameter includes a waveform shape, a wave height, a wave width, a wave direction, a phase, and a wave velocity; the calculation module is used for calculating the waveform amplitude according to the image parameters, the wave height and the wave width, calculating the waveform radian according to the wave direction and calculating the variation phase according to the phase and the wave speed; the rendering module is used for calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and a coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the rendering of the distortion effect of the original image after all pixels are sampled; therefore, the rendering of the automatic distortion effect of the image is realized according to the image and the parameters input by the user, and the time for a designer to make image distortion is greatly saved; meanwhile, the rendering stability of the distortion effect is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (9)

1. An image warping effect rendering method, comprising the steps of:
acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed;
calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating waveform radian according to the wave direction, and calculating a variation phase according to the phase and the wave speed;
and calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the distortion effect rendering of the original image after all pixels are sampled.
2. The image warping effect rendering method of claim 1, wherein if the waveform shape is a sine wave, the variation coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
3. The image warping effect rendering method of claim 1, wherein if the waveform shape is a square wave, the variation coordinate value is calculated according to the following formula:
amp=(height/h,width/w)
pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein amp represents the amplitude of the waveform, height represents the height of the wave, width represents the width of the wave, h represents the height of the original image, w represents the width of the original image, amp.x represents the X value of the amplitude of the waveform, amp.y represents the Y value of the amplitude of the waveform, pos represents the changed pixel, X represents the X coordinate value of any one pixel, Y represents the Y coordinate value of any one pixel, rad represents the radian of the waveform, pF represents the changed phase, coord.x represents the X value in the changed coordinate value, and coord.y represents the Y value in the changed coordinate value.
4. The image warping effect rendering method of claim 1, wherein if the waveform shape is a triangle wave, the variation coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, coord.x represents the X-value in the variation coordinate value, coord.y represents the Y-value in the variation coordinate value, amp.x represents the X-value of the amplitude of the waveform, and amp.y represents the Y-value of the amplitude of the waveform.
5. The image warping effect rendering method of claim 1, wherein if the waveform shape is an elliptical wave, the variation coordinate value is calculated according to the following formula:
r=x*sin(rad)-y*cos(rad)+pF
pos=-sqrt(1-amp.x2)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.x
wherein r represents the calculated median, X represents the X-coordinate value of any pixel, Y represents the Y-coordinate value of any pixel, rad represents the radian of the waveform, pF represents the variation phase, pos represents the variation pixel, amp.x represents the X-value of the amplitude of the waveform, amp.y represents the Y-value of the amplitude of the waveform, coord.x represents the X-value in the variation coordinate values, and coord.y represents the Y-value in the variation coordinate values.
6. The image warping effect rendering method of any one of claims 1-5, further comprising: and acquiring edge fixing information sent by a user, and determining the waveform change position according to the edge fixing information to determine a final distorted image.
7. A computer-readable storage medium, characterized in that an image warping effect rendering program is stored thereon, which when executed by a processor implements the image warping effect rendering method according to any one of claims 1-6.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the program, implements the image warping effect rendering method as claimed in any one of claims 1-6.
9. An image warping effect rendering apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise waveform shape, wave height, wave width, wave direction, phase and wave speed;
the calculating module is used for calculating waveform amplitude according to the image parameters, the wave height and the wave width, calculating a waveform radian according to the wave direction and calculating a variation phase according to the phase and the wave speed;
and the rendering module is used for calculating a change coordinate value corresponding to the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel, and sampling the pixel according to the change coordinate value so as to finish the rendering of the distortion effect of the original image after all pixels are sampled.
CN202011610573.8A 2020-12-30 2020-12-30 Image distortion effect rendering method and device Active CN112767236B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011610573.8A CN112767236B (en) 2020-12-30 2020-12-30 Image distortion effect rendering method and device
PCT/CN2021/106954 WO2022142274A1 (en) 2020-12-30 2021-07-16 Image warping effect rendering method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011610573.8A CN112767236B (en) 2020-12-30 2020-12-30 Image distortion effect rendering method and device

Publications (2)

Publication Number Publication Date
CN112767236A true CN112767236A (en) 2021-05-07
CN112767236B CN112767236B (en) 2022-09-16

Family

ID=75695922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011610573.8A Active CN112767236B (en) 2020-12-30 2020-12-30 Image distortion effect rendering method and device

Country Status (2)

Country Link
CN (1) CN112767236B (en)
WO (1) WO2022142274A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022142274A1 (en) * 2020-12-30 2022-07-07 稿定(厦门)科技有限公司 Image warping effect rendering method and apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2600913B2 (en) * 1989-07-27 1997-04-16 富士通株式会社 Distortion image creation processing device
US6246495B1 (en) * 1997-03-27 2001-06-12 The Institute Of Physical And Chemical Research Phase-shift digital holographic apparatus
US20030117528A1 (en) * 2001-12-13 2003-06-26 Lin Liang Interactive water effects using texture coordinate shifting
WO2015106635A1 (en) * 2014-01-15 2015-07-23 The Hong Kong University Of Science And Technology Unobtrusive data embedding in information displays and extracting unobtrusive data from camera captured images or videos
WO2017036040A1 (en) * 2015-08-28 2017-03-09 京东方科技集团股份有限公司 Pixel array, display driver device, driving method therefor, and display device
CN107845074A (en) * 2017-10-24 2018-03-27 维沃移动通信有限公司 A kind of image rendering method and mobile terminal
CN111480057A (en) * 2017-12-21 2020-07-31 索尼公司 Image processing apparatus, image processing method, and program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8279345B2 (en) * 2009-07-21 2012-10-02 Qualcomm Incorporated System and method for random noise estimation in a sequence of images
CN102592297B (en) * 2011-12-27 2015-01-07 Tcl集团股份有限公司 Real-time water wave texture processing method based on 2D (Two-dimensional) grid
TWI488441B (en) * 2012-10-29 2015-06-11 Novatek Microelectronics Corp Method for reducing water-wave noise and system thereof
CN111008928B (en) * 2019-11-26 2024-03-29 杭州小影创新科技股份有限公司 Method and system for realizing special effects of image raindrop dropping and waving
CN112767236B (en) * 2020-12-30 2022-09-16 稿定(厦门)科技有限公司 Image distortion effect rendering method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2600913B2 (en) * 1989-07-27 1997-04-16 富士通株式会社 Distortion image creation processing device
US6246495B1 (en) * 1997-03-27 2001-06-12 The Institute Of Physical And Chemical Research Phase-shift digital holographic apparatus
US20030117528A1 (en) * 2001-12-13 2003-06-26 Lin Liang Interactive water effects using texture coordinate shifting
WO2015106635A1 (en) * 2014-01-15 2015-07-23 The Hong Kong University Of Science And Technology Unobtrusive data embedding in information displays and extracting unobtrusive data from camera captured images or videos
WO2017036040A1 (en) * 2015-08-28 2017-03-09 京东方科技集团股份有限公司 Pixel array, display driver device, driving method therefor, and display device
CN107845074A (en) * 2017-10-24 2018-03-27 维沃移动通信有限公司 A kind of image rendering method and mobile terminal
CN111480057A (en) * 2017-12-21 2020-07-31 索尼公司 Image processing apparatus, image processing method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022142274A1 (en) * 2020-12-30 2022-07-07 稿定(厦门)科技有限公司 Image warping effect rendering method and apparatus

Also Published As

Publication number Publication date
WO2022142274A1 (en) 2022-07-07
CN112767236B (en) 2022-09-16

Similar Documents

Publication Publication Date Title
US9613291B2 (en) Method and system for patching up a point cloud of an object
CN112669429A (en) Image distortion rendering method and device
JP2018010622A5 (en)
CN108810597B (en) Video special effect processing method and device
US20160180501A1 (en) Efficient lens re-distortion
US9723204B2 (en) Dynamic motion path blur kernel
CN112767236B (en) Image distortion effect rendering method and device
TW201740131A (en) Method of processing FMCW radar signal
US9955065B2 (en) Dynamic motion path blur user interface
CN105021181B (en) A kind of drawing electronic map area determination method, device and navigation equipment
CN109145981A (en) Deep learning automation model training method and equipment
CN110782534B (en) 3D character color gradient method, medium, equipment and device
CN103473543B (en) For extracting device, method and the electronic equipment on objects in images border
CN106611443B (en) Three-dimensional topographic point picking method and device
US20160035068A1 (en) Dynamic Motion Path Blur Techniques
CN112598802B (en) Thermodynamic diagram generation method and system based on crowdsourcing data
KR20180034237A (en) Image processing apparatus, image processing method, storage medium, and program
CN110874824A (en) Image restoration method and device
CN112700526B (en) Concave-convex material image rendering method and device
JP5127847B2 (en) Cross-sectional image generation apparatus, cross-sectional image generation method, and program thereof
CN115147474A (en) Point cloud annotation model generation method and device, electronic equipment and storage medium
CN113256758A (en) Graph smoothing method
CN110766807B (en) 3D graph rotation method, medium, device and apparatus
JP2021518951A (en) Correction method and device for correcting image data
JP2006185038A (en) Four- or n-dimensional labeling apparatus, and four- or n-dimensional spatial filter apparatus

Legal Events

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