WO2022147964A1 - 图像扭曲渲染方法及装置 - Google Patents

图像扭曲渲染方法及装置 Download PDF

Info

Publication number
WO2022147964A1
WO2022147964A1 PCT/CN2021/099768 CN2021099768W WO2022147964A1 WO 2022147964 A1 WO2022147964 A1 WO 2022147964A1 CN 2021099768 W CN2021099768 W CN 2021099768W WO 2022147964 A1 WO2022147964 A1 WO 2022147964A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
value
coordinate value
pixel point
target pixel
Prior art date
Application number
PCT/CN2021/099768
Other languages
English (en)
French (fr)
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 WO2022147964A1 publication Critical patent/WO2022147964A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Definitions

  • the present invention relates to the technical field of image processing, and in particular, to an image warping rendering method, a computer-readable storage medium, a computer device, and an image warping rendering apparatus.
  • the designer in order to make the final image have a distorted effect, the designer usually performs actual operation processing in the process of using the camera to take pictures; after the corresponding picture is taken, it is difficult for the designer to pass the post-processing method. Makes the image have this distorted effect.
  • an object of the present invention is to propose an image distortion rendering method, which can automatically render an image into a final image with a distortion effect, so as to provide convenience for the designer's image processing process.
  • 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 warping rendering device.
  • an embodiment of the first aspect of the present invention proposes an image warping rendering method, which includes the following steps: obtaining an original image and an image center point corresponding to the original image, and calculating the distance from any pixel point in the original image to the image center point corresponding to the original image.
  • the distance of the center point of the image obtain the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera; calculate the pixel point according to the Z coordinate value
  • the corresponding target pixel coordinate value sample the target pixel point according to the coordinate value of the target pixel point to obtain the pixel value of the target pixel point, and modify the pixel value of the pixel point according to the pixel value of the target pixel point .
  • the image warping rendering method first, the original image and the image center point corresponding to the original image are obtained, and the distance from any pixel in the original image to the image center point is calculated; then, the simulation camera field of view parameters, and calculate the Z coordinate value of the pixel on the lens according to the distance and the simulated camera field of view parameter; then, calculate the target pixel coordinate value corresponding to the pixel according to the Z coordinate value,
  • the target pixel is sampled according to the coordinate value of the target pixel to obtain the pixel value of the target pixel, and the pixel value of the pixel is modified according to the pixel value of the target pixel; thus the image can be automatically rendered as The final image with distortion effects to facilitate the designer's image manipulation process.
  • image warping rendering method proposed according to the foregoing embodiments of the present invention may also have the following additional technical features:
  • calculating the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value includes: calculating a first arctangent value according to the distance and the Z coordinate value, and calculating according to the coordinate value of the pixel point.
  • the second arc tangent value; the coordinate value of the target pixel point is calculated according to the coordinate value of the image center point, the first arc tangent value and the second arc tangent value.
  • the coordinate value of the target pixel is calculated according to the following formula:
  • r represents the first arc tangent value
  • d represents the distance between the pixel point and the center point of the image
  • z represents the Z coordinate value
  • phi represents the second arc tangent value
  • (x 1 , y 1 ) represents the coordinate of the pixel point value
  • (x 2 , y 2 ) represents the coordinate value of the target pixel
  • center ⁇ x represents the X coordinate value of the image center point
  • center ⁇ y represents the Y coordinate value of the image center point.
  • a second aspect of the present invention provides a computer-readable storage medium storing an image warping rendering program thereon.
  • the image warping rendering program implements the above image warping rendering method when the image warping rendering program is executed by a processor.
  • the processor by storing the image warping rendering program, the processor implements the above-mentioned image warping rendering method when executing the image warping rendering program, so that the image can be automatically rendered into a warped image.
  • the final image of the effect facilitating the designer's image manipulation process.
  • a third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes all When the program is executed, the image warping rendering method according to any one of claims 1-3 is implemented.
  • the image warping rendering program is stored in the memory, so that the processor implements the above-mentioned image warping rendering method when executing the image warping rendering program, so that the image can be automatically rendered into a warped image.
  • the final image of the effect facilitating the designer's image manipulation process.
  • an embodiment of the fourth aspect of the present invention provides an image warping rendering device, comprising: a first computing module, the first computing module is used to obtain an original image and an image center point corresponding to the original image, and Calculate the distance from any pixel point in the original image to the center point of the image; a second calculation module, the second calculation module is used to obtain the field of view parameter of the simulated camera, and according to the distance and the field of view of the simulated camera
  • the range parameter calculates the Z coordinate value of the pixel point on the lens; the rendering module, the rendering module is used to calculate the target pixel point coordinate value corresponding to the pixel point according to the Z coordinate value, and the target pixel point according to the coordinate value of the target pixel point.
  • the target pixel is sampled to obtain the pixel value of the target pixel, and the pixel value of the pixel is modified according to the pixel value of the target pixel.
  • the first calculation module is configured to obtain the original image and the image center point corresponding to the original image, and calculate the distance from any pixel in the original image to the image center point. distance; the second calculation module is used to obtain the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera; the rendering module is used to calculate the Z coordinate value according to the Z coordinate value Calculate the coordinate value of the target pixel point corresponding to the pixel point, sample the target pixel point according to the coordinate value of the target pixel point to obtain the pixel value of the target pixel point, and according to the pixel value of the target pixel point Pixel values are modified; this enables the image to be automatically rendered into a final image with a distorted effect, facilitating the designer's image manipulation process.
  • image warping rendering apparatus proposed according to the foregoing embodiments of the present invention may also have the following additional technical features:
  • calculating the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value includes: calculating a first arctangent value according to the distance and the Z coordinate value, and calculating according to the coordinate value of the pixel point.
  • the second arc tangent value; the coordinate value of the target pixel point is calculated according to the coordinate value of the image center point, the first arc tangent value and the second arc tangent value.
  • the coordinate value of the target pixel is calculated according to the following formula:
  • r represents the first arc tangent value
  • d represents the distance between the pixel point and the center point of the image
  • z represents the Z coordinate value
  • phi represents the second arc tangent value
  • (x 1 , y 1 ) represents the coordinate of the pixel point value
  • (x 2 , y 2 ) represents the coordinate value of the target pixel
  • center ⁇ x represents the X coordinate value of the image center point
  • center ⁇ y represents the Y coordinate value of the image center point.
  • FIG. 1 is a schematic flowchart of an image warping rendering method according to an embodiment of the present invention
  • FIG. 2 is a schematic block diagram of an image warping rendering apparatus according to an embodiment of the present invention.
  • the image distortion rendering method of the embodiment of the present invention first, the original image and the image center point corresponding to the original image are obtained, and calculate The distance from any pixel in the original image to the center point of the image; then, obtain the field of view parameter of the simulated camera, and calculate the Z coordinate of the pixel on the lens according to the distance and the field of view parameter of the simulated camera Then, calculate the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value, and modify the pixel value of the pixel point according to the pixel value of the target pixel point; thus the image can be automatically rendered to have a distortion effect , which facilitates the designer's image processing process.
  • FIG. 1 is a schematic flowchart of an image warping rendering method according to an embodiment of the present invention. As shown in FIG. 1 , the image warping rendering method includes the following steps:
  • S101 Acquire an original image and an image center point corresponding to the original image, and calculate the distance from any pixel point in the original image to the image center point.
  • the original image input by the user and the image center point corresponding to the original image are obtained, and then the distance from any pixel point in the original image to the image center point is calculated.
  • the image center point corresponding to the original image there may be various ways to obtain the image center point corresponding to the original image; for example, after the user uploads the original image, the user's designated information for the image center point is obtained, so as to determine the image center point according to the designated information; or, The selection of the image center point is carried out by means of preset conditions; or, the recognition model is pre-selected and trained, so that after the original image is input, the characteristic information of the original image is obtained through the recognition model, and the image center is determined according to the characteristic information. point.
  • S102 Acquire the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera.
  • the pixel and the image center can be calculated according to the coordinates of the two points
  • calculating the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value including:
  • the coordinate value of the target pixel point is calculated according to the following formula:
  • r represents the first arc tangent value
  • d represents the distance between the pixel point and the center point of the image
  • z represents the Z coordinate value
  • phi represents the second arc tangent value
  • (x 1 , y 1 ) represents the coordinate of the pixel point value
  • (x 2 , y 2 ) represents the coordinate value of the target pixel
  • center ⁇ x represents the X coordinate value of the image center point
  • center ⁇ y represents the Y coordinate value of the image center point.
  • the image warping rendering method first, the original image and the image center point corresponding to the original image are obtained, and the distance from any pixel point in the original image to the image center point is calculated. ; Next, obtain the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera; then, calculate the target corresponding to the pixel according to the Z coordinate value pixel coordinate value, sample the target pixel point according to the coordinate value of the target pixel point to obtain the pixel value of the target pixel point, and modify the pixel value of the pixel point according to the pixel value of the target pixel point; Automatically renders images into final images with distortion effects, facilitating the designer's image manipulation process.
  • the embodiments of the present invention provide a computer-readable storage medium storing an image warping rendering program thereon.
  • the image warping rendering program implements the above image warping rendering method when the image warping rendering program is executed by a processor.
  • the processor by storing the image warping rendering program, the processor implements the above-mentioned image warping rendering method when executing the image warping rendering program, so that the image can be automatically rendered into a warped image.
  • the final image of the effect facilitating the designer's image manipulation process.
  • 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, characterized in that the processor executes the program , the image warping rendering method according to any one of claims 1-3 is implemented.
  • the image warping rendering program is stored in the memory, so that the processor implements the above-mentioned image warping rendering method when executing the image warping rendering program, so that the image can be automatically rendered into a warped image.
  • the final image of the effect facilitating the designer's image manipulation process.
  • an embodiment of the present invention provides an image warping rendering apparatus.
  • the image warping rendering apparatus includes: a first computing module 10 , a second computing module 20 and a rendering module 30 .
  • the first calculation module 10 is used to obtain the original image and the image center point corresponding to the original image, and calculate the distance from any pixel point in the original image to the image center point;
  • the second calculation module 20 is configured to obtain the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera;
  • the rendering module 30 is used to calculate the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value, sample the target pixel point according to the coordinate value of the target pixel point, to obtain the pixel value of the target pixel point, and according to the target pixel point.
  • the pixel value of the point modifies the pixel value of the pixel point.
  • calculating the coordinate value of the target pixel point corresponding to the pixel point according to the Z coordinate value includes: calculating a first arctangent value according to the distance and the Z coordinate value, and calculating a second arctangent value according to the coordinate value of the pixel point value; calculate the coordinate value of the target pixel point according to the coordinate value of the image center point, the first arc tangent value and the second arc tangent value.
  • the coordinate value of the target pixel point is calculated according to the following formula:
  • r represents the first arc tangent value
  • d represents the distance between the pixel point and the center point of the image
  • z represents the Z coordinate value
  • phi represents the second arc tangent value
  • (x 1 , y 1 ) represents the coordinate of the pixel point value
  • (x 2 , y 2 ) represents the coordinate value of the target pixel
  • center ⁇ x represents the X coordinate value of the image center point
  • center ⁇ y represents the Y coordinate value of the image center point.
  • the first calculation module is configured to obtain the original image and the image center point corresponding to the original image, and calculate the distance from any pixel point in the original image to any pixel in the original image.
  • the second calculation module is used to obtain the field of view parameter of the simulated camera, and calculate the Z coordinate value of the pixel on the lens according to the distance and the field of view parameter of the simulated camera;
  • the rendering module is used for according to The Z coordinate value calculates the coordinate value of the target pixel point corresponding to the pixel point, and samples the target pixel point according to the coordinate value of the target pixel point to obtain the pixel value of the target pixel point, and according to the pixel value of the target pixel point Modify the pixel value of the pixel point; thus, the image can be automatically rendered into a final image with a distortion effect, which is convenient for the designer's image processing process.
  • 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 can 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 communication between 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 communication between 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 below or obliquely below the second feature, or simply means that the first feature has a lower level than the second feature.

