WO2022142274A1 - Image warping effect rendering method and apparatus - Google Patents

Image warping effect rendering method and apparatus Download PDF

Info

Publication number
WO2022142274A1
WO2022142274A1 PCT/CN2021/106954 CN2021106954W WO2022142274A1 WO 2022142274 A1 WO2022142274 A1 WO 2022142274A1 CN 2021106954 W CN2021106954 W CN 2021106954W WO 2022142274 A1 WO2022142274 A1 WO 2022142274A1
Authority
WO
WIPO (PCT)
Prior art keywords
waveform
image
wave
change
coordinate value
Prior art date
Application number
PCT/CN2021/106954
Other languages
French (fr)
Chinese (zh)
Inventor
刘志杰
陈竞郴
Original Assignee
稿定(厦门)科技有限公司
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 稿定(厦门)科技有限公司 filed Critical 稿定(厦门)科技有限公司
Publication of WO2022142274A1 publication Critical patent/WO2022142274A1/en

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

Definitions

  • the present invention relates to the technical field of image processing, and in particular, to an image distortion effect rendering method, a computer-readable storage medium, a computer device, and an image distortion effect rendering apparatus.
  • an object of the present invention is to propose a method for rendering image distortion effects, which can automatically render images with distortion effects according to the images and parameters input by users, which greatly saves the time for designers to make image distortions; Effect rendering stability.
  • a second object of the present invention is to provide a computer-readable storage medium.
  • the third object of the present invention is to propose a computer device.
  • the fourth object of the present invention is to provide an image distortion effect rendering device.
  • an embodiment of the first aspect of the present invention provides an image distortion effect rendering method, which includes the following steps: acquiring an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, wave height, wave width, wave direction, phase, and wave velocity; waveform amplitude is calculated from the image parameters, wave height, and wave width, and waveform radians are calculated from the wave direction, and calculated from the phase and the wave velocity Change phase; calculate the 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 sample the pixel according to the change coordinate value , which renders the original image's warp effect after all pixels have been sampled.
  • the waveform parameter includes a waveform shape, wave height, wave width, wave direction, phase, and wave velocity
  • waveform amplitude is calculated from the image parameters
  • wave height, and wave width, and waveform radians are calculated from the
  • the image warping effect rendering method first, an original image, image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; then, the waveform amplitude is calculated according to the image parameters, wave height and wave width, and the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity; then, according to the waveform shape , the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel calculate the corresponding change coordinate value of the pixel, and sample the pixel according to the change coordinate value, so that after all pixels are sampled Complete the distortion effect rendering of the original image; thus realize the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; at the same time, improves the stability of the distortion effect rendering.
  • the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave
  • the image distortion effect rendering method proposed according to the above embodiments of the present invention may also have the following additional technical features:
  • the change coordinate value is calculated according to the following formula:
  • amp represents the waveform amplitude
  • height represents the wave height
  • width represents the wave width
  • h represents the original image height
  • w represents the original image width
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude
  • pos represents the Change pixel
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the change The Y value in the coordinate value.
  • the change coordinate value is calculated according to the following formula:
  • amp represents the waveform amplitude
  • height represents the wave height
  • width represents the wave width
  • h represents the original image height
  • w represents the original image width
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude
  • pos represents the Change pixel
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the change The Y value in the coordinate value.
  • the change coordinate value is calculated according to the following formula:
  • r represents the calculated intermediate value
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • pos represents the change pixel
  • coord.x represents the change coordinate value.
  • the X value in , coord.y represents the Y value in the change coordinate value
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude.
  • the change coordinate value is calculated according to the following formula:
  • r represents the calculated intermediate value
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • pos represents the change pixel
  • amp.x represents the waveform amplitude.
  • X value, amp.y represents the Y value of the waveform amplitude
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the Y value in the change coordinate value.
  • the method further includes: acquiring edge fixation information sent by the user, and determining a waveform change position according to the edge fixation information to determine the final distorted image.
  • a second aspect of the present invention provides a computer-readable storage medium, which stores an image warping effect rendering program, and the image warping effect rendering program is executed by a processor to achieve the above image warping effect. render method.
  • the processor by storing the image distortion effect rendering program, the processor implements the above-mentioned image distortion effect rendering method when executing the image distortion effect rendering program, so as to realize the image distortion effect rendering method according to the user input.
  • Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
  • an embodiment of the third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the program, Implement the image warping effect rendering method as described above.
  • the image warping effect rendering program is stored in the memory, so that the processor implements the above-mentioned image warping effect rendering method when executing the image warping effect rendering program, so as to realize the image warping effect rendering method according to the user input.
  • Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
  • an embodiment of the fourth aspect of the present invention provides an image distortion effect rendering device, including: an acquisition module, the acquisition module is configured to acquire an original image, image parameters and waveform parameters corresponding to the original image, wherein , the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; a calculation module, the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and according to the wave The direction calculates the waveform radian, and calculates the change phase according to the phase and the wave speed; the rendering module is configured to calculate the change phase according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and any arbitrary The coordinate value of a pixel calculates the change coordinate value corresponding to the pixel, and samples 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.
  • the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity
  • an acquisition module is configured to acquire an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, a wave height, a wave width, and a wave shape.
  • the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and calculate the changing phase according to the phase and the wave speed; rendering The module is used to calculate the 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 sample the pixel according to the change coordinate value , to complete the distortion rendering of the original image after all pixels are sampled; thus realize the automatic distortion rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; at the same time, it improves the distortion effect. Rendering stability.
  • FIG. 1 is a schematic flowchart of a method for rendering an image distortion effect according to an embodiment of the present invention
  • FIG. 2 is a schematic block diagram of an image warping effect rendering apparatus according to an embodiment of the present invention.
  • the image warping effect rendering method in the process of distorting an image, the designer needs to perform complicated steps, and the distortion result is unstable.
  • the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; then, the waveform amplitude is calculated according to the image parameters, wave height and wave width, and the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity; then, according to the waveform shape , the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel calculate the corresponding change coordinate value of the pixel, and sample the pixel according to the change coordinate value, so that after all pixels are sampled Complete the distortion effect rendering of the original image; thus realize the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production
  • FIG. 1 is a schematic flowchart of a method for rendering an image distortion effect according to an embodiment of the present invention. As shown in FIG. 1 , the image distortion effect rendering method includes the following steps:
  • S101 Acquire an original image, image parameters and waveform parameters corresponding to the original image, where the waveform parameters include waveform shape, wave height, wave width, wave direction, phase, and wave velocity.
  • the image parameters corresponding to the original image for example, the height, width, resolution, etc. of the image
  • the waveform parameters may include waveform shape, wave height, wave Width, wave direction, phase and wave velocity (it should be noted that multiple templates can also be preset; then the corresponding waveform parameters are determined by the user's selection of templates).
  • the waveform amplitude is calculated according to the image parameters, the wave height and the wave width, the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity.
  • S103 Calculate the 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 sample the pixel according to the change coordinate value, so as to complete the sampling after all pixels are sampled Distorted rendering of the original image.
  • the corresponding change coordinate value of the pixel is calculated; then, the pixel is sampled to obtain its pixel value; then according to the pixel value Fill the changing coordinate value, and after traversing all pixels, the image rendered with the distortion effect can be obtained.
  • the change coordinate value is calculated according to the following formula:
  • amp represents the waveform amplitude
  • height represents the wave height
  • width represents the wave width
  • h represents the original image height
  • w represents the original image width
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude
  • pos represents the Change pixel
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the change The Y value in the coordinate value.
  • the change coordinate value is calculated according to the following formula:
  • amp represents the waveform amplitude
  • height represents the wave height
  • width represents the wave width
  • h represents the original image height
  • w represents the original image width
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude
  • pos represents the Change pixel
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the change The Y value in the coordinate value.
  • the change coordinate value is calculated according to the following formula:
  • r represents the calculated intermediate value
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • pos represents the change pixel
  • coord.x represents the change coordinate value.
  • the X value in , coord.y represents the Y value in the change coordinate value
  • amp.x represents the X value of the waveform amplitude
  • amp.y represents the Y value of the waveform amplitude.
  • the change coordinate value is calculated according to the following formula:
  • r represents the calculated intermediate value
  • x represents the X coordinate value of any pixel
  • y represents the Y coordinate value of any pixel
  • rad represents the waveform radian
  • pF represents the change phase
  • pos represents the change pixel
  • amp.x represents the waveform amplitude.
  • X value, amp.y represents the Y value of the waveform amplitude
  • coord.x represents the X value in the change coordinate value
  • coord.y represents the Y value in the change coordinate value.
  • the image warping effect rendering method provided by the embodiments of the present invention further includes: acquiring edge fixation information sent by a user, and determining a waveform change position according to the edge fixation information to determine a final warped image.
  • the user can set the starting position and ending position of the waveform change; for example, when the waveform direction is the width direction of the image; then the user can limit the position of the waveform change from one third of the image width to three times the image width. two parts, leaving the head and tail parts unchanged.
  • the image warping effect rendering method first, the original image, the image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave speed; then, waveform amplitude is calculated according to the image parameters, wave height and wave width, waveform radian is calculated according to the wave direction, and changing phase is calculated according to the phase and the wave speed; then, Calculate the 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 sample the pixel according to the change coordinate value to After all pixels are sampled, the distortion effect rendering of the original image is completed; thus, the image is automatically rendered with a distortion effect according to the image and parameters input by the user, which greatly saves the designer's time for image distortion production; at the same time, the stability of the distortion effect rendering is improved. sex.
  • the embodiments of the present invention provide a computer-readable storage medium on which an image-distortion effect rendering program is stored, and when the image-distortion effect rendering program is executed by a processor, realizes the above-mentioned image-distortion effect rendering method .
  • the processor by storing the image distortion effect rendering program, the processor implements the above-mentioned image distortion effect rendering method when executing the image distortion effect rendering program, so as to realize the image distortion effect rendering method according to the user input.
  • Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
  • the embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor executes the program, the processor implements the following The above image warping effect rendering method.
  • the image warping effect rendering program is stored in the memory, so that the processor implements the above-mentioned image warping effect rendering method when executing the image warping effect rendering program, so as to realize the image warping effect rendering method according to the user input.
  • Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
  • an embodiment of the present invention provides an image distortion effect rendering apparatus.
  • the image distortion effect rendering apparatus includes: an acquisition module 10 , a calculation module 20 and a rendering module 30 .
  • the acquisition module 10 is used to acquire the original image, image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity.
  • the calculation module 20 is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and calculate the change phase according to the phase and wave velocity.
  • the rendering module 30 is configured to calculate the corresponding change coordinate value of the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any one pixel, and to sample the pixel according to the change coordinate value, so as to sample at all pixels. Finished rendering the distortion effect of the original image.
  • an acquisition module is set to acquire an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, a wave height , wave width, wave direction, phase and wave speed;
  • the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and according to the phase and the wave speed Calculate the change phase;
  • the rendering module is used to calculate the 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 according to the change coordinate value Sampling the pixel to complete the distortion effect rendering of the original image after all pixels are sampled; thus realizing the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; At the same time, improve
  • 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, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
  • 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 preclude the presence of a plurality of such elements.
  • the invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware.
  • the use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.
  • first and second are only used for description purposes, and cannot be interpreted as indicating or implying relative importance or the number of indicated technical features. Thus, a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • “plurality” means two or more, unless otherwise expressly and specifically defined.
  • the terms “installed”, “connected”, “connected”, “fixed” and other terms should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements.
  • installed may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements.
  • a first feature "on” or “under” a second feature may be in direct contact between the first and second features, or the first and second features indirectly through an intermediary touch.
  • the first feature being “above”, “over” and “above” the second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is level higher than the second feature.
  • the first feature being “below”, “below” and “below” the second feature may mean that the first feature is directly or obliquely below the second feature, or simply means that the first feature has a lower level than the second feature.

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

An image warping effect rendering method, a medium, a device, and an image warping effect rendering apparatus. The method comprises: acquiring an original image, and image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters comprise a waveform shape, a wave height, a wave width, a wave direction, a phase and a wave velocity (S101); calculating a 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 change phase according to the phase and the wave velocity (S102); and according to the waveform shape, the waveform amplitude, the change phase, the waveform radian, and a coordinate value of any one pixel, calculating a change coordinate value corresponding to the pixel, and sampling the pixel according to the change coordinate value, so as to complete warping effect rendering of the original image after the sampling of all pixels is finished (S103). By means of the method, automatic warping effect rendering can be performed on an image according to the image and parameters input by a user, such that the production time spent by a designer on image warping is greatly saved; moreover, the stability of warping effect rendering is improved.

Description

图像扭曲效果渲染方法及装置Image distortion effect rendering method and device 技术领域technical field
本发明涉及图像处理技术领域,特别涉及一种图像扭曲效果渲染方法、一种计算机可读存储介质、一种计算机设备以及一种图像扭曲效果渲染装置。The present invention relates to the technical field of image processing, and in particular, to an image distortion effect rendering method, a computer-readable storage medium, a computer device, and an image distortion effect rendering apparatus.
背景技术Background technique
由于设计的需要,设计师在对图像进行设计的过程中;往往需要对图像进行扭曲,以使得最终设计得到的图像具有美感。Due to the needs of design, designers often need to distort the image in the process of designing the image, so that the image obtained in the final design has an aesthetic feeling.
相关技术中,设计师在对图像进行扭曲处理的过程中,多需要通过专业的制图软件进行繁琐的调试,才能够实现图像的扭曲效果;并且,扭曲的结果往往不如人意。In the related art, in the process of distorting an image, designers often need to carry out tedious debugging through professional drawing software to achieve the distortion effect of the image; and the result of distortion is often unsatisfactory.
发明内容SUMMARY OF THE INVENTION
本发明旨在至少在一定程度上解决上述技术中的技术问题之一。为此,本发明的一个目的在于提出一种图像扭曲效果渲染方法,能够根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。The present invention aims to solve one of the technical problems in the above technologies at least to a certain extent. Therefore, an object of the present invention is to propose a method for rendering image distortion effects, which can automatically render images with distortion effects according to the images and parameters input by users, which greatly saves the time for designers to make image distortions; Effect rendering stability.
本发明的第二个目的在于提出一种计算机可读存储介质。A second object of the present invention is to provide a computer-readable storage medium.
本发明的第三个目的在于提出一种计算机设备。The third object of the present invention is to propose a computer device.
本发明的第四个目的在于提出一种图像扭曲效果渲染装置。The fourth object of the present invention is to provide an image distortion effect rendering device.
为达到上述目的,本发明第一方面实施例提出了一种图像扭曲效果渲染方法,包括以下步骤:获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。In order to achieve the above object, an embodiment of the first aspect of the present invention provides an image distortion effect rendering method, which includes the following steps: acquiring an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, wave height, wave width, wave direction, phase, and wave velocity; waveform amplitude is calculated from the image parameters, wave height, and wave width, and waveform radians are calculated from the wave direction, and calculated from the phase and the wave velocity Change phase; calculate the 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 sample the pixel according to the change coordinate value , which renders the original image's warp effect after all pixels have been sampled.
根据本发明实施例的图像扭曲效果渲染方法,首先,获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;接着,根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;然后,根据所述波形形状、 所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染;从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the image warping effect rendering method according to the embodiment of the present invention, first, an original image, image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; then, the waveform amplitude is calculated according to the image parameters, wave height and wave width, and the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity; then, according to the waveform shape , the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel calculate the corresponding change coordinate value of the pixel, and sample the pixel according to the change coordinate value, so that after all pixels are sampled Complete the distortion effect rendering of the original image; thus realize the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; at the same time, improves the stability of the distortion effect rendering.
另外,根据本发明上述实施例提出的图像扭曲效果渲染方法还可以具有如下附加的技术特征:In addition, the image distortion effect rendering method proposed according to the above embodiments of the present invention may also have the following additional technical features:
可选地,如果所述波形形状为正弦波,则所述变化坐标值根据以下公式计算:Optionally, if the waveform shape is a sine wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)amp=(height/h,width/w)
pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the coordinate value.
可选地,如果所述波形形状为正方形波,则所述变化坐标值根据以下公式计算:Optionally, if the waveform shape is a square wave, the change coordinate value is calculated according to the following formula:
amp=(height/h,width/w)amp=(height/h,width/w)
pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the coordinate value.
可选地,如果所述波形形状为三角形波,则所述变化坐标值根据以下公式计算:Optionally, 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)+pFr=x*sin(rad)-y*cos(rad)+pF
pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and coord.x represents the change coordinate value. The X value in , coord.y represents the Y value in the change coordinate value, amp.x represents the X value of the waveform amplitude, and amp.y represents the Y value of the waveform amplitude.
可选地,如果所述波形形状为椭圆形波,则所述变化坐标值根据以下公式计算:Optionally, 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)+pFr=x*sin(rad)-y*cos(rad)+pF
pos=-sqrt(1-amp.x 2)*sign(mod(r/2,2)-1) pos=-sqrt(1-amp.x 2 )*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and amp.x represents the waveform amplitude. X value, amp.y represents the Y value of the waveform amplitude, coord.x represents the X value in the change coordinate value, and coord.y represents the Y value in the change coordinate value.
可选地,还包括:获取用户发送的边缘固定信息,并根据所述边缘固定信息确定波形变化位置,以确定最终扭曲图像。Optionally, the method further includes: acquiring edge fixation information sent by the user, and determining a waveform change position according to the edge fixation information to determine the final distorted image.
为达到上述目的,本发明第二方面实施例提出了一种计算机可读存储介质,其上存储有图像扭曲效果渲染程序,该图像扭曲效果渲染程序被处理器执行时实现如上述的图像扭曲效果渲染方法。In order to achieve the above object, a second aspect of the present invention provides a computer-readable storage medium, which stores an image warping effect rendering program, and the image warping effect rendering program is executed by a processor to achieve the above image warping effect. render method.
根据本发明实施例的计算机可读存储介质,通过存储图像扭曲效果渲染程序,以使得处理器在执行该图像扭曲效果渲染程序时,实现如上述的图像扭曲效果渲染方法,从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像 扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the computer-readable storage medium of the embodiment of the present invention, by storing the image distortion effect rendering program, the processor implements the above-mentioned image distortion effect rendering method when executing the image distortion effect rendering program, so as to realize the image distortion effect rendering method according to the user input. Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
为了达到上述目的,本发明第三方面实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上述的图像扭曲效果渲染方法。In order to achieve the above object, an embodiment of the third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the program, Implement the image warping effect rendering method as described above.
根据本发明实施例的计算机设备,通过存储器对图像扭曲效果渲染程序进行存储,以使得处理器在执行该图像扭曲效果渲染程序时,实现如上述的图像扭曲效果渲染方法,从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the computer device of the embodiment of the present invention, the image warping effect rendering program is stored in the memory, so that the processor implements the above-mentioned image warping effect rendering method when executing the image warping effect rendering program, so as to realize the image warping effect rendering method according to the user input. Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
为达到上述目的,本发明第四方面实施例提出了一种图像扭曲效果渲染装置,包括:获取模块,所述获取模块用于获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;计算模块,所述计算模块用于根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;渲染模块,所述渲染模块用于根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。In order to achieve the above object, an embodiment of the fourth aspect of the present invention provides an image distortion effect rendering device, including: an acquisition module, the acquisition module is configured to acquire an original image, image parameters and waveform parameters corresponding to the original image, wherein , the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; a calculation module, the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and according to the wave The direction calculates the waveform radian, and calculates the change phase according to the phase and the wave speed; the rendering module is configured to calculate the change phase according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and any arbitrary The coordinate value of a pixel calculates the change coordinate value corresponding to the pixel, and samples 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.
根据本发明实施例的图像扭曲效果渲染装置,通过设置获取模块用于获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;计算模块用于根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;渲染模块用于根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染;从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the image distortion effect rendering device according to the embodiment of the present invention, an acquisition module is configured to acquire an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, a wave height, a wave width, and a wave shape. direction, phase and wave speed; the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and calculate the changing phase according to the phase and the wave speed; rendering The module is used to calculate the 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 sample the pixel according to the change coordinate value , to complete the distortion rendering of the original image after all pixels are sampled; thus realize the automatic distortion rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; at the same time, it improves the distortion effect. Rendering stability.
附图说明Description of drawings
图1为根据本发明实施例的图像扭曲效果渲染方法的流程示意图;1 is a schematic flowchart of a method for rendering an image distortion effect according to an embodiment of the present invention;
图2为根据本发明实施例的图像扭曲效果渲染装置的方框示意图。FIG. 2 is a schematic block diagram of an image warping effect rendering apparatus according to an embodiment of the present invention.
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。The following describes in detail the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, and are intended to explain the present invention and should not be construed as limiting the present invention.
相关技术中,设计师在对图像进行扭曲处理的过程中,所需要进行的步骤繁琐,并且,扭曲结果不稳定。根据本发明实施例的图像扭曲效果渲染方法,首先,获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;接着,根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;然后,根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染;从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。In the related art, in the process of distorting an image, the designer needs to perform complicated steps, and the distortion result is unstable. According to the image warping effect rendering method according to the embodiment of the present invention, first, an original image, image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity; then, the waveform amplitude is calculated according to the image parameters, wave height and wave width, and the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity; then, according to the waveform shape , the waveform amplitude, the change phase, the waveform radian and the coordinate value of any pixel calculate the corresponding change coordinate value of the pixel, and sample the pixel according to the change coordinate value, so that after all pixels are sampled Complete the distortion effect rendering of the original image; thus realize the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; at the same time, improves the stability of the distortion effect rendering.
为了更好的理解上述技术方案,下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。For better understanding of 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 present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present invention will be more thoroughly understood, and will fully convey the scope of the present invention to those skilled in the art.
为了更好的理解上述技术方案,下面将结合说明书附图以及具体的实施方式对上述技术方案进行详细的说明。In order to better understand the above technical solutions, the above technical solutions will be described in detail below with reference to the accompanying drawings and specific embodiments.
图1为根据本发明实施例提出的图像扭曲效果渲染方法的流程示意图,如图1所示,该图像扭曲效果渲染方法包括以下步骤:FIG. 1 is a schematic flowchart of a method for rendering an image distortion effect according to an embodiment of the present invention. As shown in FIG. 1 , the image distortion effect rendering method includes the following steps:
S101,获取原始图像、原始图像对应的图像参数和波形参数,其中,波形参数包括波形形状、波高、波宽、波方向、相位和波速度。S101: Acquire an original image, image parameters and waveform parameters corresponding to the original image, where the waveform parameters include waveform shape, wave height, wave width, wave direction, phase, and wave velocity.
也就是说,获取用户发送的原始图像、该原始图像对应的图像参数(例如,图像的高、宽、分辨率等)以及用户发送的波形参数,其中,波形参数可以包括波形形状、波高、波宽、波方向、相位和波速度(需要说明的是,也可以预设多种模板;然后通过用户对于模板的选择来确定相应的波形参数)。That is to say, obtain the original image sent by the user, the image parameters corresponding to the original image (for example, the height, width, resolution, etc. of the image), and the waveform parameters sent by the user, 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 can also be preset; then the corresponding waveform parameters are determined by the user's selection of templates).
S102,根据图像参数、波高和波宽计算波形振幅,并根据波方向计算波形弧度,以及根据相位和波速度计算变化相位。S102, the waveform amplitude is calculated according to the image parameters, the wave height and the wave width, the waveform radian is calculated according to the wave direction, and the changing phase is calculated according to the phase and the wave velocity.
S103,根据波形形状、波形振幅、变化相位、波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。S103: Calculate the 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 sample the pixel according to the change coordinate value, so as to complete the sampling after all pixels are sampled Distorted rendering of the original image.
即言,根据波形形状、波形振幅、变化相位、波形弧度和像素对应的坐标值计算该像素所对应的变化坐标值;然后,对该像素进行采样,以获取其像素值;接着根据该像素值对变化坐标值进行填充,则遍历所有像素之后,即可得到扭曲效果渲染后的图像。That is to say, according to the waveform shape, waveform amplitude, change phase, waveform radian and the coordinate value corresponding to the pixel, the corresponding change coordinate value of the pixel is calculated; then, the pixel is sampled to obtain its pixel value; then according to the pixel value Fill the changing coordinate value, and after traversing all pixels, the image rendered with the distortion effect can be obtained.
在一些实施例中,如果波形形状为正弦波,则所述变化坐标值根据以下公式计算: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)amp=(height/h,width/w)
pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the 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)amp=(height/h,width/w)
pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the 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)+pFr=x*sin(rad)-y*cos(rad)+pF
pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and coord.x represents the change coordinate value. The X value in , coord.y represents the Y value in the change coordinate value, amp.x represents the X value of the waveform amplitude, and amp.y represents the Y value of the waveform amplitude.
在一些实施例中,如果波形形状为椭圆形波,则所述变化坐标值根据以下公式计算: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)+pFr=x*sin(rad)-y*cos(rad)+pF
pos=-sqrt(1-amp.x 2)*sign(mod(r/2,2)-1) pos=-sqrt(1-amp.x 2 )*sign(mod(r/2,2)-1)
coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and amp.x represents the waveform amplitude. X value, amp.y represents the Y value of the waveform amplitude, coord.x represents the X value in the change coordinate value, and coord.y represents the Y value in the change coordinate value.
在一些实施例中,本发明实施例提出的图像扭曲效果渲染方法还包括:还包括:获取用户发送的边缘固定信息,并根据边缘固定信息确定波形变化位置,以确定最终扭曲图像。In some embodiments, the image warping effect rendering method provided by the embodiments of the present invention further includes: acquiring edge fixation information sent by a user, and determining a waveform change position according to the edge fixation information to determine a final warped image.
即言,用户可以自行设定波形变化的起始位置和结束位置;例如,当波形方向为图像的宽度方向;则用户可以将波形变化的位置限定在图像宽度三分之一到图像宽度的三分之二处,而使得头尾两部分不进行变化。In other words, the user can set the starting position and ending position of the waveform change; for example, when the waveform direction is the width direction of the image; then the user can limit the position of the waveform change from one third of the image width to three times the image width. two parts, leaving the head and tail parts unchanged.
综上所述,根据本发明实施例的图像扭曲效果渲染方法,首先,获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;接着,根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;然后,根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该 像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染;从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。To sum up, according to the image warping effect rendering method according to the embodiment of the present invention, first, the original image, the image parameters and waveform parameters corresponding to the original image are obtained, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave speed; then, waveform amplitude is calculated according to the image parameters, wave height and wave width, waveform radian is calculated according to the wave direction, and changing phase is calculated according to the phase and the wave speed; then, Calculate the 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 sample the pixel according to the change coordinate value to After all pixels are sampled, the distortion effect rendering of the original image is completed; thus, the image is automatically rendered with a distortion effect according to the image and parameters input by the user, which greatly saves the designer's time for image distortion production; at the same time, the stability of the distortion effect rendering is improved. sex.
为了实现上述实施例,本发明实施例提出了一种计算机可读存储介质,其上存储有图像扭曲效果渲染程序,该图像扭曲效果渲染程序被处理器执行时实现如上述的图像扭曲效果渲染方法。In order to realize the above-mentioned embodiments, the embodiments of the present invention provide a computer-readable storage medium on which an image-distortion effect rendering program is stored, and when the image-distortion effect rendering program is executed by a processor, realizes the above-mentioned image-distortion effect rendering method .
根据本发明实施例的计算机可读存储介质,通过存储图像扭曲效果渲染程序,以使得处理器在执行该图像扭曲效果渲染程序时,实现如上述的图像扭曲效果渲染方法,从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the computer-readable storage medium of the embodiment of the present invention, by storing the image distortion effect rendering program, the processor implements the above-mentioned image distortion effect rendering method when executing the image distortion effect rendering program, so as to realize the image distortion effect rendering method according to the user input. Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
为了实现上述实施例,本发明实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上述的图像扭曲效果渲染方法。In order to implement the above embodiments, the embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the program, the processor implements the following The above image warping effect rendering method.
根据本发明实施例的计算机设备,通过存储器对图像扭曲效果渲染程序进行存储,以使得处理器在执行该图像扭曲效果渲染程序时,实现如上述的图像扭曲效果渲染方法,从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。According to the computer device of the embodiment of the present invention, the image warping effect rendering program is stored in the memory, so that the processor implements the above-mentioned image warping effect rendering method when executing the image warping effect rendering program, so as to realize the image warping effect rendering method according to the user input. Images and parameters automatically render images with distortion effects, which greatly saves the designer's time for image distortion; at the same time, it improves the stability of distortion rendering.
为了实现上述实施例,本发明实施例提出了一种图像扭曲效果渲染装置,如图2所示,该图像扭曲效果渲染装置包括:获取模块10、计算模块20和渲染模块30。In order to realize the above-mentioned embodiment, an embodiment of the present invention provides an image distortion effect rendering apparatus. As shown in FIG. 2 , the image distortion effect rendering apparatus includes: an acquisition module 10 , a calculation module 20 and a rendering module 30 .
其中,获取模块10用于获取原始图像、原始图像对应的图像参数和波形参数,其中,波形参数包括波形形状、波高、波宽、波方向、相位和波速度.Wherein, the acquisition module 10 is used to acquire the original image, image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase and wave velocity.
计算模块20用于根据图像参数、波高和波宽计算波形振幅,并根据波方向计算波形弧度,以及根据相位和波速度计算变化相位.The calculation module 20 is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and calculate the change phase according to the phase and wave velocity.
渲染模块30用于根据波形形状、波形振幅、变化相位、波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。The rendering module 30 is configured to calculate the corresponding change coordinate value of the pixel according to the waveform shape, the waveform amplitude, the change phase, the waveform radian and the coordinate value of any one pixel, and to sample the pixel according to the change coordinate value, so as to sample at all pixels. Finished rendering the distortion effect of the original image.
需要说明的是,上述关于图1中图像扭曲效果渲染方法的描述同样适用于该图像扭曲效果渲染装置,在此不做赘述。It should be noted that the above description about the image distortion effect rendering method in FIG. 1 is also applicable to the image distortion effect rendering apparatus, and details are not repeated here.
综上所述,根据本发明实施例的图像扭曲效果渲染装置,通过设置获取模块用于获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、 波高、波宽、波方向、相位和波速度;计算模块用于根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;渲染模块用于根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染;从而实现根据用户输入的图像和参数对图像进行自动扭曲效果渲染,极大地节约设计师进行图像扭曲的制作时间;同时,提高扭曲效果渲染的稳定性。To sum up, according to the image warping effect rendering apparatus according to the embodiment of the present invention, an acquisition module is set to acquire an original image, an image parameter corresponding to the original image, and a waveform parameter, wherein the waveform parameter includes a waveform shape, a wave height , wave width, wave direction, phase and wave speed; the calculation module is used to calculate the waveform amplitude according to the image parameters, wave height and wave width, and calculate the waveform radian according to the wave direction, and according to the phase and the wave speed Calculate the change phase; the rendering module is used to calculate the 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 according to the change coordinate value Sampling the pixel to complete the distortion effect rendering of the original image after all pixels are sampled; thus realizing the automatic distortion effect rendering of the image according to the image and parameters input by the user, which greatly saves the designer's image distortion production time; At the same time, improve the stability of distortion effect rendering.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。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, etc.) 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 in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
应当注意的是,在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的部件或步骤。位于部件之前的单词“一”或“一个”不排除存在多个这样的部件。本发明可以借助于包括有若干不同部件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。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 preclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these 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 these modifications and variations.
在本发明的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the present invention, it should be understood that the terms "first" and "second" are only used for description purposes, and cannot be interpreted as indicating or implying relative importance or the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of the present invention, "plurality" means two or more, unless otherwise expressly and specifically defined.
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, unless otherwise expressly specified and limited, the terms "installed", "connected", "connected", "fixed" and other terms should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
在本发明中,除非另有明确的规定和限定,第一特征在第二特征“上”或“下”可以是第一和第二特征直接接触,或第一和第二特征通过中间媒介间接接触。而且,第一特征在第二特征“之上”、“上方”和“上面”可是第一特征在第二特征正上方或斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”可以是第一特征在第二特征正下方或斜下方,或仅仅表示第一特征水平高度小于第二特征。In the present invention, unless otherwise expressly specified and limited, a first feature "on" or "under" a second feature may be in direct contact between the first and second features, or the first and second features indirectly through an intermediary touch. Also, the first feature being "above", "over" and "above" the second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is level higher than the second feature. The first feature being "below", "below" and "below" the second feature may mean that the first feature is directly or obliquely below the second feature, or simply means that the first feature has a lower level than the second feature.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不应理解为必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms should not be construed as necessarily referring 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, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。Although the embodiments of the present invention have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present invention. Embodiments are subject to variations, modifications, substitutions and variations.