Abstract

本发明公开了一种图像扭曲渲染方法、介质、设备及装置,其中方法包括:获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改;能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。

Description

图像扭曲渲染方法及装置 技术领域
本发明涉及图像处理技术领域,特别涉及一种图像扭曲渲染方法、一种计算机可读存储介质、一种计算机设备以及一种图像扭曲渲染装置。
背景技术
在使用摄像机进行拍照的过程中,当摄像机近距离拍摄时,会使得最终拍摄得到的图像产生扭曲的效果。而这一扭曲效果往往会使得最终拍摄得到的图像具有不同的设计美感。
相关技术中,为了使得最终得到的图像具有扭曲的效果,多是通过设计师在使用摄像机进行拍照的过程中进行实际的操作处理;当拍摄得到相应的图片之后,设计师难以通过后处理的方式使得图像具有这种扭曲效果。
发明内容
本发明旨在至少在一定程度上解决上述技术中的技术问题之一。为此,本发明的一个目的在于提出一种图像扭曲渲染方法,能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
本发明的第二个目的在于提出一种计算机可读存储介质。
本发明的第三个目的在于提出一种计算机设备。
本发明的第四个目的在于提出一种图像扭曲渲染装置。
为达到上述目的,本发明第一方面实施例提出了一种图像扭曲渲染方法,包括以下步骤:获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
根据本发明实施例的图像扭曲渲染方法,首先,获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;接着,获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;然后,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目 标像素点的像素值对该像素点的像素值进行修改;从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
另外,根据本发明上述实施例提出的图像扭曲渲染方法还可以具有如下附加的技术特征:
可选地,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,包括:根据所述距离和所述Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;根据图像中心点的坐标值、所述第一反正切值和所述第二反正切值计算所述目标像素点坐标值。
可选地,所述目标像素点坐标值根据以下公式计算:
r=atan(d,z)
phi=atan(y 1,x 1)
(x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
为达到上述目的,本发明第二方面实施例提出了一种计算机可读存储介质,其上存储有图像扭曲渲染程序,该图像扭曲渲染程序被处理器执行时实现如上述的图像扭曲渲染方法。
根据本发明实施例的计算机可读存储介质,通过存储图像扭曲渲染程序,以使得处理器在执行该图像扭曲渲染程序时,实现如上述的图像扭曲渲染方法,从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为达到上述目的,本发明第三方面实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-3中任一项所述的图像扭曲渲染方法。
根据本发明实施例的计算机设备,通过存储器对图像扭曲渲染程序进行存储,以使得处理器在执行该图像扭曲渲染程序时,实现如上述的图像扭曲渲染方法,从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为达到上述目的,本发明第四方面实施例提出了一种图像扭曲渲染装置,包括:第一计算模块,所述第一计算模块用于获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;第二计算模块,所述第二计算 模块用于获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;渲染模块,所述渲染模块用于根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
根据本发明实施例的图像扭曲渲染装置,通过设置第一计算模块用于获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;第二计算模块用于获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;渲染模块用于根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改;从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
另外,根据本发明上述实施例提出的图像扭曲渲染装置还可以具有如下附加的技术特征:
可选地,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,包括:根据所述距离和所述Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;根据图像中心点的坐标值、所述第一反正切值和所述第二反正切值计算所述目标像素点坐标值。
可选地,所述目标像素点坐标值根据以下公式计算:
r=atan(d,z)
phi=atan(y 1,x 1)
(x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
附图说明
图1为根据本发明实施例的图像扭曲渲染方法的流程示意图;
图2为根据本发明实施例的图像扭曲渲染装置的方框示意图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。
相关技术中,在拍摄得到图像之后,难以通过后处理的方式使得图像具有扭曲效果;根据本发明实施例的图像扭曲渲染方法,首先,获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;接着,获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;然后,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,并根据目标像素点的像素值对该像素点的像素值进行修改;从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为了更好的理解上述技术方案,下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。
为了更好的理解上述技术方案,下面将结合说明书附图以及具体的实施方式对上述技术方案进行详细的说明。
图1为根据本发明实施例的图像扭曲渲染方法的流程示意图,如图1所示,该图像扭曲渲染方法包括以下步骤:
S101,获取原始图像和该原始图像对应的图像中心点,并计算原始图像中任意一个像素点到图像中心点的距离。
也就是说,获取用户输入的原始图像和该原始图像对应的图像中心点,然后,计算原始图像中任意一个像素点到该图像中心点的距离。
其中,该原始图像对应的图像中心点的获取方式可以有多种;例如,在用户上传完原始图像之后,获取用户对于图像中心点的指定信息,以根据该指定信息确定图像中心点;或者,通过预设条件的方式进行图像中心点的选取;或者,通过预选训练识别模型的方式,以在输入原始图像之后,通过该识别模型来获取原始图像的特征信息,并根据特征信息来确定图像中心点。
S102,获取模拟相机视野范围参数,并根据距离和模拟相机视野范围参数计算该像素点在透镜上的Z坐标值。
作为一种示例,假设图像中心点的坐标为(center·x,center·y),任意一个像素点的坐标 为(x,y),则根据两个点的坐标可以计算该像素点与图像中心点之间相对坐标值(x 1,y 1)=(x-center·x,y-center·y),进而,根据该相对坐标值可以计算该像素点与图像中心点之间的距离d=sqrt(x 1 2+y 1 2);然后,根据该距离和模拟相机视野范围参数可以计算得到该像素点在透镜上的Z坐标值:z=sqrt(1+d 2*fieldofview)。
S103,根据Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
即言,根据Z坐标值确定该像素点对应的目标像素点的坐标值,然后,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并使用该目标像素点的像素值对该像素点的像素值进行修改;从而,在通过上述方式对原始图像中所有像素点进行遍历之后,及完成原始像素点的扭曲渲染。
在一些实施例中,根据Z坐标值计算该像素点对应的目标像素点坐标值,包括:
根据距离和Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;
根据图像中心点的坐标值、第一反正切值和第二反正切值计算目标像素点坐标值。
作为一种示例,目标像素点坐标值根据以下公式计算:
r=a tan(d,z)
phi=a tan(y 1,x 1)
(x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
综上所述,根据本发明实施例的图像扭曲渲染方法,首先,获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;接着,获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;然后,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改;从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为了实现上述实施例,本发明实施例提出了一种计算机可读存储介质,其上存储有图像扭曲渲染程序,该图像扭曲渲染程序被处理器执行时实现如上述的图像扭曲渲染方法。
根据本发明实施例的计算机可读存储介质,通过存储图像扭曲渲染程序,以使得处理器在执行该图像扭曲渲染程序时,实现如上述的图像扭曲渲染方法,从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为了实现上述实施例,本发明实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-3中任一项所述的图像扭曲渲染方法。
根据本发明实施例的计算机设备,通过存储器对图像扭曲渲染程序进行存储,以使得处理器在执行该图像扭曲渲染程序时,实现如上述的图像扭曲渲染方法,从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
为了实现上述实施例,本发明实施例提出了一种图像扭曲渲染装置,如图2所示,该图像扭曲渲染装置包括:第一计算模块10、第二计算模块20和渲染模块30。
其中,第一计算模块10用于获取原始图像和该原始图像对应的图像中心点,并计算原始图像中任意一个像素点到图像中心点的距离;
第二计算模块20用于获取模拟相机视野范围参数,并根据距离和模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;
渲染模块30用于根据Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
在一些实施例中,根据Z坐标值计算该像素点对应的目标像素点坐标值,包括:根据距离和Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;根据图像中心点的坐标值、第一反正切值和第二反正切值计算目标像素点坐标值。
在一些实施例中,目标像素点坐标值根据以下公式计算:
r=a tan(d,z)
phi=a tan(y 1,x 1)
(x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
需要说明的是,上述关于图1中图像扭曲渲染方法的描述同样适用于该图像扭曲渲染装置,在此不做赘述。
综上所述,根据本发明实施例的图像扭曲渲染装置,通过设置第一计算模块用于获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;第二计算模块用于获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;渲染模块用于根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改;从而能够将图像自动渲染为具有扭曲效果的最终图像,为设计师的图像处理过程提供便利。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
应当注意的是,在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的部件或步骤。位于部件之前的单词“一”或“一个”不排除存在多个这样的部件。本发明可以借助于包括有若干不同部件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些 装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
在本发明的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。
在本发明中,除非另有明确的规定和限定,第一特征在第二特征“上”或“下”可以是第一和第二特征直接接触,或第一和第二特征通过中间媒介间接接触。而且,第一特征在第二特征“之上”、“上方”和“上面”可是第一特征在第二特征正上方或斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”可以是第一特征在第二特征正下方或斜下方,或仅仅表示第一特征水平高度小于第二特征。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不应理解为必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (8)

  1. 一种图像扭曲渲染方法,其特征在于,包括以下步骤:
    获取原始图像和该原始图像对应的图像中心点,并计算所述原始图像中任意一个像素点到所述图像中心点的距离;
    获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;
    根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
  2. 如权利要求1所述的图像扭曲渲染方法,其特征在于,根据所述Z坐标值计算该像素点对应的目标像素点坐标值的步骤包括:
    根据所述距离和所述Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;
    根据图像中心点的坐标值、所述第一反正切值和所述第二反正切值计算所述目标像素点坐标值。
  3. 如权利要求2所述的图像扭曲渲染方法,其特征在于,所述目标像素点坐标值根据以下公式计算:
    r=a tan(d,z)
    phi=a tan(y 1,x 1)
    (x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
    其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
  4. 一种计算机可读存储介质,其特征在于,其上存储有图像扭曲渲染程序,该图像扭曲渲染程序被处理器执行时实现如权利要求1-3中任一项所述的图像扭曲渲染方法。
  5. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-3中任一项所述的图像扭曲渲染方法。
  6. 一种图像扭曲渲染装置,其特征在于,包括:
    第一计算模块,所述第一计算模块用于获取原始图像和该原始图像对应的图像中心点, 并计算所述原始图像中任意一个像素点到所述图像中心点的距离;
    第二计算模块,所述第二计算模块用于获取模拟相机视野范围参数,并根据所述距离和所述模拟相机视野范围参数计算该像素点在透镜上的Z坐标值;
    渲染模块,所述渲染模块用于根据所述Z坐标值计算该像素点对应的目标像素点坐标值,根据目标像素点的坐标值对该目标像素点进行采样,以获取该目标像素点的像素值,并根据目标像素点的像素值对该像素点的像素值进行修改。
  7. 如权利要求6所述的图像扭曲渲染装置,其特征在于,根据所述Z坐标值计算该像素点对应的目标像素点坐标值,包括:
    根据所述距离和所述Z坐标值计算第一反正切值,并根据该像素点的坐标值计算第二反正切值;
    根据图像中心点的坐标值、所述第一反正切值和所述第二反正切值计算所述目标像素点坐标值。
  8. 如权利要求6所述的图像扭曲渲染装置,其特征在于,所述目标像素点坐标值根据以下公式计算:
    r=a tan(d,z)
    phi=a tan(y 1,x 1)
    (x 2,y 2)=(r*cos(phi)+center·x,r*sin(phi)+center·y)
    其中,r表示第一反正切值,d表示像素点与图像中心点之间的距离,z表示Z坐标值,phi表示第二反正切值,(x 1,y 1)表示该像素点的坐标值,(x 2,y 2)表示目标像素点的坐标值,center·x表示图像中心点的X坐标值,center·y表示图像中心点的Y坐标值。
PCT/CN2021/099768 2021-01-07 2021-06-11 图像扭曲渲染方法及装置 WO2022147964A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110016970.0 2021-01-07
CN202110016970.0A CN112669429A (zh) 2021-01-07 2021-01-07 图像扭曲渲染方法及装置

Publications (1)

Publication Number Publication Date
WO2022147964A1 true WO2022147964A1 (zh) 2022-07-14

Family

ID=75413369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/099768 WO2022147964A1 (zh) 2021-01-07 2021-06-11 图像扭曲渲染方法及装置

Country Status (2)

Country Link
CN (1) CN112669429A (zh)
WO (1) WO2022147964A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115456892A (zh) * 2022-08-31 2022-12-09 北京四维远见信息技术有限公司 2.5维视景图像自动几何校正方法、装置、设备及介质
CN116361904A (zh) * 2023-05-30 2023-06-30 中国铁路设计集团有限公司 一种渲染引擎下城轨工程bim模型渲染质量审查方法及系统
CN117057982A (zh) * 2023-10-11 2023-11-14 北京地平线信息技术有限公司 对图像进行扭曲变换的集成电路及电子设备
CN117392298A (zh) * 2023-10-18 2024-01-12 亿海蓝(北京)数据技术股份公司 基于WebGIS平台的图像渲染方法、系统、存储介质和电子设备
CN117392298B (zh) * 2023-10-18 2024-05-14 亿海蓝(北京)数据技术股份公司 基于WebGIS平台的图像渲染方法、系统、存储介质和电子设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112669429A (zh) * 2021-01-07 2021-04-16 稿定(厦门)科技有限公司 图像扭曲渲染方法及装置
CN113487725B (zh) * 2021-06-30 2024-03-29 山东齐鲁数通科技有限公司 一种模型节点修改方法、装置、终端设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030118251A1 (en) * 2001-12-18 2003-06-26 Honeywell Inc. Methods, data, and systems to warp an image
CN104537616A (zh) * 2014-12-20 2015-04-22 中国科学院西安光学精密机械研究所 鱼眼图像畸变的校正方法
CN106991658A (zh) * 2017-03-28 2017-07-28 北京小米移动软件有限公司 图像处理的方法及装置
CN107564085A (zh) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 图像扭曲处理方法、装置、计算设备及计算机存储介质
CN108090880A (zh) * 2017-12-29 2018-05-29 杭州联络互动信息科技股份有限公司 一种图像的反畸变处理方法以及装置
CN112669429A (zh) * 2021-01-07 2021-04-16 稿定(厦门)科技有限公司 图像扭曲渲染方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6756993B2 (en) * 2001-01-17 2004-06-29 The University Of North Carolina At Chapel Hill Methods and apparatus for rendering images using 3D warping techniques
CN105185288A (zh) * 2015-08-28 2015-12-23 京东方科技集团股份有限公司 一种像素阵列、显示驱动装置及其驱动方法、显示装置
US10699389B2 (en) * 2016-05-24 2020-06-30 Qualcomm Incorporated Fisheye rendering with lens distortion correction for 360-degree video
CN109325909B (zh) * 2017-07-31 2023-03-31 深圳市中兴微电子技术有限公司 一种图像放大方法和图像放大装置
CN111369655B (zh) * 2020-03-02 2023-06-30 网易(杭州)网络有限公司 渲染方法、装置和终端设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030118251A1 (en) * 2001-12-18 2003-06-26 Honeywell Inc. Methods, data, and systems to warp an image
CN104537616A (zh) * 2014-12-20 2015-04-22 中国科学院西安光学精密机械研究所 鱼眼图像畸变的校正方法
CN106991658A (zh) * 2017-03-28 2017-07-28 北京小米移动软件有限公司 图像处理的方法及装置
CN107564085A (zh) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 图像扭曲处理方法、装置、计算设备及计算机存储介质
CN108090880A (zh) * 2017-12-29 2018-05-29 杭州联络互动信息科技股份有限公司 一种图像的反畸变处理方法以及装置
CN112669429A (zh) * 2021-01-07 2021-04-16 稿定(厦门)科技有限公司 图像扭曲渲染方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115456892A (zh) * 2022-08-31 2022-12-09 北京四维远见信息技术有限公司 2.5维视景图像自动几何校正方法、装置、设备及介质
CN116361904A (zh) * 2023-05-30 2023-06-30 中国铁路设计集团有限公司 一种渲染引擎下城轨工程bim模型渲染质量审查方法及系统
CN116361904B (zh) * 2023-05-30 2023-08-22 中国铁路设计集团有限公司 一种渲染引擎下城轨工程bim模型渲染质量审查方法及系统
CN117057982A (zh) * 2023-10-11 2023-11-14 北京地平线信息技术有限公司 对图像进行扭曲变换的集成电路及电子设备
CN117057982B (zh) * 2023-10-11 2024-01-26 北京地平线信息技术有限公司 对图像进行扭曲变换的集成电路及电子设备
CN117392298A (zh) * 2023-10-18 2024-01-12 亿海蓝(北京)数据技术股份公司 基于WebGIS平台的图像渲染方法、系统、存储介质和电子设备
CN117392298B (zh) * 2023-10-18 2024-05-14 亿海蓝(北京)数据技术股份公司 基于WebGIS平台的图像渲染方法、系统、存储介质和电子设备

Also Published As

Publication number Publication date
CN112669429A (zh) 2021-04-16

Similar Documents

Publication Publication Date Title
WO2022147964A1 (zh) 图像扭曲渲染方法及装置
WO2021227360A1 (zh) 一种交互式视频投影方法、装置、设备及存储介质
US9865032B2 (en) Focal length warping
JP5121673B2 (ja) 画像投影装置及び画像投影方法
JP2019509569A (ja) 曲面ディスプレイ画面用のパース補正
US10403001B2 (en) Producing three-dimensional representation based on images of an object
WO2020056903A1 (zh) 用于生成信息的方法和装置
US10169891B2 (en) Producing three-dimensional representation based on images of a person
CN110992244B (zh) 带有摩尔纹的图片生成方法、系统、设备和存储介质
CN110021000B (zh) 基于图层变形的发际线修复方法及装置
JP2010282295A (ja) 画像処理装置、画像処理方法及びプログラム
WO2018039936A1 (en) Fast uv atlas generation and texture mapping
WO2022089185A1 (zh) 图像处理方法和图像处理装置
TWI711004B (zh) 圖片處理方法和裝置
WO2022142274A1 (zh) 图像扭曲效果渲染方法及装置
US11170550B2 (en) Facial animation retargeting using an anatomical local model
JP5401605B2 (ja) テンプレートマッチング処理装置およびテンプレートマッチング処理プログラム
JP2015179426A (ja) 情報処理装置、パラメータの決定方法、及びプログラム
JP5473096B2 (ja) イメージベースドビジュアルハルにおける凹状表面のモデリング
WO2020224118A1 (zh) 基于图片转换的病灶判断方法、装置、计算机设备
Hwang et al. Source camera identification based on interpolation via lens distortion correction
Luijten et al. 3D surgical instrument collection for computer vision and extended reality
CN113065566A (zh) 一种误匹配去除方法、系统及应用
WO2022086360A1 (ru) Способ и устройство создания панорамного изображения
GB2533449B (en) Configuration settings of a digital camera for depth map generation

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: 21917011

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: 21917011

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.09.2023)