Claims (9)

  1. 一种图像扭曲效果渲染方法,其特征在于,包括以下步骤:An image distortion effect rendering method, characterized in that it includes the following steps:
    获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;acquiring an original image, image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase, and wave velocity;
    根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;Calculate the waveform amplitude according to the image parameter, wave height and wave width, calculate the waveform radian according to the wave direction, and calculate the changing phase according to the phase and the wave speed;
    根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。Calculate the 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 sample the pixel according to the change coordinate value to After all pixels are sampled, the distortion effect rendering of the original image is completed.
  2. 如权利要求1所述的图像扭曲效果渲染方法,其特征在于,如果所述波形形状为正弦波,则所述变化坐标值根据以下公式计算:The image distortion effect rendering method according to claim 1, wherein, if the waveform shape is a sine wave, the change coordinate value is calculated according to the following formula:
    amp=(height/h,width/w)amp=(height/h,width/w)
    pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)pos=sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)
    coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
    coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
    其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the coordinate value.
  3. 如权利要求1所述的图像扭曲效果渲染方法,其特征在于,如果所述波形形状为正方形波,则所述变化坐标值根据以下公式计算:The image distortion effect rendering method according to claim 1, wherein, if the waveform shape is a square wave, the change coordinate value is calculated according to the following formula:
    amp=(height/h,width/w)amp=(height/h,width/w)
    pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]pos=sin[sin(x*sin(rad)*2pi-y*cos(rad)*2pi+pF*2pi)]
    coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
    coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
    其中,amp表示波形振幅,height表示波高,width表示波宽,h表示原始图像高度,w 表示原始图像宽度,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,pos表示变化像素,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, amp represents the waveform amplitude, height represents the wave height, width represents the wave width, h represents the original image height, w represents the original image width, amp.x represents the X value of the waveform amplitude, amp.y represents the Y value of the waveform amplitude, and pos represents the Change pixel, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, coord.x represents the X value in the change coordinate value, and coord.y represents the change The Y value in the coordinate value.
  4. 如权利要求1所述的图像扭曲效果渲染方法,其特征在于,如果所述波形形状为三角形波,则所述变化坐标值根据以下公式计算:The image distortion effect rendering method according to claim 1, wherein, 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)+pFr=x*sin(rad)-y*cos(rad)+pF
    pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)pos=-(mod(r,2)-1)*sign(mod(r/2,2)-1)
    coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
    coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
    其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and coord.x represents the change coordinate value. The X value in , coord.y represents the Y value in the change coordinate value, amp.x represents the X value of the waveform amplitude, and amp.y represents the Y value of the waveform amplitude.
  5. 如权利要求1所述的图像扭曲效果渲染方法,其特征在于,如果所述波形形状为椭圆形波,则所述变化坐标值根据以下公式计算:The image distortion effect rendering method according to claim 1, wherein, 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)+pFr=x*sin(rad)-y*cos(rad)+pF
    pos=-sqrt(1-amp.x 2)*sign(mod(r/2,2)-1) pos=-sqrt(1-amp.x 2 )*sign(mod(r/2,2)-1)
    coord.x=pos*cos(rad)*amp.ycoord.x=pos*cos(rad)*amp.y
    coord.y=pos*sin(rad)*amp.xcoord.y=pos*sin(rad)*amp.x
    其中,r表示计算中间值,x表示任意一个像素的X坐标值,y表示任意一个像素的Y坐标值,rad表示波形弧度,pF表示变化相位,pos表示变化像素,amp.x表示波形振幅的X值,amp.y表示波形振幅的Y值,coord.x表示变化坐标值中的X值,coord.y表示变化坐标值中的Y值。Among them, r represents the calculated intermediate value, x represents the X coordinate value of any pixel, y represents the Y coordinate value of any pixel, rad represents the waveform radian, pF represents the change phase, pos represents the change pixel, and amp.x represents the waveform amplitude. X value, amp.y represents the Y value of the waveform amplitude, coord.x represents the X value in the change coordinate value, and coord.y represents the Y value in the change coordinate value.
  6. 如权利要求1-5中任一项所述的图像扭曲效果渲染方法,其特征在于,还包括:获 取用户发送的边缘固定信息,并根据所述边缘固定信息确定波形变化位置,以确定最终扭曲图像。The image warping effect rendering method according to any one of claims 1-5, further comprising: acquiring edge fixation information sent by a user, and determining a waveform change position according to the edge fixation information to determine the final distortion image.
  7. 一种计算机可读存储介质,其特征在于,其特征在于,其上存储有图像扭曲效果渲染程序,该图像扭曲效果渲染程序被处理器执行时实现如权利要求1-6中任一项所述的图像扭曲效果渲染方法。A computer-readable storage medium, characterized in that, an image warping effect rendering program is stored thereon, and when the image warping effect rendering program is executed by a processor, any one of claims 1-6 is implemented. The image warping effect rendering method.
  8. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-6中任一项所述的图像扭曲效果渲染方法。A computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the program, any one of claims 1-6 is implemented. The image warping effect rendering method described in item.
  9. 一种图像扭曲效果渲染装置,其特征在于,包括:An image distortion effect rendering device, characterized in that it includes:
    获取模块,所述获取模块用于获取原始图像、所述原始图像对应的图像参数和波形参数,其中,所述波形参数包括波形形状、波高、波宽、波方向、相位和波速度;an acquisition module, configured to acquire an original image, image parameters and waveform parameters corresponding to the original image, wherein the waveform parameters include waveform shape, wave height, wave width, wave direction, phase, and wave velocity;
    计算模块,所述计算模块用于根据所述图像参数、波高和波宽计算波形振幅,并根据所述波方向计算波形弧度,以及根据所述相位和所述波速度计算变化相位;a calculation module, the calculation module is configured to calculate the waveform amplitude according to the image parameters, the wave height and the wave width, calculate the waveform radian according to the wave direction, and calculate the changing phase according to the phase and the wave speed;
    渲染模块,所述渲染模块用于根据所述波形形状、所述波形振幅、所述变化相位、所述波形弧度和任意一个像素的坐标值计算该像素对应的变化坐标值,并根据该变化坐标值对该像素进行采样,以在所有像素采样完毕后完成原始图像的扭曲效果渲染。A rendering module, the rendering module is configured to calculate the 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 according to the change coordinate The value samples the pixel to complete the distortion rendering of the original image after all pixels have been sampled.
PCT/CN2021/106954 2020-12-30 2021-07-16 Image warping effect rendering method and apparatus WO2022142274A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2022142274A1 true WO2022142274A1 (en) 2022-07-07

Family

ID=75695922

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (1)

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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592297A (en) * 2011-12-27 2012-07-18 Tcl集团股份有限公司 Real-time water wave texture processing method based on 2D (Two-dimensional) grid
US8279345B2 (en) * 2009-07-21 2012-10-02 Qualcomm Incorporated System and method for random noise estimation in a sequence of images
US20140118173A1 (en) * 2012-10-29 2014-05-01 Novatek Microelectronics Corp. Method of reducing water-wave noise and system thereof
CN111008928A (en) * 2019-11-26 2020-04-14 杭州趣维科技有限公司 Method and system for realizing special effect of dripping and scratching ripples of raindrops of image
CN112767236A (en) * 2020-12-30 2021-05-07 稿定(厦门)科技有限公司 Image distortion effect rendering method and device

Family Cites Families (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
JP3471556B2 (en) * 1997-03-27 2003-12-02 理化学研究所 Phase shift digital holography device
US6985148B2 (en) * 2001-12-13 2006-01-10 Microsoft Corporation 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
CN105185288A (en) * 2015-08-28 2015-12-23 京东方科技集团股份有限公司 Pixel array, display driving unit, driving method and display device
CN107845074A (en) * 2017-10-24 2018-03-27 维沃移动通信有限公司 A kind of image rendering method and mobile terminal
US11663831B2 (en) * 2017-12-21 2023-05-30 Sony Corporation Image processing device and image processing method

Patent Citations (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
CN102592297A (en) * 2011-12-27 2012-07-18 Tcl集团股份有限公司 Real-time water wave texture processing method based on 2D (Two-dimensional) grid
US20140118173A1 (en) * 2012-10-29 2014-05-01 Novatek Microelectronics Corp. Method of reducing water-wave noise and system thereof
CN111008928A (en) * 2019-11-26 2020-04-14 杭州趣维科技有限公司 Method and system for realizing special effect of dripping and scratching ripples of raindrops of image
CN112767236A (en) * 2020-12-30 2021-05-07 稿定(厦门)科技有限公司 Image distortion effect rendering method and device

Also Published As

Publication number Publication date
CN112767236B (en) 2022-09-16
CN112767236A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
WO2022147964A1 (en) Image distortion rendering method and apparatus
US8035643B2 (en) Animation retargeting
US20160180501A1 (en) Efficient lens re-distortion
JP2010541069A (en) Appearance change of digital image using shape
CN109998706A (en) Orthodontic video generation device and method
WO2021032172A1 (en) Method and apparatus for correcting distortion of depth image, and electronic device and storage medium
JP2009059368A (en) Example-based procedural synthesis of element arrangements
WO2022142274A1 (en) Image warping effect rendering method and apparatus
CN110021000B (en) Hairline repairing method and device based on layer deformation
US20160063670A1 (en) Dynamic Motion Path Blur Kernel
US9955065B2 (en) Dynamic motion path blur user interface
JP2762000B2 (en) Surface generating method and surface generating apparatus
WO2015165258A1 (en) Method and apparatus for determining electronic map drawing area, and navigation device
WO2023071571A9 (en) Sound effect display method and terminal device
CN114041111A (en) Handwriting drawing method, apparatus, electronic device, medium, and program product
WO2022142081A1 (en) Self-defined animation curve generation method and apparatus
US9779484B2 (en) Dynamic motion path blur techniques
JPH09198490A (en) Three-dimensional discrete data projector
CN104574473B (en) Method and device for generating dynamic effect on basis of static image
US11170550B2 (en) Facial animation retargeting using an anatomical local model
TW201701143A (en) System, method, and apparatus for color selection
JP4353957B2 (en) Image generation method, image generation apparatus, and image generation program
WO2017215018A1 (en) Educational toy kit and convex mirror imaging correction method thereof
Luijten et al. 3D surgical instrument collection for computer vision and extended reality
CN116843812A (en) Image rendering method and device and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21913026

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21913026

Country of ref document: EP

Kind code of ref document: A1